POV-Ray : Newsgroups : povray.binaries.images : Mesh lathe : Re: Mesh lathe Server Time
16 Aug 2024 14:18:07 EDT (-0400)
  Re: Mesh lathe  
From:
Date: 25 Feb 2002 00:27:29
Message: <3c79cb41@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3c7940df@news.povray.org...

> > I remember from my Numerical Analysis courses, that some authors
recommend
> > the optimal size for the epsilon as sqrt(EPS) where EPS is the distance
from
> > 1.0 to the next largest floating point number. In a traditional PC, I
> > believe EPS is approx 2.2e-16, so the optimal epsilon is approximately
> > 1.4e-8
>
>   Note that we are not using an epsilon value for making comparisons, but
> for making vector math which should be as accurate as possible.
>   The smaller the epsilon value we use for approximating the tangent of
the
> spline, the more error-prone it will become (due to inaccuracies with very
> small values).

Exactly, there are two type of errors:
* As the epsilon becomes larger, the approximation of the derivative will be
less accurate.
* As the epsilon becomes smaller, the errors due to the floating-point
arithmetic will worsen.

But both errors will affect directly the accuracy of the approximation.

That's why it's important to have a good size for the epsilon. However, for
your particular application, I think you don't need a very high accuracy for
the derivatives, so practically any reasonably small epsilon (1e-4?) will be
ok.

I searched for my Numerical Analysis notebook and didn't find it. But, I
just found a paper
(http://www.nek.uu.se/Utbildning/Foskarutbildning/MEnotes1.pdf) where the
optimal size for your epsilon, using central derivatives, is found out and
it is:

epsilon*  = (3*EPS / M)^(1/3)

Where M is the highest value of the second derivative (in absolute value) of
the function in the interval (x-epsilon, x+epsilon) and it is often not
known and it is replaced by some estimate.

So, if you use a traditional PC, then EPS is approx. 2.2e1-6,
and if you ignore M, then you'll have:

epsilon* = (3*2.2e-16)^(1/3) = 8.7e-6

which is almost 1e-5, so I think 1e-5 is a pretty good size for your
epsilon.

I hope you can make some experiments and comment us your results.

Fernando.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.