\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \le -1.22693690139242306 \cdot 10^{139} \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 7.6884888330617321 \cdot 10^{302}\right):\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (((double) (y - z)) * ((double) (t - z)))) <= -1.226936901392423e+139) || !(((double) (((double) (y - z)) * ((double) (t - z)))) <= 7.688488833061732e+302))) {
VAR = ((double) (((double) (x / ((double) (y - z)))) / ((double) (t - z))));
} else {
VAR = ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.2 |
|---|---|
| Target | 7.9 |
| Herbie | 0.8 |
if (* (- y z) (- t z)) < -1.226936901392423e+139 or 7.688488833061732e+302 < (* (- y z) (- t z)) Initial program 13.2
rmApplied associate-/r*0.6
if -1.226936901392423e+139 < (* (- y z) (- t z)) < 7.688488833061732e+302Initial program 1.1
Final simplification0.8
herbie shell --seed 2020124
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))