Short version: I'd like to know whether there are implementations of the standard trigonometric functions that are faster than the ones included in math.h
.
Long version: I got a program that's quite heavy on numerics (it's a physics simulation) and that needs to call trigonometric functions, mostly sin
and cos
, a lot. Currently I'm simply using the implementations included in math.h
. Profiling shows that the calls to these functions cost more than I was expecting (hoping).
While there is most certainly plenty of room for optimization in other parts of the code, having faster sin
and cos
might give me some additional percent.. So, do you guys have any suggestions?
In another post the usage of self-made lookup tables is suggested. But maybe there are alternatives? Or ready-made and well tested lookup solutions in some libraries?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…