\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;y \le -2.348356340171026 \cdot 10^{-179} \lor \neg \left(y \le 3.32990979763597977 \cdot 10^{240}\right):\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(y - z\right) \cdot \frac{t - z}{x}}\\
\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 (((y <= -2.348356340171026e-179) || !(y <= 3.3299097976359798e+240))) {
VAR = ((double) (((double) (x / ((double) (y - z)))) / ((double) (t - z))));
} else {
VAR = ((double) (1.0 / ((double) (((double) (y - z)) * ((double) (((double) (t - z)) / x))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.7 |
|---|---|
| Target | 8.3 |
| Herbie | 2.5 |
if y < -2.348356340171026e-179 or 3.32990979763597977e240 < y Initial program 8.2
rmApplied associate-/r*2.0
if -2.348356340171026e-179 < y < 3.32990979763597977e240Initial program 7.3
rmApplied associate-/r*2.3
rmApplied clear-num2.7
Simplified2.8
Final simplification2.5
herbie shell --seed 2020185
(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))))