Average Error: 6.9 → 0.3
Time: 12.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 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 r67491 = x;
        double r67492 = 1.0;
        double r67493 = r67491 - r67492;
        double r67494 = y;
        double r67495 = log(r67494);
        double r67496 = r67493 * r67495;
        double r67497 = z;
        double r67498 = r67497 - r67492;
        double r67499 = r67492 - r67494;
        double r67500 = log(r67499);
        double r67501 = r67498 * r67500;
        double r67502 = r67496 + r67501;
        double r67503 = t;
        double r67504 = r67502 - r67503;
        return r67504;
}

double f(double x, double y, double z, double t) {
        double r67505 = y;
        double r67506 = log(r67505);
        double r67507 = x;
        double r67508 = 1.0;
        double r67509 = r67507 - r67508;
        double r67510 = z;
        double r67511 = r67510 - r67508;
        double r67512 = log(r67508);
        double r67513 = r67508 * r67505;
        double r67514 = 0.5;
        double r67515 = 2.0;
        double r67516 = pow(r67505, r67515);
        double r67517 = pow(r67508, r67515);
        double r67518 = r67516 / r67517;
        double r67519 = r67514 * r67518;
        double r67520 = r67513 + r67519;
        double r67521 = r67512 - r67520;
        double r67522 = r67511 * r67521;
        double r67523 = t;
        double r67524 = r67522 - r67523;
        double r67525 = fma(r67506, r67509, r67524);
        return r67525;
}

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

    \[\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 2020018 +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))