Average Error: 0.2 → 0.1
Time: 3.0s
Precision: 64
\[\frac{x \cdot x - 3}{6}\]
\[1 \cdot \left(\frac{\sqrt{x \cdot x}}{6} \cdot \left|x\right|\right) - \frac{3}{6}\]
\frac{x \cdot x - 3}{6}
1 \cdot \left(\frac{\sqrt{x \cdot x}}{6} \cdot \left|x\right|\right) - \frac{3}{6}
double code(double x) {
	return ((double) (((double) (((double) (x * x)) - 3.0)) / 6.0));
}
double code(double x) {
	return ((double) (((double) (1.0 * ((double) (((double) (((double) sqrt(((double) (x * x)))) / 6.0)) * ((double) fabs(x)))))) - ((double) (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.2

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

    \[\leadsto \color{blue}{\frac{x \cdot x}{6} - \frac{3}{6}}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.2

    \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}}}{6} - \frac{3}{6}\]
  6. Applied associate-/l*0.2

    \[\leadsto \color{blue}{\frac{\sqrt{x \cdot x}}{\frac{6}{\sqrt{x \cdot x}}}} - \frac{3}{6}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.2

    \[\leadsto \frac{\sqrt{x \cdot x}}{\frac{6}{\sqrt{\color{blue}{1 \cdot \left(x \cdot x\right)}}}} - \frac{3}{6}\]
  9. Applied sqrt-prod0.2

    \[\leadsto \frac{\sqrt{x \cdot x}}{\frac{6}{\color{blue}{\sqrt{1} \cdot \sqrt{x \cdot x}}}} - \frac{3}{6}\]
  10. Applied *-un-lft-identity0.2

    \[\leadsto \frac{\sqrt{x \cdot x}}{\frac{\color{blue}{1 \cdot 6}}{\sqrt{1} \cdot \sqrt{x \cdot x}}} - \frac{3}{6}\]
  11. Applied times-frac0.2

    \[\leadsto \frac{\sqrt{x \cdot x}}{\color{blue}{\frac{1}{\sqrt{1}} \cdot \frac{6}{\sqrt{x \cdot x}}}} - \frac{3}{6}\]
  12. Applied *-un-lft-identity0.2

    \[\leadsto \frac{\sqrt{\color{blue}{1 \cdot \left(x \cdot x\right)}}}{\frac{1}{\sqrt{1}} \cdot \frac{6}{\sqrt{x \cdot x}}} - \frac{3}{6}\]
  13. Applied sqrt-prod0.2

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{x \cdot x}}}{\frac{1}{\sqrt{1}} \cdot \frac{6}{\sqrt{x \cdot x}}} - \frac{3}{6}\]
  14. Applied times-frac0.2

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

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

    \[\leadsto 1 \cdot \color{blue}{\left(\frac{\sqrt{x \cdot x}}{6} \cdot \left|x\right|\right)} - \frac{3}{6}\]
  17. Final simplification0.1

    \[\leadsto 1 \cdot \left(\frac{\sqrt{x \cdot x}}{6} \cdot \left|x\right|\right) - \frac{3}{6}\]

Reproduce

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