\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \leq -1.888243183884543 \cdot 10^{-104}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\mathbf{elif}\;y \leq 6.6024302915393845 \cdot 10^{-292}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x - y}{z - y}\\
\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
:precision binary64
(if (<= y -1.888243183884543e-104)
(/ t (/ (- z y) (- x y)))
(if (<= y 6.6024302915393845e-292)
(* (- x y) (/ t (- z y)))
(* t (/ (- x y) (- z y))))))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 tmp;
if (y <= -1.888243183884543e-104) {
tmp = t / ((z - y) / (x - y));
} else if (y <= 6.6024302915393845e-292) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * ((x - y) / (z - y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.0 |
| Herbie | 2.0 |
if y < -1.8882431838845431e-104Initial program 0.5
Applied clear-num_binary640.6
Applied associate-*l/_binary640.6
Simplified0.6
if -1.8882431838845431e-104 < y < 6.6024302915393845e-292Initial program 5.7
Applied div-inv_binary645.8
Applied associate-*l*_binary645.5
Simplified5.4
if 6.6024302915393845e-292 < y Initial program 1.7
Final simplification2.0
herbie shell --seed 2021275
(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))