Average Error: 1.8 → 0.2
Time: 11.6s
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.54646832498951517 \cdot 10^{-20}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\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}\\ \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.54646832498951517 \cdot 10^{-20}:\\
\;\;\;\;\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}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r501267 = x;
        double r501268 = y;
        double r501269 = z;
        double r501270 = log(r501269);
        double r501271 = r501268 * r501270;
        double r501272 = t;
        double r501273 = 1.0;
        double r501274 = r501272 - r501273;
        double r501275 = a;
        double r501276 = log(r501275);
        double r501277 = r501274 * r501276;
        double r501278 = r501271 + r501277;
        double r501279 = b;
        double r501280 = r501278 - r501279;
        double r501281 = exp(r501280);
        double r501282 = r501267 * r501281;
        double r501283 = r501282 / r501268;
        return r501283;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r501284 = a;
        double r501285 = 4.546468324989515e-20;
        bool r501286 = r501284 <= r501285;
        double r501287 = x;
        double r501288 = 1.0;
        double r501289 = r501288 / r501284;
        double r501290 = 1.0;
        double r501291 = pow(r501289, r501290);
        double r501292 = y;
        double r501293 = z;
        double r501294 = r501288 / r501293;
        double r501295 = log(r501294);
        double r501296 = log(r501289);
        double r501297 = t;
        double r501298 = b;
        double r501299 = fma(r501296, r501297, r501298);
        double r501300 = fma(r501292, r501295, r501299);
        double r501301 = exp(r501300);
        double r501302 = r501291 / r501301;
        double r501303 = r501287 * r501302;
        double r501304 = r501288 / r501292;
        double r501305 = r501303 * r501304;
        double r501306 = r501302 / r501292;
        double r501307 = r501287 * r501306;
        double r501308 = r501286 ? r501305 : r501307;
        return r501308;
}

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.8
Target11.5
Herbie0.2
\[\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.546468324989515e-20

    1. Initial program 0.6

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

      \[\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.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-inv0.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}}\]

    if 4.546468324989515e-20 < a

    1. Initial program 2.8

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

      \[\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.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 *-un-lft-identity2.1

      \[\leadsto \frac{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)}}}{\color{blue}{1 \cdot y}}\]
    6. Applied times-frac0.1

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{\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}}\]
    7. Simplified0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le 4.54646832498951517 \cdot 10^{-20}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\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}\\ \end{array}\]

Reproduce

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