I think we should use numpy.copysign() here rather than math.copysign()