1 /* origin: FreeBSD /usr/src/lib/msun/src/e_atanhf.c */
3 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
13 * ====================================================
18 static const float huge = 1e30;
25 GET_FLOAT_WORD(hx, x);
27 if (ix > 0x3f800000) /* |x| > 1 */
31 if (ix < 0x31800000 && huge+x > 0.0f) /* x < 2**-28 */
33 SET_FLOAT_WORD(x, ix);
34 if (ix < 0x3f000000) { /* x < 0.5 */
36 t = 0.5f*log1pf(t + t*x/(1.0f-x));
38 t = 0.5f*log1pf((x+x)/(1.0f-x));