Average Error: 0.2 → 0.2
Time: 17.4s
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 r35507168 = x;
        double r35507169 = r35507168 * r35507168;
        double r35507170 = 3.0;
        double r35507171 = 2.0;
        double r35507172 = r35507168 * r35507171;
        double r35507173 = r35507170 - r35507172;
        double r35507174 = r35507169 * r35507173;
        return r35507174;
}

double f(double x) {
        double r35507175 = x;
        double r35507176 = 3.0;
        double r35507177 = 2.0;
        double r35507178 = r35507175 * r35507177;
        double r35507179 = r35507176 - r35507178;
        double r35507180 = r35507176 + r35507178;
        double r35507181 = r35507179 * r35507180;
        double r35507182 = r35507175 * r35507181;
        double r35507183 = r35507182 / r35507180;
        double r35507184 = r35507175 * r35507183;
        return r35507184;
}

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. Using strategy rm
  9. Applied *-commutative0.2

    \[\leadsto \color{blue}{\frac{x \cdot \left(\left(3 - x \cdot 2\right) \cdot \left(3 + x \cdot 2\right)\right)}{3 + x \cdot 2} \cdot x}\]
  10. 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 2019172 
(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))))