Average Error: 2.1 → 0.3
Time: 15.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^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}\]
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, \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}
double f(double x, double y, double z, double t, double a, double b) {
        double r111307 = x;
        double r111308 = y;
        double r111309 = z;
        double r111310 = log(r111309);
        double r111311 = t;
        double r111312 = r111310 - r111311;
        double r111313 = r111308 * r111312;
        double r111314 = a;
        double r111315 = 1.0;
        double r111316 = r111315 - r111309;
        double r111317 = log(r111316);
        double r111318 = b;
        double r111319 = r111317 - r111318;
        double r111320 = r111314 * r111319;
        double r111321 = r111313 + r111320;
        double r111322 = exp(r111321);
        double r111323 = r111307 * r111322;
        return r111323;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r111324 = x;
        double r111325 = y;
        double r111326 = z;
        double r111327 = log(r111326);
        double r111328 = t;
        double r111329 = r111327 - r111328;
        double r111330 = 1.0;
        double r111331 = log(r111330);
        double r111332 = 0.5;
        double r111333 = 2.0;
        double r111334 = pow(r111326, r111333);
        double r111335 = pow(r111330, r111333);
        double r111336 = r111334 / r111335;
        double r111337 = r111332 * r111336;
        double r111338 = r111330 * r111326;
        double r111339 = r111337 + r111338;
        double r111340 = r111331 - r111339;
        double r111341 = cbrt(r111340);
        double r111342 = r111341 * r111341;
        double r111343 = b;
        double r111344 = 1.0;
        double r111345 = r111343 * r111344;
        double r111346 = -r111345;
        double r111347 = fma(r111342, r111341, r111346);
        double r111348 = a;
        double r111349 = r111347 * r111348;
        double r111350 = fma(r111325, r111329, r111349);
        double r111351 = -r111343;
        double r111352 = fma(r111351, r111344, r111345);
        double r111353 = r111352 * r111348;
        double r111354 = r111350 + r111353;
        double r111355 = exp(r111354);
        double r111356 = r111324 * r111355;
        return r111356;
}

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

    \[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.5

    \[\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. Using strategy rm
  4. Applied *-un-lft-identity0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - \color{blue}{1 \cdot b}\right)}\]
  5. Applied add-cube-cbrt0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}\right) \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}} - 1 \cdot b\right)}\]
  6. Applied prod-diff0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right)\right)}}\]
  7. Applied distribute-rgt-in0.5

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

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

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

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

Reproduce

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