Average Error: 6.9 → 0.4
Time: 31.9s
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, \mathsf{fma}\left(x - 1.0, \log \left({y}^{\frac{2}{3}}\right), \left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)\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, \mathsf{fma}\left(x - 1.0, \log \left({y}^{\frac{2}{3}}\right), \left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)\right)
double f(double x, double y, double z, double t) {
        double r1865084 = x;
        double r1865085 = 1.0;
        double r1865086 = r1865084 - r1865085;
        double r1865087 = y;
        double r1865088 = log(r1865087);
        double r1865089 = r1865086 * r1865088;
        double r1865090 = z;
        double r1865091 = r1865090 - r1865085;
        double r1865092 = r1865085 - r1865087;
        double r1865093 = log(r1865092);
        double r1865094 = r1865091 * r1865093;
        double r1865095 = r1865089 + r1865094;
        double r1865096 = t;
        double r1865097 = r1865095 - r1865096;
        return r1865097;
}

double f(double x, double y, double z, double t) {
        double r1865098 = 1.0;
        double r1865099 = log(r1865098);
        double r1865100 = 0.5;
        double r1865101 = y;
        double r1865102 = r1865101 / r1865098;
        double r1865103 = r1865102 * r1865102;
        double r1865104 = r1865101 * r1865098;
        double r1865105 = fma(r1865100, r1865103, r1865104);
        double r1865106 = r1865099 - r1865105;
        double r1865107 = z;
        double r1865108 = r1865107 - r1865098;
        double r1865109 = x;
        double r1865110 = r1865109 - r1865098;
        double r1865111 = 0.6666666666666666;
        double r1865112 = pow(r1865101, r1865111);
        double r1865113 = log(r1865112);
        double r1865114 = cbrt(r1865101);
        double r1865115 = log(r1865114);
        double r1865116 = r1865110 * r1865115;
        double r1865117 = t;
        double r1865118 = r1865116 - r1865117;
        double r1865119 = fma(r1865110, r1865113, r1865118);
        double r1865120 = fma(r1865106, r1865108, r1865119);
        return r1865120;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 6.9

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

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

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

    \[\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.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 \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.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, \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. Applied associate--l+0.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, \color{blue}{\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)}\right)\]
  10. Using strategy rm
  11. Applied pow1/30.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 \left(\sqrt[3]{y} \cdot \color{blue}{{y}^{\frac{1}{3}}}\right) + \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)\right)\]
  12. Applied pow1/30.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 \left(\color{blue}{{y}^{\frac{1}{3}}} \cdot {y}^{\frac{1}{3}}\right) + \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)\right)\]
  13. Applied pow-prod-up0.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({y}^{\left(\frac{1}{3} + \frac{1}{3}\right)}\right)} + \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)\right)\]
  14. Simplified0.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 \left({y}^{\color{blue}{\frac{2}{3}}}\right) + \left(\left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)\right)\]
  15. Using strategy rm
  16. Applied fma-def0.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, \color{blue}{\mathsf{fma}\left(x - 1.0, \log \left({y}^{\frac{2}{3}}\right), \left(x - 1.0\right) \cdot \log \left(\sqrt[3]{y}\right) - t\right)}\right)\]
  17. Final simplification0.4

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

Reproduce

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