functn must return the value of the integrand
at a given point.
Note: functn should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by
nag_quad_md_simplex (d01pac). If your code inadvertently
does return any NaNs or infinities,
nag_quad_md_simplex (d01pac) is likely to produce unexpected results.