Average Error: 0.2 → 0.2
Time: 2.8s
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 r761620 = x;
        double r761621 = r761620 * r761620;
        double r761622 = 3.0;
        double r761623 = 2.0;
        double r761624 = r761620 * r761623;
        double r761625 = r761622 - r761624;
        double r761626 = r761621 * r761625;
        return r761626;
}

double f(double x) {
        double r761627 = x;
        double r761628 = 3.0;
        double r761629 = 2.0;
        double r761630 = r761627 * r761629;
        double r761631 = r761628 - r761630;
        double r761632 = r761627 * r761631;
        double r761633 = r761627 * r761632;
        return r761633;
}

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 2020064 +o rules:numerics
(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))))