Using long doubles throughout for accumulation. Also cleaned up some of the initial variable generation