Average Error: 2.0 → 1.9
Time: 43.3s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\begin{array}{l} \mathbf{if}\;x \le -131967522831829665381196942903493345148900:\\ \;\;\;\;\frac{x \cdot {e}^{\left(\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b\right)}}{y}\\ \mathbf{elif}\;x \le 2.21645226035916800897563050125442800086 \cdot 10^{86}:\\ \;\;\;\;\frac{\frac{x}{y}}{e^{b - \mathsf{fma}\left(t - 1, \log a, \log z \cdot y\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \sqrt[3]{\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \left(\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}\right)}\right) \cdot \sqrt[3]{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}\right)\right)} \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}}\\ \end{array}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\begin{array}{l}
\mathbf{if}\;x \le -131967522831829665381196942903493345148900:\\
\;\;\;\;\frac{x \cdot {e}^{\left(\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b\right)}}{y}\\

\mathbf{elif}\;x \le 2.21645226035916800897563050125442800086 \cdot 10^{86}:\\
\;\;\;\;\frac{\frac{x}{y}}{e^{b - \mathsf{fma}\left(t - 1, \log a, \log z \cdot y\right)}}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \sqrt[3]{\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \left(\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}\right)}\right) \cdot \sqrt[3]{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}\right)\right)} \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r18537355 = x;
        double r18537356 = y;
        double r18537357 = z;
        double r18537358 = log(r18537357);
        double r18537359 = r18537356 * r18537358;
        double r18537360 = t;
        double r18537361 = 1.0;
        double r18537362 = r18537360 - r18537361;
        double r18537363 = a;
        double r18537364 = log(r18537363);
        double r18537365 = r18537362 * r18537364;
        double r18537366 = r18537359 + r18537365;
        double r18537367 = b;
        double r18537368 = r18537366 - r18537367;
        double r18537369 = exp(r18537368);
        double r18537370 = r18537355 * r18537369;
        double r18537371 = r18537370 / r18537356;
        return r18537371;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r18537372 = x;
        double r18537373 = -1.3196752283182967e+41;
        bool r18537374 = r18537372 <= r18537373;
        double r18537375 = exp(1.0);
        double r18537376 = a;
        double r18537377 = log(r18537376);
        double r18537378 = t;
        double r18537379 = 1.0;
        double r18537380 = r18537378 - r18537379;
        double r18537381 = r18537377 * r18537380;
        double r18537382 = z;
        double r18537383 = log(r18537382);
        double r18537384 = y;
        double r18537385 = r18537383 * r18537384;
        double r18537386 = r18537381 + r18537385;
        double r18537387 = b;
        double r18537388 = r18537386 - r18537387;
        double r18537389 = pow(r18537375, r18537388);
        double r18537390 = r18537372 * r18537389;
        double r18537391 = r18537390 / r18537384;
        double r18537392 = 2.216452260359168e+86;
        bool r18537393 = r18537372 <= r18537392;
        double r18537394 = r18537372 / r18537384;
        double r18537395 = fma(r18537380, r18537377, r18537385);
        double r18537396 = r18537387 - r18537395;
        double r18537397 = exp(r18537396);
        double r18537398 = r18537394 / r18537397;
        double r18537399 = exp(r18537388);
        double r18537400 = r18537372 * r18537399;
        double r18537401 = r18537400 / r18537384;
        double r18537402 = cbrt(r18537401);
        double r18537403 = r18537402 * r18537402;
        double r18537404 = r18537402 * r18537403;
        double r18537405 = cbrt(r18537404);
        double r18537406 = r18537402 * r18537405;
        double r18537407 = log1p(r18537401);
        double r18537408 = expm1(r18537407);
        double r18537409 = cbrt(r18537408);
        double r18537410 = r18537409 * r18537402;
        double r18537411 = r18537410 * r18537402;
        double r18537412 = cbrt(r18537411);
        double r18537413 = r18537406 * r18537412;
        double r18537414 = r18537393 ? r18537398 : r18537413;
        double r18537415 = r18537374 ? r18537391 : r18537414;
        return r18537415;
}

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.5
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;t \lt -0.8845848504127471478852839936735108494759:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.228837407310493290424346923828125:\\ \;\;\;\;\frac{\frac{x}{y} \cdot {a}^{\left(t - 1\right)}}{e^{b - \log z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if x < -1.3196752283182967e+41

    1. Initial program 0.7

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

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

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

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

    if -1.3196752283182967e+41 < x < 2.216452260359168e+86

    1. Initial program 2.8

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
    2. Simplified1.7

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

    if 2.216452260359168e+86 < x

    1. Initial program 0.7

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

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

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

      \[\leadsto \left(\sqrt[3]{\left(\sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\right) \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}}}\]
    8. Using strategy rm
    9. Applied expm1-log1p-u4.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -131967522831829665381196942903493345148900:\\ \;\;\;\;\frac{x \cdot {e}^{\left(\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b\right)}}{y}\\ \mathbf{elif}\;x \le 2.21645226035916800897563050125442800086 \cdot 10^{86}:\\ \;\;\;\;\frac{\frac{x}{y}}{e^{b - \mathsf{fma}\left(t - 1, \log a, \log z \cdot y\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \sqrt[3]{\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \left(\sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}} \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}\right)}\right) \cdot \sqrt[3]{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}\right)\right)} \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}\right) \cdot \sqrt[3]{\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019179 +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.0) (* 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.0) (* y (log z))))))

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