Lines Matching defs:tanh
2958 * 0. tanh(x) is defined to be -----------
2961 * 1. reduce x to non-negative by tanh(-x) = -tanh(x).
2962 * 2. 0 <= x < 2**-28 : tanh(x) := x with inexact if x != 0
2964 * 2**-28 <= x < 1 : tanh(x) := -----; t = expm1(-2x)
2967 * 1 <= x < 22 : tanh(x) := 1 - -----; t = expm1(2x)
2969 * 22 <= x <= INF : tanh(x) := 1.
2972 * tanh(NaN) is NaN;
2973 * only tanh(0)=0 is exact for finite argument.
2975 double tanh(double x) {
2987 return one / x + one; /* tanh(+-inf)=+-1 */
2989 return one / x - one; /* tanh(NaN) = NaN */
2995 if (huge + x > one) return x; /* tanh(tiny) = tiny with inexact */