Windows S5R3 App 4.15 available for Beta Test

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6534
Credit: 284700169
RAC: 113726

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 ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4265
Credit: 244920768
RAC: 17022

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: 4309237
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: 4265
Credit: 244920768
RAC: 17022

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: 3522
Credit: 686025872
RAC: 601949

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: 266
Credit: 967680411
RAC: 1223402

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: 3522
Credit: 686025872
RAC: 601949

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.