Average Error: 6.7 → 0.4
Time: 25.7s
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(x - 1, \log y, 0.5 \cdot {y}^{2} - \mathsf{fma}\left(1, z \cdot y, 0.5 \cdot \left(z \cdot {y}^{2}\right)\right)\right) - t\]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(x - 1, \log y, 0.5 \cdot {y}^{2} - \mathsf{fma}\left(1, z \cdot y, 0.5 \cdot \left(z \cdot {y}^{2}\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r53490 = x;
        double r53491 = 1.0;
        double r53492 = r53490 - r53491;
        double r53493 = y;
        double r53494 = log(r53493);
        double r53495 = r53492 * r53494;
        double r53496 = z;
        double r53497 = r53496 - r53491;
        double r53498 = r53491 - r53493;
        double r53499 = log(r53498);
        double r53500 = r53497 * r53499;
        double r53501 = r53495 + r53500;
        double r53502 = t;
        double r53503 = r53501 - r53502;
        return r53503;
}

double f(double x, double y, double z, double t) {
        double r53504 = x;
        double r53505 = 1.0;
        double r53506 = r53504 - r53505;
        double r53507 = y;
        double r53508 = log(r53507);
        double r53509 = 0.5;
        double r53510 = 2.0;
        double r53511 = pow(r53507, r53510);
        double r53512 = r53509 * r53511;
        double r53513 = z;
        double r53514 = r53513 * r53507;
        double r53515 = r53513 * r53511;
        double r53516 = r53509 * r53515;
        double r53517 = fma(r53505, r53514, r53516);
        double r53518 = r53512 - r53517;
        double r53519 = fma(r53506, r53508, r53518);
        double r53520 = t;
        double r53521 = r53519 - r53520;
        return r53521;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 6.7

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t}\]
  3. Taylor expanded around 0 0.3

    \[\leadsto \mathsf{fma}\left(x - 1, \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\]
  4. Simplified0.3

    \[\leadsto \mathsf{fma}\left(x - 1, \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\]
  5. Taylor expanded around inf 0.4

    \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{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\]
  6. Simplified0.4

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

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

Reproduce

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