Advanced Math Functions

 

Advanced Math Library

The HTBasic Math Library is a collection of precompiled higher mathematical and signal processing functions that can be called from HTBasic programs to enhance execution speed and save users the trouble of writing them.
 

Higher mathematical functions

  • Cylindrical and spherical Bessel and Hankel functions of real arguments of integer and half-integer order.
  • Airy and Kelvin functions of real arguments.
  • Error function and complementary error function of real and complex arguments, and Dawson's integral.
  • Elliptical integrals of real arguments.
  • Fresnel integrals.
  • Exponential, log, sine, and cosine integrals of real arguments.
  • Gamma and beta functions of real and complex arguments.
  • Incomplete gamma and beta functions of real arguments.
  • LeGendre, Hermite, and Chebyshev polynomials of real arguments and integer orders.
 

Statistics and data reduction

  • Probability density functions and probability integrals for many probability distributions.
  • Mean, median, standard deviation, and variance of sets of data.
  • Curve fitting using both linear regression and higher-order polynomial functions.
  • Polar/rectangular conversion of sequences of complex numbers.
 

Signal processing

Fourier transforms and inverse Fourier transforms of both real and complex sequences.
Digital filtering, correlation, convolution, autocorrelation, and power spectral density of sequences of data.
Windowing using cosine, triangular, and Bessel windows.
Built-in waveforms.
 

Numerical analysis

Solutions to linear systems of equations having both real and complex coefficients.
Polynomial evaluation.
Numerical integration.
Roots of equations of the form f(x) = 0.
Derivatives and antiderivatives of polynomials.
 

Loading the Subroutines

The subroutines in the Advanced Math Library are grouped into modules that share common program sections. Therefore, when a function is loaded, the entire module gets loaded. For example, the FNAi Airy function is in the module AIRY. When this module is loaded, all the other functions in the module, FNAie, FNBi, and FNBie, become available to the program also. The MATHLIB.HTS file in the HTBasic install folder contains all the modules.
 
Compiled subroutines appear in program listings as a single CSUB line listing its name and arguments. After the subroutine is loaded, the program should be saved using the RE-STORE command. The subroutine will thereafter be loaded together with the program. However, using SAVE to save the program in an ASCII file will remove any compiled subroutines from the program.
 
One or more modules may be loaded under program control by placing the appropriate LOADSUB line in the program. Re-running the program does not load them a second time.
 
LOADSUB ALL FROM "AIRY.HTS" ! from the current directory:
LOADSUB FROM "MATHLIB.HTS"  ! all from the current directory:
 
LOADSUB ALL FROM "C:\HTB386\MATHLIB\AIRY.HTS" !  from the install directory:
LOADSUB FROM "C:\HTB386\MATHLIB\MATHLIB.HTS" ! all from the current directory: