\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)\\
t_2 := \frac{\frac{x}{t - z}}{y - z}\\
\mathbf{if}\;t_1 \leq -5.30931023714603 \cdot 10^{+93}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 11.036884943702017:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{y - z}{\frac{\sqrt[3]{x}}{t - z}}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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))) (t_2 (/ (/ x (- t z)) (- y z))))
(if (<= t_1 -5.30931023714603e+93)
t_2
(if (<= t_1 11.036884943702017)
(/ (* (cbrt x) (cbrt x)) (/ (- y z) (/ (cbrt x) (- t z))))
t_2))))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 t_2 = (x / (t - z)) / (y - z);
double tmp;
if (t_1 <= -5.30931023714603e+93) {
tmp = t_2;
} else if (t_1 <= 11.036884943702017) {
tmp = (cbrt(x) * cbrt(x)) / ((y - z) / (cbrt(x) / (t - z)));
} else {
tmp = t_2;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.5 |
|---|---|
| Target | 8.1 |
| Herbie | 1.6 |
if (*.f64 (-.f64 y z) (-.f64 t z)) < -5.30931023714603034e93 or 11.036884943702017 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 8.6
Applied *-un-lft-identity_binary648.6
Applied times-frac_binary641.2
Applied associate-*l/_binary641.2
Simplified1.2
if -5.30931023714603034e93 < (*.f64 (-.f64 y z) (-.f64 t z)) < 11.036884943702017Initial program 3.3
Applied add-cube-cbrt_binary644.4
Applied associate-/l*_binary644.4
Simplified3.0
Final simplification1.6
herbie shell --seed 2022077
(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))))