Average Error: 2.1 → 0.2
Time: 43.8s
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 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\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 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)\right)} \cdot x
double f(double x, double y, double z, double t, double a, double b) {
        double r111753 = x;
        double r111754 = y;
        double r111755 = z;
        double r111756 = log(r111755);
        double r111757 = t;
        double r111758 = r111756 - r111757;
        double r111759 = r111754 * r111758;
        double r111760 = a;
        double r111761 = 1.0;
        double r111762 = r111761 - r111755;
        double r111763 = log(r111762);
        double r111764 = b;
        double r111765 = r111763 - r111764;
        double r111766 = r111760 * r111765;
        double r111767 = r111759 + r111766;
        double r111768 = exp(r111767);
        double r111769 = r111753 * r111768;
        return r111769;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r111770 = y;
        double r111771 = z;
        double r111772 = log(r111771);
        double r111773 = t;
        double r111774 = r111772 - r111773;
        double r111775 = a;
        double r111776 = 1.0;
        double r111777 = log(r111776);
        double r111778 = 0.5;
        double r111779 = 2.0;
        double r111780 = pow(r111771, r111779);
        double r111781 = pow(r111776, r111779);
        double r111782 = r111780 / r111781;
        double r111783 = r111776 * r111771;
        double r111784 = fma(r111778, r111782, r111783);
        double r111785 = r111777 - r111784;
        double r111786 = b;
        double r111787 = r111785 - r111786;
        double r111788 = r111775 * r111787;
        double r111789 = fma(r111770, r111774, r111788);
        double r111790 = exp(r111789);
        double r111791 = x;
        double r111792 = r111790 * r111791;
        return r111792;
}

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

    \[\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.2

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

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

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

Reproduce

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