Windows S5R3 App 4.15 available for Beta Test

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,124
Credit: 126,282,595
RAC: 22,781

How do you linearise sin &

How do you linearise sin & cos?
Given power series representations, wouldn't you have to go quadratic or higher?
.... unless you chopped up the domain to smaller intervals then linearly approximated within each them ( from some pre-calculated mid-points say ). You'd have to use more & smaller intervals to retain accuracy when in the extremes ( high rate of change of slope ie. 2nd derivative ). Or some other method - a ( huge ) lookup table for instance?

Sounds like you need something akin to a 'register' command but one which forces, rather than just requests/advises, the compiler to keep it's fingers off.

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter. Blaise Pascal

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 3,935
Credit: 198,600,852
RAC: 52,086

RE: How do you linearise

Message 74908 in response to message 74907

Quote:
How do you linearise sin & cos?
Given power series representations, wouldn't you have to go quadratic or higher?
.... unless you chopped up the domain to smaller intervals then linearly approximated within each them ( from some pre-calculated mid-points say ). You'd have to use more & smaller intervals to retain accuracy when in the extremes ( high rate of change of slope ie. 2nd derivative ). Or some other method - a ( huge ) lookup table for instance?


This is what we do. The nice thing about the linear approximation is that we can perform the float -> int conversion (argument to table index) with just bit-operations in integer registers, which is pretty fast.

Quote:
Sounds like you need something akin to a 'register' command but one which forces, rather than just requests/advises, the compiler to keep it's fingers off.


Precisely. Or, even better, something that assigns priorities to the "register" hints.

BM

BM

ca_grufti
ca_grufti
Joined: 9 Feb 05
Posts: 53
Credit: 4,309,237
RAC: 0

You have made a huge amount

You have made a huge amount of progress in the way you deal with these code issues. Compliments.

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 3,935
Credit: 198,600,852
RAC: 52,086

4.25 is available. The usual

4.25 is available. The usual suspects will probably want to dig through the assembler code ...

BM

BM

Bikeman (Heinz-Bernd Eggenstein)
Bikeman (Heinz-...
Moderator
Joined: 28 Aug 06
Posts: 3,516
Credit: 454,105,039
RAC: 42,663

RE: 4.25 is available. The

Message 74911 in response to message 74910

Quote:

4.25 is available. The usual suspects will probably want to dig through the assembler code ...

BM


:-) Yup, will probably try to disassemle it tomorrow and try to find out why it doesn't seem to be faster.

rbpeake
rbpeake
Joined: 18 Jan 05
Posts: 247
Credit: 219,266,664
RAC: 0

RE: :-) Yup, will probably

Message 74912 in response to message 74911

Quote:
:-) Yup, will probably try to disassemle it tomorrow and try to find out why it doesn't seem to be faster.


Thank you! :)

Bikeman (Heinz-Bernd Eggenstein)
Bikeman (Heinz-...
Moderator
Joined: 28 Aug 06
Posts: 3,516
Credit: 454,105,039
RAC: 42,663

Even on a weekend,, Bernd was

Even on a weekend,, Bernd was faster :-). See comments in the thread on the new app.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.