Average Error: 0.2 → 0.2
Time: 18.8s
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 r39762050 = x;
        double r39762051 = r39762050 * r39762050;
        double r39762052 = 3.0;
        double r39762053 = 2.0;
        double r39762054 = r39762050 * r39762053;
        double r39762055 = r39762052 - r39762054;
        double r39762056 = r39762051 * r39762055;
        return r39762056;
}

double f(double x) {
        double r39762057 = 3.0;
        double r39762058 = x;
        double r39762059 = 2.0;
        double r39762060 = r39762058 * r39762059;
        double r39762061 = r39762057 - r39762060;
        double r39762062 = r39762061 * r39762058;
        double r39762063 = r39762062 * r39762058;
        return r39762063;
}

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