Article View: comp.lang.prolog
Article #652Re: fuzzy unification of floating point numbers
From: Peter Ludemann
Date: Mon, 17 Aug 1992 16:50
Date: Mon, 17 Aug 1992 16:50
30 lines
1784 bytes
1784 bytes
In article <1992Aug12.210954.15241@cs.ucla.edu>, mika@oahu.cs.ucla.edu (Mikhail Karpoukhin) writes:
> Does anybody know the prolog for UNIX which supports
> the fuzzy unification of floating point numbers,
> that is two floating point numbers are considered
> equal if | X - Y | =< FUZZVALUE and this FUZZVALUE
> can be changed by user? I know that VM/Prolog has
> this feature, but it works on mainframe.
I suspect that IBM Prolog's method is more sophisticated that this,
although the manual implies that an absolute test is done.
Quintus Prolog's library has the "fuzzy" module, which defines (I quote):
For a fixed epsilon, the fuzzy comparison predicates are defined
in section 4.2.2 (Accuracy of floating point arithmetic) of
Knuth, The Art of Computer Programming, vol 2, Seminumerical Algorithms
(2nd edition) on page 218.
(21) 'fuzzy <'(U, V) <-> V-U > epsilon.b^max(e_u, e_v)
(22) 'fuzzy ~'(U, V) <-> |V-U| =< epsilon.b^max(e_u, e_v)
(23) 'fuzzy >'(U, V) <-> U-V > epsilon.b^max(e_u, e_v)
(24) 'fuzzy ='(U, V) <-> |V-U| =< epsilon.b^min(e_u, e_v)
where U = F.b^e_u and |F| < 1
and V = G.b^e_v and |G| < 1
The "fuzzvalue" can be set by the user.
---
Peter Ludemann +1-415-813-3800 ludemann@quintus.com
Technical Details
Message-ID:
<1992Aug17.165013.29853@quintus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!infonode!ingr!capalo!quintus!quintus!ludemannReferences:
<1992Aug12.210954.15241@cs.ucla.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!infonode!ingr!capalo!quintus!quintus!ludemann From: ludemann@quintus.com (Peter Ludemann) Subject: Re: fuzzy unification of floating point numbers Message-ID: <1992Aug17.165013.29853@quintus.com> Sender: news@quintus.com (USENET news account) Nntp-Posting-Host: ebisu Organization: Quintus Corporation, Palo Alto, CA References: <1992Aug12.210954.15241@cs.ucla.edu> Date: Mon, 17 Aug 1992 16:50:13 GMT Lines: 30