PetscDTTanhSinhIntegrate#
Approximate \(\int_a^b f(x)\,dx\) to a requested precision using adaptive tanh-sinh (double-exponential) quadrature
Synopsis#
#include "petscdt.h"
PetscErrorCode PetscDTTanhSinhIntegrate(void (*func)(const PetscReal[], PetscCtx, PetscReal *), PetscReal a, PetscReal b, PetscInt digits, PetscCtx ctx, PetscReal *sol)
Not Collective; No Fortran Support
Input Parameters#
func - the integrand callback (
func(x, ctx, &value)evaluates the integrand at pointx)a - lower limit of integration
b - upper limit of integration
digits - target number of correct decimal digits
ctx - optional user context passed to
func
Output Parameter#
sol - the approximate value of the integral
Notes#
Doubles the number of quadrature points at each refinement level until the change in the integral falls below the requested tolerance. Suitable for smooth integrands and integrands with endpoint singularities.
For arbitrary-precision arithmetic via MPFR, see PetscDTTanhSinhIntegrateMPFR().
See Also#
Level#
developer
Location#
Index of all DT routines
Table of Contents for all manual pages
Index of all manual pages