\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2.5677992260524592 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_1}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2.5677992260524592e+68)))
(/ (/ x (- t z)) (- y z))
(/ x t_1))))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 t_1 = (y - z) * (t - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2.5677992260524592e+68)) {
tmp = (x / (t - z)) / (y - z);
} else {
tmp = x / t_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 7.9 |
| Herbie | 1.0 |
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0 or 2.56779922605245925e68 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 11.0
Applied *-un-lft-identity_binary6411.0
Applied times-frac_binary640.6
Applied associate-*l/_binary640.6
Simplified0.6
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.56779922605245925e68Initial program 1.7
Applied *-un-lft-identity_binary641.7
Applied times-frac_binary643.5
Applied *-un-lft-identity_binary643.5
Applied *-un-lft-identity_binary643.5
Applied times-frac_binary643.5
Applied associate-*l*_binary643.5
Simplified1.7
Final simplification1.0
herbie shell --seed 2022067
(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))))