Average Error: 0.2 → 0.2
Time: 15.7s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
\[\left(3.0 - 2.0 \cdot x\right) \cdot \left(x \cdot x\right)\]
\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)
\left(3.0 - 2.0 \cdot x\right) \cdot \left(x \cdot x\right)
double f(double x) {
        double r38825369 = x;
        double r38825370 = r38825369 * r38825369;
        double r38825371 = 3.0;
        double r38825372 = 2.0;
        double r38825373 = r38825369 * r38825372;
        double r38825374 = r38825371 - r38825373;
        double r38825375 = r38825370 * r38825374;
        return r38825375;
}

double f(double x) {
        double r38825376 = 3.0;
        double r38825377 = 2.0;
        double r38825378 = x;
        double r38825379 = r38825377 * r38825378;
        double r38825380 = r38825376 - r38825379;
        double r38825381 = r38825378 * r38825378;
        double r38825382 = r38825380 * r38825381;
        return r38825382;
}

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.0 - x \cdot 2.0\right)\right)\]

Derivation

  1. Initial program 0.2

    \[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
  2. Final simplification0.2

    \[\leadsto \left(3.0 - 2.0 \cdot x\right) \cdot \left(x \cdot x\right)\]

Reproduce

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