updated versions for double double and quad double arithmetic