Add function for S correction in fretmath.py