Average Error: 1.9 → 1.2
Time: 27.2s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\frac{x \cdot \frac{{a}^{\left(-1\right)}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}}{y}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{x \cdot \frac{{a}^{\left(-1\right)}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}}{y}
double f(double x, double y, double z, double t, double a, double b) {
        double r257373 = x;
        double r257374 = y;
        double r257375 = z;
        double r257376 = log(r257375);
        double r257377 = r257374 * r257376;
        double r257378 = t;
        double r257379 = 1.0;
        double r257380 = r257378 - r257379;
        double r257381 = a;
        double r257382 = log(r257381);
        double r257383 = r257380 * r257382;
        double r257384 = r257377 + r257383;
        double r257385 = b;
        double r257386 = r257384 - r257385;
        double r257387 = exp(r257386);
        double r257388 = r257373 * r257387;
        double r257389 = r257388 / r257374;
        return r257389;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r257390 = x;
        double r257391 = a;
        double r257392 = 1.0;
        double r257393 = -r257392;
        double r257394 = pow(r257391, r257393);
        double r257395 = y;
        double r257396 = z;
        double r257397 = log(r257396);
        double r257398 = -r257397;
        double r257399 = log(r257391);
        double r257400 = -r257399;
        double r257401 = t;
        double r257402 = b;
        double r257403 = fma(r257400, r257401, r257402);
        double r257404 = fma(r257395, r257398, r257403);
        double r257405 = exp(r257404);
        double r257406 = r257394 / r257405;
        double r257407 = r257390 * r257406;
        double r257408 = r257407 / r257395;
        return r257408;
}

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.1
Herbie1.2
\[\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. Initial program 1.9

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

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

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

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

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

Reproduce

herbie shell --seed 2019212 +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.88458485041274715) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.22883740731) (/ (* (/ 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))