The absolute error for a given angle can be calculated as follows:

int16_t sin16_value = trigint_sin16(angle); double radians = trigint_angle_to_radians_d(angle); int16_t sin_value = round(32767.0 * sin(radians)); int16_t absolute_error = abs(sin16_value - sin_value);

Here's a plot of the absolute error for an entire sine wave cycle, superimposed on top of the actual trigint_sin16() values. As you can see, the maximum absolute error is 40, which is very good, given a range of -32,767 to +32,767 for the sine values. This is certainly good enough for music synthesis.

Generated by