vitalyisaev c2b2dfd982 YQ Connector: move tests from yql to ydb (OSS) | 1 year ago | |
---|---|---|
.. | ||
fmath.hpp | c2b2dfd982 YQ Connector: move tests from yql to ydb (OSS) | 1 year ago |
readme.md | c2b2dfd982 YQ Connector: move tests from yql to ydb (OSS) | 1 year ago |
readme.txt | c2b2dfd982 YQ Connector: move tests from yql to ydb (OSS) | 1 year ago |
ya.make | c2b2dfd982 YQ Connector: move tests from yql to ydb (OSS) | 1 year ago |
include fmath.hpp and use fmath::log, fmath::exp, fmath::expd.
fmath::PowGenerator is a class to generate a function to compute pow(x, y) of x >= 0 for a given fixed y > 0.
eg. fmath::PowGenerator f(1.234); f.get(x) returns pow(x, 1.234);
fmath2.hpp
provides the following functions:
If you install xbyak and define FMATH_USE_XBYAK before including fmath.hpp, then fmath::exp() and fmath::exp_ps() will be about 10~20 % faster. Xbyak version uses SSE4.1 if available.
gcc puts warnings such as "dereferencing type-punned pointer will break strict-aliasing rules." It is no problem. Please change #if 1 in fmath.hpp:423 if you worry about it. But it causes a little slower.
-ffast-math option of gcc may generate bad code for fmath::expd.
MITSUNARI Shigeo(herumi@nifty.com) http://herumi.in.coocan.jp/
cl(icl):
/Ox /Ob2 /GS- /Zi /D_SECURE_SCL=0 /MD /Oy /arch:SSE2 /fp:fast /DNOMINMAX
gcc:
-O3 -fomit-frame-pointer -DNDEBUG -fno-operator-names -msse2 -mfpmath=sse -march=native
see fastexp.cpp