Average Error: 7.2 → 0.5
Time: 32.8s
Precision: 64
\[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]
\[\mathsf{fma}\left(\log 1.0 - \mathsf{fma}\left(\frac{1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, y \cdot 1.0\right), z - 1.0, \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) + \log \left(\sqrt[3]{\sqrt{y}} \cdot \sqrt[3]{\sqrt{y}}\right) \cdot \left(\left(x - 1.0\right) + \left(x - 1.0\right)\right)\right) - t\right)\]
\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t
\mathsf{fma}\left(\log 1.0 - \mathsf{fma}\left(\frac{1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, y \cdot 1.0\right), z - 1.0, \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) + \log \left(\sqrt[3]{\sqrt{y}} \cdot \sqrt[3]{\sqrt{y}}\right) \cdot \left(\left(x - 1.0\right) + \left(x - 1.0\right)\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r1656433 = x;
        double r1656434 = 1.0;
        double r1656435 = r1656433 - r1656434;
        double r1656436 = y;
        double r1656437 = log(r1656436);
        double r1656438 = r1656435 * r1656437;
        double r1656439 = z;
        double r1656440 = r1656439 - r1656434;
        double r1656441 = r1656434 - r1656436;
        double r1656442 = log(r1656441);
        double r1656443 = r1656440 * r1656442;
        double r1656444 = r1656438 + r1656443;
        double r1656445 = t;
        double r1656446 = r1656444 - r1656445;
        return r1656446;
}

double f(double x, double y, double z, double t) {
        double r1656447 = 1.0;
        double r1656448 = log(r1656447);
        double r1656449 = 0.5;
        double r1656450 = y;
        double r1656451 = r1656450 / r1656447;
        double r1656452 = r1656451 * r1656451;
        double r1656453 = r1656450 * r1656447;
        double r1656454 = fma(r1656449, r1656452, r1656453);
        double r1656455 = r1656448 - r1656454;
        double r1656456 = z;
        double r1656457 = r1656456 - r1656447;
        double r1656458 = x;
        double r1656459 = r1656458 - r1656447;
        double r1656460 = cbrt(r1656450);
        double r1656461 = log(r1656460);
        double r1656462 = r1656459 * r1656461;
        double r1656463 = sqrt(r1656450);
        double r1656464 = cbrt(r1656463);
        double r1656465 = r1656464 * r1656464;
        double r1656466 = log(r1656465);
        double r1656467 = r1656459 + r1656459;
        double r1656468 = r1656466 * r1656467;
        double r1656469 = r1656462 + r1656468;
        double r1656470 = t;
        double r1656471 = r1656469 - r1656470;
        double r1656472 = fma(r1656455, r1656457, r1656471);
        return r1656472;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 7.2

    \[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]
  2. Simplified7.2

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

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

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

    \[\leadsto \mathsf{fma}\left(\log 1.0 - \mathsf{fma}\left(\frac{1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, 1.0 \cdot y\right), z - 1.0, \left(x - 1.0\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.0 - \mathsf{fma}\left(\frac{1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, 1.0 \cdot y\right), z - 1.0, \left(x - 1.0\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-lft-in0.5

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

    \[\leadsto \mathsf{fma}\left(\log 1.0 - \mathsf{fma}\left(\frac{1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, 1.0 \cdot y\right), z - 1.0, \left(\color{blue}{\log \left(\sqrt[3]{y}\right) \cdot \left(\left(x - 1.0\right) + \left(x - 1.0\right)\right)} + \left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right)\right) - t\right)\]
  10. Using strategy rm
  11. Applied add-sqr-sqrt0.5

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

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

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

Reproduce

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