\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;x \le 3.72607650680194631 \cdot 10^{192}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt{1}}{y - z}}{\frac{t - z}{x}}\\
\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 ((x <= 3.7260765068019463e+192)) {
temp = ((x / (y - z)) / (t - z));
} else {
temp = ((sqrt(1.0) / (y - z)) / ((t - z) / x));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.6 |
|---|---|
| Target | 8.4 |
| Herbie | 2.1 |
if x < 3.7260765068019463e+192Initial program 5.8
rmApplied associate-/r*1.9
if 3.7260765068019463e+192 < x Initial program 25.7
rmApplied associate-/r*4.2
rmApplied clear-num4.3
rmApplied div-inv4.4
Applied add-sqr-sqrt4.4
Applied times-frac4.4
Applied associate-/l*4.7
Simplified4.6
Final simplification2.1
herbie shell --seed 2020058
(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))))