Average Error: 1.9 → 0.3
Time: 59.4s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{z}{1} \cdot \frac{z}{1}, \frac{-1}{2}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{z}{1} \cdot \frac{z}{1}, \frac{-1}{2}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r5169495 = x;
        double r5169496 = y;
        double r5169497 = z;
        double r5169498 = log(r5169497);
        double r5169499 = t;
        double r5169500 = r5169498 - r5169499;
        double r5169501 = r5169496 * r5169500;
        double r5169502 = a;
        double r5169503 = 1.0;
        double r5169504 = r5169503 - r5169497;
        double r5169505 = log(r5169504);
        double r5169506 = b;
        double r5169507 = r5169505 - r5169506;
        double r5169508 = r5169502 * r5169507;
        double r5169509 = r5169501 + r5169508;
        double r5169510 = exp(r5169509);
        double r5169511 = r5169495 * r5169510;
        return r5169511;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r5169512 = x;
        double r5169513 = y;
        double r5169514 = z;
        double r5169515 = log(r5169514);
        double r5169516 = t;
        double r5169517 = r5169515 - r5169516;
        double r5169518 = 1.0;
        double r5169519 = r5169514 / r5169518;
        double r5169520 = r5169519 * r5169519;
        double r5169521 = -0.5;
        double r5169522 = log(r5169518);
        double r5169523 = r5169518 * r5169514;
        double r5169524 = r5169522 - r5169523;
        double r5169525 = fma(r5169520, r5169521, r5169524);
        double r5169526 = b;
        double r5169527 = r5169525 - r5169526;
        double r5169528 = a;
        double r5169529 = r5169527 * r5169528;
        double r5169530 = fma(r5169513, r5169517, r5169529);
        double r5169531 = exp(r5169530);
        double r5169532 = r5169512 * r5169531;
        return r5169532;
}

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

Derivation

  1. Initial program 1.9

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
  2. Simplified1.7

    \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\log \left(1 - z\right) - b\right) \cdot a\right)}}\]
  3. Taylor expanded around 0 0.3

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

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))