[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] Re: [avr-gcc-list] Problem with asin() and acos()
From: |
E. Weddington |
Subject: |
[avr-libc-dev] Re: [avr-gcc-list] Problem with asin() and acos() |
Date: |
Wed, 02 Oct 2002 10:33:45 -0600 |
On 2 Oct 2002 at 10:19, I wrote:
>
> I just did some research. The correct formula for acos(x) is:
>
> acos(x) = (PI/2) - asin(x)
>
> So acos.s is incorrect. Does anybody know if the implementation of
> asin() is correct?
>
> Eric
>
Ok, so acos.s may be correct.
GLOBAL(acos)
RCALL _U(asin)
LDI rB3,0x80
EOR rA3,rB3
LDI rB3,0x3F
LDI rB2,0xC9
LDI rB1,0x0F
LDI rB0,0xDB ; B = PI/2
RJMP _U(__addsf3)
ENDFUNC
It *looks* like that the result of asin() is negated and then added
to PI/2, which would give the correct formula.
So it's off to asin() to see what's going on with it's formula...
Eric