def exponential_remainder
import stelliferous@0.0.2.0/math_fp32.bend as MathFp32import Base
23# exp(r)-1-r near |r| <= ln(2)/2. Chebyshev coefficients, rounded to F32;
24# paired evaluation shortens the dependency chain without contracting products.
25def exponential_remainder(+r: F32) -> F32:
26 +z = (r * r : F32)
27 (z * ((0.5 + 0.16666577756404877 * r : F32) + z * ((0.041666556149721146 + 0.008363173343241215 * r : F32) + z * 0.0013926175888627768 : F32) : F32) : F32)