Average Error: 1.9 → 0.4
Time: 36.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^{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 r90013 = x;
        double r90014 = y;
        double r90015 = z;
        double r90016 = log(r90015);
        double r90017 = t;
        double r90018 = r90016 - r90017;
        double r90019 = r90014 * r90018;
        double r90020 = a;
        double r90021 = 1.0;
        double r90022 = r90021 - r90015;
        double r90023 = log(r90022);
        double r90024 = b;
        double r90025 = r90023 - r90024;
        double r90026 = r90020 * r90025;
        double r90027 = r90019 + r90026;
        double r90028 = exp(r90027);
        double r90029 = r90013 * r90028;
        return r90029;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r90030 = x;
        double r90031 = y;
        double r90032 = z;
        double r90033 = log(r90032);
        double r90034 = t;
        double r90035 = r90033 - r90034;
        double r90036 = r90031 * r90035;
        double r90037 = a;
        double r90038 = 1.0;
        double r90039 = log(r90038);
        double r90040 = 0.5;
        double r90041 = 2.0;
        double r90042 = pow(r90032, r90041);
        double r90043 = pow(r90038, r90041);
        double r90044 = r90042 / r90043;
        double r90045 = r90038 * r90032;
        double r90046 = fma(r90040, r90044, r90045);
        double r90047 = r90039 - r90046;
        double r90048 = b;
        double r90049 = r90047 - r90048;
        double r90050 = r90037 * r90049;
        double r90051 = r90036 + r90050;
        double r90052 = exp(r90051);
        double r90053 = r90030 * r90052;
        return r90053;
}

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