Average Error: 6.7 → 0.3
Time: 10.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, \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 r74132 = x;
        double r74133 = 1.0;
        double r74134 = r74132 - r74133;
        double r74135 = y;
        double r74136 = log(r74135);
        double r74137 = r74134 * r74136;
        double r74138 = z;
        double r74139 = r74138 - r74133;
        double r74140 = r74133 - r74135;
        double r74141 = log(r74140);
        double r74142 = r74139 * r74141;
        double r74143 = r74137 + r74142;
        double r74144 = t;
        double r74145 = r74143 - r74144;
        return r74145;
}

double f(double x, double y, double z, double t) {
        double r74146 = y;
        double r74147 = log(r74146);
        double r74148 = x;
        double r74149 = 1.0;
        double r74150 = r74148 - r74149;
        double r74151 = z;
        double r74152 = r74151 - r74149;
        double r74153 = log(r74149);
        double r74154 = r74149 * r74146;
        double r74155 = 0.5;
        double r74156 = 2.0;
        double r74157 = pow(r74146, r74156);
        double r74158 = pow(r74149, r74156);
        double r74159 = r74157 / r74158;
        double r74160 = r74155 * r74159;
        double r74161 = r74154 + r74160;
        double r74162 = r74153 - r74161;
        double r74163 = r74152 * r74162;
        double r74164 = t;
        double r74165 = r74163 - r74164;
        double r74166 = fma(r74147, r74150, r74165);
        return r74166;
}

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(\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 2020020 +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))