Average Error: 1.9 → 0.3
Time: 52.1s
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(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\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(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\right) - b\right) \cdot a\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r5139429 = x;
        double r5139430 = y;
        double r5139431 = z;
        double r5139432 = log(r5139431);
        double r5139433 = t;
        double r5139434 = r5139432 - r5139433;
        double r5139435 = r5139430 * r5139434;
        double r5139436 = a;
        double r5139437 = 1.0;
        double r5139438 = r5139437 - r5139431;
        double r5139439 = log(r5139438);
        double r5139440 = b;
        double r5139441 = r5139439 - r5139440;
        double r5139442 = r5139436 * r5139441;
        double r5139443 = r5139435 + r5139442;
        double r5139444 = exp(r5139443);
        double r5139445 = r5139429 * r5139444;
        return r5139445;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r5139446 = x;
        double r5139447 = y;
        double r5139448 = z;
        double r5139449 = log(r5139448);
        double r5139450 = t;
        double r5139451 = r5139449 - r5139450;
        double r5139452 = 1.0;
        double r5139453 = log(r5139452);
        double r5139454 = 0.5;
        double r5139455 = r5139448 / r5139452;
        double r5139456 = r5139455 * r5139455;
        double r5139457 = r5139452 * r5139448;
        double r5139458 = fma(r5139454, r5139456, r5139457);
        double r5139459 = r5139453 - r5139458;
        double r5139460 = b;
        double r5139461 = r5139459 - r5139460;
        double r5139462 = a;
        double r5139463 = r5139461 * r5139462;
        double r5139464 = fma(r5139447, r5139451, r5139463);
        double r5139465 = exp(r5139464);
        double r5139466 = r5139446 * r5139465;
        return r5139466;
}

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}{\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, z \cdot 1\right)\right)} - b\right) \cdot a\right)}\]
  5. Final simplification0.3

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\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))))))