Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:16:42

0001 /*
0002  * cos.h
0003  * The basic idea is to exploit Pade polynomials.
0004  * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
0005  * moshier@na-net.ornl.gov) as well as actual code. 
0006  * The Cephes library can be found here:  http://www.netlib.org/cephes/
0007  * 
0008  *  Created on: Jun 23, 2012
0009  *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
0010  */
0011 
0012 #ifndef COS_H_
0013 #define COS_H_
0014 
0015 #include "sincos.h"
0016 
0017 namespace vdt{
0018 
0019 // Cos double precision --------------------------------------------------------
0020 
0021 /// Double precision cosine: just call sincos.
0022 inline double fast_cos(double x){double s,c;fast_sincos(x,s,c);return c;}
0023 
0024 //------------------------------------------------------------------------------
0025 
0026 inline float fast_cosf(float x){float s,c;fast_sincosf(x,s,c);return c;}
0027 
0028 //------------------------------------------------------------------------------
0029 void cosv(const uint32_t size, double const * __restrict__ iarray, double* __restrict__ oarray);
0030 void fast_cosv(const uint32_t size, double const * __restrict__ iarray, double* __restrict__ oarray);
0031 void cosfv(const uint32_t size, float const * __restrict__ iarray, float* __restrict__ oarray);
0032 void fast_cosfv(const uint32_t size, float const * __restrict__ iarray, float* __restrict__ oarray);
0033 
0034 } //vdt namespace
0035 
0036 #endif /* COS_H_ */