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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r362248 = x;
        double r362249 = y;
        double r362250 = z;
        double r362251 = log(r362250);
        double r362252 = r362249 * r362251;
        double r362253 = t;
        double r362254 = 1.0;
        double r362255 = r362253 - r362254;
        double r362256 = a;
        double r362257 = log(r362256);
        double r362258 = r362255 * r362257;
        double r362259 = r362252 + r362258;
        double r362260 = b;
        double r362261 = r362259 - r362260;
        double r362262 = exp(r362261);
        double r362263 = r362248 * r362262;
        double r362264 = r362263 / r362249;
        return r362264;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r362265 = t;
        double r362266 = 1.0;
        double r362267 = r362265 - r362266;
        double r362268 = a;
        double r362269 = log(r362268);
        double r362270 = r362267 * r362269;
        double r362271 = -2.9642058948872463e+33;
        bool r362272 = r362270 <= r362271;
        double r362273 = -335.23396109099355;
        bool r362274 = r362270 <= r362273;
        double r362275 = !r362274;
        bool r362276 = r362272 || r362275;
        double r362277 = x;
        double r362278 = y;
        double r362279 = z;
        double r362280 = log(r362279);
        double r362281 = r362278 * r362280;
        double r362282 = r362281 + r362270;
        double r362283 = b;
        double r362284 = r362282 - r362283;
        double r362285 = exp(r362284);
        double r362286 = r362277 * r362285;
        double r362287 = r362286 / r362278;
        double r362288 = exp(r362283);
        double r362289 = r362278 * r362288;
        double r362290 = pow(r362268, r362267);
        double r362291 = pow(r362279, r362278);
        double r362292 = r362290 * r362291;
        double r362293 = r362289 / r362292;
        double r362294 = r362277 / r362293;
        double r362295 = r362276 ? r362287 : r362294;
        return r362295;
}

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 \cdot e^{b}}{{a}^{\left(t - 1\right)} \cdot {z}^{y}}}}\]
  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 \cdot e^{b}}{{a}^{\left(t - 1\right)} \cdot {z}^{y}}}\\ \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))