Average Error: 2.0 → 2.2
Time: 7.0s
Precision: 64
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}\]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}
double f(double x, double y, double z, double t, double a, double b) {
        double r656843 = x;
        double r656844 = y;
        double r656845 = z;
        double r656846 = r656844 * r656845;
        double r656847 = r656843 + r656846;
        double r656848 = t;
        double r656849 = a;
        double r656850 = r656848 * r656849;
        double r656851 = r656847 + r656850;
        double r656852 = r656849 * r656845;
        double r656853 = b;
        double r656854 = r656852 * r656853;
        double r656855 = r656851 + r656854;
        return r656855;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r656856 = x;
        double r656857 = y;
        double r656858 = z;
        double r656859 = r656857 * r656858;
        double r656860 = r656856 + r656859;
        double r656861 = t;
        double r656862 = a;
        double r656863 = r656861 * r656862;
        double r656864 = r656860 + r656863;
        double r656865 = r656862 * r656858;
        double r656866 = b;
        double r656867 = cbrt(r656866);
        double r656868 = r656867 * r656867;
        double r656869 = r656865 * r656868;
        double r656870 = r656869 * r656867;
        double r656871 = r656864 + r656870;
        return r656871;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.0
Target0.4
Herbie2.2
\[\begin{array}{l} \mathbf{if}\;z \lt -11820553527347888000:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z \lt 4.75897431883642871 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \end{array}\]

Derivation

  1. Initial program 2.0

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
  2. Using strategy rm
  3. Applied add-cube-cbrt2.2

    \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot \color{blue}{\left(\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \sqrt[3]{b}\right)}\]
  4. Applied associate-*r*2.2

    \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}}\]
  5. Final simplification2.2

    \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}\]

Reproduce

herbie shell --seed 2020045 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))