Symbolic-Numeric Codes and Computer Algebra Systems

Ladislav Kocbach

Department of Physics, University of Bergen, Allegaten 55, N-5007 Bergen, Norway


This talk was based mainly on an earlier work

Ladislav Kocbach and Richard Liska: Journal of Symbolic Computation 25 (1998) 367-382, Generation and Verification of Algorithms for Symbolic-Numeric Processing.

Journal of Symbolic Computation Earlier version of the paper (preprint, postscript -175 kB)

The method is also presented at this address.


Presentation of the method

You need to generate a program in FORTRAN or C, which would correctly perform some numerical evaluation of expressions, which you have obtained by analytic work. In the analytic work and subsequent coding of the results every person can make errors. Some can even happen later, after coding, by editing, text transfers, etc. Debugging of such programs might be a time consuming task, missing factors 2 and wrong signs are well known. The described techniques should both save time and ideally produce an error-free code by using the powers of computer algebra and automatic code translation.

Some of your computations might even require from your numerical code to contain algorithms performing symbolic computations with a limited class of algebraic formulas. To distinguish the algorithms which perform symbolic manipulation in numerical programming language from other methods, we propose to call them symbolic-numeric algorithms. Developing and implementing such algorithms in a numerical programming language is in principle not difficult, but in practice a tedious and error prone task.

The described method is based on developing the algorithms in a computer algebra system where their correctness can be checked by comparison with build-in facilities of the system so that the computer algebra system is used as an advanced debugging tool. After such testing of the correctness of your algebra, a numerical code for the algorithms is automatically generated from the same source code.

The computer algebra system REDUCE with the standard code generation package GENTRAN is used to develop codes in FORTRAN. Real applications to calculation of matrix elements of Coulomb interaction and two-centre exchange integrals needed in atomic collision codes have been completed and the method is currently used in new projects in atomic collision theory.