Prev Next

dgamlm

Prototype
int f2cad::dgamlm_(doublereal *xmin, doublereal *xmax);

Fortran Source
dgamlm.f

Description
This routine computes the allowable limits for the argument to the Gamma function. These limits should also work for the exponential function.
 

# include <f2cad/dgamlm.hpp>

test_result dgamlm(void)
{	bool ok = true;
	doublereal ad_xmin, ad_xmax;

	f2cad::dgamlm_(&ad_xmin, &ad_xmax);

	double xmin = f2cad::Value(ad_xmin);
	double xmax = f2cad::Value(ad_xmax);

	ok  &= xmin < 0.;
	ok  &= xmax > 0.;
	ok  &= (xmax - xmin) > 50.;
	ok  &= f2cad::near_equal( log(exp(xmin)), xmin, 1e-10, 1e-10); 
	ok  &= f2cad::near_equal( log(exp(xmax)), xmax, 1e-10, 1e-10); 

	if( ok )
		return test_pass;
	return test_fail;
}

Input File: example/dgamlm.cpp