Last Modified January 16, 2005

Numerical Methods in Pascal: Code Downloads


Frameworks & Pascal Language Extensions

[o] EFLIB: An Extended Function Library by Johan Larsson
[o] Pascal-XSC

Computer Algebra Systems (CAS) and Expression Parsers

[o] MathWizard: a CAS in Pascal by Jonathan Luyckx
[o] Marco van de Voort's symbolic solver for Free Pascal & Delphi
[o] Symbolic differentiation using DiffExpress
[o] PAS Math: a CAS developed under GPL
[o] TCioinaEval: a fast and full-featured expression parser from Alexei Cioina
[o] Stefan Hoffmeister's Mathematical Expression Evaluator
[o] Vladimir Safin's Formula Compiler and other mathematical software for Delphi

Libraries & General Numerical Methods

[o] Jean Debord's Turbo Pascal Math Library
[o] Earl F. Glynn's Computer Lab
[o] Jean-Didier Gayrard's MathLib2 : a Turbo Pascal math functions library
[o] fsUltra : a pseudo-random number generator
[o] Mark Horridge's SparSolv Unit for sparse linear systems
[o] Lluis Olle's SparLin, a Delphi component for sparse linear systems
[o] The MtxVec Library from Dew Research
[o] David Butler's Delphi Fundamentals: mathematical routines and other goodies
[o] Delphi Mathematics Components from Hans Lohninger
[o] Numeric-Tools: a Delphi equation-solving component
[o] ChroMathSome for Delphi by John Merrit
[o] Coherent Cognition's MacMathPascal Library
[o] Jean-Pierre Moreau's Numerical Analysis website
[o] An operations research library from Seoul National University
[o] Marco van de Voort's numerical mathematics library for Free Pascal
[o] Han de Bruijn's Industrial and Applied Mathematics page
[o] Herbert Sauro's TLSODA for ordinary differential equations
[o] Antonio Gornia's Simultaneous Equation Solvers
[o] Volker Walter's Amoeba: A Nelder-Mead Solver
[o] Petr Mikulik's mathematical freeware (including a Levenberg-Marquardt routine)
[o] Michael Perdue's nonlinear regression code
[o] Source code for engineering students from Annibal Hetem, Jr.
[o] Ray Lischner's tools for floating point calculations in Delphi
[o] Dmitriy Anisimkov's Integer and Linear Programming (and FFTs and other goodies)
[o] Markus Weidenauer's LP-Optimizer
[o] Glenn Crouch's Delphi Math Unit and Scientific Calculator
[o] From ESB Consultancy, Alan Miller's Random Number Module
[o] ESB's Professional Computation Suite
[o] StatUnit from The Institute of Mathematical Statistics
[o] Applied statistics algorithms from StatLib
[o] Fred Edberg's Delphi Regression Components
[o] Delphi Statistics Components for Databases from Applied Analytical Systems
[o] Das Mathe-Programm der DPG
[o] The Stony Brook Algorithm Repository maintained by Steven S. Skiena
[o] A Scientific Subroutine Library for Turbo Pascal
[o] Rene Tschaggelar's Delphi mathematics solutions
[o] The EBK&NVS Pascal-Delphi Math Library
[o] Kjell Rilbe's complex number class for Delphi
[o] SWAG : the SourceWare Archival Group
[o] The Mathematics & Statistics section of Torry's Delphi Pages
[o] John Stockton's Borland Pascal Maths Page
[o] Ernie Deel's EFD Systems Tools
[o] Random numbers from the Mersenne Twister
[o] Bent Nielsen's Special Functions Library
[o] Robert Bullock's Delphi math units
[o] Franz Glaser's TP-Links
[o] Techniques of Scientific Computing from Monash University
[o] Delphi Tools for Physics at Davidson College
[o] UDDF: the Unofficial Delphi Developers FAQ
[o] Some Optimization Codes in the Public Domain
[o] The Home of the Hammster
[o] Bob Ferguson's Mathematical Freeware
[o] Harry J. Smith's Fun With Mathematics
[o] Andrew Williams' Mandlebrot Set project
[o] The Turbo Pascal Programmers' Page
[o] A Simulation Toolbox from Lin Jensen of Bishop's University
[o] William F. Polik's Turbo Pascal Procedures and Functions library
[o] Mark Myatts's statistical utilities
[o] Berend Tober's Delphi math routines
[o] A Random Number Test Suite from StreamSec.com
[o] Satya's collection of Numerical Methods in Pascal
[o] Crout's method in Delphi
[o] FitAll: nonlinear regression analysis from MTR Software
[o] The SysTools Library from Turbo Power Software
[o] Bill Miller's OpenStats2: an open-source statistical analysis package
[o] Fit Simplex, a curve-fitting program from Julien Bobroff
[o] Scientific Mathematics: using Exentia and byte-alignment for fasting floating point operations
[o] Vector mathematics in two and three dimensions
[o] A large collection of mathematical source code from the Pascal.Sources.Ru website
[o] Mathematical goodies from Borland's Code Central
[o] Mathematics units in the Free Pascal archives
[o] B-Spline code from NIST
[o] Delphi number-crunching components from Nils Haeck
[o] Numerical methods code from the University of Aarhus
[o] Arash Partow's FastGEO library for computational geometry
[o] [New!] GrMikeD's solutions to the traveling salesman problem

Large Integers

[o] [updated] Marcel Martin's Large Integer Library
[o] Walied Othman's FGInt: Fast Gigantic Integers
[o] A large integer arithmetic unit by Keith Briggs

Special Purpose Science & Engineering Codes

[o] Sergey Sadov's scientific software for scattering matrix calculations
[o] FDTD: Finite-Difference Time-Domain code for Delphi
[o] Eugeny Shybanov's large particle Mie-scattering code
[o] DSpatial: tools for the manipulation and visualization of satellite imagery
[o] The Matrix: mathematica physics coded in Delphi
[o] [New!] Michael Vinther's AEP analysis in EEG from schizophrenic patients using PCA
[o] A Schrödinger Equation Simulation by P. B. Visscher and D. L. Wewers
[o] Steam calculations from Gerard Koops & Bernhard Spang

Artificial Intelligence

[o] Digitial Filtering, Neural Networks, and Genetic Algorithms from BaseGroup Labs
[o] NEFCLASS-PC: A Neuro-Fuzzy Classification System
[o] Pieter Spronck's Elegance: genetic algorithms in Delphi
[o] An Introduction to Evolutionary Algorithms from Dan Taylor
[o] The Inference Engine Component Suite from RiverSoftAVG

Digital Signal Processing

[o] Robert Rossmair's Delphi interface unit for The Intel Signal Processing Library
[o] Don Cross's FFT code and tutorial
[o] John Herbster's generalized radix FFT code
[o] Andreas Hofer's Delphi FFT Unit
[o] Filip Jurcicek's Wavelets Studio for Delphi
[o] Eugen Tarasov's DSPLab for Delphi
[o] METEOR: FIR filter design from Steiglitz, Parks, and Kaiser
[o] Janez Makovsek's Basic Delphi Signal Processing Package (BDSPP)

 


Frameworks & Pascal Language Extensions

EFLIB: An Extended Function Library by Johan Larsson
EFLIB is an Object Pascal application framework with cross-platform support (primarily Linux, MS-DOS and UNIX), and is freely available for non-commercial use. EFLIB includes the following math routines:
EFLIB can be downloaded from the EFLIB Web Site. At the same site you'll also find complete documentation (on-line user's guide, class reference, FAQ, etc.)
Pascal-XSC
I'm not sure if this qualifies as a dialect of Pascal, or whether it's a whole new language whose immediate ancestor is ISO Standard Pascal. According to the description on the Pascal-XSC home page, it was developed specifically to supply a powerful tool for the numerical solution of scientific problems based upon a properly defined and implemented computer arithmetic in the usual spaces of numerical computation.

Please Note: ALL XSC software has been available FREE OF CHARGE since 1997. Don't be confused by pricelists etc. on some webpages which are related with XSC software: these webpages have not been updated by the responsible webmaster.

(Can someone can provide a more comprehensive review of this system?)

Computer Algebra Systems (CAS)

MathWizard: a CAS in Pascal by Jonathan Luyckx
MathWizard is a CAS(Computer Algebra System) written in Borland Pascal 7.0. The current release(V0.1) is an alpha version, and should be approached as a preview of what's to come, rather than a completely finished product. The current capabilities include:
The distribution package -- which can be downloaded here -- contains the complete source code, as well as the DOS-based executable. The program is being actively developed, and the author gladly accepts comments, suggestions, new ideas, etc.

An NMP News Update! Here's some good news for those of us interested in CAS development in Pascal. I've recently (April 25, 2000) received a brief note from Jonathan Luyckx updating me on the current state of MathWizard. Among other things, Jonathan says, "I have to say that I learned A LOT about computer algebra since I sent you the alpha version of MathWizard, and I now have a much cleaner view of the internals of a computer algebra program. It's clear to me that in order to create a solid algebra system, I have to rewrite the foundation of the program. In doing so, I also decided to develop this program in Delphi [...] the Mathwizard project is NOT discontinued [..] I only moved it to windows, and rebuilt it from the ground up."

Marco van de Voort's Expression Parser & Symbolic Solver
Marco van de Voort has put together a set of classes that can evaluate user-defined functions, and do "simple" symbolic operations (e.g., take derivatives, generate Taylor series, etc). While this is still a work in progress, Marco's initial release incorporates the following features...
Symbolic Expression Handling
  • Simple operators on expressions ( + / * - ^ )
  • Derivatives for simple functions (all operators + most functions in the Free Pascal math unit)
  • Taylor series
Primitives for Rearranging Expressions
  • Identifying of terms
  • Simple simplying (e.g., 2*2*x -> 4*x)
High Speed Evaluation (parse once, evaluate often principle)
  • Infinite variables
  • Infinite (symbolic) constants
  • Fast (hopefully!)
Cross-platform Development
  • Compiles under Free Pascal for multi-platform support
  • with a few simple (and obvious?) changes, will also compile under Delphi
Marco's code comes packaged with a nice bit of documentation (from which I extracted the feature list above). After you download a copy of Marco's symbolic library, read through the documentation, and check out the very impressive "To Do" list!

Symbolic differentiation using DiffExpress
DiffExpress provides symbolic differentiation of (simple?) mathematical expressions. It supports 5 different operators (+ - * / ^), parenthesis, 18 mathematical functions (sin, cos, sqrt, ln, etc), and an unlimited number of user-defined variables. DiffExpress is distributed freeware, and includes full source.

AidAim Software, the authors of DiffExpress, also distribute an expression evaluator called CalcExpress. Like DiffExpress, CalcExpress is freeware with full source.

PAS Math: a CAS developed under GPL
Michele Povigna and Carmelo Spiccia are the lead developers for PAS Math, a computer algebra system developed on-line in the it.comp.lang.pascal newsgroup. The latest version has experimental support for XML/MathML, and is an interpreter for the PAS Math Script Language. In addition to the transcendental and trigonometric functions supported by standard expression parsers, PAS Math also includes support for...
COMB(n,k) Calculates simple combinations
DERIV("function",x[,n]) Calculates the derivative of a function in x
INT("function",xi,xs[,n]) Calculates the definite integral of a function
MEAN(x1,x2, ... xn) Returns the arithmetic mean of the arguments
PERM(j1,j2, ... jn) Calculates permutations
VAL("function",x) Calculates the value of a function in x
Complete source code is available at Carmelo's PAS Math website and at Michele's PAS Math website

