Average Error: 2.1 → 4.4
Time: 20.8s
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}\;y \le -1.3720154821277287 \cdot 10^{-66} \lor \neg \left(y \le 2.1260560135388765 \cdot 10^{-43}\right):\\ \;\;\;\;{\left(\frac{1}{{a}^{1}}\right)}^{1} \cdot \left(e^{\left(y \cdot \log z - t \cdot \left(-\log a\right)\right) - b} \cdot \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{{a}^{1}} \cdot {z}^{y}}{y \cdot e^{b}}\\ \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}\;y \le -1.3720154821277287 \cdot 10^{-66} \lor \neg \left(y \le 2.1260560135388765 \cdot 10^{-43}\right):\\
\;\;\;\;{\left(\frac{1}{{a}^{1}}\right)}^{1} \cdot \left(e^{\left(y \cdot \log z - t \cdot \left(-\log a\right)\right) - b} \cdot \frac{x}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{{a}^{t}}{{a}^{1}} \cdot {z}^{y}}{y \cdot e^{b}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r590262 = x;
        double r590263 = y;
        double r590264 = z;
        double r590265 = log(r590264);
        double r590266 = r590263 * r590265;
        double r590267 = t;
        double r590268 = 1.0;
        double r590269 = r590267 - r590268;
        double r590270 = a;
        double r590271 = log(r590270);
        double r590272 = r590269 * r590271;
        double r590273 = r590266 + r590272;
        double r590274 = b;
        double r590275 = r590273 - r590274;
        double r590276 = exp(r590275);
        double r590277 = r590262 * r590276;
        double r590278 = r590277 / r590263;
        return r590278;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r590279 = y;
        double r590280 = -1.3720154821277287e-66;
        bool r590281 = r590279 <= r590280;
        double r590282 = 2.1260560135388765e-43;
        bool r590283 = r590279 <= r590282;
        double r590284 = !r590283;
        bool r590285 = r590281 || r590284;
        double r590286 = 1.0;
        double r590287 = a;
        double r590288 = 1.0;
        double r590289 = pow(r590287, r590288);
        double r590290 = r590286 / r590289;
        double r590291 = pow(r590290, r590288);
        double r590292 = z;
        double r590293 = log(r590292);
        double r590294 = r590279 * r590293;
        double r590295 = t;
        double r590296 = log(r590287);
        double r590297 = -r590296;
        double r590298 = r590295 * r590297;
        double r590299 = r590294 - r590298;
        double r590300 = b;
        double r590301 = r590299 - r590300;
        double r590302 = exp(r590301);
        double r590303 = x;
        double r590304 = r590303 / r590279;
        double r590305 = r590302 * r590304;
        double r590306 = r590291 * r590305;
        double r590307 = pow(r590287, r590295);
        double r590308 = r590307 / r590289;
        double r590309 = pow(r590292, r590279);
        double r590310 = r590308 * r590309;
        double r590311 = exp(r590300);
        double r590312 = r590279 * r590311;
        double r590313 = r590310 / r590312;
        double r590314 = r590303 * r590313;
        double r590315 = r590285 ? r590306 : r590314;
        return r590315;
}

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.1
Target11.3
Herbie4.4
\[\begin{array}{l} \mathbf{if}\;t \lt -0.88458485041274715:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.22883740731:\\ \;\;\;\;\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 2 regimes
  2. if y < -1.3720154821277287e-66 or 2.1260560135388765e-43 < y

    1. Initial program 0.4

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

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

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

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{e^{y \cdot \log z + \left(t - 1\right) \cdot \log a}}{e^{b}}}}{y}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity14.9

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{{a}^{\left(t - 1\right)} \cdot {z}^{y}}{y \cdot e^{b}}}\]
    12. Using strategy rm
    13. Applied pow-sub24.3

      \[\leadsto x \cdot \frac{\color{blue}{\frac{{a}^{t}}{{a}^{1}}} \cdot {z}^{y}}{y \cdot e^{b}}\]
    14. Taylor expanded around inf 24.3

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

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

    if -1.3720154821277287e-66 < y < 2.1260560135388765e-43

    1. Initial program 4.3

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

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

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

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{e^{y \cdot \log z + \left(t - 1\right) \cdot \log a}}{e^{b}}}}{y}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity11.5

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{{a}^{\left(t - 1\right)} \cdot {z}^{y}}{y \cdot e^{b}}}\]
    12. Using strategy rm
    13. Applied pow-sub9.8

      \[\leadsto x \cdot \frac{\color{blue}{\frac{{a}^{t}}{{a}^{1}}} \cdot {z}^{y}}{y \cdot e^{b}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification4.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.3720154821277287 \cdot 10^{-66} \lor \neg \left(y \le 2.1260560135388765 \cdot 10^{-43}\right):\\ \;\;\;\;{\left(\frac{1}{{a}^{1}}\right)}^{1} \cdot \left(e^{\left(y \cdot \log z - t \cdot \left(-\log a\right)\right) - b} \cdot \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{{a}^{1}} \cdot {z}^{y}}{y \cdot e^{b}}\\ \end{array}\]

Reproduce

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

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

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