\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \le -1.22042495711387302 \cdot 10^{-264}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{elif}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \le 7.9176643066215467 \cdot 10^{-227}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{1}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - 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 ((((double) (x / ((double) (((double) (y - z)) * ((double) (t - z)))))) <= -1.220424957113873e-264)) {
VAR = ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
} else {
double VAR_1;
if ((((double) (x / ((double) (((double) (y - z)) * ((double) (t - z)))))) <= 7.917664306621547e-227)) {
VAR_1 = ((double) (((double) (x / ((double) (y - z)))) * ((double) (1.0 / ((double) (t - z))))));
} else {
VAR_1 = ((double) (((double) (x / ((double) (t - z)))) / ((double) (y - z))));
}
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 | 1.6 |
if (/ x (* (- y z) (- t z))) < -1.22042495711387302e-264Initial program 1.7
if -1.22042495711387302e-264 < (/ x (* (- y z) (- t z))) < 7.9176643066215467e-227Initial program 12.2
rmApplied *-un-lft-identity12.2
Applied times-frac0.9
rmApplied div-inv0.9
Applied associate-*r*0.9
Simplified0.8
if 7.9176643066215467e-227 < (/ x (* (- y z) (- t z))) Initial program 1.6
rmApplied *-un-lft-identity1.6
Applied times-frac3.7
rmApplied associate-*l/3.6
Simplified3.6
Final simplification1.6
herbie shell --seed 2020179
(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))))