Delphi/Kylix Math Functions

Engineering Mathematics


Contents

Hyperbolic Functions
Special Functions
Complex Math and Functions
Linear Algebra, Matrices, Eigenvalues, Eigenvectors
Digital Signal Processing, Fourier Transforms, FFTs
Ordinary and Partial Differential Equations
Sources Key

Hyperbolic Functions

Function Name Description Source(s)
arccosh Function ArcCosh(X: Extended): Extended;
Input: X >= 1
math, TPmath1(fmath),
Turbo (p. 143), AugMath
ArcCotH function ArcCotH(
const X: Extended): Extended;
Kylix math
ArcCscH function ArcCscH(
const X: Extended): Extended; 
Kylix math
ArcSecH function ArcSecH(
const X: Extended): Extended;
Kylix math
arcsinh Function ArcSinh(X: Extended): Extended; math, TPmath1(fmath),
Turbo (p. 143), AugMath
arctanh Function ArcTanh(X: Extended): Extended;
Input: |X| <= 1
math, TPmath1(fmath), AugMath
cosh Function Cosh(X: Extended): Extended;
cosh(x) = [exp(x) + exp(-x)]/2
math, TPmath1(fmath),
Turbo (p. 143), AugMath
coth coth = 1/tanh

function CotH(const X: Extended): Extended; 

Kylix math,
AugMath
csch csch = 1/sinh

function CscH(
const X: Extended): Extended; 

Kylix math, AugMath
ESBArCosh, ESBArSinh, ESBARTanh

ESBCosh
ESBSinh
ESBTanh

hypberbolic functions and inverse functions ESBMaths
farg_ch,
farg_sh,
farg_th
arccosh,
arcsinh,
arctanh
mathlib2(hyper387)
fch, fsh, fth cosh, sinh, tanh mathlib2(hyper387)
sech 1/cosh

function SecH(
const X: Extended): Extended; 

Kylix math, AugMath
sinh Function Sinh(X: Extended): Extended;

sinh(x) = [exp(x) - exp(-x)]/2
math, TPmath1(fmath),
Turbo (p. 142), AugMath
tanh Function Tanh(X: Extended): Extended;

tanh(x) = sinh(x)/cosh(x)
math, TPmath1(fmath),
Turbo (p. 143), AugMath

 


Special Functions

Numerical Methods in Pascal page
http://www-rab.larc.nasa.gov/nmp/nmpIndex.htm#SpecialFunctions 

www.sisweb.com/math/integrals/specialfuns.htm

Function Name Description Source(s)
bessI
bessI0
bessI1
modified Bessel function I of integer order
modified Bessel function I0
modified Bessel function I1
recipes
bessJ
bessJ0
bessJ1
Bessel function J of integer order
Bessel function J0
Bessel function J1
recipes
bessj(x,n) Bessel function of the first kind mathe
bessK
bessK0
bessK1
modified Bessel function K of integer order
modified Bessel function K0
modified Bessel function K1
recipes
bessY
bessY0
bessY1
modified Bessel function Y of integer order
modified Bessel function Y0
modified Bessel function Y1
recipes
Beta beta function TPmath1(fmath),
recipes
cel complete elliptic integral recipes(cel)
erf
erfc
error function,
complementary
recipes,
TPmath1(fmath)
erfcc error function,
complementary, concise
recipes
gamma gamma function TPmath1(fmath),
mathe, Turbo (p. 142)
gammp
gammq
gammln
gamma function

gamma(z + 1) = z * gamma(z) = z!

incomplete gamma function (gammp)
incomplete, complement (gammq)
logarithm of gamma function (gammln)

recipes
Gradient & Hessian Gradient and Hessian of a function of several variables. TPmath2 (hessian)
IBeta incomplete beta function TPmath1(fmath)
IGamma incomplete gamma function TPmath1(fmath)
JGamma complemement of IGamma TPmath1(fmath)
LnGamma Log(| Gamma(X) |) TPmath1(fmath),
StatUnit(distr)
plgndr Legendre polynomials, associated (spherical harmonics) recipes
SgnGamma Sign of gamma function TPmath1(fmath)
sncndn Jacobian elliptic functions recipes

 


Complex Math and Functions

Numerical Methods in Pascal page
http://www-rab.larc.nasa.gov/nmp/nmpIndex.htm#ComplexNumbers 

Complex Variables
www.math.utep.edu/sosmath/complex/complex.html

Tutorial
www.me.umist.ac.uk/cal/Delphi/D_tut6ar.doc

Complex Roots in C/C++
http://perso.wanadoo.fr/jean-pierre.moreau/c_complex.html 

