Average Error: 6.6 → 0.4
Time: 7.1s
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, \mathsf{fma}\left(0.5, {y}^{2}, -\mathsf{fma}\left(1, z \cdot y, 0.5 \cdot \left(z \cdot {y}^{2}\right)\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, \mathsf{fma}\left(0.5, {y}^{2}, -\mathsf{fma}\left(1, z \cdot y, 0.5 \cdot \left(z \cdot {y}^{2}\right)\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r55487 = x;
        double r55488 = 1.0;
        double r55489 = r55487 - r55488;
        double r55490 = y;
        double r55491 = log(r55490);
        double r55492 = r55489 * r55491;
        double r55493 = z;
        double r55494 = r55493 - r55488;
        double r55495 = r55488 - r55490;
        double r55496 = log(r55495);
        double r55497 = r55494 * r55496;
        double r55498 = r55492 + r55497;
        double r55499 = t;
        double r55500 = r55498 - r55499;
        return r55500;
}

double f(double x, double y, double z, double t) {
        double r55501 = y;
        double r55502 = log(r55501);
        double r55503 = x;
        double r55504 = 1.0;
        double r55505 = r55503 - r55504;
        double r55506 = 0.5;
        double r55507 = 2.0;
        double r55508 = pow(r55501, r55507);
        double r55509 = z;
        double r55510 = r55509 * r55501;
        double r55511 = r55509 * r55508;
        double r55512 = r55506 * r55511;
        double r55513 = fma(r55504, r55510, r55512);
        double r55514 = -r55513;
        double r55515 = fma(r55506, r55508, r55514);
        double r55516 = t;
        double r55517 = r55515 - r55516;
        double r55518 = fma(r55502, r55505, r55517);
        return r55518;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 6.6

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

    \[\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. Taylor expanded around inf 0.4

    \[\leadsto \mathsf{fma}\left(\log y, x - 1, \color{blue}{\left(0.5 \cdot {y}^{2} - \left(1 \cdot \left(z \cdot y\right) + 0.5 \cdot \left(z \cdot {y}^{2}\right)\right)\right)} - t\right)\]
  5. Simplified0.4

    \[\leadsto \mathsf{fma}\left(\log y, x - 1, \color{blue}{\mathsf{fma}\left(0.5, {y}^{2}, -\mathsf{fma}\left(1, z \cdot y, 0.5 \cdot \left(z \cdot {y}^{2}\right)\right)\right)} - t\right)\]
  6. Final simplification0.4

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

Reproduce

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