Average Error: 1.9 → 1.2
Time: 14.5s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\frac{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot x}{y}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot x}{y}
double f(double x, double y, double z, double t, double a, double b) {
        double r395421 = x;
        double r395422 = y;
        double r395423 = z;
        double r395424 = log(r395423);
        double r395425 = r395422 * r395424;
        double r395426 = t;
        double r395427 = 1.0;
        double r395428 = r395426 - r395427;
        double r395429 = a;
        double r395430 = log(r395429);
        double r395431 = r395428 * r395430;
        double r395432 = r395425 + r395431;
        double r395433 = b;
        double r395434 = r395432 - r395433;
        double r395435 = exp(r395434);
        double r395436 = r395421 * r395435;
        double r395437 = r395436 / r395422;
        return r395437;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r395438 = 1.0;
        double r395439 = a;
        double r395440 = r395438 / r395439;
        double r395441 = 1.0;
        double r395442 = pow(r395440, r395441);
        double r395443 = y;
        double r395444 = z;
        double r395445 = r395438 / r395444;
        double r395446 = log(r395445);
        double r395447 = log(r395440);
        double r395448 = t;
        double r395449 = b;
        double r395450 = fma(r395447, r395448, r395449);
        double r395451 = fma(r395443, r395446, r395450);
        double r395452 = exp(r395451);
        double r395453 = r395442 / r395452;
        double r395454 = x;
        double r395455 = r395453 * r395454;
        double r395456 = r395455 / r395443;
        return r395456;
}

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.4
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;t \lt -0.88458485041274715:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.22883740731:\\ \;\;\;\;\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{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
  4. Using strategy rm
  5. Applied *-commutative1.2

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

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

Reproduce

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