Hi all,

I want to know a why to get sine, using an algorithm that uses only Additon , subtraction , multiplication and division.

Anyone have opinion:

Amr

I want to know a why to get sine, using an algorithm that uses only Additon , subtraction , multiplication and division.

Anyone have opinion:

Amr

Hrm, I have a very faint recollection of something from math classes a while ago... Taylor Polynomials, I think. Scali says so, too :p, and that "the division can even be avoided, if you precalc 1/n! into a table". But don't tell anyone if this turns out to be useful advice, you all know that scali is purely evil ^_^

Searching the forum helps all of us to avoid reinventing the wheel. :)

http://www.asmcommunity.net/board/showthread.php?threadid=7926&highlight=sine

http://www.asmcommunity.net/board/showthread.php?threadid=7926&highlight=sine

amr,

Perhaps you might want to look at this site. Very interesting. Ratch

http://www.bmath.net/bmath/index.html

Perhaps you might want to look at this site. Very interesting. Ratch

http://www.bmath.net/bmath/index.html

Just to explain, if x is in radians,

sin x can be expressed by Maclaurin's series expansion (According to maths notes, but some people calls it Taylor's expansion. Not sure who is right, who is wrong.) to

x - x^3/3! + x^5/5! - x^7/7! + x^9/9! - x^11/11! + ..

So the above link by Starless just attempts approximation using the above expansion with a slight bit of modification...

sin x can be expressed by Maclaurin's series expansion (According to maths notes, but some people calls it Taylor's expansion. Not sure who is right, who is wrong.) to

x - x^3/3! + x^5/5! - x^7/7! + x^9/9! - x^11/11! + ..

So the above link by Starless just attempts approximation using the above expansion with a slight bit of modification...

roticv,

The infinite series f(x) = f'(a)(x-a) + f''(a)(x-a)? + ... is called the Taylor series. Expansion around x = 0, that is f(x) = f'0)(x) + f"(0)(x)? + ... is called the Maclaurin series. Ratch

The infinite series f(x) = f'(a)(x-a) + f''(a)(x-a)? + ... is called the Taylor series. Expansion around x = 0, that is f(x) = f'0)(x) + f"(0)(x)? + ... is called the Maclaurin series. Ratch

NO i do

But i do know Taylor series are good ;)

**not**consider that Scali is pure evil...But i do know Taylor series are good ;)

amr

You may also be interested in looking at the source code of a fixed point math library available at the very bottom of the page at the following link. ALL computations are done strictly in integer math with CPU instructions, i.e. no FPU instructions.

http://www.movsd.com/source.htm

Raymond

You may also be interested in looking at the source code of a fixed point math library available at the very bottom of the page at the following link. ALL computations are done strictly in integer math with CPU instructions, i.e. no FPU instructions.

http://www.movsd.com/source.htm

Raymond

BogdanOntanu,

NO i do not consider that Scali is pure evil...

But i do know Taylor series are good

Huh? Ratch

NO i do not consider that Scali is pure evil...

But i do know Taylor series are good

Huh? Ratch

Hi all,

I think you read my mind Raymond,

that's exactly what I need.

thanks

I think you read my mind Raymond,

that's exactly what I need.

thanks

You're welcome amr. I didn't think it would ever get used. Just ask if you have any question about it.

Raymond

Raymond