<<

Computing exact geometric predicates

using mo dular with single precision

z

Herv Brnnimann Ioannis Z Emiris Victor Y Pan Sylvain Pion

Intro duction Abstract We prop ose an ecient metho d that deter

mines the sign of a multivariate p olynomial expression

Most of geometric predicates can b e expressed as com

with co ecients This is a central op eration on

puting the sign of an algebraic expression In principle

which the robustness of many geometric de

one may compute such expressions by using oating

p ends The metho d relies on mo dular computations

point arithmetic with a xed nite precision fp arith

for which comparisons are usually thought to require

metic but then the roundo errors may easily lead to

multiprecision Our novel technique of recursive relax

the wrong sign This problem is often referred to as the

ation of the moduli enables us to carry out sign deter

robustness problem in computational geometry

mination and comparisons by using only oating p oint

One solution to the robustness problem is to explic

computations in single precision The metho d is highly

itly handle numerical inaccuracies so as to design an

parallelizable and is the fastest of all known multipreci

that do es not fail even if the numerical part

sion metho ds from a complexitypoint of view Weshow

of the computation is done approximately or

how to compute a few geometric predicates that reduce

to analyze the error due to the fp imprecision

to matrix We discuss implementation

Such designs are extremely involved and haveonlybeen

eciency which can be enhanced by go o d arithmetic

done for a few algorithms The general solution it has

lters We substantiate these claims by exp erimental

been widely argued is to compute the predicates ex

results and comparisons to other existing approaches

actly This can b e achieved in many

This metho d can be used to generate robust and e

ways computing the algebraic expressions with in

cient implementations of geometric algorithms includ

nite precision with a nite but much higher pre

ing solid mo deling manufacturing and tolerancing and

cision that can be shown to suce or by using

numerical computer algebraic representation

an algorithm that p erforms a sp ecic test exactly In

of curves and p oints symb olic p erturbation Sturm se

the last category much work has fo cused on comput

quences and multivariate

ing the sign of the of a matrix with inte

ger entries which applies to many geometric

Keywords computational geometry exact arithmetic

tests suchasorientation tests incircle tests compar

robustness mo dular computations single precision RNS

ing segmentintersections as well as to algebraic prim

Residue Numb er Systems

itives such as resultants and algebraic representations

of curves and surfaces Recently some techniques have

INRIA SophiaAntip olis BP Route des Lucioles

SophiaAntip olis Cedex FRANCE This researchwas par

b een devised for handling arbitrary expressions and fp

tially supp orted by the ESPRIT IV LTR Pro ject No

representation

CGAL

In our presentpaperwe prop ose a metho d that de

z Department of and Lehman

College City University of NewYork Bronx NY USA

termines the sign of a multivariate p olynomial expres

Work on this pap er was p erformed while visiting the second

sion with integer co ecients using no op erations other

author and was supp orted by NSF Grants CCR and

than mo dular arithmetic and fp computations with

and PSCUNY Awards and

a xed nite single precision The latter op erations

can be p erformed very fast on usual computers The

Chinese algorithms enable us to p erform ra

tional algebraic computations mo dulo several primes

that is with a lower precision and then to combine

them together in to recover the desired output

ently and The algorithm of Hung and value The latter stage of combining the values mo d

Parhami corresp onds to single application of the ulo smaller primes however was always considered a

second stage of our recursive relaxation of the mo duli b ottleneck of this approach b ecause higher precision

Such a single application suces in the context of the computations were required at this stage Our pap er

goal of that is application to divisions in RNS prop oses a new technique whichwecallrecursive relax

but in terms of the sign determination of an integer ation of the moduli and which enables us to resolvethe

this only works for an absolutely larger input The pa latter problem Due to this technique we correctly re

per gives probabilistic estimates for early termina coverthesignofaninteger from its value reduced mo d

tion of Newtons interp olation pro cess whichwe apply ulo several smaller primes and we only use some sim

in our probabilistic analysis of our algorithm Its main ple lower precision computations at the recovery stage

sub ject is an implementation of an algorithm computing This should make our algorithms of some indep endent

