Re:Optimizations Enabled by -ffast-Math
by jacobolus on Wednesday October 20, 2021 @12:59PM
(#28933060)
Without knowing a lot more about the context and what precisely you did, it’s impossible to comment about your negative experience.
> What is the rationale for liking rational functions?
They are cheap to evaluate, (relatively) easy to prove things about symbolically, and will efficiently approximate any reasonably smooth function.
Years ago i had some interpolation to do, and used the barycentric rational from Boost [1]. The resulting curve was all over the place. A natural cubic spline gave a much more subjectively sensible-looking fit.
[1] https://www.boost.org/doc/libs/1_77_0/libs/math/doc/html/mat...