POV-Ray : Newsgroups : povray.advanced-users : single precision vs double precision : Re: single precision vs double precision Server Time
28 Sep 2024 18:54:11 EDT (-0400)
  Re: single precision vs double precision  
From: Bruno Cabasson
Date: 16 Nov 2012 07:55:00
Message: <web.50a63783be17c2844aa45fdf0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Mesh math is pretty trivial, requiring only linear equations to be
> > solved. But even a seemingly simple thing as a sphere already involves
> > quadratic equations, and cubic equations aren't uncommon in POV-Ray
> > either. Some primitives require even higher-order polynomials.
>
> > And the higher the order of a polynomial, the higher the dynamic range
> > needed to solve it.
>
> To get a clearer picture of why this is so, consider that when you
> multiply two values, the result requires double the bits of the original
> values if exact accuracy of the result is required. (If you now multiply
> the result with a third value, the amount of bits is triple that of the
> original values. Basically, each multiplication requires as many bits
> as the sum of bits of the factors.)
>
> If you don't have that many bits in the result, it will be inaccurate
> (because the least-significant bits of the result will be dropped.)
>
> When talking about floating point values, the crucial bits are the
> mantissa bits: Their amount determines how accurate the result will be
> (ie. how many least-significant bits of the result will be dropped after
> a multiplication.)
>
> In this context it's easy to imagine why single-precision floats (which
> have 24 mantissa bits) will quickly become very inaccurate when you
> perform multiplications on them. (Double-precision floats have 53 mantissa
> bits.)
>
> --
>                                                           - Warp

Just for curiousity, would it be that difficult do make a full 32 bits build of
Pov-ray, run a few scenes and see the differences between renders?

NB: AKAIK, CPUs use a 80 bits format internally in all cases.


Post a reply to this message

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