Average Error: 7.0 → 0.5
Time: 32.8s
Precision: 64
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\right) + \mathsf{fma}\left(x - 1, \sqrt[3]{{\left(\log \left(\sqrt{y}\right)\right)}^{3}}, \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\]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\right) + \mathsf{fma}\left(x - 1, \sqrt[3]{{\left(\log \left(\sqrt{y}\right)\right)}^{3}}, \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
double f(double x, double y, double z, double t) {
        double r55146 = x;
        double r55147 = 1.0;
        double r55148 = r55146 - r55147;
        double r55149 = y;
        double r55150 = log(r55149);
        double r55151 = r55148 * r55150;
        double r55152 = z;
        double r55153 = r55152 - r55147;
        double r55154 = r55147 - r55149;
        double r55155 = log(r55154);
        double r55156 = r55153 * r55155;
        double r55157 = r55151 + r55156;
        double r55158 = t;
        double r55159 = r55157 - r55158;
        return r55159;
}

double f(double x, double y, double z, double t) {
        double r55160 = y;
        double r55161 = sqrt(r55160);
        double r55162 = log(r55161);
        double r55163 = x;
        double r55164 = 1.0;
        double r55165 = r55163 - r55164;
        double r55166 = r55162 * r55165;
        double r55167 = 3.0;
        double r55168 = pow(r55162, r55167);
        double r55169 = cbrt(r55168);
        double r55170 = z;
        double r55171 = r55170 - r55164;
        double r55172 = log(r55164);
        double r55173 = 0.5;
        double r55174 = 2.0;
        double r55175 = pow(r55160, r55174);
        double r55176 = pow(r55164, r55174);
        double r55177 = r55175 / r55176;
        double r55178 = r55173 * r55177;
        double r55179 = fma(r55164, r55160, r55178);
        double r55180 = r55172 - r55179;
        double r55181 = r55171 * r55180;
        double r55182 = fma(r55165, r55169, r55181);
        double r55183 = r55166 + r55182;
        double r55184 = t;
        double r55185 = r55183 - r55184;
        return r55185;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 7.0

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log \color{blue}{\left(\sqrt{y} \cdot \sqrt{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.4

    \[\leadsto \left(\left(x - 1\right) \cdot \color{blue}{\left(\log \left(\sqrt{y}\right) + \log \left(\sqrt{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-rgt-in0.4

    \[\leadsto \left(\color{blue}{\left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\right) + \log \left(\sqrt{y}\right) \cdot \left(x - 1\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.4

    \[\leadsto \color{blue}{\left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\right) + \left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\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.4

    \[\leadsto \left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\right) + \color{blue}{\mathsf{fma}\left(x - 1, \log \left(\sqrt{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\]
  10. Using strategy rm
  11. Applied add-cbrt-cube0.4

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

    \[\leadsto \left(\log \left(\sqrt{y}\right) \cdot \left(x - 1\right) + \mathsf{fma}\left(x - 1, \sqrt[3]{\color{blue}{{\left(\log \left(\sqrt{y}\right)\right)}^{3}}}, \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\]
  13. Final simplification0.5

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

Reproduce

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