Trigonometry without sine/cosine

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

If the LUTs are big, they cannot be cached, especially if they are traversed in a cache-unfriendly way. Cache misses can be very expensive. You often cannot tell in advance what the fastest method is.
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

The only way is to write a test-program that does something meaningful. Generally, today's PCs will evaluate trig functions very quickly and with better accuracy than what any LUTs can give you. Not quite like that on calcs of course...
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

How do PCs do it?
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

It's a single assembly instruction. Formerly (pre-Pentium era) this functionality was available in separate coprocessors, but it was integrated in the first Pentium.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

If the CPU can calculate trig itself, then you should have no real need for a LUT (unless the instruction was very ineffecient).
Of course, using maths to favour a LUT was what gave us the ATi DOOM3 shader tweak. ;) So LUTs are not always the best.
User avatar
crzyrbl
Calc Wizard
Posts: 518
Joined: Wed 06 Jul, 2005 4:56 pm
Location: 3rd rock....

Post by crzyrbl »

im happy as long as what im learning in AP calc doesnt become obsolete.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image
Kerey
Regular Member
Posts: 136
Joined: Tue 11 Jan, 2005 10:10 pm
Location: No longer in the Midwest... now in Seattle
Contact:

Post by Kerey »

benryves wrote:If the CPU can calculate trig itself, then you should have no real need for a LUT (unless the instruction was very ineffecient).
Of course, using maths to favour a LUT was what gave us the ATi DOOM3 shader tweak. ;) So LUTs are not always the best.
Ok, I guess one assembly instruction might be a tad faster than an LUT, heh. I was thinking they were a Taylor expansion or something.
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

They probably are, somewhere deep down below... Which is a little worrying, so to settle my nerves, I made a benchmark calculating a whole heap of sins and taking values from a high resolution LUT, compiled with all optimizations I could find for my amd64 3000+. The results were a little surprising, the LUT was nearly 100x faster :) I've never looked into any asm so I didn't use any weird vector-tricks with SSE to get a whole heap of values in a row.

This doesn't imply LUTs are better overall, remember that :)
Post Reply