\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -\infty:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -8.868229609988521 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{\left(\frac{y}{x \cdot y + z \cdot \left(t - a\right)} + \frac{z \cdot b}{x \cdot y + z \cdot \left(t - a\right)}\right) - \frac{y \cdot z}{x \cdot y + z \cdot \left(t - a\right)}}\\
\mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 0 \lor \neg \left(\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 9.918042372221392 \cdot 10^{+290}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(FPCore (x y z t a b)
:precision binary64
(if (<= (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) (- INFINITY))
(/ (- t a) (- b y))
(if (<=
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
-8.868229609988521e-308)
(/
1.0
(-
(+
(/ y (+ (* x y) (* z (- t a))))
(/ (* z b) (+ (* x y) (* z (- t a)))))
(/ (* y z) (+ (* x y) (* z (- t a))))))
(if (or (<= (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) 0.0)
(not
(<=
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
9.918042372221392e+290)))
(/ (- t a) (- b y))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))))))double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= -((double) INFINITY)) {
tmp = (t - a) / (b - y);
} else if ((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= -8.868229609988521e-308) {
tmp = 1.0 / (((y / ((x * y) + (z * (t - a)))) + ((z * b) / ((x * y) + (z * (t - a))))) - ((y * z) / ((x * y) + (z * (t - a)))));
} else if (((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= 0.0) || !((((x * y) + (z * (t - a))) / (y + (z * (b - y)))) <= 9.918042372221392e+290)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}













Bits error versus x













Bits error versus y













Bits error versus z













Bits error versus t













Bits error versus a













Bits error versus b
Results
| Original | 23.3 |
|---|---|
| Target | 17.9 |
| Herbie | 8.9 |
| Alternative 1 | |
|---|---|
| Error | 8.8 |
| Cost | 5777 |
| Alternative 2 | |
|---|---|
| Error | 20.5 |
| Cost | 1416 |
| Alternative 3 | |
|---|---|
| Error | 20.5 |
| Cost | 1160 |
| Alternative 4 | |
|---|---|
| Error | 21.6 |
| Cost | 1795 |
| Alternative 5 | |
|---|---|
| Error | 22.8 |
| Cost | 776 |
| Alternative 6 | |
|---|---|
| Error | 41.7 |
| Cost | 320 |
| Alternative 7 | |
|---|---|
| Error | 46.5 |
| Cost | 64 |
| Alternative 8 | |
|---|---|
| Error | 60.7 |
| Cost | 64 |
| Alternative 9 | |
|---|---|
| Error | 61.6 |
| Cost | 64 |

if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or -8.86822960998852061e-308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 9.9180423722213923e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 59.3
Taylor expanded around inf 22.1
Simplified22.1
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -8.86822960998852061e-308Initial program 0.4
rmApplied clear-num_binary64_208780.5
Taylor expanded around 0 0.5
Simplified0.5
Simplified0.5
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.9180423722213923e290Initial program 0.3
Simplified0.3
Final simplification8.9
herbie shell --seed 2021044
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))