Function Name(s) Description Source(s)
Complex Arithmetic Overview   Stockton
Complex Functions CConvert, CSet, CStr, CAdd, CDiv, CMult, CSub, CNeg, CLn, CExp, CPwr, CCos, CSin, CTan, CSec, CCsc, CCot, CCosh, CSinh, CTanh, CSech, CCsch, CCoth, CAbs, CAbsSqr, CIntPower, CRealPower, CPower, CConjugate, CSqrt, CRoot, CI0, CJ0, CLnGamma, CGama, CDeFuzz, DeFuzz, SetFuzz, FixAngle efg'sComplexMathLibrary
Complex Functions: cadd, csub, cmul, cdiv, cneg, ccong, crcp, ciz, c_iz, czero, cmod, cequal, carg, cexp, cln, csqrt, ccos, csin, ctg, carc_cos, carc_sin, carc_tg, cch, csh, cth, carg_ch, carg_sh, carg_th mathlib2(pcomplex)
Complex Functions RP, IP, Cmplx, PolarCmplx, cabs, arg, cc, ca, cs, cm, rc, cd, cr, PrSqrt, cExp, cLn, csin, ccos, ctan, ccosh, csinh, ctanh EZmath

Another Complex Library
Complex Library   UDDF MATH
Complex Unit www.ibrtses.com/delphi/complexrec.html  
C_LU_Decomp LU decomposition TPmath1 (matcomp)
C_LU_Solve Solves system of equations TPmath1 (matcomp)
Delphi 6 Complex functions General: VarComplexCreate (with overloads), VarComplex, VarIsComplex, VarAsComplex, VarComplexSimplify, VarComplexAbsSqr, VarComplexAbs, VarComplexAngle, VarComplexConjugate, VarComplexInverse, VarComplexExp, VarComplexLn, VarComplexSqr, VarComplexSqrt, VarComplexTimesPosI, VarComplexTimesNegI, VarComplexPower 

Trig/Hyperbolic: VarComplexCos, VarComplexSin, VarComplexTan, VarComplexCot, VarComplexSec, VarComplexCsc, VarComplexArcCos, VarComplexArcSin, VarComplexArcTan, VarComplexArcCot, VarComplexArcSec, VarComplexArcCsc, VarComplexCosH, VarComplexSinH, VarComplexTanH, VarComplexCotH, VarComplexSecH, VarComplexCscH, VarComplexArcCosH, VarComplexArcSinH, VarComplexArcTanH, VarComplexArcCotH, VarComplexArcSecH, VarComplexArcCscH 

Conversion: VarComplexToPolar, VarComplexFromPolar Variables: ComplexNumberSymbol, ComplexNumberSymbolBeforeImaginary

VarCmplx (D6).  
Fnd the source in ..\Delphi6\Source\Rtl\Common)
Intel's Digital Signal Processing  Library (ISPL) See Digital Signal Processing. ISPL
MMEMatrix Very easy and fast complex matrix class.  
http://delphi.icm.edu.pl/ftp/d40free/MMEMatrix.zip
 
Plotting Complex Functions www.ibrtses.com/delphi/complexplot.html  

 


Linear Algebra, Matrices, Eigenvalues, Eigenvectors

Numerical Methods in Pascal page
http://www-rab.larc.nasa.gov/nmp/nmpIndex.htm#MatrixMethods 

www.math.utep.edu/sosmath/matrix/matrix.html

Function Name Description Source(s)
Add_Matrix add matrices A and B to give matrix C Turbo (p. 146)
balanc balance a nonsymmetric matrix recipes
Determinant and Matrix Inverse   TPMath2 (DetInv)
Eigenvectors and Eigenvalues Symmetric Matrix,
General Square Matrix,
Real Eigenvalue & EigenMatrix
TPMath2(EigenSym),
TPMath2(EigenVal),
TPMath2(EigenVec)
eigsrt eigenvectors, sorts into order by eigenvalue recipes
elmhes reduce a general matrix to Hessenberg form recipes
Extentia Exentia is an open-source library for Delphi designed to perform computations on vectors of 32-bit floating point data elements using the Intel SSE, AMD 3D Now! and Intel x87 instruction sets.   www.tommesani.com/Exentia.html 

Dr. Chris Rorden created a  very basic project based on this software.  It uses QueryPerformanceCounter to measure the performance benefit for using SIMD calls.    www.psychology.nottingham.ac.uk/staff/cr1/simd.html

 
Gauss Elimination www.optimalcode.com/exgauss.htm   
Gaussian Reduction www.ibrtses.com/delphi/dequ.html  
GaussJ Gauss-Jordan matrix inversion

Download Turbo Pascal 5.5from the Borland Community Museum:  http://community.borland.com/museum,
and look for the HILB.PAS file.

