Average Error: 0.2 → 0.2
Time: 36.6s
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 r32105652 = x;
        double r32105653 = r32105652 * r32105652;
        double r32105654 = 3.0;
        double r32105655 = 2.0;
        double r32105656 = r32105652 * r32105655;
        double r32105657 = r32105654 - r32105656;
        double r32105658 = r32105653 * r32105657;
        return r32105658;
}

double f(double x) {
        double r32105659 = 3.0;
        double r32105660 = x;
        double r32105661 = 2.0;
        double r32105662 = r32105660 * r32105661;
        double r32105663 = r32105659 - r32105662;
        double r32105664 = r32105663 * r32105660;
        double r32105665 = r32105664 * r32105660;
        return r32105665;
}

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