Print this page
11210 libm should be cstyle(1ONBLD) clean
*** 20,29 ****
--- 20,30 ----
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
+
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
*** 32,42 ****
#include "libm.h"
#define GENERIC long double
#define ATANH atanhl
! /* ATANH(x)
* 1 2x x
* ATANH(x) = --- * LOG(1 + -------) = 0.5 * LOG1P(2 * --------)
* 2 1 - x 1 - x
* Note: to guarantee ATANH(-x) = -ATANH(x), we use
* sign(x) |x|
--- 33,45 ----
#include "libm.h"
#define GENERIC long double
#define ATANH atanhl
! /* BEGIN CSTYLED */
! /*
! * ATANH(x)
* 1 2x x
* ATANH(x) = --- * LOG(1 + -------) = 0.5 * LOG1P(2 * --------)
* 2 1 - x 1 - x
* Note: to guarantee ATANH(-x) = -ATANH(x), we use
* sign(x) |x|
*** 47,73 ****
* ATANH(x) is NaN if |x| > 1 with signal;
* ATANH(NaN) is that NaN with no signal;
* ATANH(+-1) is +-INF with signal.
*
*/
#define FABS fabsl
#define LOG1P log1pl
#define COPYSIGN copysignl
! extern GENERIC FABS(),LOG1P(),COPYSIGN();
!
! static GENERIC
! zero = (GENERIC) 0.0,
! half = (GENERIC) 0.5,
! one = (GENERIC) 1.0;
! GENERIC ATANH(x)
! GENERIC x;
{
GENERIC t;
t = FABS(x);
! if (t == one) return x/zero;
! t = t/(one-t);
! return COPYSIGN(half,x)*LOG1P(t+t);
}
--- 50,77 ----
* ATANH(x) is NaN if |x| > 1 with signal;
* ATANH(NaN) is that NaN with no signal;
* ATANH(+-1) is +-INF with signal.
*
*/
+ /* END CSTYLED */
#define FABS fabsl
#define LOG1P log1pl
#define COPYSIGN copysignl
+ extern GENERIC FABS(), LOG1P(), COPYSIGN();
! static GENERIC zero = (GENERIC)0.0, half = (GENERIC)0.5, one = (GENERIC)1.0;
! GENERIC
! ATANH(GENERIC x)
{
GENERIC t;
+
t = FABS(x);
!
! if (t == one)
! return (x / zero);
!
! t = t / (one - t);
! return (COPYSIGN(half, x) * LOG1P(t + t));
}