1 
2 /* @(#)w_atanh.c 1.3 95/01/18 */
3 /*
4  * ====================================================
5  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6  *
7  * Developed at SunSoft, a Sun Microsystems, Inc. business.
8  * Permission to use, copy, modify, and distribute this
9  * software is freely granted, provided that this notice
10  * is preserved.
11  * ====================================================
12  */
13 /*
14  * wrapper atanh(x)
15  */
16 
17 #include "fdlibm.h"
18 
19 
20 #ifdef __STDC__
atanh(double x)21 	double atanh(double x)		/* wrapper atanh */
22 #else
23 	double atanh(x)			/* wrapper atanh */
24 	double x;
25 #endif
26 {
27 #ifdef _IEEE_LIBM
28 	return __ieee754_atanh(x);
29 #else
30 	double z,y;
31 	z = __ieee754_atanh(x);
32 	if(_LIB_VERSION == _IEEE_ || ieee_isnan(x)) return z;
33 	y = ieee_fabs(x);
34 	if(y>=1.0) {
35 	    if(y>1.0)
36 	        return __kernel_standard(x,x,30); /* atanh(|x|>1) */
37 	    else
38 	        return __kernel_standard(x,x,31); /* atanh(|x|==1) */
39 	} else
40 	    return z;
41 #endif
42 }
43