Average Error: 0.2 → 0.2
Time: 11.1s
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 r583443 = x;
        double r583444 = r583443 * r583443;
        double r583445 = 3.0;
        double r583446 = 2.0;
        double r583447 = r583443 * r583446;
        double r583448 = r583445 - r583447;
        double r583449 = r583444 * r583448;
        return r583449;
}

double f(double x) {
        double r583450 = x;
        double r583451 = 3.0;
        double r583452 = 2.0;
        double r583453 = r583452 * r583450;
        double r583454 = r583451 - r583453;
        double r583455 = r583454 * r583450;
        double r583456 = r583450 * r583455;
        return r583456;
}

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