Average Error: 0.2 → 0.2
Time: 3.8s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[{x}^{2} \cdot \left(3 - x \cdot 2\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
{x}^{2} \cdot \left(3 - x \cdot 2\right)
double f(double x) {
        double r549308 = x;
        double r549309 = r549308 * r549308;
        double r549310 = 3.0;
        double r549311 = 2.0;
        double r549312 = r549308 * r549311;
        double r549313 = r549310 - r549312;
        double r549314 = r549309 * r549313;
        return r549314;
}

double f(double x) {
        double r549315 = x;
        double r549316 = 2.0;
        double r549317 = pow(r549315, r549316);
        double r549318 = 3.0;
        double r549319 = 2.0;
        double r549320 = r549315 * r549319;
        double r549321 = r549318 - r549320;
        double r549322 = r549317 * r549321;
        return r549322;
}

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.2
\[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 associate-*l*0.2

    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)}\]
  4. Using strategy rm
  5. Applied flip--0.2

    \[\leadsto x \cdot \left(x \cdot \color{blue}{\frac{3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)}{3 + x \cdot 2}}\right)\]
  6. Applied associate-*r/0.2

    \[\leadsto x \cdot \color{blue}{\frac{x \cdot \left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right)}{3 + x \cdot 2}}\]
  7. Taylor expanded around 0 0.1

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

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

Reproduce

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