Write a fortran program
5. The digamma function (z), defined for real or complex 2, can be calculated as where is the Euler Mascheroni constant, -0.577215664901533. Write a Fortran function my.psi that accepts a real number as input, and approximates the digamma function o(z) using the sunu nation above. The summation should continue until the difference between two consecutive terms in the series e. the estimates for two successive values of n s less than or equal to 10-. The function my.psi should return the value of n required for this agreement, as well as the approximation (s). Write a Fortran program digamma.f95 that asks the user to input a real number x and a positive integer N. The progran should create an array z, with N elements, containing the values zi-ih, 1.2, . . . N with h 4max/ N. For each i, the program should call my psi to calculate the values (%) and store 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. 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) should be written as a normal decimal with five decimal places, (s) in scientific (exponential) format with ten digits of precision, and n as an integer 10 characters wide. The same output should also be written to a file digamma.tat Submit a listing of digamma f95, including a note of the finale of the output (i.e. the output for 3x-tmax) for the case zmax = 5, N = 10. 5. The digamma function (z), defined for real or complex 2, can be calculated as where is the Euler Mascheroni constant, -0.577215664901533. Write a Fortran function my.psi that accepts a real number as input, and approximates the digamma function o(z) using the sunu nation above. The summation should continue until the difference between two consecutive terms in the series e. the estimates for two successive values of n s less than or equal to 10-. The function my.psi should return the value of n required for this agreement, as well as the approximation (s). Write a Fortran program digamma.f95 that asks the user to input a real number x and a positive integer N. The progran should create an array z, with N elements, containing the values zi-ih, 1.2, . . . N with h 4max/ N. For each i, the program should call my psi to calculate the values (%) and store 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. 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) should be written as a normal decimal with five decimal places, (s) in scientific (exponential) format with ten digits of precision, and n as an integer 10 characters wide. The same output should also be written to a file digamma.tat Submit a listing of digamma f95, including a note of the finale of the output (i.e. the output for 3x-tmax) for the case zmax = 5, N = 10