Average Error: 1.9 → 2.4
Time: 18.5s
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}\;x \le 2.7435168457173364 \cdot 10^{-294} \lor \neg \left(x \le 2.29253448745637074 \cdot 10^{-79}\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(e^{\log z \cdot y + \left(\log \left({a}^{t}\right) - b\right)} \cdot x\right) \cdot \frac{1}{y}\right) \cdot {\left(\frac{1}{{a}^{1}}\right)}^{1}\\ \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}\;x \le 2.7435168457173364 \cdot 10^{-294} \lor \neg \left(x \le 2.29253448745637074 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r543993 = x;
        double r543994 = y;
        double r543995 = z;
        double r543996 = log(r543995);
        double r543997 = r543994 * r543996;
        double r543998 = t;
        double r543999 = 1.0;
        double r544000 = r543998 - r543999;
        double r544001 = a;
        double r544002 = log(r544001);
        double r544003 = r544000 * r544002;
        double r544004 = r543997 + r544003;
        double r544005 = b;
        double r544006 = r544004 - r544005;
        double r544007 = exp(r544006);
        double r544008 = r543993 * r544007;
        double r544009 = r544008 / r543994;
        return r544009;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r544010 = x;
        double r544011 = 2.7435168457173364e-294;
        bool r544012 = r544010 <= r544011;
        double r544013 = 2.2925344874563707e-79;
        bool r544014 = r544010 <= r544013;
        double r544015 = !r544014;
        bool r544016 = r544012 || r544015;
        double r544017 = y;
        double r544018 = z;
        double r544019 = log(r544018);
        double r544020 = r544017 * r544019;
        double r544021 = t;
        double r544022 = 1.0;
        double r544023 = r544021 - r544022;
        double r544024 = a;
        double r544025 = log(r544024);
        double r544026 = r544023 * r544025;
        double r544027 = r544020 + r544026;
        double r544028 = b;
        double r544029 = r544027 - r544028;
        double r544030 = exp(r544029);
        double r544031 = r544010 * r544030;
        double r544032 = r544031 / r544017;
        double r544033 = r544019 * r544017;
        double r544034 = pow(r544024, r544021);
        double r544035 = log(r544034);
        double r544036 = r544035 - r544028;
        double r544037 = r544033 + r544036;
        double r544038 = exp(r544037);
        double r544039 = r544038 * r544010;
        double r544040 = 1.0;
        double r544041 = r544040 / r544017;
        double r544042 = r544039 * r544041;
        double r544043 = pow(r544024, r544022);
        double r544044 = r544040 / r544043;
        double r544045 = pow(r544044, r544022);
        double r544046 = r544042 * r544045;
        double r544047 = r544016 ? r544032 : r544046;
        return r544047;
}

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.7
Herbie2.4
\[\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 x < 2.7435168457173364e-294 or 2.2925344874563707e-79 < x

    1. Initial program 1.6

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

    if 2.7435168457173364e-294 < x < 2.2925344874563707e-79

    1. Initial program 3.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 *-un-lft-identity3.2

      \[\leadsto \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{\color{blue}{1 \cdot y}}\]
    4. Applied associate-/r*3.2

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

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

      \[\leadsto \frac{x \cdot \left({z}^{y} \cdot \frac{{a}^{\color{blue}{\left(t + \left(-1\right)\right)}}}{e^{b}}\right)}{y}\]
    8. Applied unpow-prod-up18.4

      \[\leadsto \frac{x \cdot \left({z}^{y} \cdot \frac{\color{blue}{{a}^{t} \cdot {a}^{\left(-1\right)}}}{e^{b}}\right)}{y}\]
    9. Taylor expanded around inf 16.1

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

      \[\leadsto \color{blue}{\left(e^{\left(-\left(\left(-\log z\right) \cdot y - \log \left({a}^{t}\right)\right)\right) - b} \cdot \frac{x}{y}\right) \cdot {\left(\frac{1}{{a}^{1}}\right)}^{1}}\]
    11. Using strategy rm
    12. Applied div-inv5.7

      \[\leadsto \left(e^{\left(-\left(\left(-\log z\right) \cdot y - \log \left({a}^{t}\right)\right)\right) - b} \cdot \color{blue}{\left(x \cdot \frac{1}{y}\right)}\right) \cdot {\left(\frac{1}{{a}^{1}}\right)}^{1}\]
    13. Applied associate-*r*5.7

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

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

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

Reproduce

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