Average Error: 0.2 → 0.1
Time: 9.9s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \left(x \cdot 3\right) - 2 \cdot {x}^{3}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(x \cdot 3\right) - 2 \cdot {x}^{3}
double f(double x) {
        double r607416 = x;
        double r607417 = r607416 * r607416;
        double r607418 = 3.0;
        double r607419 = 2.0;
        double r607420 = r607416 * r607419;
        double r607421 = r607418 - r607420;
        double r607422 = r607417 * r607421;
        return r607422;
}

double f(double x) {
        double r607423 = x;
        double r607424 = 3.0;
        double r607425 = r607423 * r607424;
        double r607426 = r607423 * r607425;
        double r607427 = 2.0;
        double r607428 = 3.0;
        double r607429 = pow(r607423, r607428);
        double r607430 = r607427 * r607429;
        double r607431 = r607426 - r607430;
        return r607431;
}

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. Using strategy rm
  9. Applied pow10.1

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{{3}^{1}} - 2 \cdot {x}^{3}\]
  10. Applied pow10.1

    \[\leadsto \left(x \cdot \color{blue}{{x}^{1}}\right) \cdot {3}^{1} - 2 \cdot {x}^{3}\]
  11. Applied pow10.1

    \[\leadsto \left(\color{blue}{{x}^{1}} \cdot {x}^{1}\right) \cdot {3}^{1} - 2 \cdot {x}^{3}\]
  12. Applied pow-prod-down0.1

    \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{1}} \cdot {3}^{1} - 2 \cdot {x}^{3}\]
  13. Applied pow-prod-down0.1

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

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

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

Reproduce

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