Average Error: 1.9 → 0.3
Time: 57.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^{\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 r4759405 = x;
        double r4759406 = y;
        double r4759407 = z;
        double r4759408 = log(r4759407);
        double r4759409 = t;
        double r4759410 = r4759408 - r4759409;
        double r4759411 = r4759406 * r4759410;
        double r4759412 = a;
        double r4759413 = 1.0;
        double r4759414 = r4759413 - r4759407;
        double r4759415 = log(r4759414);
        double r4759416 = b;
        double r4759417 = r4759415 - r4759416;
        double r4759418 = r4759412 * r4759417;
        double r4759419 = r4759411 + r4759418;
        double r4759420 = exp(r4759419);
        double r4759421 = r4759405 * r4759420;
        return r4759421;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r4759422 = x;
        double r4759423 = y;
        double r4759424 = z;
        double r4759425 = log(r4759424);
        double r4759426 = t;
        double r4759427 = r4759425 - r4759426;
        double r4759428 = 1.0;
        double r4759429 = r4759424 / r4759428;
        double r4759430 = r4759429 * r4759429;
        double r4759431 = -0.5;
        double r4759432 = log(r4759428);
        double r4759433 = r4759428 * r4759424;
        double r4759434 = r4759432 - r4759433;
        double r4759435 = fma(r4759430, r4759431, r4759434);
        double r4759436 = b;
        double r4759437 = r4759435 - r4759436;
        double r4759438 = a;
        double r4759439 = r4759437 * r4759438;
        double r4759440 = fma(r4759423, r4759427, r4759439);
        double r4759441 = exp(r4759440);
        double r4759442 = r4759422 * r4759441;
        return r4759442;
}

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))))))