\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;t \leq -2.1355344036848286 \cdot 10^{-139}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{elif}\;t \leq 1.6280989697092715 \cdot 10^{+131}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(t - z\right) \cdot \frac{y - z}{x}}\\
\end{array}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 VAR;
if ((t <= -2.1355344036848286e-139)) {
VAR = ((x / ((double) (y - z))) / ((double) (t - z)));
} else {
double VAR_1;
if ((t <= 1.6280989697092715e+131)) {
VAR_1 = ((double) ((1.0 / ((double) (y - z))) * (x / ((double) (t - z)))));
} else {
VAR_1 = (1.0 / ((double) (((double) (t - z)) * (((double) (y - z)) / x))));
}
VAR = VAR_1;
}
return VAR;
}




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.3 |
if t < -2.1355344036848286e-139Initial program 7.4
rmApplied associate-/r*1.9
if -2.1355344036848286e-139 < t < 1.628098969709271e131Initial program 6.7
rmApplied *-un-lft-identity6.7
Applied times-frac2.3
if 1.628098969709271e131 < t Initial program 10.9
rmApplied clear-num11.1
Simplified3.2
Final simplification2.3
herbie shell --seed 2020196
(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))))