Average Error: 2.0 → 0.3
Time: 18.5s
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 r186752 = x;
        double r186753 = y;
        double r186754 = z;
        double r186755 = log(r186754);
        double r186756 = t;
        double r186757 = r186755 - r186756;
        double r186758 = r186753 * r186757;
        double r186759 = a;
        double r186760 = 1.0;
        double r186761 = r186760 - r186754;
        double r186762 = log(r186761);
        double r186763 = b;
        double r186764 = r186762 - r186763;
        double r186765 = r186759 * r186764;
        double r186766 = r186758 + r186765;
        double r186767 = exp(r186766);
        double r186768 = r186752 * r186767;
        return r186768;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r186769 = y;
        double r186770 = z;
        double r186771 = log(r186770);
        double r186772 = t;
        double r186773 = r186771 - r186772;
        double r186774 = a;
        double r186775 = 1.0;
        double r186776 = log(r186775);
        double r186777 = b;
        double r186778 = r186776 - r186777;
        double r186779 = r186775 * r186770;
        double r186780 = r186778 - r186779;
        double r186781 = r186774 * r186780;
        double r186782 = fma(r186769, r186773, r186781);
        double r186783 = exp(r186782);
        double r186784 = x;
        double r186785 = r186783 * r186784;
        return r186785;
}

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

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

    \[\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 2019350 +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))))))