|
|
Up |
|
|
  |
Author: The Beez'The Beez' Date: Apr 25, 2008 10:48
Hi!
Does anyone have some high level source for FSIN and FCOS words? Of
course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
as well.
Hans Bezemer
|
| |
|
| | 7 Comments |
|
  |
Author: Aleksej SaushevAleksej Saushev Date: Apr 26, 2008 00:53
"The Beez'" bigfoot.com> writes:
> Hi!
>
> Does anyone have some high level source for FSIN and FCOS words?
: fsinn ( x -- {sin x}/x )
fsqr 1 >f fswap 1 >f 0 >r begin ( a x^2 t ; k )
1 r+! fover f* r 2* >f f/ r 2* 1+ >f f/ fnegate ( a x^2 t' ; k' )
frot fover fover f+ ( x^2 t' a a' ; k' )
ftuck f= >r f-rot r> until ( a' x^2 t' ; k' )
fdrop fdrop r> drop
;
: fsin fdup fsinn f* ;
: r+! rp@ +! ;
: >f s>d d>f ;
: f-rot frot frot ;
Obviously, it won't work for large arguments, you need another
way to calculate Taylor serie, but you want to take argument modulo pi
anyway.
cos(x) = sin (pi - x)
|
| Show full article (0.93Kb) |
|
| | no comments |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Apr 26, 2008 01:02
>Hi!
>
>Does anyone have some high level source for FSIN and FCOS words? Of
>course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
>as well.
This is excerpted of the transputer sources. It will need some adaptation,
like removing the T in front of some words.
This is not rocket science: a standard Chebychev approximation is used
to arrive at most 2 bits from the exact value. (More on those on my
site below.) The binary representation of floats is IEEE.
The series have 8 terms. This is suboptimal for single precision.
_________________________________
TCREATE- SIN
#8 T,
$4A TC, $BB TC, $52 TC, $3C TC,
$2C TC, $26 TC, $06 TC,...
|
| Show full article (5.84Kb) |
| no comments |
|
  |
Author: BillBill Date: Apr 26, 2008 09:56
The Beez' wrote:
> Hi!
>
> Does anyone have some high level source for FSIN and FCOS words? Of
> course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
> as well.
>
> Hans Bezemer
Consider "Computer Approximations" by John F Hart 1968 in the SIAM series.
|
| |
| no comments |
|
  |
Author: Rod PembertonRod Pemberton Date: Apr 26, 2008 18:55
> Hi!
>
> Does anyone have some high level source for FSIN and FCOS words? Of
> course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
> as well.
>
|
| |
| no comments |
|
  |
Author: EdEd Date: Apr 26, 2008 19:51
"Bill" wrote in message news:EPOdnab1x7Qqw47VnZ2dnUVZ_qbinZ2d@comcast.com...
> The Beez' wrote:
>> Hi!
>>
>> Does anyone have some high level source for FSIN and FCOS words? Of
>> course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
>> as well.
>>
>> Hans Bezemer
> Consider "Computer Approximations" by John F Hart 1968 in the SIAM series.
This text is often quoted but unfortunately long out of print. Public
libraries and second-hand copies may be the only alternative.
It's ironic that algorithms and data useful to the public is ultimately
subject to considerations such as whether a publisher feels it
commercially viable to reprint.
|
| |
| no comments |
|
  |
Author: Mark W. HumphriesMark W. Humphries Date: Apr 26, 2008 20:00
On Apr 27, 10:52 am, "Ed" invalid.com> wrote:
> "Bill" wrote in messagenews:EPOdnab1x7Qqw47VnZ2dnUVZ_qbinZ2d@comcast.com...
>> The Beez' wrote:
>>> Hi!
>
>>> Does anyone have some high level source for FSIN and FCOS words? Of
>>> course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
>>> as well.
>
>>> Hans Bezemer
>> Consider "Computer Approximations" by John F Hart 1968 in the SIAM series.
>
> This text is often quoted but unfortunately long out of print. Public
> libraries and second-hand copies may be the only alternative.
>
> It's ironic that algorithms and data useful to the public is ultimately
> subject to considerations such as whether a publisher feels it
> commercially viable to reprint.
|
| Show full article (0.90Kb) |
| no comments |
|
  |
|
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Apr 27, 2008 04:03
In article news-01.bur.connect.com.au>,
Ed invalid.com> wrote:
>
>"Bill" wrote in message news:EPOdnab1x7Qqw47VnZ2dnUVZ_qbinZ2d@comcast.com...
>> The Beez' wrote:
>>> Hi!
>>>
>>> Does anyone have some high level source for FSIN and FCOS words? Of
>>> course, FP words allowed ;-) BTW, FLN, F** or others are appreciated
>>> as well.
>>>
>>> Hans Bezemer
>> Consider "Computer Approximations" by John F Hart 1968 in the SIAM series.
>
>This text is often quoted but unfortunately long out of print. Public
>libraries and second-hand copies may be the only alternative.
>
>It's ironic that algorithms and data useful to the public is ultimately
>subject to considerations such as whether a publisher feels it
>commercially viable to reprint. ...
|
| Show full article (1.61Kb) |
| no comments |
|
|