Average Error: 2.0 → 2.3
Time: 35.4s
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}\;\log a \cdot \left(t - 1\right) \le -2.758687718269212165448790199192525359418 \cdot 10^{69} \lor \neg \left(\log a \cdot \left(t - 1\right) \le -205.7954937512333799531916156411170959473\right):\\ \;\;\;\;\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{\left(\frac{{a}^{\left(-1\right)}}{\sqrt{e^{b}}} \cdot \frac{{a}^{t}}{\sqrt{e^{b}}}\right) \cdot {z}^{y}}}\\ \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}\;\log a \cdot \left(t - 1\right) \le -2.758687718269212165448790199192525359418 \cdot 10^{69} \lor \neg \left(\log a \cdot \left(t - 1\right) \le -205.7954937512333799531916156411170959473\right):\\
\;\;\;\;\frac{x \cdot e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r418360 = x;
        double r418361 = y;
        double r418362 = z;
        double r418363 = log(r418362);
        double r418364 = r418361 * r418363;
        double r418365 = t;
        double r418366 = 1.0;
        double r418367 = r418365 - r418366;
        double r418368 = a;
        double r418369 = log(r418368);
        double r418370 = r418367 * r418369;
        double r418371 = r418364 + r418370;
        double r418372 = b;
        double r418373 = r418371 - r418372;
        double r418374 = exp(r418373);
        double r418375 = r418360 * r418374;
        double r418376 = r418375 / r418361;
        return r418376;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r418377 = a;
        double r418378 = log(r418377);
        double r418379 = t;
        double r418380 = 1.0;
        double r418381 = r418379 - r418380;
        double r418382 = r418378 * r418381;
        double r418383 = -2.758687718269212e+69;
        bool r418384 = r418382 <= r418383;
        double r418385 = -205.79549375123338;
        bool r418386 = r418382 <= r418385;
        double r418387 = !r418386;
        bool r418388 = r418384 || r418387;
        double r418389 = x;
        double r418390 = z;
        double r418391 = log(r418390);
        double r418392 = y;
        double r418393 = r418391 * r418392;
        double r418394 = r418382 + r418393;
        double r418395 = b;
        double r418396 = r418394 - r418395;
        double r418397 = exp(r418396);
        double r418398 = r418389 * r418397;
        double r418399 = r418398 / r418392;
        double r418400 = -r418380;
        double r418401 = pow(r418377, r418400);
        double r418402 = exp(r418395);
        double r418403 = sqrt(r418402);
        double r418404 = r418401 / r418403;
        double r418405 = pow(r418377, r418379);
        double r418406 = r418405 / r418403;
        double r418407 = r418404 * r418406;
        double r418408 = pow(r418390, r418392);
        double r418409 = r418407 * r418408;
        double r418410 = r418392 / r418409;
        double r418411 = r418389 / r418410;
        double r418412 = r418388 ? r418399 : r418411;
        return r418412;
}

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.0
Target10.8
Herbie2.3
\[\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)) < -2.758687718269212e+69 or -205.79549375123338 < (* (- t 1.0) (log a))

    1. Initial program 0.7

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

    if -2.758687718269212e+69 < (* (- t 1.0) (log a)) < -205.79549375123338

    1. Initial program 5.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 associate-/l*1.8

      \[\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 add-sqr-sqrt6.8

      \[\leadsto \frac{x}{\frac{y}{{z}^{y} \cdot \frac{{a}^{\left(t - 1\right)}}{\color{blue}{\sqrt{e^{b}} \cdot \sqrt{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)}}}{\sqrt{e^{b}} \cdot \sqrt{e^{b}}}}}\]
    8. Applied unpow-prod-up6.8

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

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"

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

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