On page 791 of http://dx.doi.org/10.1137/0914050 Higham mentions a Kahan variant with slightly nicer behavior which can be had by simply using
s = s + e
at the end of the compensated loop. This merges the final accumulated loss into the total sum. Higham cites two works by Kaham (refs 17 and 18) but those refs look time consuming to dig up.
Try this out as the additional cost and coding is minimal.
On page 791 of http://dx.doi.org/10.1137/0914050 Higham mentions a Kahan variant with slightly nicer behavior which can be had by simply using
at the end of the compensated loop. This merges the final accumulated loss into the total sum. Higham cites two works by Kaham (refs 17 and 18) but those refs look time consuming to dig up.
Try this out as the additional cost and coding is minimal.