multidimensional convex hulls The pap er do es not interest also for the theory and practice of algebraic

use our techniques of recursive relaxation of the mo duli computing Our deterministic algorithms and of

and it do es not contain the basic equations of sections and resp ectively sp ecify our approachand

our section our technique based on Lagranges and Newtons inter

p olation formulae resp ectively Our algorithm of sec

tion gives a probabilistic simplication of algorithm

Exact sign computation using mo dulararithmetic

Preliminary exp erimental results and running times are

discussed in section In general our metho ds are com

Mo dular computations Our mo del of a computer is that

parable in sp eed to other exact metho ds and even faster

of a fp pro cessor that p erforms op erations at unit cost

for particular inputs

by using bbit precision eg in the IEEE double

precision standard we have b It is a realistic

mo del as it covers the case of most workstations used

Related work Performing exact arithmetic is usually

in research and industry We will use mainly one basic

exp ensive Thus it is customary to resort to arithmetic

prop erty of fp arithmetic on such a computer for all

lters those lters safely evaluate a predicate in

four arithmetic op erations and for computing a

most cases in order to avoid p erforming a more ex

ro ot to o but we will not need it the computed result

pensive exact implementation The dicult cases arise

is always the fp representation that b est approximates

when the expression whose sign we wish to compute is

the exact result This means that the relative

very small For typical lters the smaller this quantity

error incurred by an op eration returning x is at most

the slower the lter this is referred to as adap

b blog jxjbc

and that the absolute error is at most

tivity Mo dular arithmetic displays an opp osite kind of

All logarithms in this pap er are base In particular

adaptivity with a smaller quantity fewer mo duli have

op erations p erformed on pairs of smaller than

to be computed hence the test is faster Typically

b

are p erformed exactly as long as the result is also

when lters fail they also provide an upp er b ound on

b

smaller than

the absolute value of the expression whose sign wewish

Let m m be k pairwise relatively prime inte

to compute see many details and estimates in

k

Q

gers and let m m For anynumber x not nec

This b ound can then be used to determine how many

i

i

essarily an integer welet x x mo d m b e the only

mo duli should be taken Mo dular arithmetic is there

i i

m m

i i

in the range such that x x is a

fore complementary to the ltering approach We also

i

multiple of m This op eration is always among the

observe this in section

i

standard op erations b ecause it is needed for reducing

Residue Number Systems RNS express and ma

the arguments of p erio dic functions

nipulate numb ers of arbitrary precision by their mo duli

To b e able to p erform arithmetic mo dulo m on inte

with resp ect to a given set of numb ers They have b een

i

gers by using fp arithmetic with bbit precision we will

p opular b ecause they provide a cheap and highly paral

b

assume that m Performing mo dular multi

lelizable version of multiprecision arithmetic It is im

i

m m

i i

plications of two integers from the interval

p ossible here to give a fair and full accountonRNSbut

can b e done bymultiplying these numb ers and return

Knuth and Aho Hop croft and Ullman provide

ing their pro duct mo dulo m The pro duct is smaller

a go o d intro duction to the topic From a complexity

i

b

than in magnitude and hence is computed exactly

point of view RNS allows to add and multiply numb ers

Performing can be done very much in the

in linear time Its weak p oint is that sign computation

m m

i i

same way but since the result is in the range

and comparisons are not easily p erformed and seem to

taking the sum mo dulo m is more easily achieved by

require full reconstruction in multiple precision which

i

adding or subtracting m if necessary Integral divi

defeats its purp ose This is precisely the issue that our

i

sions mo dulo m can b e computed using Euclids algo

pap er handles

i

rithm we will need them in this pap er only in section

The closest predecessors of our work are appar

k rather than k mo duli Recursivelywe will reduce Therefore arithmetic mo dulo m can b e p erformed us

i

the solution to the case of a single mo dulus m where ing fp arithmetic with bbit precision provided that

b

x x We will call this technique recursive relaxation m

i

of the moduli and we will also apply it in section

We will present our resulting algorithm by using ad

Exact sign computation In this pap er we consider the

ditional notation

following computational problem

Y

j

Problem Let k b m m denote positive inte

