(FPCore (x) :precision binary64 (/ (- (* x x) 3.0) 6.0))
(FPCore (x) :precision binary64 (fma x (* x 0.16666666666666666) -0.5))
double code(double x) {
return ((x * x) - 3.0) / 6.0;
}
double code(double x) {
return fma(x, (x * 0.16666666666666666), -0.5);
}
function code(x) return Float64(Float64(Float64(x * x) - 3.0) / 6.0) end
function code(x) return fma(x, Float64(x * 0.16666666666666666), -0.5) end
code[x_] := N[(N[(N[(x * x), $MachinePrecision] - 3.0), $MachinePrecision] / 6.0), $MachinePrecision]
code[x_] := N[(x * N[(x * 0.16666666666666666), $MachinePrecision] + -0.5), $MachinePrecision]
\frac{x \cdot x - 3}{6}
\mathsf{fma}\left(x, x \cdot 0.16666666666666666, -0.5\right)



Bits error versus x
Initial program 0.2
Taylor expanded in x around 0 0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2022150
(FPCore (x)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
:precision binary64
(/ (- (* x x) 3.0) 6.0))