Average Error: 0.2 → 0.2
Time: 10.1s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)
double f(double x) {
        double r542877 = x;
        double r542878 = r542877 * r542877;
        double r542879 = 3.0;
        double r542880 = 2.0;
        double r542881 = r542877 * r542880;
        double r542882 = r542879 - r542881;
        double r542883 = r542878 * r542882;
        return r542883;
}

double f(double x) {
        double r542884 = x;
        double r542885 = 3.0;
        double r542886 = 2.0;
        double r542887 = r542884 * r542886;
        double r542888 = r542885 - r542887;
        double r542889 = r542884 * r542888;
        double r542890 = r542884 * r542889;
        return r542890;
}

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

Reproduce

herbie shell --seed 2019297 
(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))))