Average Error: 2.1 → 0.6
Time: 35.9s
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}\;\left(t - 1\right) \cdot \log a \le -173011673.0759815275669097900390625 \lor \neg \left(\left(t - 1\right) \cdot \log a \le 145.8223216718689627668936736881732940674\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{y} \cdot \left(e^{\left(y \cdot \log z - \left(-\log a\right) \cdot t\right) - b} \cdot x\right)\\ \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}\;\left(t - 1\right) \cdot \log a \le -173011673.0759815275669097900390625 \lor \neg \left(\left(t - 1\right) \cdot \log a \le 145.8223216718689627668936736881732940674\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r327479 = x;
        double r327480 = y;
        double r327481 = z;
        double r327482 = log(r327481);
        double r327483 = r327480 * r327482;
        double r327484 = t;
        double r327485 = 1.0;
        double r327486 = r327484 - r327485;
        double r327487 = a;
        double r327488 = log(r327487);
        double r327489 = r327486 * r327488;
        double r327490 = r327483 + r327489;
        double r327491 = b;
        double r327492 = r327490 - r327491;
        double r327493 = exp(r327492);
        double r327494 = r327479 * r327493;
        double r327495 = r327494 / r327480;
        return r327495;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r327496 = t;
        double r327497 = 1.0;
        double r327498 = r327496 - r327497;
        double r327499 = a;
        double r327500 = log(r327499);
        double r327501 = r327498 * r327500;
        double r327502 = -173011673.07598153;
        bool r327503 = r327501 <= r327502;
        double r327504 = 145.82232167186896;
        bool r327505 = r327501 <= r327504;
        double r327506 = !r327505;
        bool r327507 = r327503 || r327506;
        double r327508 = x;
        double r327509 = y;
        double r327510 = z;
        double r327511 = log(r327510);
        double r327512 = r327509 * r327511;
        double r327513 = r327512 + r327501;
        double r327514 = b;
        double r327515 = r327513 - r327514;
        double r327516 = exp(r327515);
        double r327517 = r327508 * r327516;
        double r327518 = r327517 / r327509;
        double r327519 = 1.0;
        double r327520 = pow(r327499, r327497);
        double r327521 = r327519 / r327520;
        double r327522 = pow(r327521, r327497);
        double r327523 = r327522 / r327509;
        double r327524 = -r327500;
        double r327525 = r327524 * r327496;
        double r327526 = r327512 - r327525;
        double r327527 = r327526 - r327514;
        double r327528 = exp(r327527);
        double r327529 = r327528 * r327508;
        double r327530 = r327523 * r327529;
        double r327531 = r327507 ? r327518 : r327530;
        return r327531;
}

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
Target10.9
Herbie0.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 1.0) (log a)) < -173011673.07598153 or 145.82232167186896 < (* (- t 1.0) (log a))

    1. Initial program 0.4

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

    if -173011673.07598153 < (* (- t 1.0) (log a)) < 145.82232167186896

    1. Initial program 5.2

      \[\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*2.2

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

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

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

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

      \[\leadsto \frac{x}{\frac{y}{\color{blue}{\frac{{a}^{t} \cdot {z}^{y}}{e^{b} \cdot {a}^{1}}}}}\]
    9. Taylor expanded around inf 10.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. Simplified0.9

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

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

Reproduce

herbie shell --seed 2019325 
(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))