Average Error: 1.9 → 2.6
Time: 33.2s
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}\;t \le 7.683339156886951568489082663084525135709 \cdot 10^{-177} \lor \neg \left(t \le 3.541246463368194008742434730785011242134 \cdot 10^{-75}\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{1}{{a}^{1}}\right)}^{1} \cdot \frac{x}{y}\right) \cdot e^{\log \left({a}^{t} \cdot {z}^{y}\right) - 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}\;t \le 7.683339156886951568489082663084525135709 \cdot 10^{-177} \lor \neg \left(t \le 3.541246463368194008742434730785011242134 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r318370 = x;
        double r318371 = y;
        double r318372 = z;
        double r318373 = log(r318372);
        double r318374 = r318371 * r318373;
        double r318375 = t;
        double r318376 = 1.0;
        double r318377 = r318375 - r318376;
        double r318378 = a;
        double r318379 = log(r318378);
        double r318380 = r318377 * r318379;
        double r318381 = r318374 + r318380;
        double r318382 = b;
        double r318383 = r318381 - r318382;
        double r318384 = exp(r318383);
        double r318385 = r318370 * r318384;
        double r318386 = r318385 / r318371;
        return r318386;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r318387 = t;
        double r318388 = 7.683339156886952e-177;
        bool r318389 = r318387 <= r318388;
        double r318390 = 3.541246463368194e-75;
        bool r318391 = r318387 <= r318390;
        double r318392 = !r318391;
        bool r318393 = r318389 || r318392;
        double r318394 = x;
        double r318395 = y;
        double r318396 = z;
        double r318397 = log(r318396);
        double r318398 = r318395 * r318397;
        double r318399 = 1.0;
        double r318400 = r318387 - r318399;
        double r318401 = a;
        double r318402 = log(r318401);
        double r318403 = r318400 * r318402;
        double r318404 = r318398 + r318403;
        double r318405 = b;
        double r318406 = r318404 - r318405;
        double r318407 = exp(r318406);
        double r318408 = r318394 * r318407;
        double r318409 = r318408 / r318395;
        double r318410 = 1.0;
        double r318411 = pow(r318401, r318399);
        double r318412 = r318410 / r318411;
        double r318413 = pow(r318412, r318399);
        double r318414 = r318394 / r318395;
        double r318415 = r318413 * r318414;
        double r318416 = pow(r318401, r318387);
        double r318417 = pow(r318396, r318395);
        double r318418 = r318416 * r318417;
        double r318419 = log(r318418);
        double r318420 = r318419 - r318405;
        double r318421 = exp(r318420);
        double r318422 = r318415 * r318421;
        double r318423 = r318393 ? r318409 : r318422;
        return r318423;
}

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
Target10.9
Herbie2.6
\[\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 2 regimes
  2. if t < 7.683339156886952e-177 or 3.541246463368194e-75 < t

    1. Initial program 1.7

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

    if 7.683339156886952e-177 < t < 3.541246463368194e-75

    1. Initial program 3.8

      \[\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 associate-/l*3.6

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

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

      \[\leadsto \frac{x}{\frac{y \cdot e^{b}}{\color{blue}{\frac{{a}^{t}}{{a}^{1}}} \cdot {z}^{y}}}\]
    7. Applied associate-*l/8.7

      \[\leadsto \frac{x}{\frac{y \cdot e^{b}}{\color{blue}{\frac{{a}^{t} \cdot {z}^{y}}{{a}^{1}}}}}\]
    8. Applied associate-/r/8.7

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

      \[\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}}\]
    10. Simplified9.1

      \[\leadsto \color{blue}{{\left(\frac{1}{{a}^{1}}\right)}^{1} \cdot \left(\frac{x}{y} \cdot e^{\left(-\left(-\log \left({a}^{t} \cdot {z}^{y}\right)\right)\right) - b}\right)}\]
    11. Using strategy rm
    12. Applied associate-*r*12.0

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

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

Reproduce

herbie shell --seed 2019304 
(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.88458485041274715) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.22883740731) (/ (* (/ 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))