evaluation of sqrt(x*x + y*y)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | y |
real(wp) function dcpabs(x,y) real(wp),intent(in) :: x , y real(wp) :: a if ( abs(x)>abs(y) ) then a = y/x dcpabs = abs(x)*sqrt(1.0_wp+a*a) elseif ( y==0.0_wp ) then dcpabs = 0.0_wp else a = x/y dcpabs = abs(y)*sqrt(1.0_wp+a*a) end if end function dcpabs