From timm@csee.wvu.edu  Thu May  4 16:01:37 2000
Received: from naur.csee.wvu.edu (naur.csee.wvu.edu [157.182.194.28])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA21098
	for <prolog@swi.psy.uva.nl>; Thu, 4 May 2000 16:01:37 +0200 (MET DST)
Received: from localhost by naur.csee.wvu.edu (8.9.0/8.9.0) with ESMTP id JAA00487
	for <prolog@swi.psy.uva.nl>; Thu, 4 May 2000 09:59:39 -0400 (EDT)
Date: Thu, 4 May 2000 09:59:38 -0400 (EDT)
From: Tim Menzies <timm@csee.wvu.edu>
To: prolog@swi.psy.uva.nl
Subject: handling small numbers 
Message-ID: <Pine.GSO.4.21.0005040958530.28966-100000@naur.csee.wvu.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


 
got an error in my prolog code in the 20th decimal place and was wondering
was i can do about it. in the guts of my calcs, i have to do stuff like:

a=b*c/d

where c and d are numbers in the order of 10^-24 and b is a BIG number
and a must be a probability (0..1). thing is, small errors in c and d make
a > 1. my current approach is to code it all as fractions doing gcd and
defer real number calcs till as late as possible, then doing stuff like

(c*d)/(e*f)= c/e * d/f

the rewrite will mean that each stage i will be driving my rations of two
similar small numbers towards 1 BEFORE doing the real number stuff. the
code is kinda cute but i have no gret confidence that it will solve this
problem for more than a restrictive case.

any other ideas anyone?


-- 
Tim@Menzies.com; http://www.tim.menzies.com     PH  +1-304-367-8447
NASA, 100 University Dr,Fairmont WV, 26554,USA  FAX +1-304-367-8211
 
"Science is what happens when preconception meets verification."


