Average Error: 2.0 → 0.2
Time: 26.8s
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 r141979 = x;
        double r141980 = y;
        double r141981 = z;
        double r141982 = log(r141981);
        double r141983 = t;
        double r141984 = r141982 - r141983;
        double r141985 = r141980 * r141984;
        double r141986 = a;
        double r141987 = 1.0;
        double r141988 = r141987 - r141981;
        double r141989 = log(r141988);
        double r141990 = b;
        double r141991 = r141989 - r141990;
        double r141992 = r141986 * r141991;
        double r141993 = r141985 + r141992;
        double r141994 = exp(r141993);
        double r141995 = r141979 * r141994;
        return r141995;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r141996 = y;
        double r141997 = z;
        double r141998 = log(r141997);
        double r141999 = t;
        double r142000 = r141998 - r141999;
        double r142001 = a;
        double r142002 = 1.0;
        double r142003 = log(r142002);
        double r142004 = 0.5;
        double r142005 = 2.0;
        double r142006 = pow(r141997, r142005);
        double r142007 = pow(r142002, r142005);
        double r142008 = r142006 / r142007;
        double r142009 = r142002 * r141997;
        double r142010 = fma(r142004, r142008, r142009);
        double r142011 = r142003 - r142010;
        double r142012 = b;
        double r142013 = r142011 - r142012;
        double r142014 = r142001 * r142013;
        double r142015 = fma(r141996, r142000, r142014);
        double r142016 = exp(r142015);
        double r142017 = x;
        double r142018 = r142016 * r142017;
        return r142018;
}

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 2019212 +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))))))