mathe, recipes(gaussj)

 

hqr eigenvalues of a Hessenberg matrix recipes
Invert_Matrix add matrices A and B to give matrix C Turbo (p. 147-148)
Jacobi, EigenVals, EigenVect Eigenvalues and Eigenvectors TPMath1 (Eigen)
Linear Equations Gauss-Jordan Elimination
LU decomposition
Singular value decomposition
TPMath2(SysEq)
TPMath2(SysEqLU)
TPMath2(SysEqSVD)
Linear Equations,
Complex Coefficients
  TPMath2(SysEqC)
lubksb
ludcmp
linear equation solution, LU decomposition (ludcmp) and backsubstitution (lubksb) recipes
Matrices   TPMath1 (Matrices)
Matrices, Complex Elements   TPMath1 (MatComp)
Matrix Shareware Product by SDL (Software Development Lohninger)
www.lohninger.com/matrix.html
 
Matrix Math Toolkit Commerical Product from Engineering Objects International
www.engineeringobjects.com/
MatrixMathToolkitv4.htm
 
 
Matrix Operations Dynamic Types:
  TDynFloatMatrix
  TDynLWordMatrix
  TDynLIntMatrix

MatrixIsRectangular, MatrixDimensions, MatrixIsSquare, MatricesSameDimensions, AddMatrices, AddToMatrix, SubtractMatrices, SubtractFromMatrix, MultiplyMatrixByConst, MultiplyMatrixByConst2, MultiplyMatrices, TransposeMatrix, GrandMean

ESBMaths
mprove linear equation solution, iterative improvement recipes
Mult_Matrix add matrices A and B to give matrix C Turbo (p. 147)
svbksb singular value backsubstitution recipes
svdcmp singular value decomposition of a matrix recipes
TVector Vector component
www.lohninger.com/vector.html
 
toeplz solve Toeplitz systems recipes
tred2 Householder reduction of a real, symmetric matrix recipes
tqli eigensolution of a symmetric tridiagonal matrix recipes
tridag solution of tridiagonal systems recipes
vander Vandermonde systems recipes
Vector Vectors is a class library for Object Pascal (Delphi 1, 3-5 and Free Pascal v.0.99.15 and higher), which implements vectors (dynamically sized arrays) based on different Object Pascal's simple types, including all integer and real types, booleans, pointers and strings. These vectors resemble TList class type from Delphi VCL, but in addition to the common operations like  insert and delete they offer wide range of operations depending on type of vector elements - sorting, searching, arithmetic vector operations for number-type vectors, logical operations for boolean vectors and so on. The library also implements a range of derivative and additional classes - sparse vectors, matrixes, queues, stacks, dictionaries, streams Vectors.zip from DSP
Vector Operations Dynamic types:
  TDynFloatArray
  TDynLWordArray
  TDynLIntArray

SquareAll, InverseAll, Log10All, LinearTransform, AddVectors, SubVectors, MultVectors, DotProduct

ESBMaths

 


Digital Signal Processing, Fourier Analysis, FFTs

Numerical Methods in Pascal page
http://www-rab.larc.nasa.gov/nmp/nmpIndex.htm#DigitalSignalProcessing 

www.sisweb.com/math/advanced/fourier.htm

Function Name/Category Math Description Source(s)
adaptive FIR filter using LMS algorithm   ISPL
BDSPP

The Basic Delphi signal processing package (BDSPP).   The package represents FFT Properties 3.5 in parts. It includes key components on which FFT Properties 3.5 are based. The vast majority of the functionality offered by FFT Properties is available from these VCL components.
www.teemach.com/FFTProp

 
convlv convolution or deconvolution of data using FFT recipes
correl correlation or autocorrelation of data using FFT recipes
cosft fast cosine transform recipes
dsxfft Simple Fast Fourier Transformation Component. FFT and inverse FFT.
http://delphi.icm.edu.pl/ftp/d20free/dsxfft.zip
Delphi Super Page
evlmem power spectral estimation using maximum entropy coefficients recipes
FFT Unit for Delphi
  • FFT and inverse FFT routines for any number of samples
    (but if the number of samples is an exact power of 2, the faster power-of-2 FFT algorithm is used).
  • Can be used for real and complex signals.
  • FFFT (Fractional FFT) routines can provide any range of spectral lines (Zoom FFT).
  • Many data windows (Parzen, Welch, Hann, Hamming, Blackman, FlatTop, ...).
  • The source code of the FFT unit is available.

www.aho.ch/fft 

 
FFT using TFastFourier component Fast Fourier Transform
www.lohninger.com/fourier.html
 
fftprop2 Educational software for understanding the FFT properties.
www.teemach.com/FFTProp
 
