Average Error: 1.9 → 2.0
Time: 1.2m
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 -693.5771125449351757197291590273380279541 \lor \neg \left(\left(t - 1\right) \cdot \log a \le -115.603317971975243949600553605705499649\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{\frac{{a}^{\left(-1\right)}}{{\left(\frac{1}{z}\right)}^{y}}}{e^{\left(-\log a\right) \cdot t + b}}}{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 -693.5771125449351757197291590273380279541 \lor \neg \left(\left(t - 1\right) \cdot \log a \le -115.603317971975243949600553605705499649\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r428194 = x;
        double r428195 = y;
        double r428196 = z;
        double r428197 = log(r428196);
        double r428198 = r428195 * r428197;
        double r428199 = t;
        double r428200 = 1.0;
        double r428201 = r428199 - r428200;
        double r428202 = a;
        double r428203 = log(r428202);
        double r428204 = r428201 * r428203;
        double r428205 = r428198 + r428204;
        double r428206 = b;
        double r428207 = r428205 - r428206;
        double r428208 = exp(r428207);
        double r428209 = r428194 * r428208;
        double r428210 = r428209 / r428195;
        return r428210;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r428211 = t;
        double r428212 = 1.0;
        double r428213 = r428211 - r428212;
        double r428214 = a;
        double r428215 = log(r428214);
        double r428216 = r428213 * r428215;
        double r428217 = -693.5771125449352;
        bool r428218 = r428216 <= r428217;
        double r428219 = -115.60331797197524;
        bool r428220 = r428216 <= r428219;
        double r428221 = !r428220;
        bool r428222 = r428218 || r428221;
        double r428223 = x;
        double r428224 = y;
        double r428225 = z;
        double r428226 = log(r428225);
        double r428227 = r428224 * r428226;
        double r428228 = r428227 + r428216;
        double r428229 = b;
        double r428230 = r428228 - r428229;
        double r428231 = exp(r428230);
        double r428232 = r428223 * r428231;
        double r428233 = r428232 / r428224;
        double r428234 = -r428212;
        double r428235 = pow(r428214, r428234);
        double r428236 = 1.0;
        double r428237 = r428236 / r428225;
        double r428238 = pow(r428237, r428224);
        double r428239 = r428235 / r428238;
        double r428240 = -r428215;
        double r428241 = r428240 * r428211;
        double r428242 = r428241 + r428229;
        double r428243 = exp(r428242);
        double r428244 = r428239 / r428243;
        double r428245 = r428244 / r428224;
        double r428246 = r428223 * r428245;
        double r428247 = r428222 ? r428233 : r428246;
        return r428247;
}

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

Original1.9
Target11.1
Herbie2.0
\[\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)) < -693.5771125449352 or -115.60331797197524 < (* (- t 1.0) (log a))

    1. Initial program 0.6

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

    if -693.5771125449352 < (* (- t 1.0) (log a)) < -115.60331797197524

    1. Initial program 6.0

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
    2. Taylor expanded around inf 6.0

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{\frac{{a}^{\left(-1\right)}}{{\left(\frac{1}{z}\right)}^{y}}}{e^{\left(-\log a\right) \cdot t + b}}}}{y}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity10.6

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

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

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

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

Reproduce

herbie shell --seed 2019212 
(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.88458485041274715) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.22883740731) (/ (* (/ 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))