The Finite Resolution Dynamics Software
Static Public Member Functions | Static Private Member Functions | List of all members
tOpenSine< NumType, nTerms > Class Template Reference

Computes the sine function using the expansion into the Taylor series at pi/2. More...

#include <opensine.h>

Static Public Member Functions

static int compute (const NumType &xLeft, const NumType &xRight, NumType &yLeft, NumType &yRight)
 Computes the sine function in the open interval arithmetic. More...
 

Static Private Member Functions

static void computeTaylorTerms (const NumType &x, NumType *lower_x2k, NumType *upper_x2k, int n)
 Computes the provided number of terms in the expansion of sin(pi+x) in the Taylor series at pi. More...
 
static NumType lowerBoundTaylor (const NumType &x)
 Returns a lower bound for the sine function. More...
 
static NumType upperBoundTaylor (const NumType &x)
 Returns an upper bound for the sine function. More...
 
static int shifted1pi (const NumType &xLeft, const NumType &xRight, NumType &yLeft, NumType &yRight)
 Computes the sine function in the open interval arithmetic with the arguments shifted so that xLeft is in [0,pi]. More...
 
static int shifted2pi (const NumType &xLeft, const NumType &xRight, NumType &yLeft, NumType &yRight)
 Computes the sine function in the open interval arithmetic with the arguments shifted so that xLeft is in [0,2pi]. More...
 

Detailed Description

template<class NumType, int nTerms>
class tOpenSine< NumType, nTerms >

Computes the sine function using the expansion into the Taylor series at pi/2.

Definition at line 51 of file opensine.h.

Member Function Documentation

◆ compute()

template<class NumType , int nTerms>
int tOpenSine< NumType, nTerms >::compute ( const NumType &  xLeft,
const NumType &  xRight,
NumType &  yLeft,
NumType &  yRight 
)
inlinestatic

Computes the sine function in the open interval arithmetic.

Definition at line 202 of file opensine.h.

References tOpenSine< NumType, nTerms >::shifted1pi(), and tOpenSine< NumType, nTerms >::shifted2pi().

Referenced by tOpenSine< NumType, nTerms >::upperBoundTaylor().

◆ computeTaylorTerms()

template<class NumType , int nTerms>
void tOpenSine< NumType, nTerms >::computeTaylorTerms ( const NumType &  x,
NumType *  lower_x2k,
NumType *  upper_x2k,
int  n 
)
inlinestaticprivate

Computes the provided number of terms in the expansion of sin(pi+x) in the Taylor series at pi.

Definition at line 88 of file opensine.h.

Referenced by tOpenSine< NumType, nTerms >::lowerBoundTaylor(), and tOpenSine< NumType, nTerms >::upperBoundTaylor().

◆ lowerBoundTaylor()

template<class NumType , int nTerms>
NumType tOpenSine< NumType, nTerms >::lowerBoundTaylor ( const NumType &  x)
inlinestaticprivate

Returns a lower bound for the sine function.

The argument must be in the interval (0,pi).

Definition at line 139 of file opensine.h.

References tOpenSine< NumType, nTerms >::computeTaylorTerms().

Referenced by tOpenSine< NumType, nTerms >::shifted1pi().

◆ shifted1pi()

template<class NumType , int nTerms>
int tOpenSine< NumType, nTerms >::shifted1pi ( const NumType &  xLeft,
const NumType &  xRight,
NumType &  yLeft,
NumType &  yRight 
)
inlinestaticprivate

Computes the sine function in the open interval arithmetic with the arguments shifted so that xLeft is in [0,pi].

Definition at line 258 of file opensine.h.

References tOpenSine< NumType, nTerms >::lowerBoundTaylor(), tOpenSine< NumType, nTerms >::shifted2pi(), and tOpenSine< NumType, nTerms >::upperBoundTaylor().

Referenced by tOpenSine< NumType, nTerms >::compute(), and tOpenSine< NumType, nTerms >::shifted2pi().

◆ shifted2pi()

template<class NumType , int nTerms>
int tOpenSine< NumType, nTerms >::shifted2pi ( const NumType &  xLeft,
const NumType &  xRight,
NumType &  yLeft,
NumType &  yRight 
)
inlinestaticprivate

Computes the sine function in the open interval arithmetic with the arguments shifted so that xLeft is in [0,2pi].

Definition at line 402 of file opensine.h.

References tOpenSine< NumType, nTerms >::shifted1pi().

Referenced by tOpenSine< NumType, nTerms >::compute(), and tOpenSine< NumType, nTerms >::shifted1pi().

◆ upperBoundTaylor()

template<class NumType , int nTerms>
NumType tOpenSine< NumType, nTerms >::upperBoundTaylor ( const NumType &  x)
inlinestaticprivate

Returns an upper bound for the sine function.

The argument must be in the interval (0,pi).

Definition at line 169 of file opensine.h.

References tOpenSine< NumType, nTerms >::compute(), and tOpenSine< NumType, nTerms >::computeTaylorTerms().

Referenced by tOpenSine< NumType, nTerms >::shifted1pi().


The documentation for this class was generated from the following file: