\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 -\infty:\\
\;\;\;\;\frac{\frac{1}{\frac{y - z}{x}}}{t - z}\\
\mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \leq -5.327073748782111 \cdot 10^{-46}:\\
\;\;\;\;\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)) (- INFINITY))
(/ (/ 1.0 (/ (- y z) x)) (- t z))
(if (<= (* (- y z) (- t z)) -5.327073748782111e-46)
(/ 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)) <= -((double) INFINITY)) {
tmp = (1.0 / ((y - z) / x)) / (t - z);
} else if (((y - z) * (t - z)) <= -5.327073748782111e-46) {
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.4 |
|---|---|
| Target | 8.1 |
| Herbie | 1.2 |
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 20.3
rmApplied associate-/r*_binary64_198000.1
rmApplied clear-num_binary64_198550.1
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < -5.32707374878211139e-46Initial program 0.2
if -5.32707374878211139e-46 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 7.5
rmApplied associate-/r*_binary64_198001.6
Final simplification1.2
herbie shell --seed 2021069
(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))))