Average Error: 0.2 → 0.1
Time: 11.0s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left(x \cdot x\right) \cdot 3 + \left(-2 \cdot {x}^{3}\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(x \cdot x\right) \cdot 3 + \left(-2 \cdot {x}^{3}\right)
double f(double x) {
        double r893591 = x;
        double r893592 = r893591 * r893591;
        double r893593 = 3.0;
        double r893594 = 2.0;
        double r893595 = r893591 * r893594;
        double r893596 = r893593 - r893595;
        double r893597 = r893592 * r893596;
        return r893597;
}

double f(double x) {
        double r893598 = x;
        double r893599 = r893598 * r893598;
        double r893600 = 3.0;
        double r893601 = r893599 * r893600;
        double r893602 = 2.0;
        double r893603 = 3.0;
        double r893604 = pow(r893598, r893603);
        double r893605 = r893602 * r893604;
        double r893606 = -r893605;
        double r893607 = r893601 + r893606;
        return r893607;
}

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 \cdot {x}^{3}\right)}\]
  6. Final simplification0.1

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

Reproduce

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