                                   Piologie

                 A library for arbitrary precision arithmetic

         Copyright (c) 1996-98 by Sebastian Wedeniwski - Version 1.2.1



Abstract
========

Piologie is a library for arbitrary precision arithmetic, operating on natural,
integer and rational numbers.
The efficiency of the algorithms in theory and practice and the implementation
in ANSI-C++ according to newest knowledge are the fundamental features of this
library. Moreover the arithmetic is portable on all systems and independent of
all compilers, because it uses only one basic type, so that programs could be
written in a high-level language versus assembler without significant loss in
speed. The library is easy to use, because it uses overloading mechanism of C++
and allows to write expressions in a conventional mathematical form and does
not require complex usage scenarios.


The current version has been tested on the following architectures

 80x86, Pentium, PentiumPro, Pentium II,
 DEC alpha,
 HP PA,
 IBM RS6000, PowerPC,
 MIPS,
 SuperSPARC, UltraSPARC

with the following compilers

  Apogee C++ 3.0,
 Borland C++ 5.02,
 Digital C++ 5.0,
  Edison Design Group C++ front end 2.33,
 GNU C++ 2.6.1 - 2.8.1,
  HP C++ A.10.22,
  HP aC++ A.01.00,
  IBM C Set++ for AIX 3.1.1,
  IBM Visual Age C++ 3.0,
  KAI C++ 3.2,
 Microsoft Visual C++ 5.0,
 SGI MIPSpro C++ 7.1,
 SUN WorkShop C++ 4.2,
 Watcom C++ 11.0

and on the following operating systems

 SunOS, Solaris, Irix, HP-UX, AIX, Digital Unix, Linux,
 OS/2, Windows NT/95, DOS32.



Run Times and Comparisons with other Libraries
==============================================

On a (2x)UltraSPARC 200 MHz with GNU-C++ Compiler 2.8.0:

Algorithm         | Piologie |   GMP   | Piologie 1.2 | GMP 2.0.2 | freelip
                  |   1.2.1  |  2.0.2  |    (No Asm)  |  (No Asm) |   1.1
------------------+----------+---------+--------------+-----------+---------
Fibonacci(800000) |    2.8 s |  6.51 s |       4.49 s |    6.88 s |   4.17 s
Fibonacci(900000) |    2.9 s |  7.67 s |       4.67 s |    8.12 s |   5.08 s
Squareroot        |    9.2 s |  20.3 s |      15.94 s |      20 s | 564.49 s
Multiplication    |   2.67 s |  8.39 s |       4.61 s |     8.9 s |   8.23 s
Squaring          |   3.88 s | 20.44 s |       6.67 s |   21.59 s |  13.93 s
Division          |   3.11 s | 13.74 s |       5.52 s |    13.4 s |  15.86 s


On a (2x)Pentium II 233 MHz with GNU-C++ Compiler 2.7.2:

Algorithm         |Piologie|  GMP   |Piologie|   GMP   | freelip | Piologie
                  |  1.2.1 | 2.0.2  |(No Asm)| (No Asm)|         | (MSV, NoAsm)
------------------+--------+--------+--------+---------+---------+-------------
Fibonacci(800000) | 1.61 s | 1.56 s | 2.77 s |  4.58 s |  2.34 s |      1.98 s
Fibonacci(900000) | 1.73 s | 1.81 s | 3.09 s |  5.39 s |  2.77 s |      2.28 s
Squareroot        | 5.59 s | 4.16 s | 12.4 s | 11.75 s |195.97 s |      9.20 s
Multiplication    | 1.48 s | 2.02 s | 4.69 s |  5.92 s |  3.91 s |      3.91 s
Squaring          | 2.22 s | 4.86 s | 6.88 s | 14.52 s |  7.72 s |      5.72 s
Division          | 2.27 s | 2.81 s | 3.41 s |  7.77 s |  5.44 s |      2.31 s



Getting the Latest Version
==========================

The latest Version of the Piologie library is available by anonymous ftp from

  ftp://ftp.informatik.uni-tuebingen.de/pub/CA/software/Piologie/

or

  ftp://ruediger.informatik.uni-tuebingen.de/Piologie/



How to Install Piologie
=======================

The following files are required in the Piologie directory:

