Emulating AMD Approximate Arithmetic Instructions on Intel
robert.ocallahan.org
robert.ocallahan.org
> When it upgraded SSE to SSE2 (in 2000), most of its single-precision floating-point instructions got upgraded to double-precision — but not these two.
isn't correct.
It's still not likely that you needed to care about these for mu.
A lot of code uses _mm_rsqrt_ps (sometimes) followed by a Newton-raphson update to compute a "precise" 1/sqrt(x). Here's a good example of NEON's rsqrt being sufficiently different from Intel, that more iterations were necessary for Embree on ARM [1].
Because I only cared about vectorization a long time ago, and AMD was so uncompetitive then, I'd bet a lot of code assumes that the SSE rsqrtps values match.
[1] https://github.com/lighttransport/embree-aarch64/issues/20
Looks like Eigen also defaults to EIGEN_FAST_MATH which makes Eigen's psqrt ("packet sqrt") use _mm256_rsqrt_ps instead of _mm256_sqrt_ps [1].
Interestingly, the thing they're trying to avoid (long latency of sqrt vs rsqrt) hasn't been true for a long time on Intel processors, but apparently is still true for AMD parts according to Agner Fog's tables [2] (though maybe I'm reading them wrong, there is no vsqrtps entry for Zen2/3).
Hopefully, Eigen will separate the single global "fast math" config [3].
[1] https://gitlab.com/libeigen/eigen/-/blob/a75122584594fb98db0...
However, if speed is that important to you (e.g. if you are an HFT), you don't even want to be calculating the inverse square root in your hotpath. Basically, the implied volatility is "seeded" once and then you update it using greeks (finance term for a derivative, don't ask me why).
Delta is the amount an option goes up or down in price for every $ the underlying moves.
Gamma is the second derivative. The change in delta as a function of change in price of the underlying.
Theta is the amount an option goes down in price for each day you hold it (“time decay”)
Sorry if it didn't come across that way @alex_smart!
> The use of Greek letter names is presumably by extension from the common finance terms alpha and beta, and the use of sigma (the standard deviation of logarithmic returns) and tau (time to expiry) in the Black–Scholes option pricing model. Several names such as 'vega' and 'zomma' are invented, but sound similar to Greek letters. The names 'color' and 'charm' presumably derive from the use of these terms for exotic properties of quarks in particle physics.
What's with all the "presumably"?