Average Error: 1.9 → 0.4
Time: 36.0s
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^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r103860 = x;
        double r103861 = y;
        double r103862 = z;
        double r103863 = log(r103862);
        double r103864 = t;
        double r103865 = r103863 - r103864;
        double r103866 = r103861 * r103865;
        double r103867 = a;
        double r103868 = 1.0;
        double r103869 = r103868 - r103862;
        double r103870 = log(r103869);
        double r103871 = b;
        double r103872 = r103870 - r103871;
        double r103873 = r103867 * r103872;
        double r103874 = r103866 + r103873;
        double r103875 = exp(r103874);
        double r103876 = r103860 * r103875;
        return r103876;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r103877 = x;
        double r103878 = y;
        double r103879 = z;
        double r103880 = log(r103879);
        double r103881 = t;
        double r103882 = r103880 - r103881;
        double r103883 = r103878 * r103882;
        double r103884 = a;
        double r103885 = 1.0;
        double r103886 = log(r103885);
        double r103887 = 0.5;
        double r103888 = 2.0;
        double r103889 = pow(r103879, r103888);
        double r103890 = pow(r103885, r103888);
        double r103891 = r103889 / r103890;
        double r103892 = r103885 * r103879;
        double r103893 = fma(r103887, r103891, r103892);
        double r103894 = r103886 - r103893;
        double r103895 = b;
        double r103896 = r103894 - r103895;
        double r103897 = r103884 * r103896;
        double r103898 = r103883 + r103897;
        double r103899 = exp(r103898);
        double r103900 = r103877 * r103899;
        return r103900;
}

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. Taylor expanded around 0 0.4

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

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

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

Reproduce

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