\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:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{elif}\;t_1 \leq 6.4431370762226415 \cdot 10^{+211}:\\
\;\;\;\;\frac{x}{t_1}\\
\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
(let* ((t_1 (* (- y z) (- t z))))
(if (<= t_1 (- INFINITY))
(/ (/ x (- y z)) (- t z))
(if (<= t_1 6.4431370762226415e+211)
(/ x t_1)
(/ (/ 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 t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / (y - z)) / (t - z);
} else if (t_1 <= 6.4431370762226415e+211) {
tmp = x / t_1;
} 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.3 |
|---|---|
| Target | 8.0 |
| Herbie | 0.7 |
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 21.5
Applied associate-/r*_binary640.1
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 6.4431370762226415e211Initial program 1.1
if 6.4431370762226415e211 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 12.2
Applied add-cube-cbrt_binary6412.4
Applied times-frac_binary640.5
Applied associate-*l/_binary640.6
Simplified0.2
Final simplification0.7
herbie shell --seed 2022068
(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))))