\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;z \leq -2.6932216824551583 \cdot 10^{-91}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\
\mathbf{elif}\;z \leq -8.92551241015119 \cdot 10^{-218}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
(FPCore (x y z t)
:precision binary64
(if (<= z -2.6932216824551583e-91)
(* (/ 1.0 (- y z)) (/ x (- t z)))
(if (<= z -8.92551241015119e-218)
(/ x (* (- y z) (- t z)))
(/ (/ x (- y z)) (- t z)))))double code(double x, double y, double z, double t) {
return (x / ((double) (((double) (y - z)) * ((double) (t - z)))));
}
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.6932216824551583e-91)) {
tmp = ((double) ((1.0 / ((double) (y - z))) * (x / ((double) (t - z)))));
} else {
double tmp_1;
if ((z <= -8.92551241015119e-218)) {
tmp_1 = (x / ((double) (((double) (y - z)) * ((double) (t - z)))));
} else {
tmp_1 = ((x / ((double) (y - z))) / ((double) (t - z)));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.2 |
|---|---|
| Target | 8.0 |
| Herbie | 2.0 |
if z < -2.6932216824551583e-91Initial program Error: 7.9 bits
rmApplied *-un-lft-identityError: 7.9 bits
Applied times-fracError: 0.6 bits
if -2.6932216824551583e-91 < z < -8.9255124101511899e-218Initial program Error: 3.7 bits
if -8.9255124101511899e-218 < z Initial program Error: 7.3 bits
rmApplied associate-/r*Error: 2.7 bits
Final simplificationError: 2.0 bits
herbie shell --seed 2020204
(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))))