Re:Implementing Advanced Math Functions
by ajross on Wednesday April 25, 2012 @03:28PM
(#3890594)
It's worth pointing out that Netlib, along with glibc, uclibc, bionic and probably the BSDs too, is just using the SunPro code from the early 90's for its trancendental functions. I'm honestly not aware of anyone who isn't.
And most of these are doing more than simply reducing N in range. They typically have a transform (or three) which maps N onto a function which is very close to linear, so they can use a 5-6 term polynomial approximation to get full precision across the whole range. It's all very clever, really.
But it's terribly documented (and, at this point, ruthlessly forked). I'm honestly shocked there hasn't been an effort made to clean this code up, put it into a single project and get all the divergent libm implementations using it.
And most of these are doing more than simply reducing N in range. They typically have a transform (or three) which maps N onto a function which is very close to linear, so they can use a 5-6 term polynomial approximation to get full precision across the whole range. It's all very clever, really.
But it's terribly documented (and, at this point, ruthlessly forked). I'm honestly shocked there hasn't been an effort made to clean this code up, put it into a single project and get all the divergent libm implementations using it.