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






















Bits error versus f






















Bits error versus n
Results
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 39872 |
| Alternative 2 | |
|---|---|
| Error | 32.9 |
| Cost | 33216 |
| Alternative 3 | |
|---|---|
| Error | 32.6 |
| Cost | 33216 |
| Alternative 4 | |
|---|---|
| Error | 0.1 |
| Cost | 20672 |
| Alternative 5 | |
|---|---|
| Error | 1.4 |
| Cost | 20288 |
| Alternative 6 | |
|---|---|
| Error | 1.4 |
| Cost | 20160 |
| Alternative 7 | |
|---|---|
| Error | 1.3 |
| Cost | 20160 |
| Alternative 8 | |
|---|---|
| Error | 43.1 |
| Cost | 14144 |
| Alternative 9 | |
|---|---|
| Error | 43.3 |
| Cost | 14016 |
| Alternative 10 | |
|---|---|
| Error | 32.1 |
| Cost | 13504 |
| Alternative 11 | |
|---|---|
| Error | 31.8 |
| Cost | 832 |
| Alternative 12 | |
|---|---|
| Error | 0.2 |
| Cost | 576 |
| Alternative 13 | |
|---|---|
| Error | 0.0 |
| Cost | 576 |
| Alternative 14 | |
|---|---|
| Error | 31.3 |
| Cost | 448 |
| Alternative 15 | |
|---|---|
| Error | 31.8 |
| Cost | 448 |
| Alternative 16 | |
|---|---|
| Error | 0.0 |
| Cost | 448 |
| Alternative 17 | |
|---|---|
| Error | 32.4 |
| Cost | 64 |
| Alternative 18 | |
|---|---|
| Error | 32.0 |
| Cost | 64 |
| Alternative 19 | |
|---|---|
| Error | 62.0 |
| Cost | 64 |

Initial program 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021022
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))