and B uses naive summation then you can expect the end result of A to be more precise than the end result of B – even though both algorithms are correct.
> and B uses naive summation then you can expect the end result of A to be more precise than the end result of B – even though both algorithms are correct.
Formally speaking, no. The problem can be defined precisely. At least one of the algorithms fails to solve the problem.
In practice of course, some amount of error may be acceptable.
However, even though algorithm A and B are "correct" they can behave differently when rounding errors are introduced.
For example – if algorithm A uses
https://en.wikipedia.org/wiki/Kahan_summation_algorithm
and B uses naive summation then you can expect the end result of A to be more precise than the end result of B – even though both algorithms are correct.