\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t_1 \leq -3.0511107772526236 \cdot 10^{-289}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 4.794012462935694 \cdot 10^{-258}:\\
\;\;\;\;\frac{1}{\frac{y - z}{\frac{x}{t - z}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - 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 (/ x (* (- y z) (- t z)))))
(if (<= t_1 -3.0511107772526236e-289)
t_1
(if (<= t_1 4.794012462935694e-258)
(/ 1.0 (/ (- y z) (/ x (- t z))))
(* (/ (* (cbrt x) (cbrt x)) (- y z)) (/ (cbrt x) (- 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 t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -3.0511107772526236e-289) {
tmp = t_1;
} else if (t_1 <= 4.794012462935694e-258) {
tmp = 1.0 / ((y - z) / (x / (t - z)));
} else {
tmp = ((cbrt(x) * cbrt(x)) / (y - z)) * (cbrt(x) / (t - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 7.4 |
| Herbie | 1.6 |
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -3.05111077725262363e-289Initial program 1.2
Applied *-un-lft-identity_binary641.2
Applied times-frac_binary644.1
Applied *-un-lft-identity_binary644.1
Applied associate-*l*_binary644.1
Simplified1.2
if -3.05111077725262363e-289 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < 4.7940124629356944e-258Initial program 11.8
Applied *-un-lft-identity_binary6411.8
Applied times-frac_binary640.6
Applied associate-*l/_binary640.6
Simplified0.6
Applied *-un-lft-identity_binary640.6
Applied *-un-lft-identity_binary640.6
Applied times-frac_binary640.6
Applied associate-/l*_binary641.5
if 4.7940124629356944e-258 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 1.3
Applied add-cube-cbrt_binary642.3
Applied times-frac_binary642.5
Final simplification1.6
herbie shell --seed 2022088
(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))))