Average Error: 0.2 → 0.1
Time: 15.4s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(x \cdot x\right) \cdot 3 + \left(-2\right) \cdot {x}^{3}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(x \cdot x\right) \cdot 3 + \left(-2\right) \cdot {x}^{3}
double f(double x) {
        double r513516 = x;
        double r513517 = r513516 * r513516;
        double r513518 = 3.0;
        double r513519 = 2.0;
        double r513520 = r513516 * r513519;
        double r513521 = r513518 - r513520;
        double r513522 = r513517 * r513521;
        return r513522;
}

double f(double x) {
        double r513523 = x;
        double r513524 = r513523 * r513523;
        double r513525 = 3.0;
        double r513526 = r513524 * r513525;
        double r513527 = 2.0;
        double r513528 = -r513527;
        double r513529 = 3.0;
        double r513530 = pow(r513523, r513529);
        double r513531 = r513528 * r513530;
        double r513532 = r513526 + r513531;
        return r513532;
}

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. Using strategy rm
  3. Applied sub-neg0.2

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(3 + \left(-x \cdot 2\right)\right)}\]
  4. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3 + \left(x \cdot x\right) \cdot \left(-x \cdot 2\right)}\]
  5. Simplified0.1

    \[\leadsto \left(x \cdot x\right) \cdot 3 + \color{blue}{\left(-2\right) \cdot {x}^{3}}\]
  6. Final simplification0.1

    \[\leadsto \left(x \cdot x\right) \cdot 3 + \left(-2\right) \cdot {x}^{3}\]

Reproduce

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