Average Error: 7.2 → 0.4
Time: 58.2s
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(1, y, \frac{y}{1} \cdot \left(\frac{y}{1} \cdot \frac{1}{2}\right)\right), z - 1, \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), \left(x - 1\right) + \left(x - 1\right), \left(x - 1\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{y}}\right) + \left(\left(x - 1\right) + \left(x - 1\right)\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{y}}\right)\right) - t\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(1, y, \frac{y}{1} \cdot \left(\frac{y}{1} \cdot \frac{1}{2}\right)\right), z - 1, \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), \left(x - 1\right) + \left(x - 1\right), \left(x - 1\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{y}}\right) + \left(\left(x - 1\right) + \left(x - 1\right)\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{y}}\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r1629027 = x;
        double r1629028 = 1.0;
        double r1629029 = r1629027 - r1629028;
        double r1629030 = y;
        double r1629031 = log(r1629030);
        double r1629032 = r1629029 * r1629031;
        double r1629033 = z;
        double r1629034 = r1629033 - r1629028;
        double r1629035 = r1629028 - r1629030;
        double r1629036 = log(r1629035);
        double r1629037 = r1629034 * r1629036;
        double r1629038 = r1629032 + r1629037;
        double r1629039 = t;
        double r1629040 = r1629038 - r1629039;
        return r1629040;
}

double f(double x, double y, double z, double t) {
        double r1629041 = 1.0;
        double r1629042 = log(r1629041);
        double r1629043 = y;
        double r1629044 = r1629043 / r1629041;
        double r1629045 = 0.5;
        double r1629046 = r1629044 * r1629045;
        double r1629047 = r1629044 * r1629046;
        double r1629048 = fma(r1629041, r1629043, r1629047);
        double r1629049 = r1629042 - r1629048;
        double r1629050 = z;
        double r1629051 = r1629050 - r1629041;
        double r1629052 = cbrt(r1629043);
        double r1629053 = log(r1629052);
        double r1629054 = x;
        double r1629055 = r1629054 - r1629041;
        double r1629056 = r1629055 + r1629055;
        double r1629057 = cbrt(r1629052);
        double r1629058 = log(r1629057);
        double r1629059 = r1629055 * r1629058;
        double r1629060 = r1629056 * r1629058;
        double r1629061 = r1629059 + r1629060;
        double r1629062 = fma(r1629053, r1629056, r1629061);
        double r1629063 = t;
        double r1629064 = r1629062 - r1629063;
        double r1629065 = fma(r1629049, r1629051, r1629064);
        return r1629065;
}

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\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
  2. Simplified7.2

    \[\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(1, y, \frac{y}{1} \cdot \left(\frac{y}{1} \cdot \frac{1}{2}\right)\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(1, y, \frac{y}{1} \cdot \left(\frac{y}{1} \cdot \frac{1}{2}\right)\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(1, y, \frac{y}{1} \cdot \left(\frac{y}{1} \cdot \frac{1}{2}\right)\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-lft-in0.5

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(\log 1 - \mathsf{fma}\left(1, y, \frac{y}{1} \cdot \left(\frac{y}{1} \cdot \frac{1}{2}\right)\right), z - 1, \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), \left(x - 1\right) + \left(x - 1\right), \left(x - 1\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{y}}\right) + \left(\left(x - 1\right) + \left(x - 1\right)\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{y}}\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))