ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
sincos.cpp File Reference
#include <math.h>
#include <endian.h>
Include dependency graph for sincos.cpp:

Classes

union  ModuleBase::libm::mynumber
 

Namespaces

namespace  ModuleBase
 
namespace  ModuleBase::libm
 

Macros

#define max(x, y)   (((y) > (x)) ? (y) : (x))
 
#define min(x, y)   (((y) < (x)) ? (y) : (x))
 
#define HIGH_HALF   0
 
#define LOW_HALF   1
 
#define HIGH_HALF   1
 
#define LOW_HALF   0
 
#define POLYNOMIAL2(xx)   ((((s5 * (xx) + s4) * (xx) + s3) * (xx) + s2) * (xx))
 
#define POLYNOMIAL(xx)   (POLYNOMIAL2 (xx) + s1)
 
#define TAYLOR_SIN(xx, x, dx)
 
#define SINCOS_TABLE_LOOKUP(u, sn, ssn, cs, ccs)
 

Functions

int ModuleBase::libm::__branred (double x, double *a, double *aa)
 
double ModuleBase::libm::__sin (double x)
 
double ModuleBase::libm::__cos (double x)
 
void ModuleBase::libm::__sincos (double x, double *sinx, double *cosx)
 

Macro Definition Documentation

◆ HIGH_HALF [1/2]

#define HIGH_HALF   0

◆ HIGH_HALF [2/2]

#define HIGH_HALF   1

◆ LOW_HALF [1/2]

#define LOW_HALF   1

◆ LOW_HALF [2/2]

#define LOW_HALF   0

◆ max

#define max (   x,
 
)    (((y) > (x)) ? (y) : (x))

◆ min

#define min (   x,
 
)    (((y) < (x)) ? (y) : (x))

◆ POLYNOMIAL

#define POLYNOMIAL (   xx)    (POLYNOMIAL2 (xx) + s1)

◆ POLYNOMIAL2

#define POLYNOMIAL2 (   xx)    ((((s5 * (xx) + s4) * (xx) + s3) * (xx) + s2) * (xx))

◆ SINCOS_TABLE_LOOKUP

#define SINCOS_TABLE_LOOKUP (   u,
  sn,
  ssn,
  cs,
  ccs 
)
Value:
({ \
int4 k = u.i[LOW_HALF] << 2; \
sn = __sincostab.x[k]; \
ssn = __sincostab.x[k + 1]; \
cs = __sincostab.x[k + 2]; \
ccs = __sincostab.x[k + 3]; \
})
#define LOW_HALF
Definition sincos.cpp:26

◆ TAYLOR_SIN

#define TAYLOR_SIN (   xx,
  x,
  dx 
)
Value:
({ \
double t = ((POLYNOMIAL (xx) * (x) - 0.5 * (dx)) * (xx) + (dx)); \
double res = (x) + t; \
res; \
})
#define POLYNOMIAL(xx)
Definition sincos.cpp:942