TCioinaEval: a fast and full-featured expression parser from Alexei Cioina
Alexei Cioina's TCioinaEval is a robust cross-platform mathematical expression evaluator for Delphi 6+ and Kylix 2+ that parses input strings at blazing speed (as much as 9 to 10 times faster than UCalc 2.0, according to numerous tests that Alexei has run) and offers top-notch calculating performance. TCioinaEval includes a huge library of built-in functions and will of course accept user defined functions and constants (a maximum 65535 for the latest version). In addition, TCioinaEval can provide symbolic differentiation of the functions it is asked to evaluate and (unique, in my experience) export its results in Mathematica 4.1 format.

To download the initial trial version of TCioinaEval, click here.

Neat New Updates: 15 March 2003

Not content to rest on his laurels (check out this unsolicited review from Ben Crain, author of Numerical (solutions) to Ordinary Differential Equations), Alexei has been extending the capabilities of TCioinaEval with a couple of powerful new units...

TDomainsEval

Alexei Cioina's Domains Builder utility is a software tool for engineers and applied mathematicians for meshing 2D domains. The engine that drives Domains Builder is Alexei's TDomainsEval. I must admit that I haven't messed with meshes in years, so I raided the DomainsEval read-me file for the following description...

A Domain is a closed set of planar points which satisfy a logical algebraic condition. A primitive (Atom) is the simplest domain. The following primitives have been defined in TDomainsEval:

  • Closed Ellipse with rotation angle;
  • Closed Rectangle with rotation angle; and
  • Closed Round Rectangle with rotation angle.
Five logical algebraic operations are defined on a domain
  • Union
  • Intersection
  • Compliment
  • Difference
  • Symmetrical Difference
TDomainsEval can parse and evaluate a composed domain built with primitives and operations. After parsing you can test planar points to determine if they are included in the domain or every part of the domain.

TCioinaMathLink

Another very useful unit from Alexei Cioina is TCioinaMathLink, which provides a seamless link to the Mathematica 4.1 kernel for symbolic calculation of derivatives, indefinite integrals...and anything and everything else you might want to get from the almighty Mathematica.

TParser by Stefan Hoffmeister
Stefan Hoffmeister's TParser is a Delphi component for parsing and evaluating mathematical expressions at runtime. According to the accompanying documentation, TParser's performance is remarkable - only 40-80% slower than similar compiled expression - and it is by far the fastest parser on the freeware market. TParser offers native support for the following operators and functions:
Operators Functions

addition (+) MIN, MAX
subtraction (-) COS, SIN, SINH, COSH, ARCTAN
multiplication (*) EXP, LN
division (/) SQRT, ABS
exponentiation (^) HEAV (heav(x) is =1 for x>0 and =0 for x < = 0)
DIV SIGN (sign(x) is 1 for x>1, 0 for x=0, -1 for x < 0)
MOD ZERO (zero(x) is 0 for x=0, 1 for x<>0)
PH (ph(x) = x - 2*pi*round(x/2/pi))
RND (RND(x) = x * Random)
(Adding your own functions is easy, too.)

TParser is freeware. It's available in both 16 and 32 bit versions from Econos Consulting Services, and the Delphi Super Page and its mirrors

Vlad's Delphi Page : Mathematical Software by Vladimir Safin
The Dimak & Vladimir Safin Delphi pages of a couple of useful mathematical tools. TFormulaCompiler is a runtime expression parser which the authors claim " evaluates results 1.5-3.0 times faster than hardcoded Delphi." The authors go on to describe TFormulaCompiler as a "real compiler, not an interpreter. After accepting valid arithmetic expression it generates machine code for evaluating given expression. [...] The code generated is very close to optimal. It uses almost 100% of math coprocessor resources." TFormulaCompiler is shareware, with full source available on registration.

Also available from the Dimak & Vladimir Safin Delphi pages is a matrix package which includes the TRealMatrix and TSparseMatrix components (yes, they descend directly from TComponent) and the TRealVector and TSparseVector components. The matrix stuff is freeware, with full source code written by Vladimir Safin.


Libraries & General Numerical Methods

The Turbo Pascal Math Library by Jean Debord
This is an excellent, actively maintained library compatible with a large number of DOS and Windows Pascal compilers. The description that follows is quoted from an earlier version of the TP Math homepage:

Welcome to TP Math, a mathematical library in Pascal for DOS, Windows and Linux. At this time, this library is compatible with:

This library is distributed as Freeware. You may use it anyway you like, as long as you don't charge money for it, remove the copyright notices, or hold anyone liable for its results.

This library provides routines and programs for :

Latest Updates: 30 August 2001

Latest Updates: 16 November 2002

The following programs are now availble on the TPMath web page:

The author has established a TP Math mailing list specifically to support his library. In my experience the response time is always excellent...

MathLib2 : a Turbo Pascal math functions library
This is a freeware collection of basic mathematical functions written by Jean-Didier Gayrard. Included are trigonometric, logarithmic and exponential functions, hyperbolic functions, and a complex numbers unit. Full source for all routines is included. The real treats here are the separate source files offering versions of the trig, log, exponential, and hyperbolic functions implemented in 387 assembler. You can find a copy at the Delphi Super Page in the Delphi 1.0 Freeware section. (Alternately, you can download a copy directly from this site.)

fsUltra : a pseudo-random number generator
review courtesy of Stefan Hoffmeister
There is a PRNG called FSULTRA that is available in quite a lot of languages, amongst them Turbo Pascal xxx (I am running it successfully with Delphi 1). It comes with a good import unit for TP and is written fully in assembler, making it extremely fast.
This is the Marsaglia PRNG, with code written by Zaman and Marsaglia of Florida State University. You can download a copy of fsUltra1.zip from this site.

The SPARSOLV Unit by Mark Horridge
Need to solve a large system of linear equations where most equations only mention a few of the variables? Then look at Mark Horridge's SPARSOLV unit. It solves linear systems with one RHS of size 100-5000 equations. The LHS matrix need not be symmetric and would typically have up to 10 non-zero entries per row. With source, for Borland dialects TP7.0 through to Delphi 3 and above.

Revised November 1999, with new example Windows program, and comparison to Luis Olle's SparLin Unit

Lluis Olle's SparLin Unit
Lluis Olle has ported NetLib's Sparse 1.3 package to Delphi's Object Pascal. The original SPARSE is written in C by Kenneth S. Kundert; according to Lluis, SparLin is
not an exact port of the original, but is 100% Delphi Object Pascal, with some added features not present in the original. [...] Currently I'm using the compoment for solving power flow problems of about 2000 buses (which implies a Jacobian of 4000x4000), and it takes a few seconds to solve a 10-15 iterations using Newton-Raphson.
SparLin elements are real numbers. Also available is the THsMatrix class, which is designed to hold sparse matrices of complex numbers. THsMatrix uses a hash function to access the elements quickly. A Delphi demonstration project is included with both the SparLin component and the THsMatrix class.
MtxVec: Object-oriented numerics from Dew Research
Dew Research is a joint venture between Janez Makovsek (the author of the Basic Delphi Signal Processing Package) and Marjan Slatinek. Together they have built MtxVec, a numerical analysis package for Delphi that includes "built in multithreading, intelligent object handling, CPU specific optimized code, designed for huge data sets, (and) complete vector/matrix arithmetic. The basic packages includes units for probability calculations, optimization, computation of special functions, and handling polynomials. Highlights from the MtxVec feature set include... Lots of other features (mostly to do with library architecture and interface issues) are listed at the MtxVec website. The latest version (V1.02) contains several updates, and now uses the latest version of the Intel Math Kernel Libraries (MKL 5.1).

UPDATE, 18 August 2001
Dew Research has just released Statistics V1.0, a new add-on package for their object-oriented numerical library MtxVec. The Statistics Package enhances MtxVec with these new capabilities: As with the MtxVec library, the complete Pascal source for the Statistics Package is available for purchase from Dew Research. (Because MtxVec makes use of several of Intel's numerical libraries, not all of the MtxVec source code is written in Pascal; see the note at the bottom of the MtxVec order page.)

For those of you who only need a limited set of the features offered by the Statisctics Package, Dew Research also offers what they call a "Probabilites Package", which includes "a replacement for Delphi's Math unit and a set of 19 different probabilities functions". .DCU files are available as freeware for Kylix and for Delphi 4, 5, & 6, and the full source can be purchased

UPDATE, 4 July 2002
The guys at Dew Research have been hard at work improving and augmenting their flagship product. The result is MtxVec Version 1.5, which is now available for a test drive at their web site. In addtion to lots of optimizations to the existing code, this new version adds (according to Janez Makovsek) "an extensive sparse matrix library and a function evalutor capable of parsing complex numbers". To check out the complete list of enhancements, pay a visit to the Changes MtxVec 1.5 web page...

UPDATE, 23 February 2003
Dew Research keeps adding more and more functionality of its flagship product MtxVec. Their lastest add-on is a digital signal processing package. In addition to a variety of different transforms (e.g., Z, Laplace, Hilbert) the the DSP library include For those who like to try before they buy, a trial version of the MtxVec DSP add-on is available for download. And if you want an overview before taking the download plunge (the trial version is a whopping 14.2 Mb), Dew Research makes the help file available either in an online version or via download for off-line browsing.

Delphi Components from Hans Lohninger
Hans Lohninger offers the following shareware units/components through his web pages
Borland Pascal programmers will find similar offerings here

David Butler's Delphi Fundamentals
David Butler has put together a comprehensive collection of routines to allow Delphi programmers to work at a higher level of development. His Delphi Fundamentals library contains units for string manipulation, dealing with internet stuff (i.e., the implementation of various RFC standards), handling dates and times...and of course a maths unit. The maths unit is the biggest of the bunch, and addresses a wide range of topics. In it you will find classes and functions for...

Numeric-Tools: A Delphi Component
Yudi Wibisono and Masayu Leylia Khodra have written Numeric-Tools, a Delphi Component for the numerical solution of mathematical problems. and procedures that can complement those available with Delphi. The authors advertise the following capabilities for their tool: An evaluation version is available from the Numeric-Tools website. Complete source is provided upon registration.

ChroMathsome for Delphi
This large collection of numerical routines is available as shareware from John Merrit. The author's ChroMathsome.txt file includes the following description :

ChroMathsome is a collections of units (this is NOT a component!) that have implementations for advanced mathematical functions and procedures that can complement those available with Delphi.

Implemented functions include:
There are more than 300 functions implemented in ChroMathsome...

An updated description of ChroMathsome (as of 7 February 1998) can be seen here

Evaluation versions of several ChromMathsome units -- binary logic, calculus, linear algebra, and statistics -- can be found at Torry's Delphi Pages in the Science sections. Complete source is available upon registration.

Jean-Pierre Moreau's Numerical Analysis website
The Pascal section of Jean-Pierre Moreau's multi-language numerical analysis website offers a very large selection of algorithms coded in Turbo Pascal for Windows. A slightly abbreviated table of contents shows these sections... As you can see, this is a very comprehensive list of basic (and not so basic) algorithms, one that includes a few things that are relatively rare. Each algorithm is presented in a separate webpage, so you can get exactly and only those things you want. (This is great if you only need a few routines...but perhaps not so great if you want to download the entire collection.)

Seoul National University's Operations Research Library
The Department of Industrial Engineering at Seoul National University has put together a very comprehensive online operations research lab. The library offers source code solutions (in Pascal, C, Basic, Fortran, and Java) that can solve most models of Operations Research. Volume 1 contains codes for solving 28 of the more basic problems in operations research, including modules for Volume 2 contains an additional 28 routines that address more advanced problems, including

While there is definitely a mother-load of code here, the Pascal routines APPEAR as if they may be a direct translation from FORTRAN, somewhat similar to the Numerical Recipes freeware collection. The one module I looked at (nonlinear minimization) featured a very heavy dose of labels and "goto" statements.

If you're interested in more than just code, check out the selection of articles available for download at the ORLab Library.

Marco van de Voort's Numerical Mathematics Library
One of the driving forces behind the devlopment of Free Pascal is Marco van de Voort. Currently Marco is in the process of incorporating into Free Pascal a large numerical methods library originally written for Turbo Pascal by Kees van Ginneken, Wil Kortsmit and Loek van Reij of the Computational Centre of the Eindhoven University of Technology. This is a very comprehensive library, containing routines for... You can obtain a snapshot of the library code as of 2000.07.13 here. The latest version can be obtained from the Free Pascal website on the development page. The "collection smaller packages" in the Download Daily CVS Sources section contains not only the numerical methods code, but also other modules for dealing with regular expressions, OpenGL, and a whole host of other useful goodies...

Han de Bruijn's Industrial and Applied Mathematics site
Han de Bruijn offers a treasure trove of unique material at his Industrial and Applied Mathematics website. In addition to a lengthy and detailed "Series on Unified Numerical Approximations" (published previously in 1993-94 the sci.math.num-analysis newsgroup), the site offers Recently Han has expanded his offerings with some in-depth engineering calculations, such as... There are numerous other goodies too, including computer experiments in the fields of Statistics and Computational Geometry.

There's a genuine wealth of information and code (and opinion!) at this site; it's definitely worth a visit.


Herbert Sauro's TLSODA: an ODE solver for Delphi
TLSODA is a translation of the LSODA (Livermore Solver of Ordinary Differential Equations) stiff differential equation solver available as freeware from Herbert M. Sauro's Future Skill Software. According the the Future Skill website...

LSODA can dynamically switch integration method according to how stiff the problem is. The two methods employed include:

I've looked briefly through the source code, and found a couple of things to really like: (a) TLSODA is a genuine Delphi class, and (b) the code contains a hefty number of comments. What's more, the TLSODA download also contains a vector class and a reasonably full-featured matrix class that includes routines for LU decomposition, singular value decomposition, and matrix inversion.

Antonio Gorni's Scientific Freeware
Antonio Gornia, a researcher and engineer in a Brazilian integrated steelworks, offers the following Turbo Pascal programs for doing linear and nonlinear regression: The programs are provided as source code only, and require Turbo Pascal 5.0 or better to compile.

Volker Walter's Amoeba: A Nelder-Mead Solver
Volker Walter has translated the Nelder-Mead downhill simplex method (Nelder, Mead; 1965; Computer Journal; vol 7, pp 309-313) from the original FORTRAN into Pascal. His Amoeba package contains the complete source code for implementations in both Borland Pascal and Delphi.

Petr Mikulik's Mathematical Freeware
Petr Mikulik's Freeware Page contains numerical mathematics code in several different language. While most of the routines are written in C++, Petr's Pascal offerings include

Michael Perdue's Nonlinear Regression Routine
TurboNLR is a very well documented implementation of the Fletcher-Powell method, "translated directly from the FORTRAN program FMFP (Fletcher and Powell Unconstrained Search Technique), which is described on pp. 221-225 of System/360 Scientific Subroutine Package, H20-0205-3 (International Business Machines Corp.)" The source is written in Turbo Pascal 3.0 (or earlier???), but compiles cleanly in Delphi 4 and FPC 0.99.14 with very little modification.

Source code for Engineering Students from Annibal Hetem, Jr.
Annibal Hetem, Jr. provides the Turbo Pascal source code from the Numerical Calculations course taught to second year of engineering students at the Universidade Paulista in São Paulo, Brazil. Included are modules for

Free Delphi Software from Tempest Software
Ray Lischner publishes several routines of interest to anyone doing numerical work in Delphi. In particular you might check...
All of these are found in the Delphi Components section (where else?)

New!! Ray's latest book, Delphi In A Nutshell (O'Reilly, ISBN 1-56592-659-5) hit the bookstores in late March of 2000. The code that accompanies the book (which you can download for free) contains several sweet goodies for Delphi users, including a very useful FPU unit and a threaded Mandlebrot set demo.

