Average Error: 6.7 → 0.5
Time: 25.8s
Precision: 64
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\left(x - 1\right) \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), x - 1, \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) \cdot \left(z - 1\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(\left(x - 1\right) \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), x - 1, \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) \cdot \left(z - 1\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r49889 = x;
        double r49890 = 1.0;
        double r49891 = r49889 - r49890;
        double r49892 = y;
        double r49893 = log(r49892);
        double r49894 = r49891 * r49893;
        double r49895 = z;
        double r49896 = r49895 - r49890;
        double r49897 = r49890 - r49892;
        double r49898 = log(r49897);
        double r49899 = r49896 * r49898;
        double r49900 = r49894 + r49899;
        double r49901 = t;
        double r49902 = r49900 - r49901;
        return r49902;
}

double f(double x, double y, double z, double t) {
        double r49903 = x;
        double r49904 = 1.0;
        double r49905 = r49903 - r49904;
        double r49906 = y;
        double r49907 = cbrt(r49906);
        double r49908 = r49907 * r49907;
        double r49909 = log(r49908);
        double r49910 = r49905 * r49909;
        double r49911 = log(r49907);
        double r49912 = log(r49904);
        double r49913 = 0.5;
        double r49914 = 2.0;
        double r49915 = pow(r49906, r49914);
        double r49916 = pow(r49904, r49914);
        double r49917 = r49915 / r49916;
        double r49918 = r49913 * r49917;
        double r49919 = fma(r49904, r49906, r49918);
        double r49920 = r49912 - r49919;
        double r49921 = z;
        double r49922 = r49921 - r49904;
        double r49923 = r49920 * r49922;
        double r49924 = fma(r49911, r49905, r49923);
        double r49925 = r49910 + r49924;
        double r49926 = t;
        double r49927 = r49925 - r49926;
        return r49927;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 6.7

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

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

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

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

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

    \[\leadsto \left(\color{blue}{\left(\left(x - 1\right) \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \left(x - 1\right) \cdot \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\]
  8. Applied associate-+l+0.5

    \[\leadsto \color{blue}{\left(\left(x - 1\right) \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \left(\left(x - 1\right) \cdot \log \left(\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)\right)} - t\]
  9. Simplified0.5

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

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

Reproduce

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