\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -1.54076295773237828 \cdot 10^{26} \lor \neg \left(y \le 3.6542658473411332 \cdot 10^{-81}\right):\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + 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 <= -1.5407629577323783e+26) || !(y <= 3.654265847341133e-81))) {
VAR = ((x * ((z - t) / y)) + t);
} else {
VAR = (((x * (z - t)) / y) + t);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.0 |
| Herbie | 1.5 |
if y < -1.5407629577323783e+26 or 3.654265847341133e-81 < y Initial program 1.0
rmApplied div-inv1.1
Applied associate-*l*1.5
Simplified1.4
if -1.5407629577323783e+26 < y < 3.654265847341133e-81Initial program 3.5
rmApplied associate-*l/1.7
Final simplification1.5
herbie shell --seed 2020102 +o rules:numerics
(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))