来自libm*.so的__ieee754_exp_avx在某个源代码中被密集使用,我想用更快的exp(x)实现替换它?
自定义exp(x):
inline
double exp2(double x) {
x = 1.0 + x / 1024;
x *= x; x *= x; x *= x; x *= x;
x *= x; x *= x; x *= x; x *= x;
x *= x; x *= x;
return x;
}
Run Code Online (Sandbox Code Playgroud)
我应该使用什么gcc标签来使gcc自动使用自定义exp(x)实现?如果gcc无法实现,我该怎么办呢?
https://codingforspeed.com/using-faster-exponential-approximation/