Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / lib / msun / src / e_atanhf.c
1 /* e_atanhf.c -- float version of e_atanh.c.
2  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3  *
4  * $FreeBSD: src/lib/msun/src/e_atanhf.c,v 1.5 1999/08/28 00:06:29 peter Exp $
5  * $DragonFly: src/lib/msun/src/Attic/e_atanhf.c,v 1.2 2003/06/17 04:26:52 dillon Exp $
6  */
7
8 /*
9  * ====================================================
10  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
11  *
12  * Developed at SunPro, a Sun Microsystems, Inc. business.
13  * Permission to use, copy, modify, and distribute this
14  * software is freely granted, provided that this notice
15  * is preserved.
16  * ====================================================
17  */
18
19 #include "math.h"
20 #include "math_private.h"
21
22 #ifdef __STDC__
23 static const float one = 1.0, huge = 1e30;
24 #else
25 static float one = 1.0, huge = 1e30;
26 #endif
27
28 #ifdef __STDC__
29 static const float zero = 0.0;
30 #else
31 static float zero = 0.0;
32 #endif
33
34 #ifdef __STDC__
35         float __ieee754_atanhf(float x)
36 #else
37         float __ieee754_atanhf(x)
38         float x;
39 #endif
40 {
41         float t;
42         int32_t hx,ix;
43         GET_FLOAT_WORD(hx,x);
44         ix = hx&0x7fffffff;
45         if (ix>0x3f800000)              /* |x|>1 */
46             return (x-x)/(x-x);
47         if(ix==0x3f800000)
48             return x/zero;
49         if(ix<0x31800000&&(huge+x)>zero) return x;      /* x<2**-28 */
50         SET_FLOAT_WORD(x,ix);
51         if(ix<0x3f000000) {             /* x < 0.5 */
52             t = x+x;
53             t = (float)0.5*log1pf(t+t*x/(one-x));
54         } else
55             t = (float)0.5*log1pf((x+x)/(one-x));
56         if(hx>=0) return t; else return -t;
57 }