|
|
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
|
|
|
|
Bruno Cabasson <bru### [at] cabassoncom> wrote:
> NB: AKAIK, CPUs use a 80 bits format internally in all cases.
x87 uses 80-bit ("extended-precision") floating point values, but SSE doesn't
(it uses 64-bit values.) Thus the internal representation used by the
hardware will depend on whether POV-Ray has been compiled to use the FPU
or SSE.
(All floating point values will be stored in memory as 64-bit, though.
It's only the intermediate values inside the FPU that are 80-bit.)
--
- Warp
Post a reply to this message
|
|
|
|
Am 16.11.2012 13:54, schrieb Bruno Cabasson:
> Warp <war### [at] tagpovrayorg> wrote:
>> 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?
There might be more to change than just data types; some "epsilon"
values might need to be changed as well.
> NB: AKAIK, CPUs use a 80 bits format internally in all cases.
That used to be the case in times of x87 math; SSE2 uses only 64 bit
precision.
Post a reply to this message
|
|