Average Error: 0.2 → 0.2
Time: 17.6s
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 r41411697 = x;
        double r41411698 = r41411697 * r41411697;
        double r41411699 = 3.0;
        double r41411700 = 2.0;
        double r41411701 = r41411697 * r41411700;
        double r41411702 = r41411699 - r41411701;
        double r41411703 = r41411698 * r41411702;
        return r41411703;
}

double f(double x) {
        double r41411704 = 3.0;
        double r41411705 = x;
        double r41411706 = 2.0;
        double r41411707 = r41411705 * r41411706;
        double r41411708 = r41411704 - r41411707;
        double r41411709 = r41411708 * r41411705;
        double r41411710 = r41411709 * r41411705;
        return r41411710;
}

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 2019162 
(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))))