Average Error: 1.9 → 1.1
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 r286675 = x;
        double r286676 = y;
        double r286677 = z;
        double r286678 = log(r286677);
        double r286679 = r286676 * r286678;
        double r286680 = t;
        double r286681 = 1.0;
        double r286682 = r286680 - r286681;
        double r286683 = a;
        double r286684 = log(r286683);
        double r286685 = r286682 * r286684;
        double r286686 = r286679 + r286685;
        double r286687 = b;
        double r286688 = r286686 - r286687;
        double r286689 = exp(r286688);
        double r286690 = r286675 * r286689;
        double r286691 = r286690 / r286676;
        return r286691;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r286692 = x;
        double r286693 = a;
        double r286694 = 1.0;
        double r286695 = -r286694;
        double r286696 = pow(r286693, r286695);
        double r286697 = y;
        double r286698 = z;
        double r286699 = log(r286698);
        double r286700 = -r286699;
        double r286701 = log(r286693);
        double r286702 = -r286701;
        double r286703 = t;
        double r286704 = b;
        double r286705 = fma(r286702, r286703, r286704);
        double r286706 = fma(r286697, r286700, r286705);
        double r286707 = exp(r286706);
        double r286708 = r286696 / r286707;
        double r286709 = r286692 * r286708;
        double r286710 = r286709 / r286697;
        return r286710;
}

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

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

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