Average Error: 0.2 → 0.2
Time: 14.6s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[x \cdot \frac{x \cdot \left(\left(3 + x \cdot 2\right) \cdot \left(3 - x \cdot 2\right)\right)}{3 + x \cdot 2}\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \frac{x \cdot \left(\left(3 + x \cdot 2\right) \cdot \left(3 - x \cdot 2\right)\right)}{3 + x \cdot 2}
double f(double x) {
        double r35830825 = x;
        double r35830826 = r35830825 * r35830825;
        double r35830827 = 3.0;
        double r35830828 = 2.0;
        double r35830829 = r35830825 * r35830828;
        double r35830830 = r35830827 - r35830829;
        double r35830831 = r35830826 * r35830830;
        return r35830831;
}

double f(double x) {
        double r35830832 = x;
        double r35830833 = 3.0;
        double r35830834 = 2.0;
        double r35830835 = r35830832 * r35830834;
        double r35830836 = r35830833 + r35830835;
        double r35830837 = r35830833 - r35830835;
        double r35830838 = r35830836 * r35830837;
        double r35830839 = r35830832 * r35830838;
        double r35830840 = r35830839 / r35830836;
        double r35830841 = r35830832 * r35830840;
        return r35830841;
}

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. Final simplification0.2

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

Reproduce

herbie shell --seed 2019192 +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))))