Average Error: 1.9 → 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}^{\left(\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)\right)} \cdot x\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
{e}^{\left(\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)\right)} \cdot x
double f(double x, double y, double z, double t, double a, double b) {
        double r79854 = x;
        double r79855 = y;
        double r79856 = z;
        double r79857 = log(r79856);
        double r79858 = t;
        double r79859 = r79857 - r79858;
        double r79860 = r79855 * r79859;
        double r79861 = a;
        double r79862 = 1.0;
        double r79863 = r79862 - r79856;
        double r79864 = log(r79863);
        double r79865 = b;
        double r79866 = r79864 - r79865;
        double r79867 = r79861 * r79866;
        double r79868 = r79860 + r79867;
        double r79869 = exp(r79868);
        double r79870 = r79854 * r79869;
        return r79870;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r79871 = exp(1.0);
        double r79872 = y;
        double r79873 = z;
        double r79874 = log(r79873);
        double r79875 = t;
        double r79876 = r79874 - r79875;
        double r79877 = a;
        double r79878 = 1.0;
        double r79879 = log(r79878);
        double r79880 = 0.5;
        double r79881 = 2.0;
        double r79882 = pow(r79873, r79881);
        double r79883 = pow(r79878, r79881);
        double r79884 = r79882 / r79883;
        double r79885 = r79878 * r79873;
        double r79886 = fma(r79880, r79884, r79885);
        double r79887 = r79879 - r79886;
        double r79888 = b;
        double r79889 = r79887 - r79888;
        double r79890 = r79877 * r79889;
        double r79891 = fma(r79872, r79876, r79890);
        double r79892 = pow(r79871, r79891);
        double r79893 = x;
        double r79894 = r79892 * r79893;
        return r79894;
}

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}{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. Using strategy rm
  6. Applied *-un-lft-identity0.2

    \[\leadsto e^{\color{blue}{1 \cdot \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\]
  7. Applied exp-prod0.2

    \[\leadsto \color{blue}{{\left(e^{1}\right)}^{\left(\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)\right)}} \cdot x\]
  8. Simplified0.2

    \[\leadsto {\color{blue}{e}}^{\left(\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)\right)} \cdot x\]
  9. Final simplification0.2

    \[\leadsto {e}^{\left(\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)\right)} \cdot x\]

Reproduce

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