\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \leq -1.2385715054473501 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \leq 3.062538086453629 \cdot 10^{+147}:\\
\;\;\;\;\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 (<= (* (- y z) (- t z)) -1.2385715054473501e+305)
(/ (/ x (- t z)) (- y z))
(if (<= (* (- y z) (- t z)) 3.062538086453629e+147)
(/ x (* (- y z) (- t z)))
(/ (/ x (- y z)) (- t z)))))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 tmp;
if (((y - z) * (t - z)) <= -1.2385715054473501e+305) {
tmp = (x / (t - z)) / (y - z);
} else if (((y - z) * (t - z)) <= 3.062538086453629e+147) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / (y - z)) / (t - z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.2 |
|---|---|
| Target | 7.9 |
| Herbie | 0.9 |
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.2385715054473501e305Initial program 18.7
rmApplied add-cube-cbrt_binary64_1920918.7
Applied times-frac_binary64_191800.4
rmApplied associate-*l/_binary64_191170.4
Simplified0.1
if -1.2385715054473501e305 < (*.f64 (-.f64 y z) (-.f64 t z)) < 3.0625380864536291e147Initial program 1.4
if 3.0625380864536291e147 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 10.1
rmApplied associate-/r*_binary64_191180.5
Final simplification0.9
herbie shell --seed 2021093
(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))))