Math libs are often not that efficient, because they are expected to handle generalised conditions. Try to avoid math lib for embedded work, and prefer to use, depending on resolution, for example, a single quadrant sine lookup table, then perhaps interpolate for finer resolution. Say, use a 1 k lookup table, single quadrant, then use reflection and inversion for the remaining quadrants. Much faster than brute force calculation and more memory efficient as well. Optimise for the project requirements etc...