Average Error: 0.2 → 0.2
Time: 15.2s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
\[\left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x\]
\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)
\left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x
double f(double x) {
        double r35918482 = x;
        double r35918483 = r35918482 * r35918482;
        double r35918484 = 3.0;
        double r35918485 = 2.0;
        double r35918486 = r35918482 * r35918485;
        double r35918487 = r35918484 - r35918486;
        double r35918488 = r35918483 * r35918487;
        return r35918488;
}

double f(double x) {
        double r35918489 = 3.0;
        double r35918490 = x;
        double r35918491 = 2.0;
        double r35918492 = r35918490 * r35918491;
        double r35918493 = r35918489 - r35918492;
        double r35918494 = r35918493 * r35918490;
        double r35918495 = r35918494 * r35918490;
        return r35918495;
}

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.0 - x \cdot 2.0\right)\right)\]

Derivation

  1. Initial program 0.2

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

    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3.0 - x \cdot 2.0\right)\right)}\]
  4. Final simplification0.2

    \[\leadsto \left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x\]

Reproduce

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