Average Error: 2.0 → 0.2
Time: 28.7s
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 r82955 = x;
        double r82956 = y;
        double r82957 = z;
        double r82958 = log(r82957);
        double r82959 = t;
        double r82960 = r82958 - r82959;
        double r82961 = r82956 * r82960;
        double r82962 = a;
        double r82963 = 1.0;
        double r82964 = r82963 - r82957;
        double r82965 = log(r82964);
        double r82966 = b;
        double r82967 = r82965 - r82966;
        double r82968 = r82962 * r82967;
        double r82969 = r82961 + r82968;
        double r82970 = exp(r82969);
        double r82971 = r82955 * r82970;
        return r82971;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r82972 = y;
        double r82973 = z;
        double r82974 = log(r82973);
        double r82975 = t;
        double r82976 = r82974 - r82975;
        double r82977 = a;
        double r82978 = 1.0;
        double r82979 = log(r82978);
        double r82980 = 0.5;
        double r82981 = 2.0;
        double r82982 = pow(r82973, r82981);
        double r82983 = pow(r82978, r82981);
        double r82984 = r82982 / r82983;
        double r82985 = r82978 * r82973;
        double r82986 = fma(r82980, r82984, r82985);
        double r82987 = r82979 - r82986;
        double r82988 = b;
        double r82989 = r82987 - r82988;
        double r82990 = r82977 * r82989;
        double r82991 = fma(r82972, r82976, r82990);
        double r82992 = exp(r82991);
        double r82993 = x;
        double r82994 = r82992 * r82993;
        return r82994;
}

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, 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 2019235 +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))))))