k

m m

i

gers m m being pairwise relatively prime such

k

ij

Q

k

b

Y

m Let that m and let m

j

i i

i

m v

i

i

x be an integer whose magnitude is smal ler than

ij

b

i j

bm k c Given x x mo d m compute the

i i

sign of x by using only modular and oatingpoint arith

j j

w v mo d m

i

i i

metic both performed with bbit precision

j

j

X

x w mo d m

i i

We will solve this problem even though x can b e huge

j

i

S frac

m

and therefore not even representable byusingb bits

i

i

k

k k

Lagranges metho d

so that m m w w and S S All the

i

i

computations in this algorithm are p erformed by using

According to the Chinese remainder theorem x is

fp arithmetic with bbit precision

uniquely determined by its residues x that is Prob

i

Algorithm Compute the sign of x knowing x

lem is well dened and admits a unique solution

i

x mo d m

Moreover this solution can b e derived algorithmically

i

from the following formula due to Lagrange If

j

Precomputed data m w for al l i

m m

j j

i

x is an integer in the range x stands for

i

Q

j k

the residue x mo d m v mm m and

i i i j

m m

j i

i i

Input integers k and x for al l

i

w v mo d m then

i i

i

i k

Output sign of x the unique solution of x

i

k

h

X

k  k 

m m

x mo d m in

x x w modm v mo d m

i

i i i i

k 

i

m

Precondition jxj

k

Trying to determine the sign of suchaninteger we

Let j k

computed the latter sum approximately in xed bbit

Repeat j j

precision Computing a linear combination of large in

j

j

X

x w mo d m

tegers v with its subsequent reduction mo dulo m can

i i

i

i

j

S frac

b e dicult so we prefer to compute the number

m

i

i

j

until jS j or j

k

j

X

x w modm

i i i

If j return x

S frac

j m

i

If S return x

i

j

If S return x

where fracz is the fractional part of a number x that

b elongs to

Lemma Algorithm computes the sign of x know

k k

If S were computed exactly then we would have

ing its residues x by using at most fp modular

i

k k k k S fracxm due to Lagranges interp olation for

fp divisions fp addi

mula In fact S is computed with a xed bbit pre

tions and k fp comparisons

cision Nevertheless we provein the full version that

exact rounding and summing terms pairwise in a tree

j

Pro of The m s and the w s are computed once and

b

i

i

like fashion intro duces an absolute error k

k

for all and placed into a table so they are assumed to

in the sum S Therefore if S is greater than the

k

be available to the algorithm at no cost In step a

sign of x is the same as the sign of S and we are done

total of j mo dular multiplications j fp divisions and j

b

Otherwise jxj m Since m we can say

k k

fp additions including taking the fractional part are

conservatively that for all practical values of k and b

m

p erformed

and hence wemayre this is smaller than

k

m

k

By using parallel implementation of the summation

cover x already from x x mo d m for i k

i i

of k on dk log k e arithmetic pro cessors in that is it suces to rep eat the computation using only

dlog k e time cf eg ch wemay p erform algo and more generally

rithm on dk log k e arithmetic pro cessors in O k log k

k

j

X

modm x w

time assuming each bbit fp op eration takes constant

i i i

j

k

frac

time Furthermore if dk log k e pro cessors are avail

m

i

i

j j

able wemay compute all the S and compare jS j

where we assume mo d m precomputed for all i

with for all j k concurrently This would re

k i

j

k This leads to the following algorithm

quire O log k time on dk log k e pro cessors Finallyif

dtk log k e pro cessors are available for some parameter

Algorithm Generalized Lagranges metho d Com

t k wemay p erform algorithm in O k log k t

pute the sign of x knowing x x mo d m

i i

time bybatching dte consecutivevalues of j in parallel

Precomputed data m w mo d m for

In practice the algorithm needs to examine only a few

i i k k i

al l i k

values of j soO log k time suces even with dk log k e

m m

i i

Input integers k and x for al l i

pro cessors

i

k

Output sign of x the unique solution of x

i

Remark If actually x the algorithm can be

m m

x mo d m in

i

