\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;z \le -1.53942855774014694 \cdot 10^{-231} \lor \neg \left(z \le 1.26605542767374955 \cdot 10^{-209}\right):\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{1}{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 (((z <= -1.539428557740147e-231) || !(z <= 1.2660554276737495e-209))) {
VAR = ((double) (((double) (1.0 / ((double) (y - z)))) * ((double) (x / ((double) (t - z))))));
} else {
VAR = ((double) (((double) (x / ((double) (y - z)))) * ((double) (1.0 / ((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 | 8.2 |
| Herbie | 2.3 |
if z < -1.53942855774014694e-231 or 1.26605542767374955e-209 < z Initial program 7.5
rmApplied *-un-lft-identity7.5
Applied times-frac1.6
if -1.53942855774014694e-231 < z < 1.26605542767374955e-209Initial program 5.4
rmApplied *-un-lft-identity5.4
Applied times-frac6.6
rmApplied div-inv6.7
Applied associate-*r*7.6
Simplified7.6
Final simplification2.3
herbie shell --seed 2020184
(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))))