Average Error: 2.1 → 2.1
Time: 14.9s
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 r204916 = x;
        double r204917 = y;
        double r204918 = z;
        double r204919 = log(r204918);
        double r204920 = r204917 * r204919;
        double r204921 = t;
        double r204922 = 1.0;
        double r204923 = r204921 - r204922;
        double r204924 = a;
        double r204925 = log(r204924);
        double r204926 = r204923 * r204925;
        double r204927 = r204920 + r204926;
        double r204928 = b;
        double r204929 = r204927 - r204928;
        double r204930 = exp(r204929);
        double r204931 = r204916 * r204930;
        double r204932 = r204931 / r204917;
        return r204932;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r204933 = t;
        double r204934 = 1.0;
        double r204935 = r204933 - r204934;
        double r204936 = a;
        double r204937 = log(r204936);
        double r204938 = r204935 * r204937;
        double r204939 = -2.9642058948872463e+33;
        bool r204940 = r204938 <= r204939;
        double r204941 = -335.23396109099355;
        bool r204942 = r204938 <= r204941;
        double r204943 = !r204942;
        bool r204944 = r204940 || r204943;
        double r204945 = x;
        double r204946 = y;
        double r204947 = z;
        double r204948 = log(r204947);
        double r204949 = r204946 * r204948;
        double r204950 = r204949 + r204938;
        double r204951 = b;
        double r204952 = r204950 - r204951;
        double r204953 = exp(r204952);
        double r204954 = r204945 * r204953;
        double r204955 = r204954 / r204946;
        double r204956 = pow(r204947, r204946);
        double r204957 = pow(r204936, r204935);
        double r204958 = exp(r204951);
        double r204959 = r204957 / r204958;
        double r204960 = r204956 * r204959;
        double r204961 = r204946 / r204960;
        double r204962 = r204945 / r204961;
        double r204963 = r204944 ? r204955 : r204962;
        return r204963;
}

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))