Average Error: 0.1 → 0.1
Time: 1.1s
Precision: 64
\[\frac{x \cdot x - 3}{6}\]
\[x \cdot \frac{x}{6} - \frac{3}{6}\]
\frac{x \cdot x - 3}{6}
x \cdot \frac{x}{6} - \frac{3}{6}
double code(double x) {
	return (((x * x) - 3.0) / 6.0);
}
double code(double x) {
	return ((x * (x / 6.0)) - (3.0 / 6.0));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{x \cdot x - 3}{6}\]
  2. Using strategy rm
  3. Applied div-sub0.1

    \[\leadsto \color{blue}{\frac{x \cdot x}{6} - \frac{3}{6}}\]
  4. Using strategy rm
  5. Applied associate-/l*0.1

    \[\leadsto \color{blue}{\frac{x}{\frac{6}{x}}} - \frac{3}{6}\]
  6. Using strategy rm
  7. Applied div-inv0.1

    \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{6}{x}}} - \frac{3}{6}\]
  8. Simplified0.1

    \[\leadsto x \cdot \color{blue}{\frac{x}{6}} - \frac{3}{6}\]
  9. Final simplification0.1

    \[\leadsto x \cdot \frac{x}{6} - \frac{3}{6}\]

Reproduce

herbie shell --seed 2020078 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
  :precision binary64
  (/ (- (* x x) 3) 6))