Use fabs(x) instead of branching on signedness of input to sin and cos