Average Error: 0.2 → 0.2
Time: 13.9s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(x \cdot 3 - 2 \cdot \left(x \cdot x\right)\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot 3 - 2 \cdot \left(x \cdot x\right)\right)
double f(double x) {
        double r33556198 = x;
        double r33556199 = r33556198 * r33556198;
        double r33556200 = 3.0;
        double r33556201 = 2.0;
        double r33556202 = r33556198 * r33556201;
        double r33556203 = r33556200 - r33556202;
        double r33556204 = r33556199 * r33556203;
        return r33556204;
}

double f(double x) {
        double r33556205 = x;
        double r33556206 = 3.0;
        double r33556207 = r33556205 * r33556206;
        double r33556208 = 2.0;
        double r33556209 = r33556205 * r33556205;
        double r33556210 = r33556208 * r33556209;
        double r33556211 = r33556207 - r33556210;
        double r33556212 = r33556205 * r33556211;
        return r33556212;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(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))))