Average Error: 2.1 → 0.3
Time: 23.2s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - b\right) - 1 \cdot z\right)\right)} \cdot x\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - b\right) - 1 \cdot z\right)\right)} \cdot x
double f(double x, double y, double z, double t, double a, double b) {
        double r60604 = x;
        double r60605 = y;
        double r60606 = z;
        double r60607 = log(r60606);
        double r60608 = t;
        double r60609 = r60607 - r60608;
        double r60610 = r60605 * r60609;
        double r60611 = a;
        double r60612 = 1.0;
        double r60613 = r60612 - r60606;
        double r60614 = log(r60613);
        double r60615 = b;
        double r60616 = r60614 - r60615;
        double r60617 = r60611 * r60616;
        double r60618 = r60610 + r60617;
        double r60619 = exp(r60618);
        double r60620 = r60604 * r60619;
        return r60620;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r60621 = y;
        double r60622 = z;
        double r60623 = log(r60622);
        double r60624 = t;
        double r60625 = r60623 - r60624;
        double r60626 = a;
        double r60627 = 1.0;
        double r60628 = log(r60627);
        double r60629 = b;
        double r60630 = r60628 - r60629;
        double r60631 = r60627 * r60622;
        double r60632 = r60630 - r60631;
        double r60633 = r60626 * r60632;
        double r60634 = fma(r60621, r60625, r60633);
        double r60635 = exp(r60634);
        double r60636 = x;
        double r60637 = r60635 * r60636;
        return r60637;
}

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 2.1

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

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

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

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

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

Reproduce

herbie shell --seed 2019326 +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))))))