\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \leq -2.6992085356505333 \cdot 10^{-291}:\\
\;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\
\mathbf{elif}\;\frac{x - y}{z - y} \cdot t \leq -0:\\
\;\;\;\;\frac{1}{z - y} \cdot \left(\left(x - y\right) \cdot t\right)\\
\mathbf{elif}\;\frac{x - y}{z - y} \cdot t \leq 5.298243756140431 \cdot 10^{+257}:\\
\;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
:precision binary64
(if (<= (* (/ (- x y) (- z y)) t) -2.6992085356505333e-291)
(* t (- (/ x (- z y)) (/ y (- z y))))
(if (<= (* (/ (- x y) (- z y)) t) -0.0)
(* (/ 1.0 (- z y)) (* (- x y) t))
(if (<= (* (/ (- x y) (- z y)) t) 5.298243756140431e+257)
(* t (- (/ x (- z y)) (/ y (- z y))))
(* (- x y) (/ t (- z y)))))))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 tmp;
if ((((double) ((((double) (x - y)) / ((double) (z - y))) * t)) <= -2.6992085356505333e-291)) {
tmp = ((double) (t * ((double) ((x / ((double) (z - y))) - (y / ((double) (z - y)))))));
} else {
double tmp_1;
if ((((double) ((((double) (x - y)) / ((double) (z - y))) * t)) <= -0.0)) {
tmp_1 = ((double) ((1.0 / ((double) (z - y))) * ((double) (((double) (x - y)) * t))));
} else {
double tmp_2;
if ((((double) ((((double) (x - y)) / ((double) (z - y))) * t)) <= 5.298243756140431e+257)) {
tmp_2 = ((double) (t * ((double) ((x / ((double) (z - y))) - (y / ((double) (z - y)))))));
} else {
tmp_2 = ((double) (((double) (x - y)) * (t / ((double) (z - y)))));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.4 |
|---|---|
| Target | 2.3 |
| Herbie | 1.1 |
if (* (/ (- x y) (- z y)) t) < -2.6992085356505333e-291 or -0.0 < (* (/ (- x y) (- z y)) t) < 5.2982437561404306e257Initial program Error: 1.0 bits
rmApplied div-subError: 1.0 bits
if -2.6992085356505333e-291 < (* (/ (- x y) (- z y)) t) < -0.0Initial program Error: 8.1 bits
rmApplied div-subError: 8.1 bits
rmApplied div-invError: 8.1 bits
Applied div-invError: 8.1 bits
Applied distribute-rgt-out--Error: 8.1 bits
Applied associate-*l*Error: 0.4 bits
SimplifiedError: 0.4 bits
if 5.2982437561404306e257 < (* (/ (- x y) (- z y)) t) Initial program Error: 15.2 bits
SimplifiedError: 5.9 bits
Final simplificationError: 1.1 bits
herbie shell --seed 2020203
(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))