Hacker News new | past | comments | ask | show | jobs | submit login

One example could be when computing sin (or any trig function) of a large number - first you perform range reduction, ie bring it into the range 0..2pi. For that, you're (potentially) subtracting two large numbers that are close together, so you lose a lot of accuracy.

This implementation of mod2pi in Julia, for example, uses double doubles ("TwicePrecision") here and there:

https://github.com/pkofod/RemPiO2.jl/blob/master/src/RemPiO2...

And, pertinent to the article, here's a bug in mod2pi that was probably triggered by 80 bit extended floats:

https://github.com/JuliaLang/julia/issues/8799




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: