On 7 abr, 16:36, Leonardo Marques <surf...@[EMAIL PROTECTED]
> wrote:
> hey guys,
>
> im with a little problem when im transcripting a math formula from
> maple to fortran, because when i put a solution on the equation, i got
> a result diferent from zero.
>
> The formula is: 2*arctan(sin(a)*cos(a)/(.8-cos(a)^2))-4/9*Pi ;
> I've transcripted to fortran as: 2*atan((sin(a)*cos(a))/(0.8-
> cos(a)**2))-((pi)*4/9)
>
> There's correct?!
> a piece of my code:
>
> ! usando o metodo da zoada kkkkk
> program missel
> !constantes e variaveis
> real FUNCAO
> ! programa
> write(*,*)'Valor de f:',FUNCAO(1.023762140);
> end
> ! funcoes, para facilitar, tava foda ficar repetindo...
> real function FUNCAO(a);
> real pi,a; parameter(k=0.8,pi=3.141592653);
> FUNCAO=dble(2*atan((sin(a)*cos(a))/(k-cos(a)**2))-((pi)*4/9))
> return
> end
Hey guys,
first thanks for everybody who helped at this topic.
im using de g77 compiler, and f77 is what im using now, this is a
piece of a bigger applicattion which im writinh for a discipline at
college called "numerical calculus", to find zeroes of functions by
numerical a approaching.
i really missed about the 4.0/9.0 what truncate for 0, a eliminate all
the unecessary brackets, i was trying to find the error so a i started
to put it everywhere, but now i rewrote using the preference sequence
at my mind. and the k was eliminate too.
double precision is not necessary at this moment, now i just want
fininsh a first version with single, but later would be nice use
double to get more precise results.
now i get a number really closer to zero =) maple really sux about
precision :P
i rewrote this app as this way:
! usando o metodo da zoada kkkkk
program missel
!constantes e variaveis
real FUNCAO,y;
! programa
write(*,*)FUNCAO(1.023762140);
end
! funcoes, para facilitar, tava foda ficar repetindo...
real function FUNCAO(a);
real pi,a; parameter(pi=3.141592653);
FUNCAO=2*atan(sin(a)*cos(a)/(0.8-cos(a)**2))-4.0*pi/9.0;
return
end
thanks for all guys =)


|