Average Error: 0.2 → 0.2
Time: 20.0s
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 r34333961 = x;
        double r34333962 = r34333961 * r34333961;
        double r34333963 = 3.0;
        double r34333964 = 2.0;
        double r34333965 = r34333961 * r34333964;
        double r34333966 = r34333963 - r34333965;
        double r34333967 = r34333962 * r34333966;
        return r34333967;
}

double f(double x) {
        double r34333968 = 3.0;
        double r34333969 = x;
        double r34333970 = 2.0;
        double r34333971 = r34333969 * r34333970;
        double r34333972 = r34333968 - r34333971;
        double r34333973 = r34333972 * r34333969;
        double r34333974 = r34333973 * r34333969;
        return r34333974;
}

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 2019168 +o rules:numerics
(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))))