Check out the full source code of DBL, a multi-term extended precision floating point arithmetic library, at DBL git repo, available under the terms of GPL3.