greatly sp ed up by testing if x in step in which

j

m

Preconditions jxj and x

k

case wemay directly pass to j Furthermore stage

is not needed unless x x for all j whichcanbe

j

Let j

tested b eforehand Of course if the only answer needed

Repeat j j

k

is x or x then it suces to test if all the

X

x w mo d m

i i i

j

frac

x s are zero

i

m

i

i

x x mo d m for al l i k

i i k i

k

Remark If jxj is not to o small compared to m

j

until j j or j k

k

then only step k is p erformed involving only k fp op

If j k return x

erations of eachkind Also we note that the costly part

j

If return x

of the computation is likely to b e the determination of

j

If return x

the x s For these reasons we should try to minimize

i

the number k of mo duli m involved in the algorithm

It is easy to see that the numb er of iterations in step

i

This can b e done by getting b etter upp er estimates on

is O log m log O k b ecause jxj is no less than

k

k k b

the magnitude of the output or by using the probabilis

and no more than m and is multiplied

tic technique of section

by at each iteration

k

Remark Algorithm corresp onds to a choice of

A generalization of Lagranges metho d

m in step j this is why we call algorithm a

k j

We will show that Lagranges metho d is in fact a par

generalization Applying Lagranges metho d we do not

ticular case of the following metho d Let

multiply by the maximum at each step but by a smaller

number chosen so as to simplify the computations

k

X

x w modm

i i i

k

S frac

m

Remark To yield the parallel time b ounds suchas

i

i

O log k using dk log k e pro cessors for algorithm we

j

This quantity is computed in the rst step of algo

need to precompute for all i j k

k

rithm If the computed value of is smaller than

it implies that Thus jxj is smaller than

k k

An incremental variant

m We can then multiply x w by

k i i

A recursive incremental version of the Chinese remain

k

der algorithm named after Newton is describ ed in this

b c

k

k

section Its main advantage is that it do es not require

an a priori b ound on the magnitude of x

to obtain x w modm for all i k This

i i k i

j j

Let x x mo d m for j k so that

can be easily done by precomputing mo dulo each

k

k

x x and x x Let y x and for all

m We then compute

i

j k

k

X

j

j

x w mod m

i i k i

t w m mo d m

j j

j

frac

h

m

i

m m

j j

i

j

x x t mo d m y

j j j j

Then see eg for all j k Remark As in remark we can test b eforehand if

all x which is precisely the case when x

i

j j j

x x y m

j

Lemma Algorithm computes the sign of x know

k k

Clearly this leads to an incremental computation of the

ing its residues x using at most fp modular

i

k

k k

solution x x to problem we see b elowhowthis

multiplications fp modular additions and k

can b e exploited for an early termination of the interp o

fp comparisons

lation A further advantage is that all computation can

be kept mo dulo m and no oatingp oint computation

j

Pro of For every j k there are j fp

j

is required in contrast to sections and where S

mo dular additions and multiplications There is one

j

or are computed It is obvious that when y

j

comparison for each j k

j

then the sign of x is the same as the sign of y since

j

Algorithm requires k recursive steps in the worst

j j j

jx j m If y the sign of x is the

j

case though we exp ect to haveit terminate earlier in

j

same as that of x for j whereas the sign of

practice so its parallel time cannot be decreased be

x x y is known If y for all j then this is

j

low k log k Nevertheless the algorithm can be im

precisely the case when x

plemented in O k log k time on dk log k e pro cessors

For i j k weintro duce integers

assuming each bbit fp op eration takes constant time

To compare with algorithm realistically assume

j

Y

j

i

that a mo dular is equivalent to fp ad

mo d m mo d m m m t u

j j l j

i

ditions and one comparison on the average Then

li

k k

fp divisions which are algorithm requires

j

In the full version of the pap er we Then t u

j

essentially multiplications with precomputed recipro

show that the quantities y verify the following equality

j

cals more than algorithm whereas the latter requires

k k k k

for all j k

extra fp additions and additional com

parisons

j

X

j j

The principal feature of this approach based on

y x x u y u mo d m

j j i j

i

Newtons formula for recovering x is its incremental

i

