Average Error: 0.2 → 0.1
Time: 1.2s
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 f(double x) {
        double r52637 = x;
        double r52638 = r52637 * r52637;
        double r52639 = 3.0;
        double r52640 = r52638 - r52639;
        double r52641 = 6.0;
        double r52642 = r52640 / r52641;
        return r52642;
}

double f(double x) {
        double r52643 = x;
        double r52644 = 6.0;
        double r52645 = r52643 / r52644;
        double r52646 = r52643 * r52645;
        double r52647 = 3.0;
        double r52648 = r52647 / r52644;
        double r52649 = r52646 - r52648;
        return r52649;
}

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 associate-/l*0.1

    \[\leadsto \color{blue}{\frac{x}{\frac{6}{x}}} - \frac{3}{6}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt32.8

    \[\leadsto \frac{x}{\frac{6}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} - \frac{3}{6}\]
  8. Applied *-un-lft-identity32.8

    \[\leadsto \frac{x}{\frac{\color{blue}{1 \cdot 6}}{\sqrt{x} \cdot \sqrt{x}}} - \frac{3}{6}\]
  9. Applied times-frac32.8

    \[\leadsto \frac{x}{\color{blue}{\frac{1}{\sqrt{x}} \cdot \frac{6}{\sqrt{x}}}} - \frac{3}{6}\]
  10. Applied add-sqr-sqrt32.8

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

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

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

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

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

Reproduce

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