Average Error: 2.0 → 1.3
Time: 41.5s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\left(x \cdot \frac{{a}^{\left(-1\right)}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}\right) \cdot \frac{1}{y}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\left(x \cdot \frac{{a}^{\left(-1\right)}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}\right) \cdot \frac{1}{y}
double f(double x, double y, double z, double t, double a, double b) {
        double r314161 = x;
        double r314162 = y;
        double r314163 = z;
        double r314164 = log(r314163);
        double r314165 = r314162 * r314164;
        double r314166 = t;
        double r314167 = 1.0;
        double r314168 = r314166 - r314167;
        double r314169 = a;
        double r314170 = log(r314169);
        double r314171 = r314168 * r314170;
        double r314172 = r314165 + r314171;
        double r314173 = b;
        double r314174 = r314172 - r314173;
        double r314175 = exp(r314174);
        double r314176 = r314161 * r314175;
        double r314177 = r314176 / r314162;
        return r314177;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r314178 = x;
        double r314179 = a;
        double r314180 = 1.0;
        double r314181 = -r314180;
        double r314182 = pow(r314179, r314181);
        double r314183 = y;
        double r314184 = z;
        double r314185 = log(r314184);
        double r314186 = -r314185;
        double r314187 = log(r314179);
        double r314188 = -r314187;
        double r314189 = t;
        double r314190 = b;
        double r314191 = fma(r314188, r314189, r314190);
        double r314192 = fma(r314183, r314186, r314191);
        double r314193 = exp(r314192);
        double r314194 = r314182 / r314193;
        double r314195 = r314178 * r314194;
        double r314196 = 1.0;
        double r314197 = r314196 / r314183;
        double r314198 = r314195 * r314197;
        return r314198;
}

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
Target11.0
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. Using strategy rm
  5. Applied div-inv1.3

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

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

Reproduce

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