adjust_abserr Function

public pure function adjust_abserr(resasc, resabs, abserr)

Adjust estimate of absolute error

Arguments

Type IntentOptional 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

Return Value real


Contents

Source Code


Source Code

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