Re: implementation of DACOSD



Michel OLAGNON wrote:
>
> Damien MATTEI wrote:
>
>
>>in a way as simple as dsind and dcosd can be implemented:
>>
>>* *****************************************************************
>> real*8 FUNCTION DSIND( angle )
>>* *****************************************************************
>> implicit none
>> real*8 angle
>> real*8 pi
>>
>> if( angle .eq. 180.0 ) then
>> dsind = 0.
>> else
>> pi=acos(0.)*2
>> dsind = dsin( angle * pi / 180.0 )
>> endif
>> return
>> end
>>
>>* *****************************************************************
>> real*8 FUNCTION DCOSD( angle )
>>* *****************************************************************
>> implicit none
>> real*8 angle
>> real*8 pi
>>
>> if( angle .eq. 90.0 ) then
>> dcosd = 0.
>> else if( angle .eq. 270.0 ) then
>> dcosd = 0.
>> else
>> pi=acos(0.)*2
>> dcosd = dcos( angle * pi / 180.0 )
>> endif
>> return
>> end
>>
>
>
>
>
> By the way, those functions are very bad implementations.
>
> Hint: real*8 pi
> real*8 zero
> zero = 0.0
> pi = 2 * acos(zero)
>

I would even prefer

pi = ACOS(-1.D0)

cheers,

Rich
.