BM> Does anyone have any good code for calculating some of the transcendental
BM> functions (exp, sin, cos would be enough... I already know how I can do
n
BM> and atan2, and the various hyperbolic and inverse functions can be
erived
BM> from those five) using only 8087 instructions (no library calls, no
BM> emulator shortcuts, and no 387 FCOS/FSIN instructions)?
BPL>You're talking about "approximation theory." Despite textbooks and
BPL>manuals which will tell you, incorrectly, that these functions are
BPL>calculated by Taylor's theorem, they are in fact calculated by
BPL>"approximation functions" which are usually fitted polynomials. A good
BPL>source is Cody and Waite's 1980 book (forget the title just at the
BPL>moment). Also Kenneth Plauger's "The C Standard Library." I have
BPL>approximation algorithms from these, but they're all in QBASIC -- I have
BPL>no idea how I'd implement them in assembler.
What I had in mind was using some things like FPTAN and F2XM1, although I'm
not certain it's possible to do it like that... Send me your qbasic code to
MauveCloud@juno.com, and I might be able to convert it... A good
isassembler
might be nice also... look into some of my library files for C or for Pascal
and find out how they actually do it.
((Cloud))
* OLX 2.2 * Your cat just ran over my dog.
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|