\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -1.10161183992180506 \cdot 10^{-119} \lor \neg \left(y \le 2.03985428235322297 \cdot 10^{-95}\right):\\
\;\;\;\;\left(\left(x - y\right) \cdot \frac{1}{z - y}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\end{array}double code(double x, double y, double z, double t) {
return (((x - y) / (z - y)) * t);
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -1.101611839921805e-119) || !(y <= 2.039854282353223e-95))) {
VAR = (((x - y) * (1.0 / (z - y))) * t);
} else {
VAR = (((x - y) * t) / (z - y));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 1.9 |
| Herbie | 2.1 |
if y < -1.101611839921805e-119 or 2.039854282353223e-95 < y Initial program 0.6
rmApplied div-inv0.7
if -1.101611839921805e-119 < y < 2.039854282353223e-95Initial program 5.0
rmApplied associate-*l/5.3
Final simplification2.1
herbie shell --seed 2020102 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))