- #1
bsmile
- 48
- 2
The expression to code is: (z complex, m some positive integer)
z^m ( ln(z/(z-1)) - sum( 1/(k z^k), {k=1,m} ) )
The way I code is (in fortran) (in case z<2)
Z_1=1.0_q/Z
ZV1=LOG(Z/(Z-1))
ZK=1.0_q
DO K=1,M; ZK=ZK*Z_1
ZV1=ZV1-ZK/K
ENDDO
ZV1=ZV1/ZK
But it gives quite big error by this bruteforce way of coding. Can anybody help me out to suggest a better way to code it?
Thanks,
z^m ( ln(z/(z-1)) - sum( 1/(k z^k), {k=1,m} ) )
The way I code is (in fortran) (in case z<2)
Z_1=1.0_q/Z
ZV1=LOG(Z/(Z-1))
ZK=1.0_q
DO K=1,M; ZK=ZK*Z_1
ZV1=ZV1-ZK/K
ENDDO
ZV1=ZV1/ZK
But it gives quite big error by this bruteforce way of coding. Can anybody help me out to suggest a better way to code it?
Thanks,