Average Error: 6.8 → 0.4
Time: 40.4s
Precision: 64
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x - 1\right) + \mathsf{fma}\left(\log \left({y}^{\frac{1}{3}}\right), x - 1, \left(z - 1\right) \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\left(\log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x - 1\right) + \mathsf{fma}\left(\log \left({y}^{\frac{1}{3}}\right), x - 1, \left(z - 1\right) \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r53375 = x;
        double r53376 = 1.0;
        double r53377 = r53375 - r53376;
        double r53378 = y;
        double r53379 = log(r53378);
        double r53380 = r53377 * r53379;
        double r53381 = z;
        double r53382 = r53381 - r53376;
        double r53383 = r53376 - r53378;
        double r53384 = log(r53383);
        double r53385 = r53382 * r53384;
        double r53386 = r53380 + r53385;
        double r53387 = t;
        double r53388 = r53386 - r53387;
        return r53388;
}

double f(double x, double y, double z, double t) {
        double r53389 = y;
        double r53390 = cbrt(r53389);
        double r53391 = r53390 * r53390;
        double r53392 = log(r53391);
        double r53393 = x;
        double r53394 = 1.0;
        double r53395 = r53393 - r53394;
        double r53396 = r53392 * r53395;
        double r53397 = 0.3333333333333333;
        double r53398 = pow(r53389, r53397);
        double r53399 = log(r53398);
        double r53400 = z;
        double r53401 = r53400 - r53394;
        double r53402 = log(r53394);
        double r53403 = 0.5;
        double r53404 = 2.0;
        double r53405 = pow(r53389, r53404);
        double r53406 = pow(r53394, r53404);
        double r53407 = r53405 / r53406;
        double r53408 = r53403 * r53407;
        double r53409 = fma(r53394, r53389, r53408);
        double r53410 = r53402 - r53409;
        double r53411 = r53401 * r53410;
        double r53412 = fma(r53399, r53395, r53411);
        double r53413 = r53396 + r53412;
        double r53414 = t;
        double r53415 = r53413 - r53414;
        return r53415;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 6.8

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
  2. Taylor expanded around 0 0.3

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Simplified0.3

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  4. Using strategy rm
  5. Applied add-cube-cbrt0.3

    \[\leadsto \left(\left(x - 1\right) \cdot \log \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} + \left(z - 1\right) \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
  6. Applied log-prod0.4

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

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

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

    \[\leadsto \left(\log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x - 1\right) + \color{blue}{\mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), x - 1, \left(z - 1\right) \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)}\right) - t\]
  10. Using strategy rm
  11. Applied pow1/30.4

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

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

Reproduce

herbie shell --seed 2019199 +o rules:numerics
(FPCore (x y z t)
  :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
  (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))