\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \leq -2.703203109859195 \cdot 10^{-22} \lor \neg \left(y \leq 3.1725025516793346 \cdot 10^{-171}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -2.703203109859195e-22) || !(y <= 3.1725025516793346e-171))) {
VAR = (t / (((double) (z - y)) / ((double) (x - y))));
} else {
VAR = ((double) (((double) (x - y)) * (t / ((double) (z - y)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.1 |
| Herbie | 2.2 |
if y < -2.70320310985919488e-22 or 3.1725025516793346e-171 < y Initial program Error: 0.9 bits
rmApplied clear-numError: 1.0 bits
rmApplied associate-*l/Error: 0.9 bits
SimplifiedError: 0.9 bits
if -2.70320310985919488e-22 < y < 3.1725025516793346e-171Initial program Error: 4.8 bits
SimplifiedError: 5.1 bits
Final simplificationError: 2.2 bits
herbie shell --seed 2020200
(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))