\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -6.6664760713058218 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{elif}\;y \le 6.6284321389326275 \cdot 10^{-176}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\frac{x}{y} \cdot z + \frac{x}{y} \cdot \left(-t\right)\right) + t\\
\end{array}double code(double x, double y, double z, double t) {
return (((x / y) * (z - t)) + t);
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -6.666476071305822e-68)) {
VAR = ((x * ((z - t) / y)) + t);
} else {
double VAR_1;
if ((y <= 6.628432138932628e-176)) {
VAR_1 = (((1.0 / (cbrt(y) * cbrt(y))) * ((x / cbrt(y)) * (z - t))) + t);
} else {
VAR_1 = ((((x / y) * z) + ((x / y) * -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 | 2.1 |
|---|---|
| Target | 2.3 |
| Herbie | 1.7 |
if y < -6.666476071305822e-68Initial program 1.4
rmApplied div-inv1.4
Applied associate-*l*1.5
Simplified1.4
if -6.666476071305822e-68 < y < 6.628432138932628e-176Initial program 5.1
rmApplied add-cube-cbrt6.0
Applied *-un-lft-identity6.0
Applied times-frac6.0
Applied associate-*l*2.7
if 6.628432138932628e-176 < y Initial program 1.4
rmApplied sub-neg1.4
Applied distribute-lft-in1.4
Final simplification1.7
herbie shell --seed 2020078
(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))