Author: Paul Lipkowski
I decided to write my own complex numbers mechanism, as FreePascal's built-in mechanism isn't sufficient enough for me.
- basic routines, type casting
- powers, square and cubic roots
- exponential and logarithmic functions
- trigonometric functions and their inverses
- hyperbolic and area functions
- MinusOneTo, ImagTo, MinusImagTo
- isZero, isNatural, isInteger, isReal, isNotReal, isImaginary, isComplex boolean functions
- ComplexNumPolar (initializing a complex number with polar coords)
- gamma, gammaln functions
- lower and upper incomplete gamma functions
- erf, erfc, erfi functions
- beta, incomplete beta, regularized incomplete beta functions
- E_n function (exponential integral) with branches
- Ei function
- li (logarithm integral)
- sinc function
- Si, Ci functions (sine integral, cosine integral)
- Fresnel integrals
- Newton symbol
(z,n)
- Dirichlet eta function
- Riemann's zeta function
- Bernoulli numbers
- Lambert's W function with all integer branches
- Infinite power tower
h(z) = z^z^z^...
- Infinities
- Complex round functions
- The complex type substitutes
Extended
type almost plug and play, except for:- inequalities (for mathematical reasons one can't set any linear order for complex numbers)
- putting them into
write
/writeln
- they must be cast withAnsiString()
.
- Bernoulli numbers generation may produce wrong results at
n >= 40
.
- W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P. Flannery; 'Numerical Recipes. The Art of Scientific Computing. Third Edition'; Cambridge University Press (2007)
- L. Lorentzen, H. Waadeland; 'Continued fractions with applications'; North-Holland Publishing Co. (1992)
- D. Harvey; 'A multimodular algorithm for computing Bernoulli numbers'; Math. Comput., 79 (272): 2361–2370 (2010)
- L. Lóczi; 'Guaranteed- and high-precision evaluation of the Lambert W function'. Appl. Math. Comput., 433: 127406 (2022)
- github.com/IstvanMezo/LambertW-function