\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;x \leq -2.0212189911353896 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
(FPCore (x y z t) :precision binary64 (if (<= x -2.0212189911353896e-50) (/ (/ x (- y z)) (- t z)) (/ (/ x (- t z)) (- y 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 (x <= -2.0212189911353896e-50) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 7.8 |
| Herbie | 2.0 |
if x < -2.0212189911353896e-50Initial program 11.6
Applied egg-rr2.3
Applied egg-rr2.0
if -2.0212189911353896e-50 < x Initial program 5.3
Applied egg-rr2.0
Applied egg-rr2.0
Final simplification2.0
herbie shell --seed 2022130
(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))))