- Recreating code for reproducing Mathematical Tables at the back of Lawden's elliptical function book in 1989.
- Currently, code could be used to reproduce all the tables.
- BC is used to gain arbitrary precision capability on nearly all platforms, as BC is available all nearly all Unix.
- Not meant to be fast. Those need performance should check
fredrik-johansson/mpmath
. - Accuracy and speed of the functions inside the code varies, but given a good enough (high enough) scale value and time, it could reproduce the numbers.
- Making more rigorous check against cancellation error or precision loss due to divisions.
- Fixing coding style and comments
- Before git repository created in the morning of 29May2022, this piece of work starts from the theta functions which are defined in Chapter 1 on 12Oct2021.
- Originally for implementing some of the mathematics needed by other works which required me to study elliptic function + integral from scratch.
- Later agree (with myself) to reproduce all Mathematical Tables at the end of the book first, making sure I could get the numbers whenever I need.
- Sometimes numbers are checked against Mathematica on a Raspberry Pi (always thanks Wolfram for making that available).
Copyright retained until further notice (or change of this line).
File | Uses |
---|---|
README.md |
This markdown README file. |
lawden.bc |
The single file which contains all stuff for computations. Table-making codes are split into other files. |
elliptic.bc |
DLMF-based implementation of Legendre's incomplete integrals of 1st and 2nd kind for Table D, replacing slow methods Lawden book recommends. |
table_A_termio.bc |
Computes Table A. Default takes ~1.31 sec. |
table_B_termio.bc |
Computes Table B. Default takes ~6.93 sec. |
table_C_termio.bc |
Computes Table C. Default takes ~8.27 sec. |
table_D_termio.bc |
Computes Table D. Default takes ~1.05 sec which uses Carlson integrals and formula on DLMF. Takes ~609.308 sec if use what the Lawden book described and too slow. |
table_E_termio.bc |
Computes Table E. Default takes ~5.26 sec. |
table_F_termio.bc |
Computes Table F. Default takes ~0.75 sec. |
table_G_termio.bc |
Computes Table G. Default takes ~1.90 sec. |
table_H_termio.bc |
Computes Table H. Default takes ~225.79 sec. (Need debug as there are two functions doing the same thing and both are not fully correct over all inputs.) |
table_I_termio.bc |
Computes Table I. Default takes ~75.40 sec. |
table_J_termio.bc |
Computes Table J. Default takes ~1.20 sec. |
table_K_termio.bc |
Computes Table K. Default takes ~2.78 sec. |
table_L_termio.bc |
Computes Table L. Default takes ~71.99 sec. |
table_M_termio.bc |
Computes Table M. Default takes ~21.60 sec. |
For obvious reason, the mathematical notation used in the description will stick to notations used in Lawden's book. Ordered by the order of appearance in the code.
Name and Arguments | Description |
---|---|
abs(x) |
Returns absolute value of |
rad(x) |
Returns |
sqr(x) |
Returns |
theta1(z,q) |
Returns |
theta3(z,q) |
Returns |
theta2(z,q) |
A lazy implementation of |
theta4(z,q) |
A lazy implementation of |
theta1deg(x,q) |
A wrapped function for Table A. |
theta2deg(x,q) |
A wrapped function for Table A. |
theta3deg(x,q) |
A wrapped function for Table A. |
theta4deg(x,q) |
A wrapped function for Table A. |
theta1_dz(z,q) |
Returns |
theta1_dz2(z,q) |
Returns |
theta2_dz(z,q) |
A lazy implementation of |
theta2_dz2(z,q) |
A lazy implementation of |
theta1_dz3(z,q) |
Returns |
theta3_dz(z,q) |
Returns |
theta4_dz(z,q) |
A lazy implementation of |
theta3_dz2(z,q) |
Returns |
theta4_dz2(z,q) |
A lazy implementation of |
k2q(k) |
Returns nome |
sn(u,k) |
Returns Jacobi's elliptic function |
cn(u,k) |
Returns Jacobi's elliptic function |
dn(u,k) |
Returns Jacobi's elliptic function |
smallk2bigk(k) |
Given modulus |
smallk2bige(k) |
Given modulus |
jacobi_epsilon(u,k) |
Jacobi's Epsilon Function |
jacobi_zeta(u,k) |
Jacobi's Zeta Function |
tabled1_1stkind_deg(phi,k) |
Legendre's incomplete elliptic integral of the 1st kind |
tabled2_integral_e(u,k) |
Legendre's incomplete elliptic integral of the 2nd kind tabled1_1stkind_deg(phi,k) . Lawden used |
tablef1_function(uow1,kappa) |
Returns |
sigma1_function(uow1,kappa) |
Returns |
sigma2_function(uow1,kappa) |
Returns |
sigma3_function(uow1,kappa) |
Returns |
tablef1_function_duow1(uow1,kappa) |
Returns the derivative of tablef1_function(uow1,kappa) , for Table G. |
tableg_function(uow1,kappa) |
Returns |
tableh1_p(uow1,kappa) |
Returns |
tablef1_function_duow2(uow1,kappa) |
Returns the derivative of tablef1_function_duow1(uow1,kappa) , for tableg_function_duow1(uow1,kappa) below. |
tableg_function_duow1(uow1,kappa) |
Returns the derivative of tableg_function(uow1,kappa) , for tableh_p(uow1,kappa) below. |
tableh_p(uow1,kappa) |
Returns |
tablek1_e1w1square(kappa) |
Returns |
tablek1_e2w1square(kappa) |
Returns |
tablek1_e3w1square(kappa) |
Returns |
tablek1_g2w1fourth(kappa) |
Returns |
tablek1_g3w1sixth(kappa) |
Returns |
tablei_p(uow1,kappa) |
Returns |
psi(z,nu) |
A sum |
psi_dz(z,nu) |
Returns |
psi_dz2(z,nu) |
Returns |
psi_dz3(z,nu) |
Returns |
tablej_p(uow1,nu) |
Returns |
tablej_p_duow1(uow1,nu) |
Returns the derivative of tablej_p(uow1,nu) . |
tablek1_bigg(kappa) |
Returns |
tablek2_e1w1square(nu) |
Returns |
tablek2_e2imagpart(nu) |
Returns |
void tablek2_print_e2w1square(nu) |
Pretty-print of the complex conjugate pair on terminal for lower half of Table K. |
tablek2_g2w1fourth(nu) |
Returns |
tablek2_g3w1sixth(nu) |
Returns |
tablek2_bigg(nu) |
Returns |
bigg2nu_g3gt0(g) |
Solves |
bigg2nu_g3lt0(g) |
Solves |
bigg2kappa_g3gt0(g) |
Solves |
bigg2kappa_g3lt0(g) |
Solves |