Average Error: 0.2 → 0.1
Time: 10.0s
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 r735325 = x;
        double r735326 = r735325 * r735325;
        double r735327 = 3.0;
        double r735328 = 2.0;
        double r735329 = r735325 * r735328;
        double r735330 = r735327 - r735329;
        double r735331 = r735326 * r735330;
        return r735331;
}

double f(double x) {
        double r735332 = 3.0;
        double r735333 = x;
        double r735334 = r735333 * r735333;
        double r735335 = r735332 * r735334;
        double r735336 = 3.0;
        double r735337 = pow(r735333, r735336);
        double r735338 = 2.0;
        double r735339 = r735337 * r735338;
        double r735340 = r735335 - r735339;
        return r735340;
}

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 2019179 
(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))))