Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5. The digamma function (z), defined for real or complex z, can be calculated as where is the Euler Mascheroni constant, ~ 0.577215664901533. Write a
5. The digamma function (z), defined for real or complex z, can be calculated as where is the Euler Mascheroni constant, ~ 0.577215664901533. Write a Fortran subroutine function p (z) using the summation above. The summation should continue until the difference between two consecutive terms in the series i.e. the estimates for two successive values of nis less than or my-psi that sccepts a real number z as input, and approximates the digamma the approximation (z). Write a Fortran program digamma.f95 that asks the user to input a real number 2max and apositive integer N. The program should create an array z, with N elements, containing the values -ih, i 1,2,...N with h--mas/N. For each i, the progran should call my-p81 to calculate t these in another array p, also with N elements. It should also save the value of n needed in each case, to a third array np, also with N elements. he values (s), and store The elements of the arrays z, p and np should be written to the screen as N rows, with the i-th row displaying the i-th elements of the three arrays (and no other text): z should be written as a normal dennal with five decnnal places, (2) in scientific (exponential) format with ten digits of precision, and n as an integer 10 characters wide. The sanne output should also be written to a file digamma.trt. Submit a listing of digamma. 95, including a note of the final line of the output (i.e. the output for 2N-Zmax) for the case zmax 5, N 10
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started