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

Error

Derivation

  1. Initial program 0.1

    \[\frac{x \cdot x - 3}{6} \]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{6}, x, -0.5\right)} \]
  3. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(\frac{x}{6}, x, -0.5\right) \]

Reproduce

herbie shell --seed 2022210 
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
  :precision binary64
  (/ (- (* x x) 3.0) 6.0))