Average Error: 0.2 → 0.2
Time: 14.9s
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 r34408746 = x;
        double r34408747 = r34408746 * r34408746;
        double r34408748 = 3.0;
        double r34408749 = 2.0;
        double r34408750 = r34408746 * r34408749;
        double r34408751 = r34408748 - r34408750;
        double r34408752 = r34408747 * r34408751;
        return r34408752;
}

double f(double x) {
        double r34408753 = 3.0;
        double r34408754 = x;
        double r34408755 = 2.0;
        double r34408756 = r34408754 * r34408755;
        double r34408757 = r34408753 - r34408756;
        double r34408758 = r34408757 * r34408754;
        double r34408759 = r34408758 * r34408754;
        return r34408759;
}

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 2019170 +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))))