Average Error: 2.1 → 2.1
Time: 15.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}\;\left(t - 1\right) \cdot \log a \le -2.9642058948872463 \cdot 10^{33} \lor \neg \left(\left(t - 1\right) \cdot \log a \le -335.233961090993546\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{{z}^{y} \cdot \frac{{a}^{\left(t - 1\right)}}{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}\;\left(t - 1\right) \cdot \log a \le -2.9642058948872463 \cdot 10^{33} \lor \neg \left(\left(t - 1\right) \cdot \log a \le -335.233961090993546\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r169406 = x;
        double r169407 = y;
        double r169408 = z;
        double r169409 = log(r169408);
        double r169410 = r169407 * r169409;
        double r169411 = t;
        double r169412 = 1.0;
        double r169413 = r169411 - r169412;
        double r169414 = a;
        double r169415 = log(r169414);
        double r169416 = r169413 * r169415;
        double r169417 = r169410 + r169416;
        double r169418 = b;
        double r169419 = r169417 - r169418;
        double r169420 = exp(r169419);
        double r169421 = r169406 * r169420;
        double r169422 = r169421 / r169407;
        return r169422;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r169423 = t;
        double r169424 = 1.0;
        double r169425 = r169423 - r169424;
        double r169426 = a;
        double r169427 = log(r169426);
        double r169428 = r169425 * r169427;
        double r169429 = -2.9642058948872463e+33;
        bool r169430 = r169428 <= r169429;
        double r169431 = -335.23396109099355;
        bool r169432 = r169428 <= r169431;
        double r169433 = !r169432;
        bool r169434 = r169430 || r169433;
        double r169435 = x;
        double r169436 = y;
        double r169437 = z;
        double r169438 = log(r169437);
        double r169439 = r169436 * r169438;
        double r169440 = r169439 + r169428;
        double r169441 = b;
        double r169442 = r169440 - r169441;
        double r169443 = exp(r169442);
        double r169444 = r169435 * r169443;
        double r169445 = r169444 / r169436;
        double r169446 = pow(r169437, r169436);
        double r169447 = pow(r169426, r169425);
        double r169448 = exp(r169441);
        double r169449 = r169447 / r169448;
        double r169450 = r169446 * r169449;
        double r169451 = r169436 / r169450;
        double r169452 = r169435 / r169451;
        double r169453 = r169434 ? r169445 : r169452;
        return r169453;
}

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
Herbie2.1
\[\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 (* (- t 1.0) (log a)) < -2.9642058948872463e+33 or -335.23396109099355 < (* (- t 1.0) (log a))

    1. Initial program 1.1

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

    if -2.9642058948872463e+33 < (* (- t 1.0) (log a)) < -335.23396109099355

    1. Initial program 6.6

      \[\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.1

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

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

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

Reproduce

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