Average Error: 0.2 → 0.2
Time: 48.2s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
\[x \cdot \frac{\left(\left(3.0 + x \cdot 2.0\right) \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)}{3.0 + x \cdot 2.0}\]
\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)
x \cdot \frac{\left(\left(3.0 + x \cdot 2.0\right) \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)}{3.0 + x \cdot 2.0}
double f(double x) {
        double r39539248 = x;
        double r39539249 = r39539248 * r39539248;
        double r39539250 = 3.0;
        double r39539251 = 2.0;
        double r39539252 = r39539248 * r39539251;
        double r39539253 = r39539250 - r39539252;
        double r39539254 = r39539249 * r39539253;
        return r39539254;
}

double f(double x) {
        double r39539255 = x;
        double r39539256 = 3.0;
        double r39539257 = 2.0;
        double r39539258 = r39539255 * r39539257;
        double r39539259 = r39539256 + r39539258;
        double r39539260 = r39539259 * r39539255;
        double r39539261 = r39539256 - r39539258;
        double r39539262 = r39539260 * r39539261;
        double r39539263 = r39539262 / r39539259;
        double r39539264 = r39539255 * r39539263;
        return r39539264;
}

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.0 - x \cdot 2.0\right)\right)\]

Derivation

  1. Initial program 0.2

    \[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3.0 - x \cdot 2.0\right)\right)}\]
  4. Using strategy rm
  5. Applied flip--0.2

    \[\leadsto x \cdot \left(x \cdot \color{blue}{\frac{3.0 \cdot 3.0 - \left(x \cdot 2.0\right) \cdot \left(x \cdot 2.0\right)}{3.0 + x \cdot 2.0}}\right)\]
  6. Applied associate-*r/0.2

    \[\leadsto x \cdot \color{blue}{\frac{x \cdot \left(3.0 \cdot 3.0 - \left(x \cdot 2.0\right) \cdot \left(x \cdot 2.0\right)\right)}{3.0 + x \cdot 2.0}}\]
  7. Simplified0.2

    \[\leadsto x \cdot \frac{\color{blue}{\left(3.0 - x \cdot 2.0\right) \cdot \left(\left(3.0 + x \cdot 2.0\right) \cdot x\right)}}{3.0 + x \cdot 2.0}\]
  8. Final simplification0.2

    \[\leadsto x \cdot \frac{\left(\left(3.0 + x \cdot 2.0\right) \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)}{3.0 + x \cdot 2.0}\]

Reproduce

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