46 #ifdef POK_NEEDS_LIBMATH
49 #include "math_private.h"
51 static const double one = 1.0, huge = 1e300;
53 static const double zero = 0.0;
56 __ieee754_atanh(
double x)
61 EXTRACT_WORDS(hx,lx,x);
63 if ((ix|((lx|(-lx))>>31))>0x3ff00000)
67 if(ix<0x3e300000&&(huge+x)>zero)
return x;
71 t = 0.5*log1p(t+t*x/(one-x));
73 t = 0.5*log1p((x+x)/(one-x));
74 if(hx>=0)
return t;
else return -t;