Average Error: 1.9 → 0.3
Time: 34.1s
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^{\mathsf{fma}\left(y, \log z - t, \left(\left(\log 1 - \mathsf{fma}\left(z, 1, \left(\frac{z}{1} \cdot \frac{z}{1}\right) \cdot \frac{1}{2}\right)\right) - b\right) \cdot a\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\left(\log 1 - \mathsf{fma}\left(z, 1, \left(\frac{z}{1} \cdot \frac{z}{1}\right) \cdot \frac{1}{2}\right)\right) - b\right) \cdot a\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r6780094 = x;
        double r6780095 = y;
        double r6780096 = z;
        double r6780097 = log(r6780096);
        double r6780098 = t;
        double r6780099 = r6780097 - r6780098;
        double r6780100 = r6780095 * r6780099;
        double r6780101 = a;
        double r6780102 = 1.0;
        double r6780103 = r6780102 - r6780096;
        double r6780104 = log(r6780103);
        double r6780105 = b;
        double r6780106 = r6780104 - r6780105;
        double r6780107 = r6780101 * r6780106;
        double r6780108 = r6780100 + r6780107;
        double r6780109 = exp(r6780108);
        double r6780110 = r6780094 * r6780109;
        return r6780110;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r6780111 = x;
        double r6780112 = y;
        double r6780113 = z;
        double r6780114 = log(r6780113);
        double r6780115 = t;
        double r6780116 = r6780114 - r6780115;
        double r6780117 = 1.0;
        double r6780118 = log(r6780117);
        double r6780119 = r6780113 / r6780117;
        double r6780120 = r6780119 * r6780119;
        double r6780121 = 0.5;
        double r6780122 = r6780120 * r6780121;
        double r6780123 = fma(r6780113, r6780117, r6780122);
        double r6780124 = r6780118 - r6780123;
        double r6780125 = b;
        double r6780126 = r6780124 - r6780125;
        double r6780127 = a;
        double r6780128 = r6780126 * r6780127;
        double r6780129 = fma(r6780112, r6780116, r6780128);
        double r6780130 = exp(r6780129);
        double r6780131 = r6780111 * r6780130;
        return r6780131;
}

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

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

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

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

Reproduce

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