Average Error: 0.2 → 0.2
Time: 15.7s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}
double f(double x) {
        double r34893475 = x;
        double r34893476 = r34893475 * r34893475;
        double r34893477 = 3.0;
        double r34893478 = 2.0;
        double r34893479 = r34893475 * r34893478;
        double r34893480 = r34893477 - r34893479;
        double r34893481 = r34893476 * r34893480;
        return r34893481;
}

double f(double x) {
        double r34893482 = x;
        double r34893483 = r34893482 * r34893482;
        double r34893484 = 1.0;
        double r34893485 = 3.0;
        double r34893486 = 2.0;
        double r34893487 = r34893482 * r34893486;
        double r34893488 = r34893485 - r34893487;
        double r34893489 = r34893484 / r34893488;
        double r34893490 = r34893483 / r34893489;
        return r34893490;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.2
Herbie0.2
\[x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\]

Derivation

  1. Initial program 0.2

    \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)}\]
  4. Using strategy rm
  5. Applied flip--0.2

    \[\leadsto x \cdot \left(x \cdot \color{blue}{\frac{3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)}{3 + x \cdot 2}}\right)\]
  6. Applied associate-*r/0.2

    \[\leadsto x \cdot \color{blue}{\frac{x \cdot \left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right)}{3 + x \cdot 2}}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.2

    \[\leadsto \color{blue}{\left(1 \cdot x\right)} \cdot \frac{x \cdot \left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right)}{3 + x \cdot 2}\]
  9. Applied associate-*l*0.2

    \[\leadsto \color{blue}{1 \cdot \left(x \cdot \frac{x \cdot \left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right)}{3 + x \cdot 2}\right)}\]
  10. Simplified0.2

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

    \[\leadsto \frac{x \cdot x}{\frac{1}{3 - x \cdot 2}}\]

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"

  :herbie-target
  (* x (* x (- 3.0 (* x 2.0))))

  (* (* x x) (- 3.0 (* x 2.0))))