\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 -5.677687246889938 \cdot 10^{175} \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 1.11107988507083972 \cdot 10^{86}\right):\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\left(y - z\right) \cdot \left(t - z\right)}{x}}\\
\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)))) <= -5.6776872468899376e+175) || !(((double) (((double) (y - z)) * ((double) (t - z)))) <= 1.1110798850708397e+86))) {
VAR = ((double) (((double) (x / ((double) (y - z)))) / ((double) (t - z))));
} else {
VAR = ((double) (1.0 / ((double) (((double) (((double) (y - z)) * ((double) (t - z)))) / x))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.1 |
|---|---|
| Target | 7.9 |
| Herbie | 1.0 |
if (* (- y z) (- t z)) < -5.677687246889938e175 or 1.11107988507083972e86 < (* (- y z) (- t z)) Initial program 9.6
rmApplied associate-/r*0.5
if -5.677687246889938e175 < (* (- y z) (- t z)) < 1.11107988507083972e86Initial program 1.5
rmApplied clear-num2.0
Final simplification1.0
herbie shell --seed 2020162
(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))))