PIOLOGIE

A library for arbitrary precision arithmetic

Copyright Ó 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

with the following compilers

and on the following operating systems

 

 Run Times and Comparisons with other Libraries

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

Algorithm

Piologie 1.2.1

GMP 2.0.2

Piologie 1.2.1
(No Asm)

GMP 2.0.2
(No Asm)

freelip 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 1.2.1

GMP 2.0.2

Piologie 1.2.1
(No Asm)

GMP 2.0.2
(No Asm)

freelip 1.1

Piologie 1.2.1
(MSV, No Asm)

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

or

 

 How to Install Piologie

The following files are required in the Piologie directory:

README

this file in txt format

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 Unix, 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.cpp

holds the implementation file for rational operations

rational.h

holds the include 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

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 100 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