Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Altivec 'bug' or limitation?




Scott Horn wrote:

This is a curiosity question. I've no experience in distributed or high-precision software development. I just noticed a funny thing when playing around with xgrid at home.

In Xgrid Preview 2, with two CPUs, a 800mhz G3 and a 1.25ghz G4. Running mandelbrot, manual zoom, the following coords:

X: -0.7499982136839042
Y: -0.008411978256855454
Width: 4.903769581863252e-07

With 'Use Altivec if available' is checked I get 7 squares with horizontal colored lines

Question: Is this possibly a bug in the altivec libraries or hardware, or in the mandelbrot app, or is it simply a mathematical precision limitation of altivec?

It's a precision thing. AltiVec only has 32-bit float precision, which works OK for low-magnification fractal images. At high magnification, the coordinates are not represented accurately enough.


A 'production' fractal program (as contrasted with a programmer's toy) has therefore to switch from AltiVec to scalar double precision above a certain magnification (typically several thousand). Double in turn runs out of steam at about 10^11 x.

My Mandelbrot program (a free 160 KB download at <http://fred.tekotago.ac.nz/~rp/>) then switches to double-double arithmetic that allows it to work (perfectly, but also painfully slowly) up to 10^28 x. At low mag, the combination of AltiVec and dual processor support makes it quite lively, because 16 pixels are computed simultaneously.

Robert P.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Altivec 'bug' or limitation? (From: Scott Horn <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.