Average Error: 0.2 → 0.1
Time: 12.8s
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 r597677 = x;
        double r597678 = r597677 * r597677;
        double r597679 = 3.0;
        double r597680 = 2.0;
        double r597681 = r597677 * r597680;
        double r597682 = r597679 - r597681;
        double r597683 = r597678 * r597682;
        return r597683;
}

double f(double x) {
        double r597684 = 3.0;
        double r597685 = x;
        double r597686 = 2.0;
        double r597687 = pow(r597685, r597686);
        double r597688 = r597684 * r597687;
        double r597689 = 2.0;
        double r597690 = 3.0;
        double r597691 = pow(r597685, r597690);
        double r597692 = r597689 * r597691;
        double r597693 = r597688 - r597692;
        return r597693;
}

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