Generative Fast Fourier Transforms (GFFT)  0.3
Static Public Member Functions | List of all members
MF::SinCosSeries< M, N, B, A > Struct Template Reference

Common series to compile-time calculation of sine and cosine functions. More...

#include <pseudometafunc.h>

Static Public Member Functions

static long double value ()
 

Detailed Description

template<unsigned M, unsigned N, unsigned B, unsigned A>
struct MF::SinCosSeries< M, N, B, A >

Template Parameters
Mis the starting counter of members in the series (2 for Sin function and 1 for Cos function)
Nis the number of last member in the series
Anumerator
Bdenominator

Using theory of Taylor series sine and cosine functions can be defined as infinite series, which are valid for all real numbers x:

\[ \sin(x) = \sum_{n=0}^{\infty}\frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + ... = x(1 - \frac{x^2}{2\cdot 3}(1 - \frac{x^2}{4\cdot 5}(1 - \frac{x^2}{6\cdot 7}(1 - ... )))) \approx x S(x,M,N), \quad M=2 , \]

\[ \cos(x) = \sum_{n=0}^{\infty}\frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + ... = 1 - \frac{x^2}{1\cdot 2}(1 - \frac{x^2}{3\cdot 4}(1 - \frac{x^2}{5\cdot 6}(1 - ... ))) \approx S(x,M,N), \quad M=1 . \]

Both series contain common series S :

\[ S(x,M,N) = 1 - \frac{x^2}{M(M+1)}(1 - \frac{x^2}{(M+2)(M+3)}(1 - ... \frac{x^2}{N(N+1)})) \]

which can be parametrized by the starting denominator coefficient M and parameter N as the stopping criterium M = N. This template class implements the common series S for the argument $ x = \frac{A\pi}{B} $.


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

Generated on Mon Feb 10 2014 for Generative Fast Fourier Transforms (GFFT) by DoxyGen 1.8.3.1