Complex arg-trig functions

Stephen Montgomery-Smith stephen at missouri.edu
Wed Aug 15 03:31:37 UTC 2012


I was looking through the code e_acosh.c, and it made me realize I could 
get a small fraction more ULP in catrig.c by making the replacements:

216c216
< 			*rx = log1p(Am1 + sqrt(Am1*(A+1)));
---
 > 			*rx = log1p(Am1 + sqrt(2*Am1 + Am1*Am1));
282c282
< 			*sqrt_A2my2 = sqrt(Amy*(A+y));
---
 > 			*sqrt_A2my2 = sqrt(2*y*Amy + Amy*Amy);

I'm not quite sure if the second replacement makes much difference, but 
the first replacement seemed quite effective.


More information about the freebsd-numerics mailing list