\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) = -\infty:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \le 2.37517183699055636 \cdot 10^{168}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\end{array}double code(double x, double y, double z, double t) {
return (x / ((y - z) * (t - z)));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((y - z) * (t - z)) <= -inf.0)) {
VAR = ((x / (t - z)) / (y - z));
} else {
double VAR_1;
if ((((y - z) * (t - z)) <= 2.3751718369905564e+168)) {
VAR_1 = (x / ((t - z) * (y - z)));
} else {
VAR_1 = ((x / (y - z)) / (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.3 |
|---|---|
| Target | 8.2 |
| Herbie | 0.7 |
if (* (- y z) (- t z)) < -inf.0Initial program 21.5
rmApplied *-commutative21.5
Applied associate-/r*0.1
if -inf.0 < (* (- y z) (- t z)) < 2.3751718369905564e+168Initial program 1.3
rmApplied *-commutative1.3
if 2.3751718369905564e+168 < (* (- y z) (- t z)) Initial program 10.6
rmApplied associate-/r*0.3
Final simplification0.7
herbie shell --seed 2020071 +o rules:numerics
(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 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))