\frac{-\left(f + n\right)}{f - n}\frac{1}{\frac{n}{n + f} - \frac{f}{n + f}}(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
(FPCore (f n) :precision binary64 (/ 1.0 (- (/ n (+ n f)) (/ f (+ n f)))))
double code(double f, double n) {
return -(f + n) / (f - n);
}
double code(double f, double n) {
return 1.0 / ((n / (n + f)) - (f / (n + f)));
}
























Bits error versus f
























Bits error versus n
Results
| Alternative 1 | |
|---|---|
| Error | 48.2 |
| Cost | 26560 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 20800 |
| Alternative 3 | |
|---|---|
| Error | 1.3 |
| Cost | 20160 |
| Alternative 4 | |
|---|---|
| Error | 31.9 |
| Cost | 13760 |
| Alternative 5 | |
|---|---|
| Error | 32.6 |
| Cost | 13632 |
| Alternative 6 | |
|---|---|
| Error | 32.6 |
| Cost | 13632 |
| Alternative 7 | |
|---|---|
| Error | 32.6 |
| Cost | 13504 |
| Alternative 8 | |
|---|---|
| Error | 32.4 |
| Cost | 13504 |
| Alternative 9 | |
|---|---|
| Error | 0.0 |
| Cost | 13312 |
| Alternative 10 | |
|---|---|
| Error | 31.9 |
| Cost | 832 |
| Alternative 11 | |
|---|---|
| Error | 0.0 |
| Cost | 832 |
| Alternative 12 | |
|---|---|
| Error | 0.2 |
| Cost | 704 |
| Alternative 13 | |
|---|---|
| Error | 0.2 |
| Cost | 576 |
| Alternative 14 | |
|---|---|
| Error | 0.0 |
| Cost | 576 |
| Alternative 15 | |
|---|---|
| Error | 0.0 |
| Cost | 512 |
| Alternative 16 | |
|---|---|
| Error | 31.7 |
| Cost | 448 |
| Alternative 17 | |
|---|---|
| Error | 0.0 |
| Cost | 448 |
| Alternative 18 | |
|---|---|
| Error | 31.4 |
| Cost | 448 |
| Alternative 19 | |
|---|---|
| Error | 32.4 |
| Cost | 64 |
| Alternative 20 | |
|---|---|
| Error | 32.1 |
| Cost | 64 |
| Alternative 21 | |
|---|---|
| Error | 62.0 |
| Cost | 64 |

Initial program 0.0
Simplified0.0
rmApplied clear-num_binary640.0
rmApplied div-sub_binary640.0
Simplified0.0
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021042
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))