Average Error: 2.0 → 1.3
Time: 32.6s
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 r350022 = x;
        double r350023 = y;
        double r350024 = z;
        double r350025 = log(r350024);
        double r350026 = r350023 * r350025;
        double r350027 = t;
        double r350028 = 1.0;
        double r350029 = r350027 - r350028;
        double r350030 = a;
        double r350031 = log(r350030);
        double r350032 = r350029 * r350031;
        double r350033 = r350026 + r350032;
        double r350034 = b;
        double r350035 = r350033 - r350034;
        double r350036 = exp(r350035);
        double r350037 = r350022 * r350036;
        double r350038 = r350037 / r350023;
        return r350038;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r350039 = x;
        double r350040 = a;
        double r350041 = 1.0;
        double r350042 = -r350041;
        double r350043 = pow(r350040, r350042);
        double r350044 = y;
        double r350045 = z;
        double r350046 = log(r350045);
        double r350047 = -r350046;
        double r350048 = log(r350040);
        double r350049 = -r350048;
        double r350050 = t;
        double r350051 = b;
        double r350052 = fma(r350049, r350050, r350051);
        double r350053 = fma(r350044, r350047, r350052);
        double r350054 = exp(r350053);
        double r350055 = r350043 / r350054;
        double r350056 = r350039 * r350055;
        double r350057 = r350056 / r350044;
        return r350057;
}

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
Target10.8
Herbie1.3
\[\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.0

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

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

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

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