\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;t \le -6.523938592531431327362225760875114999913 \cdot 10^{-162} \lor \neg \left(t \le 6.34702047355559309045456629371189110415 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\end{array}double f(double x, double y, double z, double t) {
double r559508 = x;
double r559509 = y;
double r559510 = r559508 - r559509;
double r559511 = z;
double r559512 = r559511 - r559509;
double r559513 = r559510 / r559512;
double r559514 = t;
double r559515 = r559513 * r559514;
return r559515;
}
double f(double x, double y, double z, double t) {
double r559516 = t;
double r559517 = -6.523938592531431e-162;
bool r559518 = r559516 <= r559517;
double r559519 = 6.347020473555593e-18;
bool r559520 = r559516 <= r559519;
double r559521 = !r559520;
bool r559522 = r559518 || r559521;
double r559523 = z;
double r559524 = y;
double r559525 = r559523 - r559524;
double r559526 = x;
double r559527 = r559526 - r559524;
double r559528 = r559525 / r559527;
double r559529 = r559516 / r559528;
double r559530 = r559527 * r559516;
double r559531 = r559530 / r559525;
double r559532 = r559522 ? r559529 : r559531;
return r559532;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.1 |
| Herbie | 2.2 |
if t < -6.523938592531431e-162 or 6.347020473555593e-18 < t Initial program 2.2
rmApplied clear-num2.3
rmApplied pow12.3
Applied pow12.3
Applied pow-prod-down2.3
Simplified2.2
if -6.523938592531431e-162 < t < 6.347020473555593e-18Initial program 2.2
rmApplied associate-*l/2.1
Final simplification2.2
herbie shell --seed 2019351 +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))