Average Error: 7.0 → 1.1
Time: 7.8s
Precision: 64
\[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
\[\begin{array}{l} \mathbf{if}\;z - 1 \le -2.27131261465393877 \cdot 10^{110} \lor \neg \left(z - 1 \le 2.7111376646142364 \cdot 10^{104}\right):\\ \;\;\;\;\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \left(\log \left(\sqrt{1} + \sqrt{y}\right) + \log \left(\sqrt{1} - \sqrt{y}\right)\right) - t\right)\\ \end{array}\]
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\begin{array}{l}
\mathbf{if}\;z - 1 \le -2.27131261465393877 \cdot 10^{110} \lor \neg \left(z - 1 \le 2.7111376646142364 \cdot 10^{104}\right):\\
\;\;\;\;\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \left(\log \left(\sqrt{1} + \sqrt{y}\right) + \log \left(\sqrt{1} - \sqrt{y}\right)\right) - t\right)\\

\end{array}
double code(double x, double y, double z, double t) {
	return ((((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t);
}
double code(double x, double y, double z, double t) {
	double temp;
	if ((((z - 1.0) <= -2.2713126146539388e+110) || !((z - 1.0) <= 2.7111376646142364e+104))) {
		temp = ((cbrt(fma(log(y), (x - 1.0), (((z - 1.0) * (log(1.0) - ((1.0 * y) + (0.5 * (pow(y, 2.0) / pow(1.0, 2.0)))))) - t))) * cbrt(fma(log(y), (x - 1.0), (((z - 1.0) * (log(1.0) - ((1.0 * y) + (0.5 * (pow(y, 2.0) / pow(1.0, 2.0)))))) - t)))) * cbrt(fma(log(y), (x - 1.0), (((z - 1.0) * (log(1.0) - ((1.0 * y) + (0.5 * (pow(y, 2.0) / pow(1.0, 2.0)))))) - t))));
	} else {
		temp = fma(log(y), (x - 1.0), (((z - 1.0) * (log((sqrt(1.0) + sqrt(y))) + log((sqrt(1.0) - sqrt(y))))) - t));
	}
	return temp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (- z 1.0) < -2.2713126146539388e+110 or 2.7111376646142364e+104 < (- z 1.0)

    1. Initial program 19.7

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\]
    2. Simplified19.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.7

      \[\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. Using strategy rm
    5. Applied add-cube-cbrt1.8

      \[\leadsto \color{blue}{\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}}\]

    if -2.2713126146539388e+110 < (- z 1.0) < 2.7111376646142364e+104

    1. Initial program 0.9

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt0.9

      \[\leadsto \mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \log \left(1 - \color{blue}{\sqrt{y} \cdot \sqrt{y}}\right) - t\right)\]
    5. Applied add-sqr-sqrt0.9

      \[\leadsto \mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \log \left(\color{blue}{\sqrt{1} \cdot \sqrt{1}} - \sqrt{y} \cdot \sqrt{y}\right) - t\right)\]
    6. Applied difference-of-squares0.9

      \[\leadsto \mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \log \color{blue}{\left(\left(\sqrt{1} + \sqrt{y}\right) \cdot \left(\sqrt{1} - \sqrt{y}\right)\right)} - t\right)\]
    7. Applied log-prod0.8

      \[\leadsto \mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \color{blue}{\left(\log \left(\sqrt{1} + \sqrt{y}\right) + \log \left(\sqrt{1} - \sqrt{y}\right)\right)} - t\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;z - 1 \le -2.27131261465393877 \cdot 10^{110} \lor \neg \left(z - 1 \le 2.7111376646142364 \cdot 10^{104}\right):\\ \;\;\;\;\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, \left(z - 1\right) \cdot \left(\log \left(\sqrt{1} + \sqrt{y}\right) + \log \left(\sqrt{1} - \sqrt{y}\right)\right) - t\right)\\ \end{array}\]

Reproduce

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