Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!sunic!draken!d88-jwa From: d88-jwa@nada.kth.se (Jon Watte) Newsgroups: comp.sys.mac.programmer Subject: Re: How to Cosine: some results Message-ID: <2304@draken.nada.kth.se> Date: 13 Nov 89 21:33:02 GMT References: <2256@hudson.acc.virginia.edu> Reply-To: d88-jwa@nada.kth.se (Jon W{tte) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 50 In article <2256@hudson.acc.virginia.edu> cak3g@astsun7.astro.Virginia.EDU (Colin Klipsch) writes: (WARNING: Assembly language discussion ahead! Run for your lives!!) Various ramblings deleted II) Table with quadratic interpolation: Quadratic because linear interpolation would require too many table entries for 30b accuracy. [...] the largest you can get away with.) The primary disadvantage of this subroutine is that it requires a table with over a thousand entries, which amounts to over 4kB. I note also that this routine makes use of the long multiply instructions on the 68020, which are unavailable on the 68000. [...] IV) Call the M68881: Convert the angle to radians in M68881 format (96b), call FSINCOS, convert the result to fract. Call FSINCOS because we need both sine and cosine in the transformation matrix anyway. The fact that this calculates both will be taken into account. [...] And the results: II) Quadratic interp 1,250,297 79,981 24,100 IV) M68881 (FSINCOS) 817,654 122,301 66,400 (33,200) Hey, are you running a Mac 128K or what ? 4kB for speed FASTER than a Mc68881 ? That's NOTHING at all ! And consider; more people have the 68020 (or -30) than have the 68881 (or -2) Probably those 4kB will be less than an average "about" box 8) You could have the table in a resource (hell, you could have EIGHT tables in a resource 8) and load it only when you need it, if you're so concerned for memory. This would also save you the trouble of feeding the data by hand to the program editor :-) All in all, you have produced a VERY GOOD post (maybe my candidate for "post of the year" :-) and the Net should have more of these... Happy Hacking ! h+ -- This .signature is longer than 4 lines. If you'd like to see it in whole, please send a note to me. I'm h+@nada.kth.se and also h+@proxxi.se 8')