Average Error: 2.1 → 0.6
Time: 36.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}\;\left(t - 1\right) \cdot \log a \le -173011673.0759815275669097900390625 \lor \neg \left(\left(t - 1\right) \cdot \log a \le 145.8223216718689627668936736881732940674\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{y} \cdot \left(e^{\left(y \cdot \log z - \left(-\log a\right) \cdot t\right) - b} \cdot x\right)\\ \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 -173011673.0759815275669097900390625 \lor \neg \left(\left(t - 1\right) \cdot \log a \le 145.8223216718689627668936736881732940674\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r329893 = x;
        double r329894 = y;
        double r329895 = z;
        double r329896 = log(r329895);
        double r329897 = r329894 * r329896;
        double r329898 = t;
        double r329899 = 1.0;
        double r329900 = r329898 - r329899;
        double r329901 = a;
        double r329902 = log(r329901);
        double r329903 = r329900 * r329902;
        double r329904 = r329897 + r329903;
        double r329905 = b;
        double r329906 = r329904 - r329905;
        double r329907 = exp(r329906);
        double r329908 = r329893 * r329907;
        double r329909 = r329908 / r329894;
        return r329909;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r329910 = t;
        double r329911 = 1.0;
        double r329912 = r329910 - r329911;
        double r329913 = a;
        double r329914 = log(r329913);
        double r329915 = r329912 * r329914;
        double r329916 = -173011673.07598153;
        bool r329917 = r329915 <= r329916;
        double r329918 = 145.82232167186896;
        bool r329919 = r329915 <= r329918;
        double r329920 = !r329919;
        bool r329921 = r329917 || r329920;
        double r329922 = x;
        double r329923 = y;
        double r329924 = z;
        double r329925 = log(r329924);
        double r329926 = r329923 * r329925;
        double r329927 = r329926 + r329915;
        double r329928 = b;
        double r329929 = r329927 - r329928;
        double r329930 = exp(r329929);
        double r329931 = r329922 * r329930;
        double r329932 = r329931 / r329923;
        double r329933 = 1.0;
        double r329934 = pow(r329913, r329911);
        double r329935 = r329933 / r329934;
        double r329936 = pow(r329935, r329911);
        double r329937 = r329936 / r329923;
        double r329938 = -r329914;
        double r329939 = r329938 * r329910;
        double r329940 = r329926 - r329939;
        double r329941 = r329940 - r329928;
        double r329942 = exp(r329941);
        double r329943 = r329942 * r329922;
        double r329944 = r329937 * r329943;
        double r329945 = r329921 ? r329932 : r329944;
        return r329945;
}

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
Target10.9
Herbie0.6
\[\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)) < -173011673.07598153 or 145.82232167186896 < (* (- t 1.0) (log a))

    1. Initial program 0.4

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

    if -173011673.07598153 < (* (- t 1.0) (log a)) < 145.82232167186896

    1. Initial program 5.2

      \[\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.2

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

      \[\leadsto \frac{x}{\color{blue}{\frac{y}{\frac{{a}^{\left(t - 1\right)} \cdot {z}^{y}}{e^{b}}}}}\]
    5. Using strategy rm
    6. Applied pow-sub7.6

      \[\leadsto \frac{x}{\frac{y}{\frac{\color{blue}{\frac{{a}^{t}}{{a}^{1}}} \cdot {z}^{y}}{e^{b}}}}\]
    7. Applied associate-*l/7.6

      \[\leadsto \frac{x}{\frac{y}{\frac{\color{blue}{\frac{{a}^{t} \cdot {z}^{y}}{{a}^{1}}}}{e^{b}}}}\]
    8. Applied associate-/l/7.6

      \[\leadsto \frac{x}{\frac{y}{\color{blue}{\frac{{a}^{t} \cdot {z}^{y}}{e^{b} \cdot {a}^{1}}}}}\]
    9. Taylor expanded around inf 10.8

      \[\leadsto \color{blue}{{\left(\frac{1}{{a}^{1}}\right)}^{1} \cdot \frac{x \cdot \left(e^{-1 \cdot \left(\log \left(\frac{1}{z}\right) \cdot y\right)} \cdot e^{-1 \cdot \left(\log \left(\frac{1}{a}\right) \cdot t\right)}\right)}{e^{b} \cdot y}}\]
    10. Simplified0.9

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

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

Reproduce

herbie shell --seed 2019325 
(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))