FUNCTION
Trigamma
Evaluates the Trigamma function.
You're viewing an older version of this page (#284). View the current version.
Interface
#include <codecogs/maths/special/gamma/trigamma.h>
using namespace Maths::Special::Gamma;
This component evaluates the Trigamma function with given parameters, defined by the second derivative of the logarithm of the Gamma function:
(1)
In the following example, arguments from the [3, 4] interval are used, with step equal to 0.2, to evaluate the Trigamma function.
Example 1
#include <codecogs/maths/special/gamma/trigamma.h>
#include <iostream>
#include <iomanip>
int main()
{
std::cout << std::setprecision(10);
for (double x = 3; x < 5; x += 0.2)
{
std::cout << "Trigamma(" << x << ") = ";
std::cout << Maths::Special::Gamma::trigamma(x) << std::endl;
}
return 0;
}Output
Trigamma(3) = 0.3949340655
Trigamma(3.2) = 0.3663211898
Trigamma(3.4) = 0.3415413972
Trigamma(3.6) = 0.3198778986
Trigamma(3.8) = 0.3007811415
Trigamma(4) = 0.2838229544
Trigamma(4.2) = 0.2686649398
Trigamma(4.4) = 0.2550362069
Trigamma(4.6) = 0.2427174048
Trigamma(4.8) = 0.2315290639Parameters
x
the argument of the trigamma function
Returns
An approximation of the Trigamma function with the given argument.
References
John Burkardt's library of statistical C++ routines, http://www.csit.fsu.edu/~burkardt/cpp_src/prob/prob.html
Interactive Calculator
x
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.