nature This may lead to faster termination b efore

Therefore they can be computed by using mo dular

examining all k mo duli Informally this should hap

arithmetic with bitprecision given by the maximum

p en whenever the magnitude of x is signicantly smaller

bitsize of the m Here it suces to assume that the

k

j

than m inwhichcasewewould save the computa

k

absolute value of x is b ounded by m

tion required to obtain x for all larger j This saves a

j

signicant amount of computation if termination o ccurs

Algorithm Compute the sign of x knowing x mo d

earlier than the static b ound indicated by k A quan

m by Newtons incremental metho d

i

tication of this prop erty in the case of convex hulls can

j

b e found in

Precomputed data m u for al l i

j

i

We prop ose below a probabilistic variant of algo

j k

m m

i i

rithm which moreover removes the need of an apri

Input integers k and x for al l i

i

ori knowledge of k Step is mo died to include a test

k

j

of y against zero Clearly y precisely when x

j j

Output sign of xwhere x is the unique solution

h

j j k

k  k 

x Then wemay deduce that x x xwith

m m

of x x mo d m in

i i

avery high probability and terminate the iteration

Precondition None

Algorithm Yield earlier termination of algo

Let y x j Depending on whether y

rithm for absolutely smaller input Algorithm is

is negative zero or positive set s to or

mo died exactly as shown

respectively

m m

i i

Input integers x for i as

i

Repeat j j

required in the course of the algorithm no need

j

for k

X

j j

Output sign of x with very high probability

y x x u mo d m y u

j j j i

i

i

Terminate the loop also if y

j

until j k For every j if y is strictly negative

j

By lemma of this algorithm fails with prob

or positive then set s to or respectively

ability b ounded by k m where

min

Depending on whether s is or return

x x or x respectively

m minfm m m g

min k

For k m the error probability is less The computation usually go es by computing the

min

than A more careful analysis can reduce this width of the convex hull and the data is usually

probability by exploiting the correlation of failure at very at hence prone to numerical inaccuracies

dierent stages For exp erimental supp ort of this claim

In geometric and solid mo deling traditional ap

we refer to

proaches have employed nite precision oating p oint

arithmetic based on b ounds on the roundo errors Al

Applications

though certain basic questions in this domain are now

considered closed there remain some fundamental op en

Exact geometric predicates

problems including b oundary computation Toler

Exact geometric predicates is the most general way

ance techniques and symb olic reasoning have b een used

to provide robust implementations of geometric algo

but have b een mostly restricted to p olyhedral ob jects

rithms In particular orientation tests

their extension to curved or arbitrary degree sculptured

can b e implemented by lo oking for the sign of a deter

solids would be complicated and exp ensive More re

minant Mo dular arithmetic b ecomes increasingly in

cently exact arithmetic has b een prop osed as a valid

teresting when the geometric tests eg determinants

alternativefor generating b oundary representations of

are of higher order and complexity They are central in

sculptured solids since it guarantees robustness and

notably

precision even for degenerate inputs at a reasonable or

negligible p erformance p enalty

Convex hull computations this is a fundamental

Furthermore exact arithmetic allows the use of a

problem of computational geometry and of opti

variety of algebraic and symbolic metho ds including

mization for larger dimensions Among numerous

algebraic representation of curves and p oints symb olic

practical applications one maynote collision de

p erturbation Sturm sequences and multivariate resul

tection in dynamic simulation and animation

tants for an intro duction to these metho ds see The

prediction of p oses for industrial parts on a con

critical op eration is deciding the sign of a multivariate

veyer b elt and computation of stable grasps by

p olynomial expression with rational co ecients on a set

rob ots

of p oints Recent data structures that exploit structure

Voronoi diagrams for p oints their computation

of algebraic ob jects suchasstraightline programs also

reduces to convex hulls The sweepline algorithm

use precisely this kind of primitive op eration

in D is relatively simple but involves tests of de

gree and mo dular arithmetic can b e of substan

Sign of the determinant of a matrix

tial help in conjunction with arithmetic lters

As mentioned computing the sign of a matrix determi

For segments the tests b ecome of even higher de