Dmitriy Anisimkov's Integer and Linear Programming, FFTs, and more
Dmitriy Anisimkov offers solutions in Delphi and Borland Pascal 7.0 to several different problems. Available for download at his web site are modules dealing with linear and integer programming, arbitrary precision arithmetic, and fast Fourier transforms. Documentation in ASCII format is provided in Russian. (If some kind soul can provide a rough translation, I'd be grateful.)

Markus Weidenauer's LP-Optimizer
Markus Weidenauer offers the complete source to his LP-Optimizer (a revised Simplex procedure) written entirely in Pascal for DOS (BP7) and OS/2 (Virtual Pascal)

Glenn Crouch's Delphi Math Unit and Scientific Calculator
ESBMaths from Glenn Crouch at ESB Consultancy is a collection of integer and floating point routines for Delphi and Kylix. The Delphi Math unit is not required. The latest update (19 June 2001) supports Delphi versions through D6 and includes vector and matrix routines (D4 and above) and probability and statistical routines. Freeware, with full source AND and extensive help file included. (Note: see the 2002.09.22 ESB Update for more info)

The ESB Scientific Calculator (also Freeware) has Infix Notation, Brackets, Scientific Functions, Memory, Result History list, and more. It too includes Delphi 4 source.
ESB's Random Numbers Module for Delphi
Glenn Crouch and crew have announced yet another bit of freeware for the mathematically inclined Delphi programmer. The easiest way for me to describe it is to repeat the text of Glenn's e-mail announcement below...

ESB Consultancy is pleased to announce the Public Beta of AMRandom - a translation of Alan Miller's Random Module for FORTRAN-90 into Borland Delphi. This translation has been done with Dr Miller's approval and is being made FREELY available to all Delphi Developers, though we do ask the Alan Miller and ESB Consultancy be given due credit. The following Random Number Generators are included:
Normal (Gaussian) Gamma Chi-squared
Exponential Weibull Beta
Student's t Multivariate Normal Generalized inverse Gaussian
Binomial (2 different ones) Negative Binomial
von Mises Cauchy
Borland Delphi 4 and above required. And as of 8 October 2001, ESB also offers AMRandom for Kylix users (see AMRandom for Cross Platform Development v1.0)
 

Note: The initial release of AMRandom generated random deviates from the listed distributions by first calling Delphi's built-in random number generator. The updated version (beta 2) now has overloaded routines so that users of the library can pass in the uniform random number Generator of their choice. The default is still Delphi's built in generator, but wrapper code is included for using Ernie Deel's Mother Of All Pseudo-Random Number Generators instead.
An ESB Freeware Update: 22 September 2002
To get all of the functionality that Glenn includes in his ESBMaths and AMRandom units (and for that matter, his very useful ESBDates too) check out the FREE SUBSET of the ESB edit components in his mighty ESB Professional Computation Suite. This collection, which is distributed on the Delphi 7 Companion Tools CD, contains an excellent selection of components for numerical data entry, including integer edit controls, floating point edit controls, and scientific edit controls. And of course you also get updated versions of all of the mathematical routines previously included in ESB's freeware offerings. Typical of ESP products, the complete source code is included, as is help in HTML format. For those of you without the D7 Companion Tools CD, Glenn has graciously uploaded versions for both Delphi and Kylix to Borland's Code Central repository.

ESB's Professional Computation Suite
In late August of 2001 ESB Consultancy released Version 2.0 of their Professional Computation Suite. This is an enormous collection of more than 100 units containing over 6000 routines/methods and over 150 classes and components for Borland Delphi 4, 5, 6, and 7. ESB's comprehensive set of numerical routines includes...

I wrote Glenn to ask him about the enhanced mathematical capabilities in ESBPCS V2. He replied that...
From the Math point of view, the biggest thing would be the Data Aware side of things - we now have...
  • Data Aware Hypothesis Analysis for the Mean and for the Variance,
  • Data Aware Linear Regression, and
  • Statistical Routines that work on a Data Source (i.e. no components besides the data source involved).
If (like me) you're not a database aficionado, there's still lots to like in ESBPCS V2...because now ESB is offering a "Lite" version which DOES NOT contain the data aware stuff, and DOES come at a substantially reduced price. Both the Standard and Lite versions of the ESBPCS package include a huge variety of custom designed Edit Controls for various numerical and mathematical data types. In addition to the customary assortment of numeric editors for floating point and integer values, you'll also find visual vector and matrix editors, and a complex number editor. The ESBPCS package is distributed as shareware and includes full source upon registration (about 3.5 Mb, not including the demo programs).

One other really nice thing about these components...the guys and girls at ESB Consultancy are constantly working to improve their product, and updates for registered users are a regular event. As of 22 September 2002, the current version of ESBPCS is version 2.3, released on 14 September 2002.


An ESB Update: 16 January 2005
As I noted/predicted above, over the last couple of years Glenn Crouch and his ESB Consultancy colleagues have continued to improve and expand their flagship product, the powerful and comprehensive ESB Professional Computation Suite (ESBPCS). ESBPCS for VCL Version 4.0.0, released on 16 December 2004, now contains over 6000 routines/methods and over 235 classes/components in over 140 units for Borland Delphi 5, 6, 7 and 2005/Win32. Obviously this is a really BIG product...and because ESB recognizes that there could be a number of folks who only want or need bits and pieces of the ESBPCS, the latest redesign of the ESBPCS unit structure makes it possible for ESB to satisfy those folks by distributing the following dedicated subsets: Finally, for those of you who (like me! ;^D) never ever use data-aware components, ESB also offers the compact and complete For details on what's included in the individual packages, scope out the feature matrix at ESB's website.

Earl F. Glynn's Computer Lab
The Computer Lab is a magnificent resource for Delphi programmers, with pages devoted to Mathematics, Graphics, Image Processing, Fractals & Chaos, and Science & Engineering. The Mathematics page contains links to numerous code collections, including several complex number libraries, and a Delphi Interface to Intel Math Kernel Library (DLL). The Graphics page includes 2D and 3D graphics code written in several dialects of Pascal (Delphi 1 and 3, and Turbo Pascal).

While most of the code at the Computer Lab is written specifically for Delphi, enough of it is sufficiently generic to be of use to programmers using other dialects of Pascal.

Prior to building his site(s), Earl made several of routines available here for download. The units listed below are still available at this site, although newer versions may be available at the ComputerLab

The ComplexOps Unit, a Turbo/Borland Pascal unit from Earl F. Glynn
The ComplexOps UNIT provides complex arithmetic and transcendental functions in Turbo Pascal, including complex trig (sin, cos, tan, csc, sec, cot), hyperbolic (cosh, sinh, tanh, sech, csch, coth), Bessel (I0, J0) and certain special functions (Log Gamma and Gamma). Complex values can be represented in either rectangular or polar form with conversions taking place as necessary (or on request). A "CDemo" program is included that shows how many of the complex functions can be used. The output from CDemo is also included.

ComplexOps may be freely distributed ONLY for non-commercial use. You can download a copy here

A 2D & 3D Graphics Library for Delphi 1.0
This is a pair of two units that provide a matrix library and a set of graphics primitives for displaying 2D and 3D graphics in Delphi 1.0 (not yet tested in 2.0). The math unit should be understandable by anyone with knowledge of matrix math and 2D/3D geometry. The Graphics Primitives unit allows the definition of 2D/3D vectors using real world coordinates (DOUBLE values). These coordinates can be transformed (scaled, rotated, translated) before display. To simplify display of 3D objects, a ViewTransformMatrix can be defined. Multiple viewports can be defined on a logical window. Clipping to each viewport is possible.

The Graphics Library may be freely distributed ONLY for non-commercial use. You can download a copy here


StatUnit, offered by The Institute of Mathematical Statistics
The Institute of Mathematical Statistics is affiliated with Faculty of Science, University of Copenhagen. The following description of the StatUnit package is a quote from their web page
StatUnit : This is a Turbo Pascal unit (that is a procedure library, roughly) for statistical computing. With this unit, Turbo or Borland Pascal can perform most of the tasks that are usually performed by standard statistical packages. At the same time, you maintain all the advantages of a down-to-the-ground programming language. If you are a pascal programmer, you will find it easy to write your own additional units for special purposes.

The StatUnit statistical analysis suite (and several other Pascal programs) can be found at chief author Tue Tjur's homepage

A Complex Numbers Class by Kjell Rilbe
Kjell Rilbe has written a complex numbers class for Delphi that he has recently made available to the wider Pascal community. Kjell's code comes with a very generous license:

Anyone can modify the code as they please, but I would appreciate if they send their changes to me (Kjell Rilbe) so that I can incorporate them if I think they're good. (With due credit of course!)

StatLib's Applied Statistics Algorithms
StatLib's collection of Applied Statistics Algorithms contains several items in Pascal.

Das Mathe-Programm der DPG
This page is written in German (but the available source code is in Delphi 2). Michael Beck has kindly provided a rough translation of the content of the main program modules...
Zinsrechnung Interest calculations
Kombinatorik Combinatorics: Permutations, Variations, Combinations
Wahrscheinlichkeit beim würfeln Probabilities in dice tossing
Zeichnen von beliebigen Funktionen Charting/Plotting of functions
Vektorrechnung Vector Operations
Berechnungen von/an geometrischen Figuren Area and Volume Calculations of geometric figures
kgV / ggT least common Multiple, greatest common Divisor
Mittelwerte (geom., harm., arhitm.) Calculations of averages - arithmetic, geometric, harmonic
Primzahlen Prime numbers
Bruchrechnung Fractions
Michael also recommends downloading the executable available at the Mathe-Programm site. Playing around with this should give you a better idea about the functionality of the various routines.

The Stony Brook Algorithm Repository, maintained by Steven S. Skiena
Quoting from the introduction...
This WWW page is intended to serve as a comprehensive collection of algorithm implementations for over seventy of the most fundamental problems in combinatorial algorithms.
In addition to Pascal code, there are links to versions written in C, C++, FORTRAN, Mathematica, and Lisp

You folks who are interested in this kind of stuff might also want to check out the on-line version of Steven Skiena's Algorithm Design Manual

Scientific Subroutine Library for Turbo Pascal
This is a math unit for Turbo Pascal, dating from the early 1980s. It offers matrix inversion, least squares fits, Romberg integration, and the evaluation of special functions (gamma, Bessel). In addition to the mathematics routines, several different sorting routines are also provided.

Delphi mathematics solutions from Rene Tschaggelar
Rene Tschaggelar offers well documented solutions to several common mathematical and graphical problems at his IBRT website. These include a linear equation solver, a least squares polynominal fit routine, and several tips on effective use of graphics in Delphi.

Also available from IBRT is a complex numbers unit. The code is written in Delphi, with complex numbers implemented as records.

The EBK & NVS Pascal-Delphi Math Library
The EBK&NVS Pascal-Delphi Math Library written by authors Nikolai V. Shokhirev and Eugene B. Krissinel contains units for real and complex calculations including Full source can be downloaded from the EBK&NVS website

Latest Updates: 27 October 2002
The latest and greatest release of the EBK&NVS Pascal-Delphi Math Library now contains some additional linear algebra routines. In particular, you'll now find Jacobi solvers for both real symmetric and complex Hermitian matrices, and Cholesky Decomposition.

SWAG : The SourceWare Archival Group
This is a large collection of Pascal code fragments (mostly Borland) on almost every topic. The software runs under DOS & Windows. Freeware, available at (SimTel, Garbo, and elsewhere. At last count (swag9608) the math section had 116 entries, including FFTs (see especially Bob Shor's excellent and well-commented implementation), matrix algebra, complex numbers, etc.

Update, 2000.10.22
An updated SWAG code library is now available directly through a web interface. David Cermak at ProgNET CZ now has 134 different topics listed in the SWAG math section.

Update, 2000.11.12
The SWAG math listings are also available at Math section of Chuck Gadd's Knowledge Base

Torry's Delphi Pages
The Vector, Statistics, and "MathPacks" sections of Torry's Delphi Pages contain several useful items. In addition to numerous expression parsers, Torry also has

Latest Updates: 28 November 2002
Several new goodies have been uploaded to Torry's since the last time I checked. These include

John Stockton's Borland Pascal Maths Page
John Stockton's Borland Pascal Maths Page covers a broad range of topics of interest to folks writing numerical routines in Pascal. Code offerings include a large integers unit and high-speed trigonometric functions for BP7 and Delphi

Ernie Deel's EFD Systems Tools
Ernie Deel offers a useful collection of tools and advice at his EFD Systems Tools page, including...

Random numbers from the Mersenne Twister
Makoto Matsumoto's Mersenne Twister is a random number generator of period 2^(19937-1). The algorithm has been published in a refereed journal (M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator", ACM Trans. on Modeling and Computer Simulation Vol. 8, No. 1, Januray pp.3-30 1998), and implementations are available in a huge number of different languages. Pascal and/or Delphi versions have been put together by Roman Krejci, Paul Nichols, Andrew N. Driazgov, and others. But before you check out any of these implementations, pay heed to the warning posted on the Mersenne Twister homepage:
Caution: MT is for MonteCarlo, and is NOT SECURE for CRYPTOGRAPHY as it is.
Bent Nielsen's Special Functions Library
Bent Nielsen has put together a library of special functions, including Gamma functions and Bessel functions coded from Abramowitz and Stegun.
Robert Bullock's Page
Robert Bullock's homepage includes a complex number unit and a replacement for the Delphi math unit

Franz Glaser's TP-Links
The Numeric Programming & Math section of Franz Glaser's TP-Links page has links to several implementations of the Simplex method, some complex number units, a large integer unit, and more.

Techniques of Scientific Computing from Monash University
Leo Brewin of the Math Department at Monash University offers some Techniques of Scientific Computing. Included are Pascal listings for LU decomposition, Romberg integration, Neville's algorithm, and a few others. (if the link above is broken, try this one.)

Delphi Tools for Physics at Davidson College
Some interesting demonstrations of Delphi being used for scientific programming can be found at Davidson College's Student Projects in Physics. Among the projects available (complete code and/or .exe) are programs to simulate the motion of a planetary body, to model the rate equations of a two level laser, and to demonstrate graphically multiple slit interference using Huygens principle. Also available is a matrix unit that includes matrix inversion, LU decomposition, and a power method implementation to find the most dominant eigenvalue and its corresponding eigenvector

UDDF: the Unofficial Delphi Developers FAQ
The Unofficial Delphi Developers FAQ contains a few useful mathematical routines, including a well thought-out power function by Paul Cunningham, and an FFT and (small) complex numbers library by David Ullrich.

Some Optimization Codes in the Public Domain
Jiefeng Xu's List of Interesting Optimization Codes in Public Domain contains several Pascal listings

The Home of the Hammster
The Home of the Hammster offers "a full set of trigonometric and hyperbolic routines and for complex numbers too! Also some linear and logarithmic graphing as well as true perspective viewing of 3 dimensional wire-frames."

Bob Ferguson's Mathematical Freeware
From Bob Ferguson's Freeware WebSite you can download several different mathematical codes he's written in both Turbo/Borland Pascal and in Delphi. Included among the offerings are modules for factoring polynomials (up to degree 40), generating prime numbers, and solving linear systems using Gaussian elimination.

Harry J. Smith's Fun With Mathematics
Harry J. Smith's Fun With Mathematics has Pascal listings for the calculation of Gaussian Primes and big Fibonacci numbers (and maybe some other stuff too...)

Andrew Williams' Mandlebrot Set project
Computing the Mandelbrot Set: source code and explanation by Andrew Williams. (and for lots more chaotic code, check out the entries from Borland's Fractal Programming Contest)

The Turbo Pascal Programmers' Page
My earlier announcement of the imminent demise of Johan Prins' Turbo Pascal Programmers' Page fortunately proved unfounded. The last time I checked (June 30, 2001) it was alive and well and healthier than ever. Johan offers several implementations of the simplex method and of complex numbers, a link to a prime numbers unit, and lots and lots of other useful goodies for Turbo Pascal programmers.

Coherent Cognition's MacMathPascal Library
This library is contained in a Hypercard stack, and has long been available to MacIntosh programmers. Thanks to the herculean efforts of a pair of kind-hearted net-citizens, a zip file of the MacMathPascal code is now available (as shareware) for programmers on other platforms. This looks to be a fairly comprehensive library. There are routines included for matrix methods, FFTs, differentiation and the solution of differential equations, and for several different interpolation methods. You can read the author's introduction here.

Update: 29 November 2002
I recently received a short note from Dr. Tim Kaiser, the author of MacMathPascal, giving me a little history of his product and letting me know that, after an extended hiatus (from somewhere around 1990 until March of this year), Coherent Cognition is definitely back in action. One thing I found particularly encouraging in Tim's note was this quote:
I started Coherent Cognition a number of years ago with MacMathPascal as our only product. It partly paid my way through school the second time.
Nice to know that real money has been made selling numerical analysis code written in Pascal!!

Fred Edberg's Delphi Regression Components
Fred Edberg has developed RegComp, a multifunctional regression component for 32 bit Delphi programmers. The statistical functions included focus primarily on multivariate parametric and regression related tasks. A brief (but partial) list of RegComp's capabilities includes... You can download a test-drive version of RegComp from the statistics section of Torry's Delphi Pages

Update, August 15, 2000
There's some bad news in the numerical Pascal community, but it's mitigated by a bit of good news. The bad news is that Fred Edberg has (temporarily?) bailed out of the component writing business...so if you're searching for a fully supported, ready-to-go regression component, there's now one less vendor in the market. The good news is that Fred left a very sweet legacy behind: the complete source to his RegComp component is now available as freeware in three separate packages... Fred's source is provided "as is"; it comes with all the standard disclaimers firmly in place, and without any official support from the author (though maybe you could sneak in an occasional "short & concise" question). Personally I think this is a very classy move...rather than let a bunch of useful code get old and moldy on his disk drive, Fred has released it to the Pascal programming community "so that anyone that is looking to do any kind of statistics/regression programming can have the source to use as a guide." Thanks, Fred!

Delphi Statistical Components from Applied Analytical Systems
Applied Analytical Systems offers a couple of tools for database programmers using Delphi, including components for descriptive statistics and multiple regression. A quick trip to their web page suggests that these are for database programming only. Since I'm not a database person, I have no idea how useful these things might be, nor do I have any comprehension of how difficult it is to integrate other possible solutions that are not database-oriented. Anyone care to enlighten me?
A Simulation Toolbox from Lin Jensen
Lin Jensen, a lecturer in the Department of Computer Science at Bishop's University, has put together a set of simulation programming notes to introduce students to the contents of his Simulation Techniques course. In addition the course notes, he also offers a complete simulation toolbox which includes documentation, example programs, and a suite of Pascal units for building various types of simulations. Lin describes these units as follows... The toolbox download page lists several more units, as well as a selection of complete (classic?) simulation program examples. The code is written in Turbo Pascal 6.0.

William F. Polik's Turbo Pascal Procedures and Functions library
William F. Polik, a chemistry professor at Hope College in Holland, Michigan offers a wide range of free software for scientific uses. In addition to a web-based computational chemistry package and a Turbo Pascal Graphics Library (for DOS), Polik provides a Turbo Pascal Procedures and Functions library that contains a hefty dose of numerical analysis routines. Polik's library includes units for... The code looks fairly generic. I was able to compile the two curve fitting programs with both Borland Pascal 7 and Free Pascal 1.02, with no changes whatsoever required in the source code (well, I did have to change the paths for the include files.)

Mark Myatt's Statistical Utilities
Mark Myatt has collected several "Miscellaneous Statistical Utilities" written by