123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include <openlibm_math.h>
- #include "math_private.h"
- static const long double one = 1.0, huge = 1e4900L;
- static const long double zero = 0.0;
- long double
- atanhl(long double x)
- {
- long double t;
- int32_t ix;
- u_int32_t se,i0,i1;
- GET_LDOUBLE_WORDS(se,i0,i1,x);
- ix = se&0x7fff;
- if ((ix+((((i0&0x7fffffff)|i1)|(-((i0&0x7fffffff)|i1)))>>31))>0x3fff)
-
- return (x-x)/(x-x);
- if(ix==0x3fff)
- return x/zero;
- if(ix<0x3fe3&&(huge+x)>zero) return x;
- SET_LDOUBLE_EXP(x,ix);
- if(ix<0x3ffe) {
- t = x+x;
- t = 0.5*log1pl(t+t*x/(one-x));
- } else
- t = 0.5*log1pl((x+x)/(one-x));
- if(se<=0x7fff) return t; else return -t;
- }
|