Average Error: 0.2 → 0.2
Time: 2.4s
Precision: 64
\[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)\]
\[\left({x}^{2} \cdot \left({\left(\sqrt[3]{3}\right)}^{2} \cdot \left(\sqrt[3]{\sqrt[3]{3}} \cdot \sqrt[3]{\sqrt[3]{3}}\right)\right)\right) \cdot \sqrt[3]{\sqrt[3]{3}} + \left(-2 \cdot {x}^{3}\right)\]
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left({x}^{2} \cdot \left({\left(\sqrt[3]{3}\right)}^{2} \cdot \left(\sqrt[3]{\sqrt[3]{3}} \cdot \sqrt[3]{\sqrt[3]{3}}\right)\right)\right) \cdot \sqrt[3]{\sqrt[3]{3}} + \left(-2 \cdot {x}^{3}\right)
double f(double x) {
        double r1596022 = x;
        double r1596023 = r1596022 * r1596022;
        double r1596024 = 3.0;
        double r1596025 = 2.0;
        double r1596026 = r1596022 * r1596025;
        double r1596027 = r1596024 - r1596026;
        double r1596028 = r1596023 * r1596027;
        return r1596028;
}

double f(double x) {
        double r1596029 = x;
        double r1596030 = 2.0;
        double r1596031 = pow(r1596029, r1596030);
        double r1596032 = 3.0;
        double r1596033 = cbrt(r1596032);
        double r1596034 = pow(r1596033, r1596030);
        double r1596035 = cbrt(r1596033);
        double r1596036 = r1596035 * r1596035;
        double r1596037 = r1596034 * r1596036;
        double r1596038 = r1596031 * r1596037;
        double r1596039 = r1596038 * r1596035;
        double r1596040 = 2.0;
        double r1596041 = 3.0;
        double r1596042 = pow(r1596029, r1596041);
        double r1596043 = r1596040 * r1596042;
        double r1596044 = -r1596043;
        double r1596045 = r1596039 + r1596044;
        return r1596045;
}

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 sub-neg0.2

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(3 + \left(-x \cdot 2\right)\right)}\]
  4. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3 + \left(x \cdot x\right) \cdot \left(-x \cdot 2\right)}\]
  5. Simplified0.1

    \[\leadsto \left(x \cdot x\right) \cdot 3 + \color{blue}{\left(-2 \cdot {x}^{3}\right)}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt0.1

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \sqrt[3]{3}\right)} + \left(-2 \cdot {x}^{3}\right)\]
  8. Applied associate-*r*0.2

    \[\leadsto \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)\right) \cdot \sqrt[3]{3}} + \left(-2 \cdot {x}^{3}\right)\]
  9. Using strategy rm
  10. Applied add-cube-cbrt0.2

    \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{3}} \cdot \sqrt[3]{\sqrt[3]{3}}\right) \cdot \sqrt[3]{\sqrt[3]{3}}\right)} + \left(-2 \cdot {x}^{3}\right)\]
  11. Applied associate-*r*0.2

    \[\leadsto \color{blue}{\left(\left(\left(x \cdot x\right) \cdot \left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{3}} \cdot \sqrt[3]{\sqrt[3]{3}}\right)\right) \cdot \sqrt[3]{\sqrt[3]{3}}} + \left(-2 \cdot {x}^{3}\right)\]
  12. Simplified0.2

    \[\leadsto \color{blue}{\left({x}^{2} \cdot \left({\left(\sqrt[3]{3}\right)}^{2} \cdot \left(\sqrt[3]{\sqrt[3]{3}} \cdot \sqrt[3]{\sqrt[3]{3}}\right)\right)\right)} \cdot \sqrt[3]{\sqrt[3]{3}} + \left(-2 \cdot {x}^{3}\right)\]
  13. Final simplification0.2

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

Reproduce

herbie shell --seed 2020057 
(FPCore (x)
  :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
  :precision binary64

  :herbie-target
  (* x (* x (- 3 (* x 2))))

  (* (* x x) (- 3 (* x 2))))