Average Error: 0.2 → 0.2
Time: 7.4s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)\]
\[\left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x\]
\left(x \cdot x\right) \cdot \left(3.0 - x \cdot 2.0\right)
\left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x
double f(double x) {
        double r16669103 = x;
        double r16669104 = r16669103 * r16669103;
        double r16669105 = 3.0;
        double r16669106 = 2.0;
        double r16669107 = r16669103 * r16669106;
        double r16669108 = r16669105 - r16669107;
        double r16669109 = r16669104 * r16669108;
        return r16669109;
}

double f(double x) {
        double r16669110 = 3.0;
        double r16669111 = x;
        double r16669112 = 2.0;
        double r16669113 = r16669111 * r16669112;
        double r16669114 = r16669110 - r16669113;
        double r16669115 = r16669114 * r16669111;
        double r16669116 = r16669115 * r16669111;
        return r16669116;
}

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 add-cube-cbrt0.5

    \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\left(\sqrt[3]{3.0 - x \cdot 2.0} \cdot \sqrt[3]{3.0 - x \cdot 2.0}\right) \cdot \sqrt[3]{3.0 - x \cdot 2.0}\right)}\right)\]
  6. Applied associate-*r*0.5

    \[\leadsto x \cdot \color{blue}{\left(\left(x \cdot \left(\sqrt[3]{3.0 - x \cdot 2.0} \cdot \sqrt[3]{3.0 - x \cdot 2.0}\right)\right) \cdot \sqrt[3]{3.0 - x \cdot 2.0}\right)}\]
  7. Using strategy rm
  8. Applied associate-*l*0.5

    \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\left(\sqrt[3]{3.0 - x \cdot 2.0} \cdot \sqrt[3]{3.0 - x \cdot 2.0}\right) \cdot \sqrt[3]{3.0 - x \cdot 2.0}\right)\right)}\]
  9. Simplified0.2

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

    \[\leadsto \left(\left(3.0 - x \cdot 2.0\right) \cdot x\right) \cdot x\]

Reproduce

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