Average Error: 0.2 → 0.1
Time: 12.6s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[3 \cdot {x}^{2} - 2 \cdot {x}^{3}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
3 \cdot {x}^{2} - 2 \cdot {x}^{3}
double f(double x) {
        double r562441 = x;
        double r562442 = r562441 * r562441;
        double r562443 = 3.0;
        double r562444 = 2.0;
        double r562445 = r562441 * r562444;
        double r562446 = r562443 - r562445;
        double r562447 = r562442 * r562446;
        return r562447;
}

double f(double x) {
        double r562448 = 3.0;
        double r562449 = x;
        double r562450 = 2.0;
        double r562451 = pow(r562449, r562450);
        double r562452 = r562448 * r562451;
        double r562453 = 2.0;
        double r562454 = 3.0;
        double r562455 = pow(r562449, r562454);
        double r562456 = r562453 * r562455;
        double r562457 = r562452 - r562456;
        return r562457;
}

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.1
\[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. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {x}^{2} - 2 \cdot {x}^{3}}\]
  3. Final simplification0.1

    \[\leadsto 3 \cdot {x}^{2} - 2 \cdot {x}^{3}\]

Reproduce

herbie shell --seed 2019198 +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))))