home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / fracl / 1355 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.8 KB  |  52 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!FWI.UVA.NL!DOK
  3. Return-Path: <dok@fwi.uva.nl>
  4. X-Organisation: Faculty of Mathematics & Computer Science University of
  5.                 Amsterdam Plantage Muidergracht 24 NL-1018 TV Amsterdam The
  6.                 Netherlands
  7. X-Phone:        +31 20 525 5200
  8. X-Telex:        16460 facwn nl
  9. X-Fax:          +31 20 525 5101
  10. Message-ID: <199301220853.AA09482@larry.fwi.uva.nl>
  11. Newsgroups: bit.listserv.frac-l
  12. Date:         Fri, 22 Jan 1993 09:53:19 +0100
  13. Sender:       'FRACTAL' discussion list <FRAC-L@GITVM1.BITNET>
  14. From:         "P.J.van Dok W92" <dok@FWI.UVA.NL>
  15. Subject: Re: Speeding up Calculation of Mandelbrot Set
  16. Lines: 34
  17.  
  18. Hi there!
  19.  
  20. On the topic of speeding up calculation:
  21.  
  22. As mike points out, there are two aspects to the speeding up.
  23.  
  24. >1. Try to optimize the routine that calculates the dwell of a given point.
  25.  
  26. If you have no knowledge of assembler, there are still ways of speeding things
  27.  up a bit. When you check wether the point has escaped to infinity, do not
  28.  calcu-
  29. late x*x and y*y seperate, but put those values in two variables, so that you
  30.  can re-use them for the calculation of the next x-value. a
  31. Also, instead of :     y := 2*x*y;
  32. do this:
  33.                        q := x*y;
  34.                        y := q+q+b;
  35.  
  36. An addition is much faster than a multiplication.
  37. Also, if you dont test for escape from a circlelike border, but against a square
  38. area, an idea from mr. Pickover, I believe, which means:
  39.  
  40. in stead of :      if x*x+y*y > 4 then ....
  41. you get            if abs(x) >2 or abs(y) >2 then ...
  42. you can reduce the multiplication by using:
  43.                         x := (x+y)*(x-y) + a;
  44.  
  45. instead of the usual two squares.
  46.  
  47. I will send sth about point two as well if anybody's interested.
  48.  
  49. See Ya!
  50.  
  51. Hans van Dok.
  52.