Adjust estimate of absolute error
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | resasc |
Approximation to the integral of abs(f-i/(b-a)) |
||
real, | intent(in) | :: | resabs |
Approximation to the integral of abs(f) |
||
real, | intent(in) | :: | abserr |
Estimate of absolute error |
pure real function adjust_abserr(resasc, resabs, abserr)
!> Approximation to the integral of abs(f-i/(b-a))
real, intent(in) :: resasc
!> Approximation to the integral of abs(f)
real, intent(in) :: resabs
!> Estimate of absolute error
real, intent(in) :: abserr
adjust_abserr = abserr
if (is_not_zero(resasc) .and. is_not_zero(adjust_abserr)) then
adjust_abserr = resasc * min(1.0e+00, (2.0e+02 * adjust_abserr/resasc)**1.5e+00)
end if
if (resabs > tiny(resabs) / (5.0e+01 * epsilon(resabs))) then
adjust_abserr = max((epsilon(resabs) * 5.0e+01) * resabs, adjust_abserr)
end if
end function adjust_abserr