Bruce Evans 25efbfb212 Fixed some magic numbers.
The threshold for not being tiny was too small.  Use the usual 2**-12
threshold.  This change is not just an optimization, since the general
code that we fell into has accuracy problems even for tiny x.  Avoiding
it fixes 2*1366 args with errors of more than 1 ulp, with a maximum
error of 1.167 ulps.

The magic number 22 is log(DBL_EPSILON)/2 plus slop.  This is bogus
for float precision.  Use 9 (~log(FLT_EPSILON)/2 plus less slop than
for double precision).  The code for handling the interval
[2**-28, 9_was_22] has accuracy problems even for [9, 22], so this
change happens to fix errors of more than 1 ulp in about 2*17000
cases.  It leaves such errors in about 2*1074000 cases, with a max
error of 1.242 ulps.

The threshold for switching from returning exp(x)/2 to returning
exp(x/2)^2/2 was a little smaller than necessary.  As for coshf(),
This was not quite harmless since the exp(x/2)^2/2 case is inaccurate,
and fixing it avoids accuracy problems in 2*6 cases, leaving problems
in 2*19997 cases.

Fixed naming errors in pseudo-code in comments.
2005-11-13 00:41:46 +00:00
..
2005-04-22 18:57:32 +00:00
2005-07-13 10:40:07 +00:00
2005-02-13 23:45:54 +00:00
2005-10-04 22:00:35 +00:00
2005-10-20 08:26:03 +00:00
2005-05-24 10:10:38 +00:00
2004-12-29 02:18:24 +00:00
2005-09-14 10:42:51 +00:00
2004-12-21 10:49:29 +00:00
2005-06-04 10:48:21 +00:00
2004-12-21 10:16:04 +00:00
2005-09-26 06:23:43 +00:00
2005-11-13 00:41:46 +00:00