Average Error: 1.9 → 0.2
Time: 22.2s
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}^{\left(\mathsf{fma}\left(y, \log z - t, \log 1 \cdot a - \mathsf{fma}\left(1 \cdot z, a, b \cdot a\right)\right)\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot {e}^{\left(\mathsf{fma}\left(y, \log z - t, \log 1 \cdot a - \mathsf{fma}\left(1 \cdot z, a, b \cdot a\right)\right)\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r4250880 = x;
        double r4250881 = y;
        double r4250882 = z;
        double r4250883 = log(r4250882);
        double r4250884 = t;
        double r4250885 = r4250883 - r4250884;
        double r4250886 = r4250881 * r4250885;
        double r4250887 = a;
        double r4250888 = 1.0;
        double r4250889 = r4250888 - r4250882;
        double r4250890 = log(r4250889);
        double r4250891 = b;
        double r4250892 = r4250890 - r4250891;
        double r4250893 = r4250887 * r4250892;
        double r4250894 = r4250886 + r4250893;
        double r4250895 = exp(r4250894);
        double r4250896 = r4250880 * r4250895;
        return r4250896;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r4250897 = x;
        double r4250898 = exp(1.0);
        double r4250899 = y;
        double r4250900 = z;
        double r4250901 = log(r4250900);
        double r4250902 = t;
        double r4250903 = r4250901 - r4250902;
        double r4250904 = 1.0;
        double r4250905 = log(r4250904);
        double r4250906 = a;
        double r4250907 = r4250905 * r4250906;
        double r4250908 = r4250904 * r4250900;
        double r4250909 = b;
        double r4250910 = r4250909 * r4250906;
        double r4250911 = fma(r4250908, r4250906, r4250910);
        double r4250912 = r4250907 - r4250911;
        double r4250913 = fma(r4250899, r4250903, r4250912);
        double r4250914 = pow(r4250898, r4250913);
        double r4250915 = r4250897 * r4250914;
        return r4250915;
}

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

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

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, \color{blue}{a \cdot \log 1 - \mathsf{fma}\left(1 \cdot z, a, a \cdot b\right)}\right)}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.2

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

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

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

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

Reproduce

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