\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;t \le -2.49327115381347073 \cdot 10^{-30} \lor \neg \left(t \le 1.97952534099318673 \cdot 10^{-91}\right):\\
\;\;\;\;{\left(\frac{x}{y} \cdot \left(z - t\right) + t\right)}^{1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - t}{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 temp;
if (((t <= -2.4932711538134707e-30) || !(t <= 1.9795253409931867e-91))) {
temp = pow((((x / y) * (z - t)) + t), 1.0);
} else {
temp = ((x * ((z - t) / y)) + t);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.4 |
| Herbie | 2.3 |
if t < -2.4932711538134707e-30 or 1.9795253409931867e-91 < t Initial program 0.3
rmApplied pow10.3
if -2.4932711538134707e-30 < t < 1.9795253409931867e-91Initial program 4.7
rmApplied div-inv4.7
Applied associate-*l*5.0
Simplified4.9
Final simplification2.3
herbie shell --seed 2020058
(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))