def tanh_small

stelliferous@0.0.2.0 · math_fp32.bend:94

import stelliferous@0.0.2.0/math_fp32.bend as MathFp32
import Base

94# Chebyshev interpolation of (tanh(sqrt(z))/sqrt(z)-1)/z, |t|<=0.75.
95# The coefficients are F32 values.
96def tanh_small(+t: F32,+z: F32) -> F32:
97  (t + (t * z : F32) * (((((0.001909503829665482 * z + F32.neg(0.007933800108730793) : F32) * z + 0.021615320816636086 : F32) * z + F32.neg(0.05393586680293083) : F32) * z + 0.1333317905664444 : F32) * z + F32.neg(0.3333333134651184) : F32) : F32)

Uses (4)

Used by (1)