Average Error: 0.2 → 0.2
Time: 18.9s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \frac{x \cdot \left(\left(3 - x \cdot 2\right) \cdot \left(3 + x \cdot 2\right)\right)}{3 + x \cdot 2}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \frac{x \cdot \left(\left(3 - x \cdot 2\right) \cdot \left(3 + x \cdot 2\right)\right)}{3 + x \cdot 2}
double f(double x) {
        double r37672454 = x;
        double r37672455 = r37672454 * r37672454;
        double r37672456 = 3.0;
        double r37672457 = 2.0;
        double r37672458 = r37672454 * r37672457;
        double r37672459 = r37672456 - r37672458;
        double r37672460 = r37672455 * r37672459;
        return r37672460;
}

double f(double x) {
        double r37672461 = x;
        double r37672462 = 3.0;
        double r37672463 = 2.0;
        double r37672464 = r37672461 * r37672463;
        double r37672465 = r37672462 - r37672464;
        double r37672466 = r37672462 + r37672464;
        double r37672467 = r37672465 * r37672466;
        double r37672468 = r37672461 * r37672467;
        double r37672469 = r37672468 / r37672466;
        double r37672470 = r37672461 * r37672469;
        return r37672470;
}

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. Simplified0.2

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

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

    \[\leadsto x \cdot \frac{x \cdot \left(\left(3 - x \cdot 2\right) \cdot \left(3 + x \cdot 2\right)\right)}{3 + x \cdot 2}\]

Reproduce

herbie shell --seed 2019172 
(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))))