\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;z \le -6.2234270145344795 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{elif}\;z \le 5.02895661975026341 \cdot 10^{-230}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{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 temp;
if ((z <= -6.22342701453448e-113)) {
temp = ((x / (y - z)) / (t - z));
} else {
double temp_1;
if ((z <= 5.028956619750263e-230)) {
temp_1 = (x / ((y - z) * (t - z)));
} else {
temp_1 = ((1.0 / (y - z)) * (x / (t - z)));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.5 |
|---|---|
| Target | 8.2 |
| Herbie | 2.0 |
if z < -6.22342701453448e-113Initial program 8.8
rmApplied associate-/r*0.6
if -6.22342701453448e-113 < z < 5.028956619750263e-230Initial program 5.4
if 5.028956619750263e-230 < z Initial program 7.5
rmApplied *-un-lft-identity7.5
Applied times-frac1.6
Final simplification2.0
herbie shell --seed 2020049 +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))))