Average Error: 0.2 → 0.1
Time: 22.8s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(x \cdot 3\right) + \left(-{x}^{3} \cdot 2\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot 3\right) + \left(-{x}^{3} \cdot 2\right)
double f(double x) {
        double r621586 = x;
        double r621587 = r621586 * r621586;
        double r621588 = 3.0;
        double r621589 = 2.0;
        double r621590 = r621586 * r621589;
        double r621591 = r621588 - r621590;
        double r621592 = r621587 * r621591;
        return r621592;
}

double f(double x) {
        double r621593 = x;
        double r621594 = 3.0;
        double r621595 = r621593 * r621594;
        double r621596 = r621593 * r621595;
        double r621597 = 3.0;
        double r621598 = pow(r621593, r621597);
        double r621599 = 2.0;
        double r621600 = r621598 * r621599;
        double r621601 = -r621600;
        double r621602 = r621596 + r621601;
        return r621602;
}

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.2

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

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

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

Reproduce

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