Average Error: 7.2 → 0.7
Time: 22.2s
Precision: 64
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
\[\log y \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -1 \cdot 1\right) + \mathsf{fma}\left(\mathsf{fma}\left(-1, 1, 1\right), \log y, \left(z - 1\right) \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\log y \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -1 \cdot 1\right) + \mathsf{fma}\left(\mathsf{fma}\left(-1, 1, 1\right), \log y, \left(z - 1\right) \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r147 = x;
        double r148 = 1.0;
        double r149 = r147 - r148;
        double r150 = y;
        double r151 = log(r150);
        double r152 = r149 * r151;
        double r153 = z;
        double r154 = r153 - r148;
        double r155 = r148 - r150;
        double r156 = log(r155);
        double r157 = r154 * r156;
        double r158 = r152 + r157;
        double r159 = t;
        double r160 = r158 - r159;
        return r160;
}

double f(double x, double y, double z, double t) {
        double r161 = y;
        double r162 = log(r161);
        double r163 = x;
        double r164 = cbrt(r163);
        double r165 = r164 * r164;
        double r166 = 1.0;
        double r167 = 1.0;
        double r168 = r166 * r167;
        double r169 = -r168;
        double r170 = fma(r165, r164, r169);
        double r171 = r162 * r170;
        double r172 = -r166;
        double r173 = fma(r172, r167, r166);
        double r174 = z;
        double r175 = r174 - r166;
        double r176 = log(r166);
        double r177 = r166 * r161;
        double r178 = 0.5;
        double r179 = 2.0;
        double r180 = pow(r161, r179);
        double r181 = pow(r166, r179);
        double r182 = r180 / r181;
        double r183 = r178 * r182;
        double r184 = r177 + r183;
        double r185 = r176 - r184;
        double r186 = r175 * r185;
        double r187 = t;
        double r188 = r186 - r187;
        double r189 = fma(r173, r162, r188);
        double r190 = r171 + r189;
        return r190;
}

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 y, x - 1, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)}\]
  3. Taylor expanded around 0 0.4

    \[\leadsto \mathsf{fma}\left(\log y, x - 1, \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)} - t\right)\]
  4. Using strategy rm
  5. Applied fma-udef0.4

    \[\leadsto \color{blue}{\log y \cdot \left(x - 1\right) + \left(\left(z - 1\right) \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.4

    \[\leadsto \log y \cdot \left(x - \color{blue}{1 \cdot 1}\right) + \left(\left(z - 1\right) \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
  8. Applied add-cube-cbrt0.7

    \[\leadsto \log y \cdot \left(\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} - 1 \cdot 1\right) + \left(\left(z - 1\right) \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
  9. Applied prod-diff0.7

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

    \[\leadsto \color{blue}{\left(\log y \cdot \mathsf{fma}\left(\sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x}, -1 \cdot 1\right) + \log y \cdot \mathsf{fma}\left(-1, 1, 1 \cdot 1\right)\right)} + \left(\left(z - 1\right) \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
  11. Applied associate-+l+0.7

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

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

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

Reproduce

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