special

package
Version: v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

README

Special Functions Port

This directory contains special functions ported to Go / Golang.

Documentation

Index

Constants

View Source
const M_EULER = 5.772156649015328606065120900824024310e-01
View Source
const M_PI = 3.14159265358979323846264338328
View Source
const M_ROOT_TWO_PI = 2.506628274631000502415765284811045253
View Source
const M_SQRTPI = 1.77245385090551602729816748334

Variables

View Source
var EpsilonFloat64 float64
View Source
var MaxFactorial int
View Source
var MaxLogFloat64 float64
View Source
var MinLogFloat64 float64
View Source
var PrecisionFloat64 int
View Source
var SeriesIterationsMax int

Functions

func BernoulliNumber

func BernoulliNumber(n int) float64

func BesselI

func BesselI(v, x float64) float64

modified bessel function of the first kind

func CF1_ik

func CF1_ik(v, x float64) float64

Evaluate continued fraction fv = I_(v+1) / I_v, derived from Abramowitz and Stegun, Handbook of Mathematical Functions, 1972, 9.1.73

func CF1_ik_log

func CF1_ik_log(v, x float64) float64

Evaluate continued fraction fv = I_(v+1) / I_v, derived from Abramowitz and Stegun, Handbook of Mathematical Functions, 1972, 9.1.73

func CF2_ik

func CF2_ik(v, x float64) (float64, float64)

Calculate K(v, x) and K(v+1, x) by evaluating continued fraction z1 / z0 = U(v+1.5, 2v+1, 2x) / U(v+0.5, 2v+1, 2x), see Thompson and Barnett, Computer Physics Communications, vol 47, 245 (1987)

func CF2_ik_log

func CF2_ik_log(v, x float64) (float64, float64)

Calculate K(v, x) and K(v+1, x) by evaluating continued fraction z1 / z0 = U(v+1.5, 2v+1, 2x) / U(v+0.5, 2v+1, 2x), see Thompson and Barnett, Computer Physics Communications, vol 47, 245 (1987)

func CosPi

func CosPi(x float64) float64

func Digamma

func Digamma(x float64) float64

func EvalContinuedFraction

func EvalContinuedFraction(fraction ContinuedFraction, factor float64, max_terms int) float64

func Factorial

func Factorial(x int) float64

func GammaLower

func GammaLower(a, z float64) float64

Full lower incomplete gamma:

func GammaP

func GammaP(a, z float64) float64

Regularised lower incomplete gamma:

func GammaPfirstDerivative

func GammaPfirstDerivative(a, z float64) float64

func GammaPsecondDerivative

func GammaPsecondDerivative(a, z float64) float64

func GammaQ

func GammaQ(a, z float64) float64

Regularised upper incomplete gamma:

func GammaUpper

func GammaUpper(a, z float64) float64

Full upper incomplete gamma:

func LogBesselI

func LogBesselI(v, x float64) float64

modified bessel function of the first kind

func LogErfc

func LogErfc(x float64) float64

func Mgamma

func Mgamma(x float64, k int) float64

multivariate gamma function

func Mlgamma

func Mlgamma(x float64, k int) float64

func Polygamma

func Polygamma(n int, x float64) float64

func Powm1

func Powm1(a, z float64) float64

func SinPi

func SinPi(x float64) float64

func SumLogSeries

func SumLogSeries(series Series, init_value, logFactor float64, max_terms int) float64

func SumSeries

func SumSeries(series Series, init_value, factor float64, max_terms int) float64

func Trigamma

func Trigamma(x float64) float64

func Zeta

func Zeta(s float64) float64

Types

type ContinuedFraction

type ContinuedFraction interface {
	Eval() (float64, float64)
}

type EvenPolynomial

type EvenPolynomial struct {
	Polynomial
}

func NewEvenPolynomial

func NewEvenPolynomial(coefficients []float64) EvenPolynomial

func (EvenPolynomial) Eval

func (p EvenPolynomial) Eval(z float64) float64

type LogPolynomial

type LogPolynomial struct {
	// contains filtered or unexported fields
}

func NewLogPolynomial

func NewLogPolynomial(coefficients []float64) LogPolynomial

func (LogPolynomial) Eval

func (p LogPolynomial) Eval(logz float64) float64

type LowerIncompleteGammaSeries

type LowerIncompleteGammaSeries struct {
	// contains filtered or unexported fields
}

func NewLowerIncompleteGammaSeries

func NewLowerIncompleteGammaSeries(a1, z1 float64) *LowerIncompleteGammaSeries

func (*LowerIncompleteGammaSeries) Eval

func (series *LowerIncompleteGammaSeries) Eval() float64

type Polynomial

type Polynomial struct {
	// contains filtered or unexported fields
}

func NewPolynomial

func NewPolynomial(coefficients []float64) Polynomial

func (Polynomial) Eval

func (p Polynomial) Eval(z float64) float64

type Series

type Series interface {
	Eval() float64
}

type SmallGamma2Series

type SmallGamma2Series struct {
	// contains filtered or unexported fields
}

func NewSmallGamma2Series

func NewSmallGamma2Series(a, x float64) *SmallGamma2Series

func (*SmallGamma2Series) Eval

func (series *SmallGamma2Series) Eval() float64

type UpperIncompleteGammaFraction

type UpperIncompleteGammaFraction struct {
	// contains filtered or unexported fields
}

func NewUpperIncompleteGammaFraction

func NewUpperIncompleteGammaFraction(a1, z1 float64) *UpperIncompleteGammaFraction

func (*UpperIncompleteGammaFraction) Eval

func (fraction *UpperIncompleteGammaFraction) Eval() (float64, float64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL