[comp.windows.x] Fast Floating Point Math

rulmer@ncrorl.Orlando.NCR.COM (Rick Ulmer) (07/10/89)

I'm interested in speeding up some graphics operations such as arc drawing
in a X11 R3 server.  These routines rely on floating point math.  Does
anyone have any information on a fast floating point library for a 68020.

Also, I was told that in sun news SUN replaced the floating point math
with something call "fracs"???.  Does anyone have any information on "fracs"
and/or how to implement a "fracs" based math library.


				Rick Ulmer

MMcM@STONY-BROOK.SCRC.SYMBOLICS.COM (Mike McMahon) (07/11/89)

    Date: 10 Jul 89 16:15:42 GMT
    From: ncrlnk!ncrorl!rulmer@uunet.uu.net  (Rick Ulmer)

    I'm interested in speeding up some graphics operations such as arc drawing
    in a X11 R3 server.  These routines rely on floating point math.  Does
    anyone have any information on a fast floating point library for a 68020.

There is no need for floating point math to do conic section rasterization.

joel@pandora.pa.dec.com (Joel McCormack) (07/11/89)

    Date: 10 Jul 89 16:15:42 GMT
    From: ncrlnk!ncrorl!rulmer@uunet.uu.net  (Rick Ulmer)

    I'm interested in speeding up some graphics operations such as arc drawing
    in a X11 R3 server.  These routines rely on floating point math.  Does
    anyone have any information on a fast floating point library for a 68020.

  From: MMcM@STONY-BROOK.SCRC.SYMBOLICS.COM (Mike McMahon)
  There is no need for floating point math to do conic section rasterization.


I believe a more accurate statement would be: there is no need for
floating point math to do conic section rasterization if you are
willing to substitute an easily computed error approximation for
the exact non-linear error term.  The best algorithms I know bound
the error to 1/2 pixel, which is not the same as always picking
the pixel closest to the curve. It so happens that under certain
conditions the two error terms do give you identical results.  I
am aware of proofs of this for circles with integer radii, but not
for ellipses in general.  This may be simply my ignorance.

Using all integer arithmetic will certainly give you good results
for 0-width arcs, both circles and ellipses.  And they should paint
a lot faster.  And no one is going to notice the difference between
a perfect width-1 arc and a fast width-0 arc unless they plop them
right down on top of each other.

I believe that it may be possible to draw wide circular arcs with
integer arithmetic.  Maybe.  I'm 99% sure that you can't use integer
arithmetic to draw wide arcs in general.  Ditto for filled arcs.

X11 specifies some very difficult semantics for wide lines and arcs.
Just because you can draw a fast approximation to something doesn't
mean you can do it in an X server and still match the protocol.

- Joel McCormack (decwrl!joel, joel@decwrl.dec.com)

grunwald@flute.cs.uiuc.edu (Dirk Grunwald) (07/11/89)

are there any statistics on the frequency of various linewidths?

it might make sense to optmize the zero-width arcs; I know that it's what I
use all the time.
--
Dirk Grunwald -- Univ. of Illinois 		  (grunwald@flute.cs.uiuc.edu)