Remove code duplication in trigonometric functions