Average Error: 1.9 → 0.4
Time: 32.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}\;a \le 8.688125216583023590748649810398493823188 \cdot 10^{-83}:\\ \;\;\;\;\left(x \cdot \frac{e^{\mathsf{fma}\left(y, \log z, -\mathsf{fma}\left(-\log a, t, b\right)\right)}}{{a}^{1}}\right) \cdot \frac{1}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\mathsf{fma}\left(y, \log z, -\mathsf{fma}\left(-\log a, t, b\right)\right)}}{y \cdot {a}^{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}\;a \le 8.688125216583023590748649810398493823188 \cdot 10^{-83}:\\
\;\;\;\;\left(x \cdot \frac{e^{\mathsf{fma}\left(y, \log z, -\mathsf{fma}\left(-\log a, t, b\right)\right)}}{{a}^{1}}\right) \cdot \frac{1}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r301354 = x;
        double r301355 = y;
        double r301356 = z;
        double r301357 = log(r301356);
        double r301358 = r301355 * r301357;
        double r301359 = t;
        double r301360 = 1.0;
        double r301361 = r301359 - r301360;
        double r301362 = a;
        double r301363 = log(r301362);
        double r301364 = r301361 * r301363;
        double r301365 = r301358 + r301364;
        double r301366 = b;
        double r301367 = r301365 - r301366;
        double r301368 = exp(r301367);
        double r301369 = r301354 * r301368;
        double r301370 = r301369 / r301355;
        return r301370;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r301371 = a;
        double r301372 = 8.688125216583024e-83;
        bool r301373 = r301371 <= r301372;
        double r301374 = x;
        double r301375 = y;
        double r301376 = z;
        double r301377 = log(r301376);
        double r301378 = log(r301371);
        double r301379 = -r301378;
        double r301380 = t;
        double r301381 = b;
        double r301382 = fma(r301379, r301380, r301381);
        double r301383 = -r301382;
        double r301384 = fma(r301375, r301377, r301383);
        double r301385 = exp(r301384);
        double r301386 = 1.0;
        double r301387 = pow(r301371, r301386);
        double r301388 = r301385 / r301387;
        double r301389 = r301374 * r301388;
        double r301390 = 1.0;
        double r301391 = r301390 / r301375;
        double r301392 = r301389 * r301391;
        double r301393 = r301374 * r301385;
        double r301394 = r301375 * r301387;
        double r301395 = r301393 / r301394;
        double r301396 = r301373 ? r301392 : r301395;
        return r301396;
}

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
Target10.7
Herbie0.4
\[\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 a < 8.688125216583024e-83

    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. Using strategy rm
    3. Applied *-un-lft-identity0.7

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

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

      \[\leadsto \frac{x \cdot {\color{blue}{e}}^{\left(\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b\right)}}{y}\]
    6. 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}\]
    7. Simplified0.0

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

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

    if 8.688125216583024e-83 < a

    1. Initial program 2.6

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

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

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

      \[\leadsto \frac{x \cdot {\color{blue}{e}}^{\left(\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b\right)}}{y}\]
    6. Taylor expanded around inf 2.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}\]
    7. Simplified1.9

      \[\leadsto \frac{x \cdot \color{blue}{\frac{e^{\mathsf{fma}\left(y, \log z, -\mathsf{fma}\left(-\log a, t, b\right)\right)}}{{a}^{1}}}}{y}\]
    8. Using strategy rm
    9. Applied associate-*r/1.8

      \[\leadsto \frac{\color{blue}{\frac{x \cdot e^{\mathsf{fma}\left(y, \log z, -\mathsf{fma}\left(-\log a, t, b\right)\right)}}{{a}^{1}}}}{y}\]
    10. Applied associate-/l/0.5

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

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

Reproduce

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