Average Error: 7.0 → 0.4
Time: 32.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(\log 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \log y \cdot \left(x - 1\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 1 - \mathsf{fma}\left(y, 1, \left(\frac{y}{1} \cdot \frac{y}{1}\right) \cdot \frac{1}{2}\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)
double f(double x, double y, double z, double t) {
        double r1845053 = x;
        double r1845054 = 1.0;
        double r1845055 = r1845053 - r1845054;
        double r1845056 = y;
        double r1845057 = log(r1845056);
        double r1845058 = r1845055 * r1845057;
        double r1845059 = z;
        double r1845060 = r1845059 - r1845054;
        double r1845061 = r1845054 - r1845056;
        double r1845062 = log(r1845061);
        double r1845063 = r1845060 * r1845062;
        double r1845064 = r1845058 + r1845063;
        double r1845065 = t;
        double r1845066 = r1845064 - r1845065;
        return r1845066;
}

double f(double x, double y, double z, double t) {
        double r1845067 = 1.0;
        double r1845068 = log(r1845067);
        double r1845069 = y;
        double r1845070 = r1845069 / r1845067;
        double r1845071 = r1845070 * r1845070;
        double r1845072 = 0.5;
        double r1845073 = r1845071 * r1845072;
        double r1845074 = fma(r1845069, r1845067, r1845073);
        double r1845075 = r1845068 - r1845074;
        double r1845076 = z;
        double r1845077 = r1845076 - r1845067;
        double r1845078 = log(r1845069);
        double r1845079 = x;
        double r1845080 = r1845079 - r1845067;
        double r1845081 = r1845078 * r1845080;
        double r1845082 = t;
        double r1845083 = r1845081 - r1845082;
        double r1845084 = fma(r1845075, r1845077, r1845083);
        return r1845084;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 7.0

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

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

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

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

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

Reproduce

herbie shell --seed 2019170 +o rules:numerics
(FPCore (x y z t)
  :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
  (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))