Average Error: 2.2 → 1.4
Time: 30.4s
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 r309276 = x;
        double r309277 = y;
        double r309278 = z;
        double r309279 = log(r309278);
        double r309280 = r309277 * r309279;
        double r309281 = t;
        double r309282 = 1.0;
        double r309283 = r309281 - r309282;
        double r309284 = a;
        double r309285 = log(r309284);
        double r309286 = r309283 * r309285;
        double r309287 = r309280 + r309286;
        double r309288 = b;
        double r309289 = r309287 - r309288;
        double r309290 = exp(r309289);
        double r309291 = r309276 * r309290;
        double r309292 = r309291 / r309277;
        return r309292;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r309293 = x;
        double r309294 = a;
        double r309295 = 1.0;
        double r309296 = -r309295;
        double r309297 = pow(r309294, r309296);
        double r309298 = y;
        double r309299 = z;
        double r309300 = log(r309299);
        double r309301 = -r309300;
        double r309302 = log(r309294);
        double r309303 = -r309302;
        double r309304 = t;
        double r309305 = b;
        double r309306 = fma(r309303, r309304, r309305);
        double r309307 = fma(r309298, r309301, r309306);
        double r309308 = exp(r309307);
        double r309309 = r309297 / r309308;
        double r309310 = r309293 * r309309;
        double r309311 = r309310 / r309298;
        return r309311;
}

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.2
Target11.3
Herbie1.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. 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.4

    \[\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. Final simplification1.4

    \[\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 2019208 +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))