README .............................................................. this file
SPEED ........................ information about the speed on different systems
check.cpp .................................................... checking program
cfrac.cpp ........................... little demonstration to factoring numbers
config* ................................ configurations for different compilers
digit.cpp .................. holds the implementation file for digit operations
digit.h ........................... holds the include file for digit operations
doc/ . documentation in nuweb format (ftp://ftp.dante.de/tex-archive/web/nuweb)
.................................................. (sorry, at moment in German)
makefile .......................... builds the library for Linux, NT, OS/2, ...
natural.cpp .............. holds the implementation file for natural operations
natural.h ....................... holds the include file for natural operations
integer.cpp .............. holds the implementation file for integer operations
integer.h ....................... holds the include file for natural operations
pi.cpp ............. holds the implementation file for calculation of constants
pi.h ...................... holds the include file for calculation of constants
piologie.html ........................................ this file in html format
primes.h ......................... holds the include file for factoring numbers
rational.h ..................... holds the include file for rational operations
rational.cpp ............ holds the implementation file for rational operations
test.cpp .................................................. little test program
zeta.cpp ........................................ programm to calculate zeta(3)
zeta3.cmd ....................... script example for Windows NT to use zeta.exe


If you are in the Piologie directory and you have one of the supported
compilers, type

  make ap                         for Apogee C++ 3.0,

  make borland                    for Borland C++ 5.0,

  make dec                        for Digital C++ 5.0,

  make edg                        for Edison Design Group C++ front end 2.33,

  make gnu                        for GNU C++ 2.6.1 - 2.7.2,

  make gnu28                      for GNU C++ 2.8.0,

  make gnu_mips4                  for GNU C++ 2.7.2, MIPS R8000,

  make gnu_sparc                  for GNU C++ 2.7.2, SuperSPARC,

  make hp                         for HP C++ A.10.22,

  make hpa                        for HP aC++ A.01.00,

  make kai                        for KAI C++ 3.2,

  make i386_ibm                   for IBM Visual Age C++ 3.0 on OS/2,

  make ppc_ibm                    for IBM C Set++ for AIX 3.1.1,

  make sgi                        for SGI MIPSpro C++ 7.1,

  make sgi_8000                   for SGI MIPSpro C++ 7.1, MIPS R8000,

  make sun                        for SUN WorkShop C++ 4.2,

 make visual                     for Microsoft Visual C++ 5.0,
 
 make watcom                     for Watcom C++ 11.0


to build the library (e.g. piologie.a or piologie.lib) and the test executable.

Otherwise adjust the settings for your own compiler in the file "config" before
calling make.



The test program is succesful, if it generates the following output (e.g.
Pentium 133 MHz with Microsoft Visual C++ 5.0, Windows NT):

fib1 time [s] = 5.198, (385053125)
fib2 time [s] = 5.367, (938800000)
sqrt time [s] = 17.405, (652162098)
mul time [s] = 4.887, (750000000)
sqr time [s] = 7.33, (0)
div time [s] = 6.59, (986328126)
pi time [s] = 6.629



After having installed Piologie, please send an e-mail to me:

  wedeniws@informatik.uni-tuebingen.de

This enables me to inform you about bugs, bug fixes, new versions, etc.



Compiler Flags
==============

Flag:                           Meaning:
------------------------------------------------------------------------------
_Old_STD_                       use not the newest C++ standard
STATIC_VS_INLINE                some compiler have problems with inline
DEFINE_VS_CONST                 some compiler have problems with const
_DigitAsm_                      use assembler if ever it is possible
_Piologie_Debug_                Debug modus for assert (developement only)
_Unknown_Apogee_Bug_            an unknown bug with Apogee and inlining



Significant Changes
===================

We do not support functions for arithmetical operations. We use the template
technic to hand over the arguments to the next operation. This template
technic do not use unnecessary copying, allocating and freeing of memory and
is as fast as simple function callings.
Additionally, we have the advantage that special operator-combinations can
internally be optimized. For more details of this point see the manual.
The member function isprime of the class Natural has a new specification and
the function pow has a new convention for the arguments.



Piologie Copying Conditions
===========================

This library is free; this means that everyone is free to use it and free
to redistribute it on a free basis. But for all modifications to Piologie
library and excerpts of it the copyright remains to the author.
Of course there is no warranty for the Piologie library!



Piologie Revision History
=========================

- Version 1.2.1 was released in March 1998.
- Version 1.2   was released in March 1998.
- Version 1.1   was released in February 1998.
- Version 1.0.2 was released in November 1997.
- Version 1.0.1 was released in August 1997.
- Version 1.0   was released in February 1997.
- Version BETA  built in November 1996, internal release.
- Version ALPHA built in October 1996, internal release.
