Average Error: 6.6 → 0.4
Time: 33.1s
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(\mathsf{fma}\left(\frac{-1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, \log 1.0 - 1.0 \cdot y\right), z - 1.0, \left(\log \left(\sqrt[3]{y}\right) \cdot \left(x - 1.0\right) + \left(\left(x - 1.0\right) + \left(x - 1.0\right)\right) \cdot \log \left(\sqrt[3]{y}\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(\mathsf{fma}\left(\frac{-1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, \log 1.0 - 1.0 \cdot y\right), z - 1.0, \left(\log \left(\sqrt[3]{y}\right) \cdot \left(x - 1.0\right) + \left(\left(x - 1.0\right) + \left(x - 1.0\right)\right) \cdot \log \left(\sqrt[3]{y}\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r1441968 = x;
        double r1441969 = 1.0;
        double r1441970 = r1441968 - r1441969;
        double r1441971 = y;
        double r1441972 = log(r1441971);
        double r1441973 = r1441970 * r1441972;
        double r1441974 = z;
        double r1441975 = r1441974 - r1441969;
        double r1441976 = r1441969 - r1441971;
        double r1441977 = log(r1441976);
        double r1441978 = r1441975 * r1441977;
        double r1441979 = r1441973 + r1441978;
        double r1441980 = t;
        double r1441981 = r1441979 - r1441980;
        return r1441981;
}

double f(double x, double y, double z, double t) {
        double r1441982 = -0.5;
        double r1441983 = y;
        double r1441984 = 1.0;
        double r1441985 = r1441983 / r1441984;
        double r1441986 = r1441985 * r1441985;
        double r1441987 = log(r1441984);
        double r1441988 = r1441984 * r1441983;
        double r1441989 = r1441987 - r1441988;
        double r1441990 = fma(r1441982, r1441986, r1441989);
        double r1441991 = z;
        double r1441992 = r1441991 - r1441984;
        double r1441993 = cbrt(r1441983);
        double r1441994 = log(r1441993);
        double r1441995 = x;
        double r1441996 = r1441995 - r1441984;
        double r1441997 = r1441994 * r1441996;
        double r1441998 = r1441996 + r1441996;
        double r1441999 = r1441998 * r1441994;
        double r1442000 = r1441997 + r1441999;
        double r1442001 = t;
        double r1442002 = r1442000 - r1442001;
        double r1442003 = fma(r1441990, r1441992, r1442002);
        return r1442003;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 6.6

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

    \[\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}{\mathsf{fma}\left(\frac{-1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, \log 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(\mathsf{fma}\left(\frac{-1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, \log 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.4

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, \log 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-rgt-in0.4

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

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \frac{y}{1.0} \cdot \frac{y}{1.0}, \log 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)} + \log \left(\sqrt[3]{y}\right) \cdot \left(x - 1.0\right)\right) - t\right)\]
  10. Final simplification0.4

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

Reproduce

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