Average Error: 2.1 → 2.1
Time: 16.1s
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}{\left({z}^{y} \cdot {a}^{t}\right) \cdot \frac{{a}^{\left(-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}{\left({z}^{y} \cdot {a}^{t}\right) \cdot \frac{{a}^{\left(-1\right)}}{e^{b}}}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r403350 = x;
        double r403351 = y;
        double r403352 = z;
        double r403353 = log(r403352);
        double r403354 = r403351 * r403353;
        double r403355 = t;
        double r403356 = 1.0;
        double r403357 = r403355 - r403356;
        double r403358 = a;
        double r403359 = log(r403358);
        double r403360 = r403357 * r403359;
        double r403361 = r403354 + r403360;
        double r403362 = b;
        double r403363 = r403361 - r403362;
        double r403364 = exp(r403363);
        double r403365 = r403350 * r403364;
        double r403366 = r403365 / r403351;
        return r403366;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r403367 = t;
        double r403368 = 1.0;
        double r403369 = r403367 - r403368;
        double r403370 = a;
        double r403371 = log(r403370);
        double r403372 = r403369 * r403371;
        double r403373 = -2.9642058948872463e+33;
        bool r403374 = r403372 <= r403373;
        double r403375 = -335.23396109099355;
        bool r403376 = r403372 <= r403375;
        double r403377 = !r403376;
        bool r403378 = r403374 || r403377;
        double r403379 = x;
        double r403380 = y;
        double r403381 = z;
        double r403382 = log(r403381);
        double r403383 = r403380 * r403382;
        double r403384 = r403383 + r403372;
        double r403385 = b;
        double r403386 = r403384 - r403385;
        double r403387 = exp(r403386);
        double r403388 = r403379 * r403387;
        double r403389 = r403388 / r403380;
        double r403390 = pow(r403381, r403380);
        double r403391 = pow(r403370, r403367);
        double r403392 = r403390 * r403391;
        double r403393 = -r403368;
        double r403394 = pow(r403370, r403393);
        double r403395 = exp(r403385);
        double r403396 = r403394 / r403395;
        double r403397 = r403392 * r403396;
        double r403398 = r403380 / r403397;
        double r403399 = r403379 / r403398;
        double r403400 = r403378 ? r403389 : r403399;
        return r403400;
}

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}}}}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity6.8

      \[\leadsto \frac{x}{\frac{y}{{z}^{y} \cdot \frac{{a}^{\left(t - 1\right)}}{\color{blue}{1 \cdot e^{b}}}}}\]
    7. Applied sub-neg6.8

      \[\leadsto \frac{x}{\frac{y}{{z}^{y} \cdot \frac{{a}^{\color{blue}{\left(t + \left(-1\right)\right)}}}{1 \cdot e^{b}}}}\]
    8. Applied unpow-prod-up6.7

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

      \[\leadsto \frac{x}{\frac{y}{{z}^{y} \cdot \color{blue}{\left(\frac{{a}^{t}}{1} \cdot \frac{{a}^{\left(-1\right)}}{e^{b}}\right)}}}\]
    10. Applied associate-*r*6.7

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

      \[\leadsto \frac{x}{\frac{y}{\color{blue}{\left({z}^{y} \cdot {a}^{t}\right)} \cdot \frac{{a}^{\left(-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}{\left({z}^{y} \cdot {a}^{t}\right) \cdot \frac{{a}^{\left(-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))