Board index » delphi » How Does Turbo Pascal Find Sin?
dmurd...@mast.queensu.ca (Duncan Murdoch)
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT

dmurd...@mast.queensu.ca (Duncan Murdoch)
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
How Does Turbo Pascal Find Sin?
In article <19950612.200505.860472.NETN...@VM.BIU.AC.IL>
Quotebro...@popeye.cc.biu.ac.il (Brosh Ariel) writes: Pascal, you'll see that it bases its calculation on the hardware FPTAN instruction when using the IEEE types. I couldn't follow what was going on when using the Real type, or what the hardware emulator did. Duncan Murdoch 
s..
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?In a previous article, dmurd...@mast.queensu.ca (Duncan Murdoch) wrote: Quote>In article <19950612.200505.860472.NETN...@VM.BIU.AC.IL> a Taylor Series (and yes, you remember correctly  I did post something saying that a former prof of mine said a lot of languages used a Taylor Series expansion.). I tested a Taylor series expansion that I wrote against what BP 7.01 uses 
Jos van Ka
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?Quotes...@skyfox.usask.ca wrote: Quote
(That is the polynomial that minimizes the maximal error for a given degree over a given interval.) The crux of the matter is, that you can do with a polynomial of much lower degree than truncated Taylor series expansion, while guaranteeing a certain accuracy OVER A WHOLE INTERVAL. In this respect Taylor expansion is notoriously bad, being very accurate in a neighbourhood of the expansion point, but losing accuracy fast when you move away. To use the minimax approximation you'd have to calculate the polynomial coefficients to acceptable precision, but this has been done in the 60's for all standard functions. (You'd have to look them up in old "Communications of the ACM") Jos. 
James B. Milla
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?Quotes...@skyfox.usask.ca wrote: : >In article <19950612.200505.860472.NETN...@VM.BIU.AC.IL> : >bro...@popeye.cc.biu.ac.il (Brosh Ariel) writes: : > : I tested a Taylor series expansion that I wrote against what BP 7.01 uses There are faster ways to calculate with series: (I know this is 
s..
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?In a previous article, Jos van Kan <j.van...@math.tudelft.nl> wrote: Quote>Yes, they probably use something like the minimax polynomial approximation. expansion to evaluate, the yes, it will generally lose accuracy as you move further away from the expansion point. However, if you have you algorithm go through the polynomial termbyterm until For example, expansion of Sin(X) about Xo = 0 (from my memory may be wrong) Sin(X) = 1  c2 * x^2 + c4 * x^4  c6 * x^6 + c8 * x^8  .... where cN = 1 / N! If you have evaluated sin(X) up to the term cN * x^N and find that the term I have found that doing this using nothing but BP/TP's six byte reals easily In the post of mine that Jos is responding to, I claimed that the Taylor series 
Paul J. Ga
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?Quotes...@skyfox.usask.ca wrote: : However, if you have you algorithm go through the polynomial termbyterm until [more deletions] No. One of the things that goes into a minimax polynomial is the There are other ways to calculate transcendental functions as well. Any decent algorithm used in any decent language will have a maximum  Paul J. Gans [g...@scholar.chem.nyu.edu] 
Marueli Sun
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?James B. Millard (jmill...@nmsu.edu) wrote: Quote: s...@skyfox.usask.ca wrote: : : >In article <19950612.200505.860472.NETN...@VM.BIU.AC.IL> : : >bro...@popeye.cc.biu.ac.il (Brosh Ariel) writes: : : > : : I tested a Taylor series expansion that I wrote against what BP 7.01 uses : There are faster ways to calculate with series: (I know this is  "Bilbo Buggins Lives" (unknown) Sunny 
Marueli Sun
Delphi Developer 
Wed, 18 Jun 1902 08:00:00 GMT
Re:How Does Turbo Pascal Find Sin?James B. Millard (jmill...@nmsu.edu) wrote: Quote: s...@skyfox.usask.ca wrote: : : >In article <19950612.200505.860472.NETN...@VM.BIU.AC.IL> : : >bro...@popeye.cc.biu.ac.il (Brosh Ariel) writes: : : > : : I tested a Taylor series expansion that I wrote against what BP 7.01 uses : There are faster ways to calculate with series: (I know this is You can use Horner's algorithm to evalute polynomials in minimum of muls/adds  p(x) = a(n)x^n + ... + a(0) y = a(n) for j = n1 downto 1: y=x*y+a(0) return y,z where : this plus the fact that minmax algorithms require polynomials of much lesser degree will do the trick.  "Bilbo Buggins Lives" (unknown) Sunny 
1. Turbo Pascal 7 or Educational Turbo Pascal 7
2. Where can I find Borland Turbo Pascal 6.0?
3. Do you know where can I find a translator from Turbo Pascal to C
4. Need to find Turbo Pascal v6.0
5. Where can I find Turbo Pascal?
7. Were can i find turbo pascal 6 ???
9. ! Serious question: Can anyone find a job doing Turbo Pascal?