Average Error: 0.2 → 0.2
Time: 13.4s
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 r30231168 = x;
        double r30231169 = r30231168 * r30231168;
        double r30231170 = 3.0;
        double r30231171 = 2.0;
        double r30231172 = r30231168 * r30231171;
        double r30231173 = r30231170 - r30231172;
        double r30231174 = r30231169 * r30231173;
        return r30231174;
}

double f(double x) {
        double r30231175 = x;
        double r30231176 = 3.0;
        double r30231177 = r30231175 * r30231176;
        double r30231178 = 2.0;
        double r30231179 = r30231175 * r30231175;
        double r30231180 = r30231178 * r30231179;
        double r30231181 = r30231177 - r30231180;
        double r30231182 = r30231175 * r30231181;
        return r30231182;
}

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 2019172 +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))))