From: Florian Weimer <fw@cygnus.stuttgart.netsurf.de>
Subject: Re: Ada95 speed
Date: 1999/05/18
Date: 1999-05-18T05:38:20+00:00 [thread overview]
Message-ID: <m3so8vdjjo.fsf@deneb.cygnus.stuttgart.netsurf.de> (raw)
In-Reply-To: 3740C535.7C6200A8@gte.net
"Clifford J. Nelson" <cnelson9@gte.net> writes:
> Ten years ago a Mandelbrot set computation and display on a 1200x700
> screen with eight bit color took six seconds in C on a MacIIfx.
You obviously used a different algorithm.
> exit when (abs( Z)) > 2.0;
This statement is executed approximately 6 million times. Calculating
the absolute value of a complex number involves taking a square root.
This is a very expensive operation and dominates the running time by far.
I'd suggest to square both sides of the inequation and use:
exit when (Z.Re * Z.Re + Z.Im * Z.Im) > 4.0;
I suppose your C code does exactly that because C hasn't got built-in
complex types, so this optimization is more obvious.
next prev parent reply other threads:[~1999-05-18 0:00 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-05-18 0:00 Ada95 speed Clifford J. Nelson
1999-05-17 0:00 ` David Starner
1999-05-18 0:00 ` Clifford J. Nelson
1999-05-18 0:00 ` Florian Weimer [this message]
1999-05-18 0:00 ` Larry Kilgallen
1999-05-18 0:00 ` Tucker Taft
1999-05-18 0:00 ` Clifford J. Nelson
1999-05-20 0:00 ` Tom Moran
1999-05-21 0:00 ` Clifford J. Nelson
1999-05-21 0:00 ` Tom Moran
1999-05-21 0:00 ` Clifford J. Nelson
1999-05-21 0:00 ` Tom Moran
-- strict thread matches above, loose matches on Subject: below --
1999-06-07 0:00 Robert I. Eachus
1999-06-07 0:00 ` tmoran
1999-06-06 0:00 tmoran
1999-06-06 0:00 ` Robert Dewar
1999-06-06 0:00 tmoran
1999-06-06 0:00 ` David C. Hoos, Sr.
1999-06-06 0:00 ` tmoran
1999-06-07 0:00 ` Robert Dewar
1999-06-06 0:00 ` David C. Hoos, Sr.
1999-06-07 0:00 ` Robert Dewar
1999-06-06 0:00 ` Brian Rogoff
1999-06-05 0:00 tmoran
1999-06-05 0:00 ` Robert Dewar
1999-06-05 0:00 ` Ehud Lamm
1999-06-05 0:00 ` William Starner
1999-06-05 0:00 ` Ehud Lamm
1999-06-05 0:00 ` Clifford J. Nelson
1999-06-06 0:00 ` David Botton
1999-06-06 0:00 ` Ehud Lamm
1999-06-07 0:00 ` Robert Dewar
1999-06-07 0:00 ` Ehud Lamm
1999-06-05 0:00 tmoran
1999-06-05 0:00 ` Al Christians
1999-06-05 0:00 ` David C. Hoos, Sr.
[not found] <374182F2.B10AD449@Maths.UniNe.CH>
1999-05-18 0:00 ` Tom Moran
1999-05-18 0:00 ` Gautier
1999-05-19 0:00 ` Robert Dewar
1999-05-20 0:00 ` Clifford J. Nelson
1999-05-20 0:00 ` Tucker Taft
1999-05-20 0:00 ` Tom Moran
1999-05-20 0:00 ` Tom Moran
1999-05-21 0:00 ` Tom Moran
1999-05-31 0:00 ` James E. Hopper
1999-06-01 0:00 ` Clifford J. Nelson
1999-06-01 0:00 ` James E. Hopper
1999-06-02 0:00 ` Clifford J. Nelson
1999-06-04 0:00 ` Clifford J. Nelson
1999-06-02 0:00 ` Robert Dewar
1999-06-04 0:00 ` Clifford J. Nelson
1999-06-04 0:00 ` David C. Hoos, Sr.
1999-06-04 0:00 ` Ole-Hjalmar Kristensen
1999-06-02 0:00 ` James E. Hopper
1999-06-02 0:00 ` Clifford J. Nelson
1999-06-02 0:00 ` James E. Hopper
1999-06-02 0:00 ` Clifford J. Nelson
1999-06-02 0:00 ` Gautier
1999-06-02 0:00 ` John B. Matthews, M.D.
1999-06-02 0:00 ` John B. Matthews, M.D.
1999-06-02 0:00 ` Clifford J. Nelson
1999-06-01 0:00 ` Clifford J. Nelson
1999-06-01 0:00 ` James E. Hopper
1999-06-02 0:00 ` Robert Dewar
1999-06-04 0:00 ` Clifford J. Nelson
1999-06-05 0:00 ` Robert Dewar
1999-06-03 0:00 ` Robert I. Eachus
1999-05-31 0:00 ` Gautier
1999-05-19 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox