next up previous
Next: User's guide Up: Example 1 Previous: On the ``automatically generated''

Using extended precision

As it has been mentioned before, taylor has support for some extended precision arithmetics. For instance, assume we want to build a Taylor integrator for the Lorenz example, using the GNU Multiple Precision library.

The code for the jet of derivatives and the step size (and order) control does not depend on the arithmetic. So, we can use the same file as before, or to build it again,

   taylor -name lrnz -o lorenz.c -jet -step lorenz.eq1
The differences are in the header file:
   taylor -name lrnz -o taylor.h -gmp -header
The flag -gmp instructs taylor to produce a header file to use the gmp library. As an example, we can ask taylor to generate a (very simple) main program for this case,
   taylor -name lrnz -o main_lrnz.c -main_only -gmp lorenz.eq1
We stress that the gmp library is not included in or package. In what follows, we assume that it is already installed in the computer.
   gcc -O3 main_lrnz.c lorenz.c -lgmp -s
We have also assumed that the gmp library is somewhere in the default path used by your compiler to look for libraries, otherwise you will need to tell the compiler (-L flag for gcc) where to find that library.

Important note: Extended precision libraries usually require some specific initializations that must be done by the main program. The subroutines produced by taylor will produce wrong results if these initializations are not done properly. We strongly suggest you to read the documentation that comes with these libraries before using them.



Maorong Zou
Tue Nov 13 09:42:48 CST 2001