xiaohh
 
In iec_std_functions.h, the sin function is defined in this way.
#define __sin(TYPENAME) __numeric(SIN_, TYPENAME, sin)
__ANY_REAL(__sin)
 
It means sin function is always called, however sin is much slower than sinf. so it would be better to change to 
 
#define __sin(TYPENAME) __numeric(SIN_, TYPENAME, sinf)
__FLOAT_ONLY_ (__sin)
#define __sin(TYPENAME) __numeric(SIN_, TYPENAME, sin)
__DOUBLE_ONLY_(__sin)
 
 
 
 
Reply 1 0
Reply