TBCI Numerical high perf. C++ Library  2.8.0
Macros | Functions
mathplus.h File Reference

general purpose math definitions and functions (C) More...

#include <math.h>
#include "tbci/constants.h"
Include dependency graph for mathplus.h:

Go to the source code of this file.

Macros

#define MATH__
 
#define LONG_LONG   long long
 

Functions

double bernoulli (const double x)
 Despite being C compliant, we do use namespace stuff, if we can. More...
 
double asinh (const double x)
 
unsigned long binom (const unsigned long x, unsigned long y)
 x!/(y!(x-y)!) More...
 
unsigned long binomial (const unsigned long y, const unsigned long z)
 (y+z)!/(y!z!) More...
 
unsigned long long fac (const unsigned char x)
 
unsigned long trinomial (const unsigned long x, const unsigned long y, const unsigned long z)
 (x+y+z)!/(x!y!z!) Like for binomial, more efficient algos (or algos less prone to overflow) are possible ... More...
 
long double fact (const double x)
 
long double ldgamma (const double x)
 the gamma fct More...
 
double poisson (const double x, const double la)
 poisson distrib More...
 
double chi_s (const double x, const double n)
 chi_square distrib More...
 
double erfc3 (const double x, const double c, const double s)
 Gauss normal distribution (x, center, sigma) More...
 

Detailed Description

general purpose math definitions and functions (C)

Definition in file mathplus.h.

Macro Definition Documentation

#define LONG_LONG   long long

Definition at line 22 of file mathplus.h.

Referenced by binom(), binomial(), and fac().

#define MATH__

Definition at line 17 of file mathplus.h.

Referenced by asinh(), bernoulli(), chi_s(), erfc3(), fact(), ldgamma(), and poisson().

Function Documentation

double asinh ( const double  x)
inline

Definition at line 44 of file mathplus.h.

References std::fabs(), log(), MATH__, and std::sqrt().

double bernoulli ( const double  x)
inline

Despite being C compliant, we do use namespace stuff, if we can.

<Bernoulli function from: Simulation of optoelectronic semiconductors, TR 310, S. 60

Definition at line 35 of file mathplus.h.

References exp(), std::fabs(), and MATH__.

unsigned long binom ( const unsigned long  x,
unsigned long  y 
)
inline

x!/(y!(x-y)!)

Definition at line 52 of file mathplus.h.

References i, LONG_LONG, x, and y.

unsigned long binomial ( const unsigned long  y,
const unsigned long  z 
)
inline

(y+z)!/(y!z!)

Definition at line 66 of file mathplus.h.

References i, LONG_LONG, x, y, and z.

double chi_s ( const double  x,
const double  n 
)
inline

chi_square distrib

Definition at line 130 of file mathplus.h.

References exp(), ldgamma(), MATH__, and pow().

double erfc3 ( const double  x,
const double  c,
const double  s 
)
inline

Gauss normal distribution (x, center, sigma)

Definition at line 137 of file mathplus.h.

References c, exp(), MATH__, pi, and std::sqrt().

unsigned long long fac ( const unsigned char  x)
inline

Definition at line 79 of file mathplus.h.

References i, LONG_LONG, and x.

long double fact ( const double  x)
inline
Note
Stirling is only fine for large numbers

Definition at line 101 of file mathplus.h.

References E1, MATH__, pi, pow(), std::sqrt(), and x.

Referenced by ldgamma(), and lu_solve_expert().

long double ldgamma ( const double  x)
inline

the gamma fct

Definition at line 112 of file mathplus.h.

References fact(), MATH__, and res.

Referenced by chi_s(), and poisson().

double poisson ( const double  x,
const double  la 
)
inline

poisson distrib

Definition at line 124 of file mathplus.h.

References exp(), ldgamma(), MATH__, and pow().

unsigned long trinomial ( const unsigned long  x,
const unsigned long  y,
const unsigned long  z 
)
inline

(x+y+z)!/(x!y!z!) Like for binomial, more efficient algos (or algos less prone to overflow) are possible ...

Definition at line 92 of file mathplus.h.

References fac.