Rudolf's residue calculation