Average Error: 0.2 → 0.1
Time: 10.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 r635484 = x;
        double r635485 = r635484 * r635484;
        double r635486 = 3.0;
        double r635487 = 2.0;
        double r635488 = r635484 * r635487;
        double r635489 = r635486 - r635488;
        double r635490 = r635485 * r635489;
        return r635490;
}

double f(double x) {
        double r635491 = 3.0;
        double r635492 = x;
        double r635493 = r635492 * r635492;
        double r635494 = r635491 * r635493;
        double r635495 = 3.0;
        double r635496 = pow(r635492, r635495);
        double r635497 = 2.0;
        double r635498 = r635496 * r635497;
        double r635499 = r635494 - r635498;
        return r635499;
}

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