Adjust code for potential absence of sincos()