Average Error: 0.2 → 0.1
Time: 12.7s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[3 \cdot \left(x \cdot x\right) - {x}^{3} \cdot 2\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
3 \cdot \left(x \cdot x\right) - {x}^{3} \cdot 2
double f(double x) {
        double r610442 = x;
        double r610443 = r610442 * r610442;
        double r610444 = 3.0;
        double r610445 = 2.0;
        double r610446 = r610442 * r610445;
        double r610447 = r610444 - r610446;
        double r610448 = r610443 * r610447;
        return r610448;
}

double f(double x) {
        double r610449 = 3.0;
        double r610450 = x;
        double r610451 = r610450 * r610450;
        double r610452 = r610449 * r610451;
        double r610453 = 3.0;
        double r610454 = pow(r610450, r610453);
        double r610455 = 2.0;
        double r610456 = r610454 * r610455;
        double r610457 = r610452 - r610456;
        return r610457;
}

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

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

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

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

    \[\leadsto \color{blue}{3 \cdot {x}^{2} - 2 \cdot {x}^{3}}\]
  7. Simplified0.1

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

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

Reproduce

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