Message58749
Unfortunately, implementing asinh, acosh, atanh correctly is not as simple as just using the formulas
(this is one of the reasons that it's useful to be able to get at the library definitions). For
example, the formula
asinh(x) = log(x + sqrt(1.+(x*x)))
has significant error (i.e. much more than just a few ulps) when x is small (so that the argument of
the log is close to 1), and when x is large and negative (so that the addition involves adding two
numbers of almost equal magnitude but opposite sign). It also overflows unnecessarily at around
1e154 (on an IEEE754 system), as a result of the intermediate calculation x*x overflowing, and it
fails to give the correct signs on zero arguments. (asinh(0.) = 0., asinh(-0.) = -0.)
So either some serious work is required here, or code should be borrowed in an appropriately legal
fashion from some other library, or those few people who don't have asinh, acosh, etc. already in
libm will have to live without.
Mark |
|
| Date |
User |
Action |
Args |
| 2007-12-18 14:36:34 | mark.dickinson | set | spambayes_score: 0.123327 -> 0.123327 recipients:
+ mark.dickinson, Rhamphoryncus, christian.heimes |
| 2007-12-18 14:36:33 | mark.dickinson | set | spambayes_score: 0.123327 -> 0.123327 messageid: <1197988593.82.0.462545018696.issue1640@psf.upfronthosting.co.za> |
| 2007-12-18 14:36:33 | mark.dickinson | link | issue1640 messages |
| 2007-12-18 14:36:33 | mark.dickinson | create | |
|