finite impulse response (FIR) filter (many routines)   ISPL
fixrts reflect roots of a polynomial into unit circle recipes
four1 FFT in one dimension recipes
Fourier Analysis, FFTs   TPmath1(fourier)

DatabaseFTP:  Select "7Object Pascal" followed by "FFT_1.ZIP"
fourn FFT in multidimensions recipes
infinite impulse response (IIR) filter (many routines)   ISPL
Intel Signal Processing Library  Intel Signal Processing Library V4.1 Delphi interface patch and examples
http://home.t-online.de/home/Robert.Rossmair/nsp.htm 
ISPL
memcof evaluate maximum entropy coefficients recipes
miscellaneous signal processing functions Examples:
Permute vector into binary bit-reversed order,
uniform distribution, normal distribution, NSP tone generator, other tone functions, triangle functions, vector addition and multiplication, scalar and vector functions, autocorrelation, crosscorrelation, vector arithmetic and algebraic functions
ISPL
nspXConv
where X is s, c, d, z, sd, cs, dz, zd, w
finite, linear convolution of two sequences ISPL
nspXConv2D, for X=s, d, w finite, linear convolution of two 2D signals ISPL
nspvReal, nspvImag Real and Imaginary part of Complex Vector ISPL
nspvbMag, nspvbPhas Magnitude and phase of Complex Vector ISPL
predic linear prediction using maximum entropy coefficients recipes
realft FFT of single real function recipes
Signal Processing Package www.dewresearch.com/products/SPP_index.htm   
sinft fast sine transform recipes
Single frequency DFT (Goertzel algorithm)   ISPL
spctrm power spectrum estimation using FFT recipes
TFastFourier Can transform data sets of up to 32k samples in both directions and provides several of the most important windowing functions (such as Hamming, Blackman, Cosine Square, Triangle, and others).

www.lohninger.com/fourier.html

 
twofft FFT of two real functions recipes

Ordinary and Partial Differential Equations (ODEs and PDEs)

Numerical Methods in Pascal page
http://www-rab.larc.nasa.gov/nmp/nmpIndex.htm#Calculus 

Runge-Kutta ODE Algorithm
www.delphiforfun.org/Programs/Math_Topics/rungekutta.htm 

Category Math Description Source(s)
bsstep integrate ODEs, Bulirsch-Stoer step recipes
mmid integrate ODEs by modified midipoint method recipes
odeint integrate ODEs with accuracy monitoring recipes
rk4 integrate one step of ODEs, fourth-order Runge-Kutta recipes
rkdumb integrate ODEs by fourth-order Runge-Kutta recipes
shoot solve two-point boundary value problem by shooting recipes
shootf solve two-point boundary value problem by shooting to a fitting point recipes
solvde two-point boundary value problem, solve by relaxation recipes
sor elliptic PDE solved by successive overrelation method recipes

 


Sources Key

Source Description/Location
AugMath Augmented Math (what Borland left out)
www.engineeringobjects.com/AugMathUnit.htm 
ESBMaths
ESB Consultancy
Developers of Mathematical & Statistical
Software and Delphi Software.

ESBMaths is a collection of Integer and Floating Point Routines for Delphi. Includes probability and statistical related routines

Freeware ESBMaths with Source.  www.esbconsult.com

EZMath ?
DSP Delphi Super Page (not to be confused with Digital Signal Processing):
http://delphi.icm.edu.pl
ISPL Delphi interface for the Intel Signal Processing Library (5430 lines, 872 procedures and functions exported by NSP.DLL): http://home.t-online.de/home/Robert.Rossmair/nsp.htm

Intel Signal Processing Library:
http://developer.intel.com/vtune/perflibst/spl

math Borland's Delphi math unit
mathe Scientific Subroutine Library
mathlib2 ftp://ftp.coriolis.com/Downloads/mathlib2.zip
recipes Numerical Recipes Pascal shareware version, ftp://garbo.uwasa.fi/pc/turbopas/nrpas13.zip
(On-line FORTRAN/C Books:  www.nr.com.)
StatUnit www.math.ku.dk/ims/software/index.html
TPmath1
TPmath2

TP Math

Jean DeBord's TPMath
www.unilim.fr/pages_perso/jean.debord/tpmath/tpmath.htm 

Turbo Turbo Algorithms (C, Pascal, Basic, Prolog)
Keith Weiskamp, Namir Shamas, Ron Pronk
John Wiley, 1989 (Out of Print)
UDDF Math Unofficial Delphi Developers FAQ:  www.gnomehome.demon.nl/uddf/pages/math.htm (linki broken 30 July 2000)

Links Verified 30 Jul 2000
Updated 05 Jul 2003


since 1 Nov 1998