This note in postscript form.......... This document has been prepared by latex2html and slightly modified

## VALIDATION AND GENERATION OF SYMBOLIC-NUMERIC ALGORITHMS

R. Liska, L. Kocbach*

CTU, Fac. of Nucl. Sci. &Phys. Eng., Dept. of Physical Electronics, Brehova 7, 115 19 Prague 1

*University of Bergen, Dept. of Physics, Alleegaten 55, N-5007 Bergen, Norway

Keywords: algorithm validation, code generation, symbolic computation, computer algebra, exchange integrals for atomic collisions

For the solution of many problems from physics and other fields (see e.g. [1]) it is necessary to combine numerical computation and symbolic, algebraic computation with formulae. Symbolic processing of formulae on computer is most naturally done by one of the available computer algebra systems (CAS), but these are slow for numerical computations. Splitting the computation into two environments, numeric and symbolic, would most often lead to problems with information exchange between them. Further, such combined computations would be useful in cases where only a particular type of mathematical objects, e.g. polynomials, are processed and where algorithms faster than the general ones implemented in CAS can be applied for these objects. It is thus desirable and already proved to be useful [1] to implement algorithms manipulating symbolically specific type of formulae in the numeric environment. However, such implementations meet other difficulties, since the algorithms dealing with formulae are complicated and their formulation in the numeric environment is tedious and error prone. To overcome this difficulty we propose a method allowing validation of these algorithms by their comparision with algorithms already implemented in CAS. Automatic code generation then guarantees that the resulted implementation is error-free. To distinquish the algorithms which perform symbolic operations in the numerical environment from other methods we call them symbolic-numeric algorithms.

The method for development of symbolic-numeric algorithm performing operation O on formulae of type TF can be shortly described by the following steps:

1. the symbolic implementation SI of the operation O in a CAS in which formulae from TF are represented as standard formulae; this implementation is usually very simple and we assume error-free
2. propose the representation R of functions from TF in numerical arrays
3. the symbolic-numeric implementation SNI of the operation O in the CAS in which formulae from TF are represented by the representation R; this implementation is typically much more complicated than the implementation SI
4. compare the results of the implementations SI and SNI on chosen input data for the operation O; comparison is done in the CAS; in the case of different results follows correction of bugs in the implementation SNI
5. automatic generation (by CAS) of numerical implementation of the operation O from the CAS-validated implementation SNI
In this method we are using the computer algebra system REDUCE with the numerical code generation package GENTRAN and numerical programming language FORTRAN.

The described methodology has been used for the development of validated symbolic-numeric algorithms for computations of two quantities used in atomic collision theory. The first, matrix elements of Coulomb interaction between two bound hydrogenic states needs evaluation of integrals

where are polynomials in originating from the radial hydrogenic functions. The developed symbolic-numeric algorithm includes subalgorithms for symbolic integration of the above integrals, calculation of the radial hydrogenic functions and manipulations with polynomials. The developed symbolic-numeric algorithm implemented in FORTRAN is about 300 times faster than the symbolic one implemented in REDUCE. The symbolic-numeric algorithm is much faster because it uses floating point representation of polynomial coefficients, works only with a specific type of formulae and it is compiled with static arrays. It lacks the symbolic absolute precision, not relevant for the applications.

The second, three-dimensional overlap exchange integrals for heavy particle collisions, have the form

where are hydrogen like wave functions with the quantum numbers . Shakeshaft [2] has shown how these integrals can be transformed into one dimensional integrals. For symbolic-numeric algorithm calculating the exchange integral (2) we have derived [3] a closed form formula based on the method of ref. [2]. The presented methodology has been used for checking the correctness of the closed form formula and implementation of the symbolic-numeric algorithm which transforms (2) into one dimensional integral integrated numerically.

The methodology and its applications to matrix elements (1) and exchange integrals (2) are described in more detail in [4], which also includes a fully treated simple example.

References

1. HANSEN, J.P. - DUBOIS, A.: Procedures for analytical and numerical calculation of Coulombic 1- and 2-centre integrals. Comput. Phys. Com. 67, pp. 456-464, 1992.
2. SHAKESHAFT, R.: A note on the exchange integrals in the impact-parameter treatment of heavy-particle collisions. J. Phys. B: Atom. Molec. Phys. 8, pp. 134-36, 1975.
3. KOCBACH, L. - LISKA, R.: Closed form formula for the exchange integrals in the impact-parameter treatment of heavy-particle collisions. J. Phys. B: At. Mol. Opt. Phys. 27, pp. L619-L624, 1994.
4. KOCBACH, L. - LISKA, R.: Generation of Validated Algorithms fo Symbolic-Numeric Processing. J. Symbolic Computation (submitted).

This research has been conducted at the Department of Physical Electronic as part of the research project "Symbolic derivation, analysis and programming of difference schemes and algebraic algorithms" and has been supported in part by the Czech Grant Agency grant No. 201/94/1209.