math for the CPS transform