Average Error: 1.9 → 0.9
Time: 14.9s
Precision: 64
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\[\begin{array}{l} \mathbf{if}\;b \le -3.185210700417682681581697880982463637949 \cdot 10^{87} \lor \neg \left(b \le 1.778206102780430494185685516429247536496 \cdot 10^{-205}\right):\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + a \cdot \left(z \cdot b\right)\\ \end{array}\]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\begin{array}{l}
\mathbf{if}\;b \le -3.185210700417682681581697880982463637949 \cdot 10^{87} \lor \neg \left(b \le 1.778206102780430494185685516429247536496 \cdot 10^{-205}\right):\\
\;\;\;\;\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}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + a \cdot \left(z \cdot b\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r451241 = x;
        double r451242 = y;
        double r451243 = z;
        double r451244 = r451242 * r451243;
        double r451245 = r451241 + r451244;
        double r451246 = t;
        double r451247 = a;
        double r451248 = r451246 * r451247;
        double r451249 = r451245 + r451248;
        double r451250 = r451247 * r451243;
        double r451251 = b;
        double r451252 = r451250 * r451251;
        double r451253 = r451249 + r451252;
        return r451253;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r451254 = b;
        double r451255 = -3.1852107004176827e+87;
        bool r451256 = r451254 <= r451255;
        double r451257 = 1.7782061027804305e-205;
        bool r451258 = r451254 <= r451257;
        double r451259 = !r451258;
        bool r451260 = r451256 || r451259;
        double r451261 = x;
        double r451262 = y;
        double r451263 = z;
        double r451264 = r451262 * r451263;
        double r451265 = r451261 + r451264;
        double r451266 = t;
        double r451267 = a;
        double r451268 = r451266 * r451267;
        double r451269 = r451265 + r451268;
        double r451270 = r451267 * r451263;
        double r451271 = cbrt(r451254);
        double r451272 = r451271 * r451271;
        double r451273 = r451270 * r451272;
        double r451274 = r451273 * r451271;
        double r451275 = r451269 + r451274;
        double r451276 = r451263 * r451254;
        double r451277 = r451267 * r451276;
        double r451278 = r451269 + r451277;
        double r451279 = r451260 ? r451275 : r451278;
        return r451279;
}

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

Original1.9
Target0.4
Herbie0.9
\[\begin{array}{l} \mathbf{if}\;z \lt -11820553527347888128:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z \lt 4.758974318836428710669076838657752600596 \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. Split input into 2 regimes
  2. if b < -3.1852107004176827e+87 or 1.7782061027804305e-205 < b

    1. Initial program 1.2

      \[\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-cbrt1.4

      \[\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*1.4

      \[\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}}\]

    if -3.1852107004176827e+87 < b < 1.7782061027804305e-205

    1. Initial program 2.9

      \[\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.9

      \[\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.9

      \[\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. Using strategy rm
    6. Applied pow12.9

      \[\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 \color{blue}{{\left(\sqrt[3]{b}\right)}^{1}}\]
    7. Applied pow12.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \color{blue}{{\left(\sqrt[3]{b}\right)}^{1}}\right)\right) \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    8. Applied pow12.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \left(\color{blue}{{\left(\sqrt[3]{b}\right)}^{1}} \cdot {\left(\sqrt[3]{b}\right)}^{1}\right)\right) \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    9. Applied pow-prod-down2.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \color{blue}{{\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)}^{1}}\right) \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    10. Applied pow12.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot \color{blue}{{z}^{1}}\right) \cdot {\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)}^{1}\right) \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    11. Applied pow12.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(\color{blue}{{a}^{1}} \cdot {z}^{1}\right) \cdot {\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)}^{1}\right) \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    12. Applied pow-prod-down2.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\color{blue}{{\left(a \cdot z\right)}^{1}} \cdot {\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)}^{1}\right) \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    13. Applied pow-prod-down2.9

      \[\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)}^{1}} \cdot {\left(\sqrt[3]{b}\right)}^{1}\]
    14. Applied pow-prod-down2.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{{\left(\left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}\right)}^{1}}\]
    15. Simplified0.2

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + {\color{blue}{\left(a \cdot \left(z \cdot b\right)\right)}}^{1}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -3.185210700417682681581697880982463637949 \cdot 10^{87} \lor \neg \left(b \le 1.778206102780430494185685516429247536496 \cdot 10^{-205}\right):\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + a \cdot \left(z \cdot b\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019306 
(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.75897431883642871e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

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