Average Error: 6.6 → 0.4
Time: 7.4s
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 r55741 = x;
        double r55742 = 1.0;
        double r55743 = r55741 - r55742;
        double r55744 = y;
        double r55745 = log(r55744);
        double r55746 = r55743 * r55745;
        double r55747 = z;
        double r55748 = r55747 - r55742;
        double r55749 = r55742 - r55744;
        double r55750 = log(r55749);
        double r55751 = r55748 * r55750;
        double r55752 = r55746 + r55751;
        double r55753 = t;
        double r55754 = r55752 - r55753;
        return r55754;
}

double f(double x, double y, double z, double t) {
        double r55755 = y;
        double r55756 = log(r55755);
        double r55757 = x;
        double r55758 = 1.0;
        double r55759 = r55757 - r55758;
        double r55760 = 0.5;
        double r55761 = 2.0;
        double r55762 = pow(r55755, r55761);
        double r55763 = z;
        double r55764 = r55763 * r55755;
        double r55765 = r55763 * r55762;
        double r55766 = r55760 * r55765;
        double r55767 = fma(r55758, r55764, r55766);
        double r55768 = -r55767;
        double r55769 = fma(r55760, r55762, r55768);
        double r55770 = t;
        double r55771 = r55769 - r55770;
        double r55772 = fma(r55756, r55759, r55771);
        return r55772;
}

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))