62 #ifndef _r123_BOXMULLER_HPP__
63 #define _r123_BOXMULLER_HPP__
71 #if !defined(__CUDACC__)
79 #if !defined(R123_NO_SINCOS) && defined(__APPLE__)
81 #define R123_NO_SINCOS 1
85 R123_CUDA_DEVICE R123_STATIC_INLINE
void sincosf(
float x,
float *s,
float *c) {
90 R123_CUDA_DEVICE R123_STATIC_INLINE
void sincos(
double x,
double *s,
double *c) {
96 #if !defined(CUDART_VERSION) || CUDART_VERSION < 5000
98 R123_CUDA_DEVICE R123_STATIC_INLINE
void sincospif(
float x,
float *s,
float *c){
99 const float PIf = 3.1415926535897932f;
100 sincosf(PIf*x, s, c);
103 R123_CUDA_DEVICE R123_STATIC_INLINE
void sincospi(
double x,
double *s,
double *c) {
104 const double PI = 3.1415926535897932;
117 r = sqrtf(-2.f * logf(u01<float>(u1)));
132 r = sqrt(-2. * log(u01<double>(u1)));
static float2 boxmuller(uint32_t u0, uint32_t u1)
Definition: boxmuller.hpp:113
double y
Definition: boxmuller.hpp:73
float y
Definition: boxmuller.hpp:72
double x
Definition: boxmuller.hpp:73
float x
Definition: boxmuller.hpp:72
static void sincospi(double x, double *s, double *c)
Definition: boxmuller.hpp:103
Definition: boxmuller.hpp:72
static void sincospif(float x, float *s, float *c)
Definition: boxmuller.hpp:98
Definition: boxmuller.hpp:73