Average Error: 6.8 → 0.4
Time: 31.4s
Precision: 64
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
\[\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x - 1\right) + \left(\left(x - 1\right) \cdot \log \left({y}^{\frac{1}{3}}\right) - t\right)\right)\]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x - 1\right) + \left(\left(x - 1\right) \cdot \log \left({y}^{\frac{1}{3}}\right) - t\right)\right)
double f(double x, double y, double z, double t) {
        double r1814517 = x;
        double r1814518 = 1.0;
        double r1814519 = r1814517 - r1814518;
        double r1814520 = y;
        double r1814521 = log(r1814520);
        double r1814522 = r1814519 * r1814521;
        double r1814523 = z;
        double r1814524 = r1814523 - r1814518;
        double r1814525 = r1814518 - r1814520;
        double r1814526 = log(r1814525);
        double r1814527 = r1814524 * r1814526;
        double r1814528 = r1814522 + r1814527;
        double r1814529 = t;
        double r1814530 = r1814528 - r1814529;
        return r1814530;
}

double f(double x, double y, double z, double t) {
        double r1814531 = 1.0;
        double r1814532 = log(r1814531);
        double r1814533 = y;
        double r1814534 = r1814533 / r1814531;
        double r1814535 = r1814534 * r1814534;
        double r1814536 = 0.5;
        double r1814537 = r1814535 * r1814536;
        double r1814538 = fma(r1814533, r1814531, r1814537);
        double r1814539 = r1814532 - r1814538;
        double r1814540 = z;
        double r1814541 = r1814540 - r1814531;
        double r1814542 = cbrt(r1814533);
        double r1814543 = r1814542 * r1814542;
        double r1814544 = log(r1814543);
        double r1814545 = x;
        double r1814546 = r1814545 - r1814531;
        double r1814547 = r1814544 * r1814546;
        double r1814548 = 0.3333333333333333;
        double r1814549 = pow(r1814533, r1814548);
        double r1814550 = log(r1814549);
        double r1814551 = r1814546 * r1814550;
        double r1814552 = t;
        double r1814553 = r1814551 - r1814552;
        double r1814554 = r1814547 + r1814553;
        double r1814555 = fma(r1814539, r1814541, r1814554);
        return r1814555;
}

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. Simplified6.8

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log \left(1 - y\right), z - 1, \left(x - 1\right) \cdot \log y - t\right)}\]
  3. Taylor expanded around 0 0.4

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

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

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

    \[\leadsto \mathsf{fma}\left(\log 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \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)} - t\right)\]
  8. Applied distribute-rgt-in0.5

    \[\leadsto \mathsf{fma}\left(\log 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \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)} - t\right)\]
  9. Applied associate--l+0.5

    \[\leadsto \mathsf{fma}\left(\log 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \color{blue}{\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) - t\right)}\right)\]
  10. Using strategy rm
  11. Applied pow1/30.4

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

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

Reproduce

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