\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -3.9144475542745143 \cdot 10^{-193} \lor \neg \left(\frac{x - y}{z - y} \le 2.00487685086135815 \cdot 10^{-140}\right):\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (((double) (x - y)) / ((double) (z - y)))) <= -3.9144475542745143e-193) || !(((double) (((double) (x - y)) / ((double) (z - y)))) <= 2.0048768508613581e-140))) {
VAR = ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
} else {
VAR = ((double) (((double) (((double) (x - y)) * t)) * ((double) (1.0 / ((double) (z - y))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.2 |
| Herbie | 1.5 |
if (/ (- x y) (- z y)) < -3.9144475542745143e-193 or 2.0048768508613581e-140 < (/ (- x y) (- z y)) Initial program 1.5
if -3.9144475542745143e-193 < (/ (- x y) (- z y)) < 2.0048768508613581e-140Initial program 6.5
rmApplied div-inv6.6
Applied associate-*l*1.5
Simplified1.5
rmApplied div-inv1.5
Applied associate-*r*1.6
Final simplification1.5
herbie shell --seed 2020130
(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))