| 31 | } |
| 32 | |
| 33 | double fast_exp(double x) { |
| 34 | double arg = x; |
| 35 | double res = 1; |
| 36 | |
| 37 | const auto& expTable = HugeSingletonWithPriority<TTable, 0>()->ExpTable; |
| 38 | |
| 39 | for (int iter = 0; iter < 4; ++iter) { |
| 40 | TDoubleInt dd; |
| 41 | dd.FVal = arg; |
| 42 | double chk = expTable[dd.IVal >> 48]; |
| 43 | dd.IVal &= 0xffff000000000000ll; |
| 44 | res *= chk; |
| 45 | arg -= dd.FVal; |
| 46 | } |
| 47 | |
| 48 | return res * (1 + arg); |
| 49 | } |
| 50 | |
| 51 | void FastExpInplace(double* x, size_t count) { |
| 52 | #if defined(_x86_64_) || defined(_i386_) |
no outgoing calls
no test coverage detected