Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/stdwrap.h @ 16722

Last change on this file since 16722 was 16269, checked in by bburlacu, 6 years ago

#2958: Add C++ source code

File size: 702 bytes
RevLine 
[16269]1#ifndef _VDT_STD_H_
2#define _VDT_STD_H_
3
4#include <cmath>
5
6// wrapper around std function just to benefit of naming
7// to be used in vectorized wrappers
8
9namespace vdt {
10 
11  template<typename T>
12  inline T fast_sqrt(T x) { return std::sqrt(x); }
13
14  template<typename T>
15  inline T fast_div(T x,T y) { return x/y; }
16
17  template<typename T>
18  inline T fast_fma(T x,T y, T z) { return x*y+z; }
19
20  // correclty rounded
21  template<typename T>
22  inline T fast_fmac(T x, T y, T z) { return std::fma(x,y,z); }
23 
24  template<typename T>
25  inline T fast_pow(T x, T y) { return std::pow(x, y); }
26
27  template<typename T>
28  inline T fast_round(T x) { return std::round(x); }
29}
30#endif
Note: See TracBrowser for help on using the repository browser.