|
Boost : |
Subject: Re: [boost] Updating the Boost Review Process Was: [GGL] Bost.Polygon (GTL) vs GGL - rationale
From: Fernando Cacciola (fernando.cacciola_at_[hidden])
Date: 2009-11-19 13:09:05
Hi Barend,
> I know that 1e-10 is too large, for FP comparisons.
Really?
Let's see:
Given these 2D straight line segments segments:
s0: (-e,0) - (e ,h)
s1: (0 ,0) - (0 ,h)
s2: (e ,0) - (-e,h)
where 'e' is a really small number, say 1e-5, and h a really big number, say 1e5
Now compute the intersection points p between s0 and s1, and q between s1 and s2.
You can see from basic reasoning that p and q should he exactly coincident, but
what are the computed coordinates of p and q using 'double' (you can even try it
with a straight C expression, FWIW, since the goal is to understand FP behaviour)?
What is their distance? (i.e. the error)
That example is off the top of my head, so the points might be closer than I
imagine, but let's see what the results are.
Best
-- Fernando Cacciola SciSoft Consulting, Founder http://www.scisoft-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk