Average Error: 2.0 → 0.8
Time: 15.2s
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 -1.029332914097035150003651381505816557895 \cdot 10^{146}:\\ \;\;\;\;\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\ \mathbf{elif}\;b \le 3.88479588022017558466900273665607578266 \cdot 10^{84}:\\ \;\;\;\;z \cdot \left(a \cdot b\right) + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + a \cdot t\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 -1.029332914097035150003651381505816557895 \cdot 10^{146}:\\
\;\;\;\;\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\

\mathbf{elif}\;b \le 3.88479588022017558466900273665607578266 \cdot 10^{84}:\\
\;\;\;\;z \cdot \left(a \cdot b\right) + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r33158692 = x;
        double r33158693 = y;
        double r33158694 = z;
        double r33158695 = r33158693 * r33158694;
        double r33158696 = r33158692 + r33158695;
        double r33158697 = t;
        double r33158698 = a;
        double r33158699 = r33158697 * r33158698;
        double r33158700 = r33158696 + r33158699;
        double r33158701 = r33158698 * r33158694;
        double r33158702 = b;
        double r33158703 = r33158701 * r33158702;
        double r33158704 = r33158700 + r33158703;
        return r33158704;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r33158705 = b;
        double r33158706 = -1.0293329140970352e+146;
        bool r33158707 = r33158705 <= r33158706;
        double r33158708 = a;
        double r33158709 = z;
        double r33158710 = r33158708 * r33158709;
        double r33158711 = r33158710 * r33158705;
        double r33158712 = x;
        double r33158713 = y;
        double r33158714 = r33158713 * r33158709;
        double r33158715 = r33158712 + r33158714;
        double r33158716 = t;
        double r33158717 = r33158708 * r33158716;
        double r33158718 = r33158715 + r33158717;
        double r33158719 = r33158711 + r33158718;
        double r33158720 = 3.8847958802201756e+84;
        bool r33158721 = r33158705 <= r33158720;
        double r33158722 = r33158708 * r33158705;
        double r33158723 = r33158709 * r33158722;
        double r33158724 = r33158723 + r33158718;
        double r33158725 = r33158721 ? r33158724 : r33158719;
        double r33158726 = r33158707 ? r33158719 : r33158725;
        return r33158726;
}

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.3
Herbie0.8
\[\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 < -1.0293329140970352e+146 or 3.8847958802201756e+84 < b

    1. Initial program 0.9

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]

    if -1.0293329140970352e+146 < b < 3.8847958802201756e+84

    1. Initial program 2.3

      \[\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.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*2.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}}\]
    5. Using strategy rm
    6. Applied pow12.4

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -1.029332914097035150003651381505816557895 \cdot 10^{146}:\\ \;\;\;\;\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\ \mathbf{elif}\;b \le 3.88479588022017558466900273665607578266 \cdot 10^{84}:\\ \;\;\;\;z \cdot \left(a \cdot b\right) + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< z -1.1820553527347888e+19) (+ (* 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)))