$ luarocks install numlua
Numeric Lua is a numerical package for the Lua programming language. It
includes support for complex numbers, multidimensional matrices, random
number generation, fast Fourier transforms, and special functions. Most of
the routines are simple wrappers for well known numerical libraries:
complex numbers and part of the extended math modules come from C99; other
special functions, including statistical functions, are adapted from
Netlib's SLATEC and DCDFLIB; random number generation is based on Takuji
Nishimura and Makoto Matsumoto's Mersenne Twister generator as the
"engine" (uniform deviates) and Netlib's RANLIB for the remaining
deviates; fast Fourier transforms are implemented from FFTW; and the
matrix package draws most of its numeric intensive routines from Netlib's
ubiquitous BLAS and LAPACK packages.