Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

ISBN: 3642271561, 978-3642271564

More Books

Students also viewed these Databases questions