Average Error: 0.2 → 0.2
Time: 2.8s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)
double f(double x) {
        double r809546 = x;
        double r809547 = r809546 * r809546;
        double r809548 = 3.0;
        double r809549 = 2.0;
        double r809550 = r809546 * r809549;
        double r809551 = r809548 - r809550;
        double r809552 = r809547 * r809551;
        return r809552;
}

double f(double x) {
        double r809553 = x;
        double r809554 = 3.0;
        double r809555 = 2.0;
        double r809556 = r809553 * r809555;
        double r809557 = r809554 - r809556;
        double r809558 = r809553 * r809557;
        double r809559 = r809553 * r809558;
        return r809559;
}

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. Final simplification0.2

    \[\leadsto x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\]

Reproduce

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

  :herbie-target
  (* x (* x (- 3 (* x 2))))

  (* (* x x) (- 3 (* x 2))))