Average Error: 2.0 → 1.0
Time: 24.8s
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}\;a \le 4.53731180448953874 \cdot 10^{-185}:\\ \;\;\;\;\frac{\sqrt[3]{{\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)}^{3}}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{\frac{y}{\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)}}}}\\ \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}\;a \le 4.53731180448953874 \cdot 10^{-185}:\\
\;\;\;\;\frac{\sqrt[3]{{\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)}^{3}}}{y}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{\frac{y}{\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)}}}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r470304 = x;
        double r470305 = y;
        double r470306 = z;
        double r470307 = log(r470306);
        double r470308 = r470305 * r470307;
        double r470309 = t;
        double r470310 = 1.0;
        double r470311 = r470309 - r470310;
        double r470312 = a;
        double r470313 = log(r470312);
        double r470314 = r470311 * r470313;
        double r470315 = r470308 + r470314;
        double r470316 = b;
        double r470317 = r470315 - r470316;
        double r470318 = exp(r470317);
        double r470319 = r470304 * r470318;
        double r470320 = r470319 / r470305;
        return r470320;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r470321 = a;
        double r470322 = 4.537311804489539e-185;
        bool r470323 = r470321 <= r470322;
        double r470324 = x;
        double r470325 = 1.0;
        double r470326 = r470325 / r470321;
        double r470327 = 1.0;
        double r470328 = pow(r470326, r470327);
        double r470329 = y;
        double r470330 = z;
        double r470331 = r470325 / r470330;
        double r470332 = log(r470331);
        double r470333 = log(r470326);
        double r470334 = t;
        double r470335 = b;
        double r470336 = fma(r470333, r470334, r470335);
        double r470337 = fma(r470329, r470332, r470336);
        double r470338 = exp(r470337);
        double r470339 = r470328 / r470338;
        double r470340 = r470324 * r470339;
        double r470341 = 3.0;
        double r470342 = pow(r470340, r470341);
        double r470343 = cbrt(r470342);
        double r470344 = r470343 / r470329;
        double r470345 = r470329 / r470339;
        double r470346 = r470325 / r470345;
        double r470347 = r470324 * r470346;
        double r470348 = r470323 ? r470344 : r470347;
        return r470348;
}

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

Original2.0
Target11.2
Herbie1.0
\[\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 a < 4.537311804489539e-185

    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 add-cbrt-cube0.1

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\color{blue}{\sqrt[3]{\left(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 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 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}\]
    6. Applied add-cbrt-cube64.0

      \[\leadsto \frac{x \cdot \frac{\color{blue}{\sqrt[3]{\left({\left(\frac{1}{a}\right)}^{1} \cdot {\left(\frac{1}{a}\right)}^{1}\right) \cdot {\left(\frac{1}{a}\right)}^{1}}}}{\sqrt[3]{\left(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 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 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}\]
    7. Applied cbrt-undiv64.0

      \[\leadsto \frac{x \cdot \color{blue}{\sqrt[3]{\frac{\left({\left(\frac{1}{a}\right)}^{1} \cdot {\left(\frac{1}{a}\right)}^{1}\right) \cdot {\left(\frac{1}{a}\right)}^{1}}{\left(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 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 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}\]
    8. Applied add-cbrt-cube64.0

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(x \cdot x\right) \cdot x}} \cdot \sqrt[3]{\frac{\left({\left(\frac{1}{a}\right)}^{1} \cdot {\left(\frac{1}{a}\right)}^{1}\right) \cdot {\left(\frac{1}{a}\right)}^{1}}{\left(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 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 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}\]
    9. Applied cbrt-unprod64.0

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x \cdot x\right) \cdot x\right) \cdot \frac{\left({\left(\frac{1}{a}\right)}^{1} \cdot {\left(\frac{1}{a}\right)}^{1}\right) \cdot {\left(\frac{1}{a}\right)}^{1}}{\left(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 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 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}\]
    10. Simplified2.2

      \[\leadsto \frac{\sqrt[3]{\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)}^{3}}}}{y}\]

    if 4.537311804489539e-185 < a

    1. Initial program 2.2

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

      \[\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. Simplified1.5

      \[\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 associate-/l*0.6

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{\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)}}}}}\]
    6. Using strategy rm
    7. Applied div-inv0.7

      \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{y}{\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)}}}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le 4.53731180448953874 \cdot 10^{-185}:\\ \;\;\;\;\frac{\sqrt[3]{{\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)}^{3}}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{\frac{y}{\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)}}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020056 +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))