\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -1.8415800691353711 \cdot 10^{-151}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{elif}\;y \le 3.5907182236266797 \cdot 10^{-229}:\\
\;\;\;\;\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(\frac{x}{\sqrt[3]{y}} \cdot \left(z - t\right)\right) + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -1.841580069135371e-151)) {
VAR = ((double) (((double) (x * ((double) (((double) (z - t)) / y)))) + t));
} else {
double VAR_1;
if ((y <= 3.59071822362668e-229)) {
VAR_1 = ((double) (((double) (((double) (1.0 / ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * ((double) (((double) (x / ((double) cbrt(y)))) * ((double) (z - t)))))) + t));
} else {
VAR_1 = ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.2 |
| Herbie | 2.2 |
if y < -1.8415800691353711e-151Initial program 1.6
rmApplied div-inv1.6
Applied associate-*l*3.1
Simplified3.0
if -1.8415800691353711e-151 < y < 3.5907182236266797e-229Initial program 5.9
rmApplied add-cube-cbrt6.8
Applied *-un-lft-identity6.8
Applied times-frac6.8
Applied associate-*l*3.1
if 3.5907182236266797e-229 < y Initial program 1.3
Final simplification2.2
herbie shell --seed 2020163
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))