Average Error: 0.2 → 0.2
Time: 11.3s
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 r32023289 = x;
        double r32023290 = r32023289 * r32023289;
        double r32023291 = 3.0;
        double r32023292 = 2.0;
        double r32023293 = r32023289 * r32023292;
        double r32023294 = r32023291 - r32023293;
        double r32023295 = r32023290 * r32023294;
        return r32023295;
}

double f(double x) {
        double r32023296 = 3.0;
        double r32023297 = x;
        double r32023298 = 2.0;
        double r32023299 = r32023297 * r32023298;
        double r32023300 = r32023296 - r32023299;
        double r32023301 = r32023300 * r32023297;
        double r32023302 = r32023301 * r32023297;
        return r32023302;
}

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