Average Error: 2.0 → 1.5
Time: 49.6s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.874142655497601 \cdot 10^{-203}:\\ \;\;\;\;\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}} \cdot \left(\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}} \cdot \sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}}\right)\\ \mathbf{elif}\;x \le 4.564051854504764 \cdot 10^{+138}:\\ \;\;\;\;\frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{e^{\mathsf{fma}\left(t - 1.0, \log a, y \cdot \log z\right) - b}}{\sqrt[3]{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{e}^{\left(\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b\right)} \cdot x}{y}\\ \end{array}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}
\begin{array}{l}
\mathbf{if}\;x \le -1.874142655497601 \cdot 10^{-203}:\\
\;\;\;\;\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}} \cdot \left(\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}} \cdot \sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}}\right)\\

\mathbf{elif}\;x \le 4.564051854504764 \cdot 10^{+138}:\\
\;\;\;\;\frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{e^{\mathsf{fma}\left(t - 1.0, \log a, y \cdot \log z\right) - b}}{\sqrt[3]{y}}\\

\mathbf{else}:\\
\;\;\;\;\frac{{e}^{\left(\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b\right)} \cdot x}{y}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r20742127 = x;
        double r20742128 = y;
        double r20742129 = z;
        double r20742130 = log(r20742129);
        double r20742131 = r20742128 * r20742130;
        double r20742132 = t;
        double r20742133 = 1.0;
        double r20742134 = r20742132 - r20742133;
        double r20742135 = a;
        double r20742136 = log(r20742135);
        double r20742137 = r20742134 * r20742136;
        double r20742138 = r20742131 + r20742137;
        double r20742139 = b;
        double r20742140 = r20742138 - r20742139;
        double r20742141 = exp(r20742140);
        double r20742142 = r20742127 * r20742141;
        double r20742143 = r20742142 / r20742128;
        return r20742143;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r20742144 = x;
        double r20742145 = -1.874142655497601e-203;
        bool r20742146 = r20742144 <= r20742145;
        double r20742147 = a;
        double r20742148 = log(r20742147);
        double r20742149 = t;
        double r20742150 = 1.0;
        double r20742151 = r20742149 - r20742150;
        double r20742152 = r20742148 * r20742151;
        double r20742153 = y;
        double r20742154 = z;
        double r20742155 = log(r20742154);
        double r20742156 = r20742153 * r20742155;
        double r20742157 = r20742152 + r20742156;
        double r20742158 = b;
        double r20742159 = r20742157 - r20742158;
        double r20742160 = exp(r20742159);
        double r20742161 = sqrt(r20742160);
        double r20742162 = r20742161 * r20742161;
        double r20742163 = r20742144 * r20742162;
        double r20742164 = r20742163 / r20742153;
        double r20742165 = cbrt(r20742164);
        double r20742166 = r20742165 * r20742165;
        double r20742167 = r20742165 * r20742166;
        double r20742168 = 4.564051854504764e+138;
        bool r20742169 = r20742144 <= r20742168;
        double r20742170 = cbrt(r20742153);
        double r20742171 = r20742170 * r20742170;
        double r20742172 = r20742144 / r20742171;
        double r20742173 = fma(r20742151, r20742148, r20742156);
        double r20742174 = r20742173 - r20742158;
        double r20742175 = exp(r20742174);
        double r20742176 = r20742175 / r20742170;
        double r20742177 = r20742172 * r20742176;
        double r20742178 = exp(1.0);
        double r20742179 = pow(r20742178, r20742159);
        double r20742180 = r20742179 * r20742144;
        double r20742181 = r20742180 / r20742153;
        double r20742182 = r20742169 ? r20742177 : r20742181;
        double r20742183 = r20742146 ? r20742167 : r20742182;
        return r20742183;
}

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

Target

Original2.0
Target11.0
Herbie1.5
\[\begin{array}{l} \mathbf{if}\;t \lt -0.8845848504127471:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1.0\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.2288374073:\\ \;\;\;\;\frac{\frac{x}{y} \cdot {a}^{\left(t - 1.0\right)}}{e^{b - \log z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1.0\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if x < -1.874142655497601e-203

    1. Initial program 1.6

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt1.6

      \[\leadsto \frac{x \cdot \color{blue}{\left(\sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}} \cdot \sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}\right)}}{y}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt1.6

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}} \cdot \sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}\right)}{y}} \cdot \sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}} \cdot \sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}\right)}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}} \cdot \sqrt{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}\right)}{y}}}\]

    if -1.874142655497601e-203 < x < 4.564051854504764e+138

    1. Initial program 2.8

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt2.8

      \[\leadsto \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}\]
    4. Applied times-frac1.6

      \[\leadsto \color{blue}{\frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{\sqrt[3]{y}}}\]
    5. Simplified1.6

      \[\leadsto \frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \color{blue}{\frac{e^{\mathsf{fma}\left(t - 1.0, \log a, \log z \cdot y\right) - b}}{\sqrt[3]{y}}}\]

    if 4.564051854504764e+138 < x

    1. Initial program 0.6

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b}}{y}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.6

      \[\leadsto \frac{x \cdot e^{\color{blue}{1 \cdot \left(\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b\right)}}}{y}\]
    4. Applied exp-prod0.6

      \[\leadsto \frac{x \cdot \color{blue}{{\left(e^{1}\right)}^{\left(\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b\right)}}}{y}\]
    5. Simplified0.6

      \[\leadsto \frac{x \cdot {\color{blue}{e}}^{\left(\left(y \cdot \log z + \left(t - 1.0\right) \cdot \log a\right) - b\right)}}{y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.874142655497601 \cdot 10^{-203}:\\ \;\;\;\;\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}} \cdot \left(\sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}} \cdot \sqrt[3]{\frac{x \cdot \left(\sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}} \cdot \sqrt{e^{\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b}}\right)}{y}}\right)\\ \mathbf{elif}\;x \le 4.564051854504764 \cdot 10^{+138}:\\ \;\;\;\;\frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{e^{\mathsf{fma}\left(t - 1.0, \log a, y \cdot \log z\right) - b}}{\sqrt[3]{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{e}^{\left(\left(\log a \cdot \left(t - 1.0\right) + y \cdot \log z\right) - b\right)} \cdot x}{y}\\ \end{array}\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"

  :herbie-target
  (if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1) (* y (log z))))))

  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))