nant is a basic op eration in computational geometryap

gree and complexity and fp computation is

plied to many geometric tests such as orientation tests

likely to intro duce errors so exact arithmetic is

incircle tests comparing segmentintersections

often a must

Sometimes the entries to the determinant are them

Mixed sub divisions used in solving systems of non

selves algebraic expressions For instance the incircle

linear equations Sparse elimination theory is

test can b e reduced to computing a determinant

a relatively new of computational algebraic

whose entries have degree and thus require b O

geometry which exploits the geometric structure

bit precision to be computed exactly Computing

of p olynomial systems in order to obtain tighter

these entries by using mo dular arithmetic enables in

b ounds and faster algorithms for their manipula

circle tests with bbit precision while still computing

tion The algebraic questions are formulated

exactly the sign of a determinant

in terms of Newton polytopes and their mixed vol

To compute an n n determinant mo dulo m we

k

ume each p olytop e being the convex hull of the

mayuse with a single nal divi

exp onentvectors app earing in a p olynomial

sion At step in of the algorithm the matrix is

Even for small dimensions the nature of the data

may force the fp computation to intro duce inconsis

C B

C B

ii

C B tencies for instance in

C B

A

Planarity testing in geometric tolerancing

ni

Here one must determine if a set of p oints sam

pling a plane surface can be enclosed in a slab

and we assume that the pivot is invertible mo dulo

ii

whose width is part of the planarity requirements

m Then wechange line L to L L for all

k j ii j ji i

j i n At step n of the algorithm wemul

tiply the co ecient by the mo dular inverse of the

n FP MOD CL GMP LEDA

nn

Q

n

ni

This gives us the value of the de pro duct

ii

i

terminant mo dulo m Note that the same metho d but

k

with nonmo dular integers and a nal would

have involved exp onentially large integers and several

slow divisions at each step Nevertheless it is only

the range of the nal result that matters for mo dular

computations This shows a big advantage of mo dular

arithmetic over other multiprecision approaches

The pivots should b e invertible mo dulo m If m

k k

is prime the pivot simply has to be nonzero mo dulo

m The algorithm can be also easily implemented if

k

m is a p ower of a prime or if m is the pro duct of two

k k

primes This would b e desirable mainly for taking m

k

b

k

for which mo dular arithmetic is done naturally by

Table Performance on random determinants

integer pro cessors though here sp ecial care must be

taken ab out even output Other choices of m do not

k

seem to bring any improvement

With IEEE double precision b we cho ose

m

n FP MOD CL GMP LEDA

k

mo duli smaller than so that

Gaussian elimination intensively uses ad bcstyle op

erations here we may apply one nal mo dular reduc

tion instead of two for each pro duct b efore subtracting

This algorithm p erforms O n op erations for each

mo dulus m With Hadamards determinant b ound and

i

b

m greater than only k dn log ne nite elds

k

need to b e considered Hence the complexity of nding

the sign of the determinantis O n log n single preci

sion op erations On a O n log npro cessor machine

the drops to O n if we use custor

mary parallelization of the Gaussian elimination rou

tine for matrix triangulation cf which gives us

the value of the determinant We apply this routine

in mo dular arithmetic with simplied pivoting con

Table Performance on small determinants

currently for all m s Theoretically substantial ad

i

ditional parallel acceleration can be achieved byusing

randomization ch yielding the time b ound

O log n on dn log ne arithmetic pro cessors and the

n FP MOD CL GMP LEDA

pro cessor b ound can b e decreased further to O n

by applying asymptotically fast algorithms for matrix

Exp erimental results

Wepresentseveral b enchmark results of our implemen

tations of the describ ed metho ds for computing a deter

minant in C and compare them with dierent existing

packages Metho d FP is a straightforward fp imple

mentation of Gaussian elimination Metho d LEDAuses

the routine signofdeterminantintegermatrix

of Leda Metho d CL has been implemented by

us based on As we compare with metho ds

that handle arbitrary dimensions we did not sp ecial

Table Performance on zero determinants

ize the implementation for small dimensions as is done

Conclusion in this would provide an additional sp eedup of ap

