The gamma function is a generalization of the factorial, and it appears in many applications such as evaluating certain integrals, working with probability distributions, and evaluating fractional derivatives. MATLAB includes the function gamma, but it accepts only real arguments.
Write a function that evaluates the gamma function for complex arguments.
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers20
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3065 Solvers
-
Find state names that start with the letter N
1441 Solvers
-
Number of 1s in the Binary Representation of a Number
480 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
884 Solvers
-
calculate the length of matrix
2477 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Several formulas can approximate the gamma function on the complex domain, but all of them have issues. Please, look at its plot before starting. Nonetheless, there is a trick that makes them all work; and you must find it (I've lost some time trying different formulas, adding more terms, but it is not the way to go).
I've found a 1968-paper by Wrench, Concerning Two Series for the Gamma Function, which gives us the 20th first terms of one formula for instance. https://www.ams.org/journals/mcom/1968-22-103/S0025-5718-1968-0237078-4/ (It would be more than enough if there weren't issues with all approximations.)
lol that was fun xD