Average Error: 2.0 → 0.2
Time: 16.5s
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(\log 1 - \mathsf{fma}\left(1, z, b\right)\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(\log 1 - \mathsf{fma}\left(1, z, b\right)\right) \cdot a\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r110822 = x;
        double r110823 = y;
        double r110824 = z;
        double r110825 = log(r110824);
        double r110826 = t;
        double r110827 = r110825 - r110826;
        double r110828 = r110823 * r110827;
        double r110829 = a;
        double r110830 = 1.0;
        double r110831 = r110830 - r110824;
        double r110832 = log(r110831);
        double r110833 = b;
        double r110834 = r110832 - r110833;
        double r110835 = r110829 * r110834;
        double r110836 = r110828 + r110835;
        double r110837 = exp(r110836);
        double r110838 = r110822 * r110837;
        return r110838;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r110839 = x;
        double r110840 = y;
        double r110841 = z;
        double r110842 = log(r110841);
        double r110843 = t;
        double r110844 = r110842 - r110843;
        double r110845 = 1.0;
        double r110846 = log(r110845);
        double r110847 = b;
        double r110848 = fma(r110845, r110841, r110847);
        double r110849 = r110846 - r110848;
        double r110850 = a;
        double r110851 = r110849 * r110850;
        double r110852 = fma(r110840, r110844, r110851);
        double r110853 = exp(r110852);
        double r110854 = r110839 * r110853;
        return r110854;
}

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

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

    \[\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. Taylor expanded around inf 0.4

    \[\leadsto \color{blue}{e^{\left(\log z \cdot y + a \cdot \log 1\right) - \left(a \cdot b + \left(t \cdot y + 1 \cdot \left(a \cdot z\right)\right)\right)} \cdot x}\]
  6. Simplified0.2

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

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

Reproduce

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