Average Error: 0.2 → 0.2
Time: 20.8s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(\left(3 - x \cdot 2\right) \cdot x\right) \cdot x\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(\left(3 - x \cdot 2\right) \cdot x\right) \cdot x
double f(double x) {
        double r36772936 = x;
        double r36772937 = r36772936 * r36772936;
        double r36772938 = 3.0;
        double r36772939 = 2.0;
        double r36772940 = r36772936 * r36772939;
        double r36772941 = r36772938 - r36772940;
        double r36772942 = r36772937 * r36772941;
        return r36772942;
}

double f(double x) {
        double r36772943 = 3.0;
        double r36772944 = x;
        double r36772945 = 2.0;
        double r36772946 = r36772944 * r36772945;
        double r36772947 = r36772943 - r36772946;
        double r36772948 = r36772947 * r36772944;
        double r36772949 = r36772948 * r36772944;
        return r36772949;
}

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 - x \cdot 2\right)\right)\]

Derivation

  1. Initial program 0.2

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

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

    \[\leadsto \left(\left(3 - x \cdot 2\right) \cdot x\right) \cdot x\]

Reproduce

herbie shell --seed 2019171 +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))))