Average Error: 0.2 → 0.2
Time: 15.6s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(\left(3 - 2 \cdot x\right) \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(\left(3 - 2 \cdot x\right) \cdot x\right)
double f(double x) {
        double r518964 = x;
        double r518965 = r518964 * r518964;
        double r518966 = 3.0;
        double r518967 = 2.0;
        double r518968 = r518964 * r518967;
        double r518969 = r518966 - r518968;
        double r518970 = r518965 * r518969;
        return r518970;
}

double f(double x) {
        double r518971 = x;
        double r518972 = 3.0;
        double r518973 = 2.0;
        double r518974 = r518973 * r518971;
        double r518975 = r518972 - r518974;
        double r518976 = r518975 * r518971;
        double r518977 = r518971 * r518976;
        return r518977;
}

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. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019306 
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
  :precision binary64

  :herbie-target
  (* x (* x (- 3 (* x 2))))

  (* (* x x) (- 3 (* x 2))))