-=> Quoting David Williams to Rick Pedley <=-
-> It's pretty good. I would look for some way to reduce or eliminate
-> the real division, arctan, and multiplication operations which are
-> all floating point ops. 2*PI and PI/2 are obvious ones, replaced with
-> 6.28 and 1.57.. SGN might also be FP, I forget now.
DW> !!!! I don't think floating-point operations are really avoidable,
DW> especially if you want reasonable accuracy.
DW> Did you learn to program in FORTH?
Ah.. no :) But as can see you.. I mean, as you can see, by setting
constants equal to 2*PI and PI/2, we've already eliminated two FP
operations. There is also a technique, often used in financial
calculations, of temporarily scaling up all FP numbers by several
orders of magnitude (e.g. 3.1416 becomes 31416) and doing all
calculations with long integers, then returning the decimal to its
proper position in the solution. Much faster. I notice in some of
the code you posted a DEFDBL but perhaps only single precision was
required, again a small speed increase. But as you note in a later
message, the original poster was never heard from again, so I think
we would be wasting time taking this further without any input
from him.
--- Blue Wave/DOS v2.20
---------------
* Origin: ...the vented spleen - kingston on (613) 544-9332 (1:249/139)
|