proximately Metho d GMP is an implementation

RNS systems have been used in number systems be

of Gaussian elimination using the GNU Multiprecision

cause they provide a highly parallelizable technique for

Package for dimension lower than and an implemen

multiprecision As parallel computers are b ecoming

tation of Bareiss extension of Gaussian elimination for

more available RNS provide an increasingly desirable

higher dimensions Metho d MOD is an implementation

implementation of multiprecision This comes in sharp

of mo dular Gaussian elimination as describ ed in sec

contrast with other multiprecision metho ds that are not

tion using our recursive relaxation of the mo duli Of

easily parallelizable Perhaps the main problem with

the other metho ds available the lattice metho d of

RNS is that comparisons and sign computations seem

has not yet b een implemented in dimensions higher than

to require full reconstruction and therefore use stan

LN provides a very fast implementation in di

dard multiprecision arithmetic Weshowthatonemay

mensions up to but was not available to us in higher

in fact use only single precision and still p erform these

dimensions

op erations exactly and eciently In some applications

Among the metho ds that guarantee exact compu

the number of mo duli may be large Our algorithms

tation our implementations are at least as ecient as

maybe easily implemented in parallel with a sp eedup

the others and for certain classes of input they outp er

dep ending almost linearly on the numb er of pro cessors

form all available programs Furthermore our approach

As an application weshowhow to compute the sign

applies to arbitrary dimensions whereas metho ds that

of a determinant This problem has received consid

compute a fp approximation of the determinantvalue

erable attention yet the fastest techniques are usually

are do omed to fail in dimensions higher than b ecause

iterative and do not parallelize easily Moreover they

of overow in the fp exp onent

usually only handle single precision inputs Our tech

All tests were carried out on a MHz Sun Sparc

niques are comparable in sp eed or even faster than other

workstation using the clock function Each program

techniques eg and can easily handle arbitrar

is compiled with the compiler that gives b est results

ily large inputs

Eachentry in the following tables represents the aver

A central problem we plan to explore further is

age time of one run in microseconds with a maximum

to design algorithms that compute upp er bounds on

deviation of ab out We concentrated on deter

the quantities involved to determine how manymoduli

minant sign evaluation and considered three classes of

should be taken For determinants the static b ounds

matrices random matrices whose determinantistyp

we use seem to suce for applications in computational

ically away from zero in table almostsingular ma

geometry They might be overly p essimistic in

trices with singleprecision determinant in table and

other such as tolerancing or symbolic algebra

lastly singular matrices with zero determinant in ta

where the nature of the data or algebraic techniques

ble The co ecients are integers of bitsize n

might imply much b etter b ounds Avalid approachwe

due to restrictions of Clarksons metho d

will further study and implement is Newtons incremen

Our results suggest that our approach is comparable

tal metho d of section provided that we are willing to

and for certain classes of input signicantly faster than

aord some small probability of error

the examined alternatives that guarantee exact results

The running times are displayed in tables For

small dimensions sp ecialized implementations can pro

References

vide an additional sp eedup for all metho ds Our co de

A V Aho and J E Hop croft and J D Ull

is reasonably compact and easy to maintain As an

man The Design And Analysis Of Computer Al

obvious improvement with a reasonably accurate fp

gorithms AddisonWesley Reading MA

lter the p enalty of exact arithmetic can b e paid only

F Avnaim JD Boissonnat O Devillers

for small determinants tables and Another im

F Preparata and M Yvinec Evaluation of a new

provementwe plan on exploring is to use parallelization

metho d to compute signs of determinants In Proc

Some side eects may o ccur due to the way we

th Annu ACM Sympos Comput Geom pages

generate matrices The co de of the mo dular pack

CC

age is free and anyone can benchmark it on the

D Bini V Y Pan and Matrix

kind of matrices that he uses It is available via

Computations Vol Fundamental Algorithms

the URL httpwwwinriafrprismepersonnel

Birkhuser Boston

pionprogsmodularhtml

H Brnnimann M Yvinec Ecient exact evalu

ation of signs of determinants These pro ceedings

B Buchb erger GE Collins and R Lo os editors

CY Hung B Parhami An approximate sign de Symbolic and Algebraic Com

tection metho d for residue numb ers and its appli putation Springer Wien nd edition

cation to RNS division Computers Math Applic C Burnikel J Knnemann K Mehlhorn S

Nher S Schirra and C Uhrig Exact

J Keyser S Krishnan and D Mano cha Ecient geometric computation in LEDA In Proc

Brep generation of low degree sculptured solids th Annu ACM Sympos Comput Geom

using exact arithmetic Technical Rep ort Dept pages CC Package available at

Computer Science Univ N Carolina Chap el Hill httpwwwmpisbmpgdeLEDAledahtml

K L Clarkson Safe and eective determinanteval

DE Knuth The Art of Computer Programming uation In Proc rdAnnu IEEE Sympos Found

Seminumerical Algorithms volume Addison Comput Sci pages

Wesley Reading Massachusetts and T H Cormen C E Leiserson and R L Rivest

M Lauer Computing by homomorphic images Introduction to Algorithms The MIT Press Cam

In B Buchb erger GE Collins and R Lo os ed bridge Mass

itors Computer Algebra Symbolic and Algebraic H Edelsbrunner and EP Mcke Simulation of

Computation pages Springer Wien nd simplicity A technique to cop e with degenerate

edition cases in geometric algorithms ACM Trans Graph

MC Lin D Mano cha and J Canny Ecient con ics

tact determination for dynamic environments In IZ Emiris A complete implementation for com

Proc IEEE Conf Robotics and Automation pages puting general dimensional convex hulls Intern

J Computational Geom ApplicationsTo

V Y Pan Y Yu and C Stewart Algebraic and app ear Preliminary version as Tech Rep ort

numerical techniques for the computation of matrix INRIA SophiaAntip olis France

determinants Computers Math with Applica IZ Emiris and JF Canny A general approach

tions to app ear to removing degeneracies SIAM J Computing

V Y Pan Parallel computation of p olynomial

GCD and some related parallel computations over S Fortune Numerical stability of algorithms for

abstract elds Theoretical Computer Science d Delaunay triangulations and Voronoi diagrams

In Proc th Annu ACM Sympos Comput Geom

A Rege A complete and practical algorithm for pages

geometric theorem proving In Proc ACM Symp S Fortune and C J Van Wyk Ecient exact

on Computational Geometry pages Van arithmetic for computational geometry In Proc

couver June th Annu ACM Sympos Comput Geom pages

JR Shewchuk Robust adaptive oatingp oint

geometric predicates In Proc th Annu ACM S Fortune CJ Van Wyk Static analysis yields

Sympos Comput Geom pages ecient exact integer arithmetic for computational

K Sugihara and M Iri A robust top ologyoriented geometry ACM Trans on Graphics

incremental algorithm for Voronoi diagrams Inter IM Gelfand MM Kapranov and AV Zelevin

nat J Comput Geom Appl sky Discriminants and Resultants Birkhuser

J Wiegley A Rao and K Goldb erg Computing Boston

a statistical distribution of stable p oses for a p oly G H Golub and C F van Loan Matrix computa

hedron In Proc th Annual Al lerton Conf on tions Johns Hopkins University Press Baltimore

Comm Control and Computing UnivIll Urbana Maryland

Champaign C M Homann The problem of accuracy and

C Yap Towards exact geometric computation robustness in geometric computation Rep ort CSD

Comput Geom Theory Appl TR Dept Comput Sci Purdue Univ West

C K Yap Exact computational geometry and tol Lafayette IN

erancing metrologyInDAvis and J Bose editors CM Homann How solid is solid mo deling In

Snapshots of Computational and Discrete Geome Applied Computational Geometry volume of

try Vol Tech Rep SOCS McGill Scho ol LNCS pages Springer

of Comp Sci C M Homann J E Hop croft and M T Kara

C K Yap and T Dubhe The exact computa sick Robust set op erations on p olyhedral solids

tion paradigm In D Du and F Hwang editors IEEE Comput Graph Appl Novem

Computing in Euclidean Geometry World Scien b er tic Press