Average Error: 1.9 → 0.1
Time: 15.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}\;x \le -1015.931981034841896871512290090322494507:\\ \;\;\;\;\left(\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{1}{y}\\ \mathbf{elif}\;x \le 717450678909797:\\ \;\;\;\;\frac{x}{y} \cdot \frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot \sqrt{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{1}{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}\;x \le -1015.931981034841896871512290090322494507:\\
\;\;\;\;\left(\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{1}{y}\\

\mathbf{elif}\;x \le 717450678909797:\\
\;\;\;\;\frac{x}{y} \cdot \frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r675799 = x;
        double r675800 = y;
        double r675801 = z;
        double r675802 = log(r675801);
        double r675803 = r675800 * r675802;
        double r675804 = t;
        double r675805 = 1.0;
        double r675806 = r675804 - r675805;
        double r675807 = a;
        double r675808 = log(r675807);
        double r675809 = r675806 * r675808;
        double r675810 = r675803 + r675809;
        double r675811 = b;
        double r675812 = r675810 - r675811;
        double r675813 = exp(r675812);
        double r675814 = r675799 * r675813;
        double r675815 = r675814 / r675800;
        return r675815;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r675816 = x;
        double r675817 = -1015.9319810348419;
        bool r675818 = r675816 <= r675817;
        double r675819 = 1.0;
        double r675820 = a;
        double r675821 = r675819 / r675820;
        double r675822 = 1.0;
        double r675823 = 2.0;
        double r675824 = r675822 / r675823;
        double r675825 = pow(r675821, r675824);
        double r675826 = y;
        double r675827 = z;
        double r675828 = r675819 / r675827;
        double r675829 = log(r675828);
        double r675830 = log(r675821);
        double r675831 = t;
        double r675832 = b;
        double r675833 = fma(r675830, r675831, r675832);
        double r675834 = fma(r675826, r675829, r675833);
        double r675835 = exp(r675834);
        double r675836 = cbrt(r675835);
        double r675837 = r675836 * r675836;
        double r675838 = r675825 / r675837;
        double r675839 = r675816 * r675838;
        double r675840 = r675825 / r675836;
        double r675841 = r675839 * r675840;
        double r675842 = r675819 / r675826;
        double r675843 = r675841 * r675842;
        double r675844 = 717450678909797.0;
        bool r675845 = r675816 <= r675844;
        double r675846 = r675816 / r675826;
        double r675847 = pow(r675820, r675822);
        double r675848 = r675819 / r675847;
        double r675849 = pow(r675848, r675822);
        double r675850 = r675849 / r675835;
        double r675851 = r675846 * r675850;
        double r675852 = pow(r675821, r675822);
        double r675853 = r675852 / r675835;
        double r675854 = r675816 * r675853;
        double r675855 = sqrt(r675854);
        double r675856 = r675855 * r675855;
        double r675857 = r675856 * r675842;
        double r675858 = r675845 ? r675851 : r675857;
        double r675859 = r675818 ? r675843 : r675858;
        return r675859;
}

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

Target

Original1.9
Target11.0
Herbie0.1
\[\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 3 regimes
  2. if x < -1015.9319810348419

    1. Initial program 0.7

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

      \[\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. Simplified0.1

      \[\leadsto \frac{x \cdot \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
    4. Using strategy rm
    5. Applied div-inv0.1

      \[\leadsto \color{blue}{\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\right) \cdot \frac{1}{y}}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt0.1

      \[\leadsto \left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\color{blue}{\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\right) \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}\right) \cdot \frac{1}{y}\]
    8. Applied sqr-pow0.1

      \[\leadsto \left(x \cdot \frac{\color{blue}{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}}{\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\right) \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{1}{y}\]
    9. Applied times-frac0.1

      \[\leadsto \left(x \cdot \color{blue}{\left(\frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right)}\right) \cdot \frac{1}{y}\]
    10. Applied associate-*r*0.1

      \[\leadsto \color{blue}{\left(\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right)} \cdot \frac{1}{y}\]

    if -1015.9319810348419 < x < 717450678909797.0

    1. Initial program 3.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 3.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. Simplified2.2

      \[\leadsto \frac{x \cdot \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
    4. Using strategy rm
    5. Applied div-inv2.2

      \[\leadsto \color{blue}{\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\right) \cdot \frac{1}{y}}\]
    6. Taylor expanded around inf 0.1

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

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\]

    if 717450678909797.0 < x

    1. Initial program 0.7

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

      \[\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. Simplified0.1

      \[\leadsto \frac{x \cdot \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
    4. Using strategy rm
    5. Applied div-inv0.1

      \[\leadsto \color{blue}{\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\right) \cdot \frac{1}{y}}\]
    6. Using strategy rm
    7. Applied add-sqr-sqrt0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1015.931981034841896871512290090322494507:\\ \;\;\;\;\left(\left(x \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{{\left(\frac{1}{a}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt[3]{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{1}{y}\\ \mathbf{elif}\;x \le 717450678909797:\\ \;\;\;\;\frac{x}{y} \cdot \frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}} \cdot \sqrt{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}\right) \cdot \frac{1}{y}\\ \end{array}\]

Reproduce

herbie shell --seed 2019362 +o rules:numerics
(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))