Regarding the precision, couldn't the doubles just be replaced with long doubles for 80 bit precision in a lookup table?