Average Error: 1.9 → 0.4
Time: 37.3s
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^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r94539 = x;
        double r94540 = y;
        double r94541 = z;
        double r94542 = log(r94541);
        double r94543 = t;
        double r94544 = r94542 - r94543;
        double r94545 = r94540 * r94544;
        double r94546 = a;
        double r94547 = 1.0;
        double r94548 = r94547 - r94541;
        double r94549 = log(r94548);
        double r94550 = b;
        double r94551 = r94549 - r94550;
        double r94552 = r94546 * r94551;
        double r94553 = r94545 + r94552;
        double r94554 = exp(r94553);
        double r94555 = r94539 * r94554;
        return r94555;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r94556 = x;
        double r94557 = y;
        double r94558 = z;
        double r94559 = log(r94558);
        double r94560 = t;
        double r94561 = r94559 - r94560;
        double r94562 = r94557 * r94561;
        double r94563 = a;
        double r94564 = 1.0;
        double r94565 = log(r94564);
        double r94566 = 0.5;
        double r94567 = 2.0;
        double r94568 = pow(r94558, r94567);
        double r94569 = pow(r94564, r94567);
        double r94570 = r94568 / r94569;
        double r94571 = r94564 * r94558;
        double r94572 = fma(r94566, r94570, r94571);
        double r94573 = r94565 - r94572;
        double r94574 = b;
        double r94575 = r94573 - r94574;
        double r94576 = r94563 * r94575;
        double r94577 = r94562 + r94576;
        double r94578 = exp(r94577);
        double r94579 = r94556 * r94578;
        return r94579;
}

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. Taylor expanded around 0 0.4

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

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

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

Reproduce

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