Average Error: 7.1 → 0.3
Time: 14.3s
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 y, x - 1, \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
\mathsf{fma}\left(\log y, x - 1, \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 r77436 = x;
        double r77437 = 1.0;
        double r77438 = r77436 - r77437;
        double r77439 = y;
        double r77440 = log(r77439);
        double r77441 = r77438 * r77440;
        double r77442 = z;
        double r77443 = r77442 - r77437;
        double r77444 = r77437 - r77439;
        double r77445 = log(r77444);
        double r77446 = r77443 * r77445;
        double r77447 = r77441 + r77446;
        double r77448 = t;
        double r77449 = r77447 - r77448;
        return r77449;
}

double f(double x, double y, double z, double t) {
        double r77450 = y;
        double r77451 = log(r77450);
        double r77452 = x;
        double r77453 = 1.0;
        double r77454 = r77452 - r77453;
        double r77455 = z;
        double r77456 = r77455 - r77453;
        double r77457 = log(r77453);
        double r77458 = r77453 * r77450;
        double r77459 = 0.5;
        double r77460 = 2.0;
        double r77461 = pow(r77450, r77460);
        double r77462 = pow(r77453, r77460);
        double r77463 = r77461 / r77462;
        double r77464 = r77459 * r77463;
        double r77465 = r77458 + r77464;
        double r77466 = r77457 - r77465;
        double r77467 = r77456 * r77466;
        double r77468 = t;
        double r77469 = r77467 - r77468;
        double r77470 = fma(r77451, r77454, r77469);
        return r77470;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 7.1

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
  2. Simplified7.1

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

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

    \[\leadsto \mathsf{fma}\left(\log y, x - 1, \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 2020024 +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))