[math toolkit] Accuracy?

Hi, I directly skipped to the documentation of the gamma function (I'm no expert with statistical distributions, so I will only review the special functions) and I have a few questions related to accuracy. Sorry if the answers are in the documentation, I couldn't find them. The accuracy table of the gamma function contains "native peak" and "(native?) mean" values. What are theses native values and how are they different from the usual values? I'm also intrigued by the high values of peak and mean for IA32/gcc. Why are they different from the values for IA64/gcc? Are you using other datatypes internally? (I haven't looked at the implementation yet.) Thanks. Best regards, Guillaume PS: the documentation seems really nice. Good job.

Guillaume Melquiond wrote:
Hi,
I directly skipped to the documentation of the gamma function (I'm no expert with statistical distributions, so I will only review the special functions) and I have a few questions related to accuracy. Sorry if the answers are in the documentation, I couldn't find them.
The accuracy table of the gamma function contains "native peak" and "(native?) mean" values. What are theses native values and how are they different from the usual values?
They are the peak and mean errors of the platform's native implementation of tgamma as measured by our test suite. I should have made that clearer.
I'm also intrigued by the high values of peak and mean for IA32/gcc. Why are they different from the values for IA64/gcc? Are you using other datatypes internally? (I haven't looked at the implementation yet.) Thanks.
The code should be exactly the same in the two cases: but is highly dependent on the accuracy of powl and expl: the itanium/linux glibc uses Intel provided math functions which seem to be much more accurate in the corner cases than the IA32 (non-Intel sourced) versions. I always meant to add a test suite for the std lib functions so we could verify stuff like this easily, but never got around to it. Submissions always welcome :-)
PS: the documentation seems really nice. Good job.
Thanks! John.

Quoting John Maddock:
The code should be exactly the same in the two cases: but is highly dependent on the accuracy of powl and expl
The results make sense then. I had implicitly assumed that the special functions were implemented from scratch and that you were relying only on basic arithmetic. Seems like my practice of elementary functions (where you are ultimately down to just polynomial evaluations and hence only need additions and multiplications) played tricks on me there :). Best regards, Guillaume
participants (2)
-
Guillaume Melquiond
-
John Maddock