The C xsin is over 4 times faster than the Crt lib
What C compiler are you using?
gcc version 14.2.0 (x86_64-win32-seh-rev2, Built by MinGW-Builds project) using ucrt:without optimization
sum of sin from -10000 to 10000 = -3.55265816764927e-12
elapsed time 0.302194199999576 seconds
sum of xsin from -10000 to 10000 = -1.33232314070142e-12
elapsed time 1.13876749999963 seconds
with -O3
sum of sin from -10000 to 10000 = -3.55265816764927e-12
elapsed time 0.249794700000166 seconds
sum of xsin from -10000 to 10000 = -1.33232314070142e-12
elapsed time 0.278383999999278 seconds
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34120 for x64 (VS 2022 v.17.11.3):without optimization
sum of sin from -10000 to 10000 = -3.55265816764927e-12
elapsed time 0.49480290000065 seconds
sum of xsin from -10000 to 10000 = -1.33232314070142e-12
elapsed time 2.84119210000063 seconds
with /O2
sum of sin from -10000 to 10000 = -3.55265816764927e-12
elapsed time 0.253984400000263 seconds
sum of xsin from -10000 to 10000 = -1.33232314070142e-12
elapsed time 1.47731719999865 seconds