TBCI Numerical high perf. C++ Library 2.8.0
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.
double asinh (const double x)
unsigned long binom (const unsigned long x, unsigned long y)
 x!
unsigned long binomial (const unsigned long y, const unsigned long z)
 (y+z)!
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)!
long double fact (const double x)
long double ldgamma (const double x)
 the gamma fct
double poisson (const double x, const double la)
 poisson distrib
double chi_s (const double x, const double n)
 chi_square distrib
double erfc3 (const double x, const double c, const double s)
 Gauss normal distribution (x, center, sigma).

Detailed Description

general purpose math definitions and functions (C)

Definition in file mathplus.h.

Macro Definition Documentation

◆ LONG_LONG

#define LONG_LONG   long long

Definition at line 22 of file mathplus.h.

◆ MATH__

#define MATH__

Definition at line 17 of file mathplus.h.

Function Documentation

◆ asinh()

double asinh ( const double x)
inline

Definition at line 44 of file mathplus.h.

References fabs(), log(), MATH__, sqrt(), and x.

◆ bernoulli()

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(), fabs(), MATH__, and x.

◆ binom()

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.

◆ binomial()

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, and y.

◆ chi_s()

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__, pow(), and x.

◆ erfc3()

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, sqrt(), and x.

◆ fac()

unsigned long long fac ( const unsigned char x)
inline

Definition at line 79 of file mathplus.h.

References i, LONG_LONG, and x.

◆ fact()

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(), sqrt(), and x.

Referenced by dgbsvx2_(), dgbsvx_(), ldgamma(), and lu_solve_expert().

◆ ldgamma()

long double ldgamma ( const double x)
inline

the gamma fct

Definition at line 112 of file mathplus.h.

References fact(), MATH__, res, and x.

Referenced by chi_s(), and poisson().

◆ poisson()

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

poisson distrib

Definition at line 124 of file mathplus.h.

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

◆ trinomial()

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, x, and y.