Average Error: 2.0 → 2.2
Time: 7.1s
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 r772516 = x;
        double r772517 = y;
        double r772518 = z;
        double r772519 = r772517 * r772518;
        double r772520 = r772516 + r772519;
        double r772521 = t;
        double r772522 = a;
        double r772523 = r772521 * r772522;
        double r772524 = r772520 + r772523;
        double r772525 = r772522 * r772518;
        double r772526 = b;
        double r772527 = r772525 * r772526;
        double r772528 = r772524 + r772527;
        return r772528;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r772529 = x;
        double r772530 = y;
        double r772531 = z;
        double r772532 = r772530 * r772531;
        double r772533 = r772529 + r772532;
        double r772534 = t;
        double r772535 = a;
        double r772536 = r772534 * r772535;
        double r772537 = r772533 + r772536;
        double r772538 = r772535 * r772531;
        double r772539 = b;
        double r772540 = cbrt(r772539);
        double r772541 = r772540 * r772540;
        double r772542 = r772538 * r772541;
        double r772543 = r772542 * r772540;
        double r772544 = r772537 + r772543;
        return r772544;
}

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