\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.7328829703332447 \cdot 10^{294}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 2.7572682904365426 \cdot 10^{272}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\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.7328829703332447e+294)) {
VAR = ((double) (((double) (x / ((double) (t - z)))) / ((double) (y - z))));
} else {
double VAR_1;
if ((((double) (((double) (y - z)) * ((double) (t - z)))) <= 2.7572682904365426e+272)) {
VAR_1 = ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
} else {
VAR_1 = ((double) (((double) (x / ((double) (y - z)))) / ((double) (t - z))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.5 |
|---|---|
| Target | 8.4 |
| Herbie | 0.7 |
if (* (- y z) (- t z)) < -1.7328829703332447e294Initial program 17.2
rmApplied *-un-lft-identity17.2
Applied times-frac0.1
rmApplied associate-*l/0.1
Simplified0.1
if -1.7328829703332447e294 < (* (- y z) (- t z)) < 2.7572682904365426e272Initial program 1.2
if 2.7572682904365426e272 < (* (- y z) (- t z)) Initial program 14.7
rmApplied associate-/r*0.1
Final simplification0.7
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))))