\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -8.5735405728985964 \cdot 10^{-251} \lor \neg \left(y \le 1.4643699871055045 \cdot 10^{-31}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z - y} \cdot \left(t \cdot \left(x - y\right)\right)\\
\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 (((y <= -8.573540572898596e-251) || !(y <= 1.4643699871055045e-31))) {
VAR = ((double) (t / ((double) (((double) (z - y)) / ((double) (x - y))))));
} else {
VAR = ((double) (((double) (1.0 / ((double) (z - y)))) * ((double) (t * ((double) (x - y))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.3 |
|---|---|
| Target | 2.3 |
| Herbie | 2.4 |
if y < -8.573540572898596e-251 or 1.4643699871055045e-31 < y Initial program 1.2
rmApplied clear-num1.4
Applied associate-*l/1.3
Simplified1.3
if -8.573540572898596e-251 < y < 1.4643699871055045e-31Initial program 5.2
rmApplied div-inv5.2
rmApplied *-commutative5.2
Applied associate-*l*5.5
Simplified5.5
Final simplification2.4
herbie shell --seed 2020113 +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))