\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 0:\\
\;\;\;\;\left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{y - z}\right) \cdot \frac{\sqrt[3]{x}}{t - z}\\
\mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \leq 2.931163622679604 \cdot 10^{+244}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}double code(double x, double y, double z, double t) {
return (x / ((double) (((double) (y - z)) * ((double) (t - z)))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (((double) (y - z)) * ((double) (t - z)))) <= 0.0)) {
VAR = ((double) (((double) (((double) cbrt(x)) * (((double) cbrt(x)) / ((double) (y - z))))) * (((double) cbrt(x)) / ((double) (t - z)))));
} else {
double VAR_1;
if ((((double) (((double) (y - z)) * ((double) (t - z)))) <= 2.931163622679604e+244)) {
VAR_1 = (x / ((double) (((double) (y - z)) * ((double) (t - z)))));
} else {
VAR_1 = ((x / ((double) (t - z))) / ((double) (y - z)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.5 |
|---|---|
| Target | 8.1 |
| Herbie | 0.9 |
if (* (- y z) (- t z)) < 0.0Initial program 7.9
rmApplied add-cube-cbrt8.5
Applied times-frac2.2
Simplified2.2
if 0.0 < (* (- y z) (- t z)) < 2.93116362267960373e244Initial program 0.3
if 2.93116362267960373e244 < (* (- y z) (- t z)) Initial program 12.9
rmApplied add-cube-cbrt13.0
Applied times-frac0.4
Simplified0.4
rmApplied associate-*r/0.4
Applied associate-*l/0.5
Simplified0.1
Final simplification0.9
herbie shell --seed 2020199
(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))))