Skip to content

Instantly share code, notes, and snippets.

@Nexuapex Nexuapex/kahan3.c
Created Aug 23, 2012

Embed
What would you like to do?
Kahan summation (3-way)
float sum(float x0, float x1, float x2)
{
float accum = x0 + x1;
float excess = (accum - x0) - x1;
float addend = x2 - excess;
return accum + addend;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.