by dancsi · 4y ago · 0 comments
What does "tail" mean in this context?
[1] https://en.wikipedia.org/wiki/Quadruple-precision_floating-p...
[2] https://github.com/ifduyue/musl/blob/6d8a515796270eb6cec8a27...
this is an amusing way to describe the precision of sub-normal floating point numbers
Do people do that in practice? It's on the FPU, which is basically legacy emulated these days, and it's inaccurate.
you'll pry my long doubles from my cold, dead hands!
You can check it out: https://github.com/jeremysalwen/vectrig
I compared several different methods of generating polynomials of different sizes for speed and precision (spoilers: taylor series were the worst and minimax polynomials (Remez algorithm) were the best).
Another (surprising) thing which I learned during the project was that the range reduction was just as (if not more) important to the accuracy of the implementation than the polynomial. If you think about it, you will realize that it's actually pretty difficult to quickly and accurately compute the sin of large numbers like 2^50.
I also tried to directly optimize the coefficients for the accuracy of the polynomial on the required range, but that experiment was unsuccessful.
It's all there in the repository, the implementations, notes about the different polynomials used, and the accuracy/speed statistics for the different methods.
I would have expected at least an LSQ approximation with a basis of Legendre polynomials thrown into the mix. I got that as a basic homework in my numerics class once, after we've shown to ourselves in the class that [1, x, x², x³...] is not a really good basis to project things onto.