亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? errors.f90

?? 數值計算常用的出錯處理!可以看看!學習一下:)
?? F90
?? 第 1 頁 / 共 4 頁
字號:
subroutine dpoly_val ( n, p, x, pval )

!*****************************************************************************80
!
!! DPOLY_VAL evaluates a double precision polynomial.
!
!  Modified:
!
!    08 August 1999
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, integer N, the degree of the polynomial.
!
!    Input, double precision PCOF(0:N), the polynomial coefficients.
!    P(I) is the coefficient of X**I.
!
!    Input, double precision X, the evaluation point.
!
!    Output, double precision PVAL, the value of the polynomial at X.
!
  implicit none

  integer n

  integer i
  double precision p(0:n)
  double precision pval
  double precision x

  pval = p(0)
  do i = 1, n
    pval = pval + p(i) * x**i
  end do

  return
end
subroutine dpoly_val_horner ( n, p, x, pval )

!*****************************************************************************80
!
!! DPOLY_VAL_HORNER evaluates a double precision polynomial using Horner's method.
!
!  Modified:
!
!    08 August 1999
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, integer N, the degree of the polynomial.
!
!    Input, double precision PCOF(0:N), the polynomial coefficients.
!    P(I) is the coefficient of X**I.
!
!    Input, double precision X, the evaluation point.
!
!    Output, double precision PVAL, the value of the polynomial at X.
!
  implicit none

  integer n

  integer i
  double precision p(0:n)
  double precision pval
  double precision x

  pval = p(n)
  do i = n - 1, 0, -1
    pval = pval * x + p(i)
  end do

  return
end
subroutine dpoly2_roots ( p, r )

!*****************************************************************************80
!
!! DPOLY2_ROOTS finds the roots of a quadratic polynomial.
!
!  Discussion:
!
!    The standard quadratic formula is used.
!
!  Modified:
!
!    09 August 1999
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, double precision PCOF(0:2), the polynomial coefficients.
!    P(I) is the coefficient of X**I.
!
!    Output, complex R(2), the roots of the polynomial.
!
  implicit none

  double precision disc
  double precision p(0:2)
  complex ( kind = 16 ) r(2)

  if ( p(2) == 0.0D+00 ) then
    write ( *, * ) ' '
    write ( *, * ) 'DPOLY2_ROOTS - Fatal error!'
    write ( *, * ) '  Quadratic coefficient is zero.'
    stop
  end if

  disc = p(1)**2 - 4.0D+00 * p(2) * p(0)

  if ( disc >= 0.0D+00 ) then

    r(1) = cmplx ( 0.5D+00 * ( - p(1) + sqrt ( disc ) ) / p(2), 0.0D+00 )
    r(2) = cmplx ( 0.5D+00 * ( - p(1) - sqrt ( disc ) ) / p(2), 0.0D+00 )

  else if ( disc < 0.0D+00 ) then

    r(1) = cmplx ( - 0.5D+00 * p(1) / p(2), 0.5D+00 * sqrt ( - disc ) / p(2) )
    r(2) = cmplx ( - 0.5D+00 * p(1) / p(2), - 0.5D+00 * sqrt ( - disc ) / p(2) )
 
  end if

  return
end
subroutine dpoly2_roots2 ( p, r, ierror )

!*****************************************************************************80
!
!! DPOLY2_ROOTS2 finds the roots of a quadratic polynomial.
!
!  Discussion:
!
!    An alternate form of the quadratic formula is used.
!
!  Modified:
!
!    09 December 2001
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, double precision PCOF(0:2), the polynomial coefficients.
!    P(I) is the coefficient of X**I.
!
!    Output, double complex R(2), the roots of the polynomial.
!
!    Output, integer IERROR, error flag.
!    0, no error;
!    1, an error occurred.
!
  implicit none

  double precision disc
  integer ierror
  double precision p(0:2)
  complex ( kind = 16 ) r(2)

  ierror = 0

  if ( p(2) == 0.0D+00 ) then
    ierror = 1
    write ( *, '(a)' ) ' '
    write ( *, '(a)' ) 'DPOLY2_ROOTS2 - Fatal error!'
    write ( *, '(a)' ) '  Quadratic coefficient is zero.'
    stop
  end if

  disc = p(1)**2 - 4.0D+00 * p(2) * p(0)

  if ( disc >= 0.0D+00 ) then

    if ( - p(1) + sqrt ( disc ) == 0.0D+00 ) then
      ierror = 1
      r(1) = cmplx ( 0.0D+00, 0.0D+00 )
    else
      r(1) = cmplx ( 2.0D+00 * p(0) / ( - p(1) + sqrt ( disc ) ), 0.0D+00 )
    end if

    if ( - p(1) - sqrt ( disc ) == 0.0D+00 ) then
      ierror = 1
      r(2) = cmplx ( 0.0D+00, 0.0D+00 )
    else
      r(2) = cmplx ( 2.0D+00 * p(0) / ( - p(1) - sqrt ( disc ) ), 0.0D+00 )
    end if
!
!  Need to revise this part of the calculation.
!
  else if ( disc < 0.0D+00 ) then

    r(1) = cmplx ( - 0.5D+00 * p(1) / p(2), + 0.5D+00 * sqrt ( - disc ) / p(2) )
    r(2) = cmplx ( - 0.5D+00 * p(1) / p(2), - 0.5D+00 * sqrt ( - disc ) / p(2) )

  end if

  return
end
function fmin ( ax, bx, f, tol )

!*****************************************************************************80
!
!! FMIN seeks a minimizer of a scalar function of a scalar variable.
!
!  Discussion:
!
!    FMIN seeks an approximation to the point where F attains a minimum on
!    the interval (AX,BX).
!
!    The method used is a combination of golden section search and
!    successive parabolic interpolation.  Convergence is never much
!    slower than that for a Fibonacci search.  If F has a continuous
!    second derivative which is positive at the minimum (which is not
!    at AX or BX), then convergence is superlinear, and usually of the
!    order of about 1.324....
!
!    The function F is never evaluated at two points closer together
!    than EPS * ABS ( FMIN ) + (TOL/3), where EPS is approximately the
!    square root of the relative machine precision.  If F is a unimodal
!    function and the computed values of F are always unimodal when
!    separated by at least EPS * ABS ( XSTAR ) + (TOL/3), then FMIN
!    approximates the abcissa of the global minimum of F on the
!    interval AX, BX with an error less than 3 * EPS * ABS ( FMIN ) + TOL.
!    If F is not unimodal, then FMIN may approximate a local, but
!    perhaps non-global, minimum to the same accuracy.
!
!  Reference:
!
!    Richard Brent,
!    Algorithms for Minimization without Derivatives,
!    Prentice Hall, 1973.
!
!    David Kahaner, Clever Moler, Steven Nash,
!    Numerical Methods and Software,
!    Prentice Hall, 1988.
!
!  Parameters
!
!    Input/output, real AX, BX.  On input, the left and right endpoints
!    of the initial interval.  On output, the lower and upper bounds for
!    the minimizer.
!
!    Input, external F, a real function of the form
!      function f ( x )
!      real f
!      real x
!    which evaluates F(X) for any X in the interval (AX,BX).
!
!    Input, real TOL, the desired length of the interval of uncertainty of the
!    final result ( >= 0.0)
!
!    Output, real FMIN, the abcissa approximating the minimizer of f.
!
  implicit none

  real a
  real ax
  real b
  real bx
  real c
  real d
  real e
  real eps
  real, external :: f
  real fmin
  real fu
  real fv
  real fw
  real fx
  real p
  real q
  real r
  real tol
  real tol1
  real tol2
  real u
  real v
  real w
  real x
  real xm

  c = 0.5E+00 * ( 3.0E+00 - sqrt ( 5.0E+00 ) )
!
!  C is the squared inverse of the golden ratio.
!
!  EPS is the square root of the relative machine precision.
!
  eps = sqrt ( epsilon ( eps ) )
!
!  Initialization.
!
  a = ax
  b = bx
  v = a + c * ( b - a )
  w = v
  x = v
  e = 0.0E+00
  fx = f(x)
  fv = fx
  fw = fx
!
!  Main loop starts here.
!
20 continue

  xm = 0.5E+00 * ( a + b )
  tol1 = eps * abs ( x ) + tol / 3.0E+00
  tol2 = 2.0E+00 * tol1
!
!  Check the stopping criterion.
!
  if ( abs ( x - xm ) <= ( tol2 - 0.5E+00 * ( b - a ) ) ) then
    fmin = x
    return
  end if
!
!  Is golden-section necessary?
!
  if ( abs ( e ) <= tol1 ) then
    go to 40
  end if
!
!  Fit a parabola.
!
  r = ( x - w ) * ( fx - fv )
  q = ( x - v ) * ( fx - fw )
  p = ( x - v ) * q - ( x - w ) * r
  q = 2.0E+00 * ( q - r )
  if ( q > 0.0E+00 ) then
    p = -p
  end if
  q = abs ( q )
  r = e
  e = d
!
!  Is a parabola acceptable?
!
   30 continue

  if ( abs ( p ) >= abs ( 0.5E+00 * q * r ) ) then
    go to 40
  end if

  if ( p <= q * ( a - x ) ) then
    go to 40
  end if

  if ( p >= q * ( b - x ) ) then
    go to 40
  end if
!
!  A parabolic interpolation step
!
  d = p / q
  u = x + d
!
!  F must not be evaluated too close to AX or BX.
!
  if ( ( u - a ) < tol2 ) then
    d = sign ( tol1, xm - x )
  end if

  if ( ( b - u ) < tol2 ) then
    d = sign ( tol1, xm - x )
  end if

  go to 50
!
!  A golden-section step.
!
   40 continue

  if ( x >= xm ) then
    e = a - x
  else
    e = b - x
  end if

  d = c * e
!
!  F must not be evaluated too close to X.
!
   50 continue

  if ( abs ( d ) >= tol1 ) then
    u = x + d
  end if

  if ( abs ( d ) < tol1 ) then
    u = x + sign ( tol1, d )
  end if

  fu = f(u)
!
!  Update  a, b, v, w, and x
!
  if ( fu <= fx ) then

    if ( u >= x ) then
      a = x
    else
      b = x
    end if

    v = w
    fv = fw
    w = x
    fw = fx
    x = u
    fx = fu
    go to 20

  end if

60 continue

  if ( u < x ) then
    a = u
  else
    b = u
  end if

  if ( fu <= fw ) then
    go to 70
  end if

  if ( w == x ) then
    go to 70
  end if

  if ( fu <= fv ) then
    go to 80
  end if

  if ( v == x ) then
    go to 80
  end if

  if ( v == w ) then
    go to 80
  end if

  go to 20

   70 continue

  v = w
  fv = fw
  w = u
  fw = fu
  go to 20
   80 continue

  v = u
  fv = fu
  go to 20

end
function isamax ( n, x, incx )

!*****************************************************************************80
!
!! ISAMAX finds the index of the vector element of maximum absolute value.
!
!  Modified:
!
!    08 April 1999
!
!  Parameters:
!
!    Input, integer N, the number of entries in the vector.
!
!    Input, real X(*), the vector to be examined.
!
!    Input, integer INCX, the increment between successive entries of SX.
!
!    Output, integer ISAMAX, the index of the element of SX of maximum
!    absolute value.
!
  implicit none

  integer i
  integer incx
  integer isamax
  integer ix
  integer n
  real samax
  real x(*)

  if ( n <= 0 ) then

    isamax = 0

  else if ( n == 1 ) then

    isamax = 1

  else if ( incx == 1 ) then

    isamax = 1
    samax = abs ( x(1) )

    do i = 2, n

      if ( abs ( x(i) ) > samax ) then
        isamax = i
        samax = abs ( x(i) )
      end if

    end do

  else

    if ( incx >= 0 ) then
      ix = 1
    else
      ix = ( - n + 1 ) * incx + 1
    end if

    isamax = 1
    samax = abs ( x(ix) )

    ix = ix + incx

    do i = 2, n
      if ( abs ( x(ix) ) > samax ) then
        isamax = i
        samax = abs ( x(ix) )
      end if
      ix = ix + incx
    end do

  end if

  return
end
function lcm_12n ( n )

!*****************************************************************************80
!
!! LCM_12N computes the least common multiple of the integers 1 through N.
!
!  Examples:
!
!    N    LCM_12N
!
!    1          1
!    2          2
!    3          3
!    4         12
!    5         60
!    6         60
!    7        420
!    8        840
!    9       2520
!   10       2520
!
!  Modified:
!
!    18 May 2001
!
!  Author:
!
!    John Burkardt
!
!  Parameters:
!
!    Input, integer N, the value of N.
!
!    Output, integer LCM_12N, the least common multiple of the integers 1 to N.
!
  implicit none

  integer i
  integer imult
  integer j
  integer lcm_12n
  integer n

  lcm_12n = 1

  do i = 2, n

    imult = i

    do j = 1, i-1

      if ( mod ( imult, (i-j) )   ==   0 ) then
        imult = imult / ( i - j )
      end if

    end do

    lcm_12n = lcm_12n * imult

  end do

  return
end
subroutine matrix_exponential_taylor ( n, a, a_exp )

!*****************************************************************************80
!
!! MAXTRIX_EXPONENTIAL_TAYLOR uses a Taylor series for the matrix exponential.
!

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品欧美精品系列| 久久午夜羞羞影院免费观看| 日韩精品一区二区三区蜜臀| 国产精品日日摸夜夜摸av| 亚洲二区在线观看| 99久久婷婷国产综合精品| 欧美精品日韩一区| 亚洲三级免费电影| 国产精品一区在线| 日韩欧美一二三四区| 一区二区三区在线免费观看| 国产不卡免费视频| 日韩三区在线观看| 亚洲免费观看高清完整版在线观看| 久久电影国产免费久久电影| 欧美天堂亚洲电影院在线播放| 亚洲国产精品v| 狠狠色狠狠色综合系列| 欧美日韩国产经典色站一区二区三区| 中文字幕中文在线不卡住| 九色综合狠狠综合久久| 欧美一区在线视频| 亚洲国产一区二区在线播放| 91女神在线视频| 国产精品免费人成网站| 国产99久久久精品| 久久久久国色av免费看影院| 九色综合国产一区二区三区| 日韩欧美一区二区久久婷婷| 免费看欧美女人艹b| 91麻豆精品国产91久久久久| 亚洲午夜激情网页| 国产精品你懂的在线欣赏| 国产在线播放一区二区三区| 精品成人a区在线观看| 韩国三级在线一区| 久久精品视频在线看| 国产精品一级片在线观看| 久久婷婷成人综合色| 国产精品伊人色| 国产精品免费av| 91亚洲资源网| 亚洲第一主播视频| 欧美精品亚洲二区| 免费看日韩a级影片| 久久影院午夜片一区| 国产九色精品成人porny| 欧美激情一区二区在线| gogogo免费视频观看亚洲一| 亚洲手机成人高清视频| 日本乱人伦一区| 日本女人一区二区三区| 337p粉嫩大胆色噜噜噜噜亚洲| 国产一区视频导航| 国产精品久线在线观看| 91久久久免费一区二区| 日韩福利视频网| 国产喂奶挤奶一区二区三区| 91视频xxxx| 午夜视频久久久久久| 欧美成人video| 99久久精品免费看国产| 日产国产欧美视频一区精品| 久久日一线二线三线suv| 成人在线视频一区| 亚洲五码中文字幕| 精品美女在线观看| 91免费小视频| 国产又粗又猛又爽又黄91精品| 国产精品成人网| 日韩精品自拍偷拍| 91免费精品国自产拍在线不卡| 日韩高清不卡一区二区| 自拍偷拍亚洲激情| 欧美一区二区三区精品| 91在线看国产| 精品一区二区三区在线观看| 亚洲美女淫视频| 久久久精品黄色| 欧美一区二区视频免费观看| 成人黄色片在线观看| 蜜臀av一区二区在线免费观看| 亚洲日本护士毛茸茸| 精品美女在线观看| 欧美精品777| 91视频xxxx| 成人av网站免费观看| 久久福利资源站| 日韩精品成人一区二区在线| 亚洲日本在线观看| 国产调教视频一区| 欧美不卡在线视频| 综合久久久久综合| 久久久久久久综合日本| 欧美欧美欧美欧美首页| 一本到不卡免费一区二区| 国产精品一线二线三线| 另类小说一区二区三区| 亚洲一区二区三区在线看| 国产精品电影一区二区三区| 久久亚洲一级片| 日韩美女视频在线| 日韩欧美国产精品| 欧美日韩国产一级| 欧美综合久久久| 色婷婷av久久久久久久| eeuss影院一区二区三区| 国产激情视频一区二区三区欧美| 免费在线观看视频一区| 日韩电影在线观看一区| 亚洲一区二区三区中文字幕在线| 亚洲色图在线视频| 国产精品女主播在线观看| 日本一区二区不卡视频| 国产午夜亚洲精品理论片色戒| 久久久久久久免费视频了| 国产日韩av一区| 中文字幕高清一区| 亚洲欧洲日韩女同| 夜夜爽夜夜爽精品视频| 性欧美疯狂xxxxbbbb| 石原莉奈在线亚洲二区| 日韩国产成人精品| 久久丁香综合五月国产三级网站| 狠狠色狠狠色综合系列| 高清久久久久久| 91国偷自产一区二区使用方法| 91国产免费看| 欧美一区二区三区男人的天堂| 日韩美女视频一区二区在线观看| 久久毛片高清国产| 中文字幕一区av| 亚洲欧美欧美一区二区三区| 亚洲精品自拍动漫在线| 99久久99久久综合| 在线国产亚洲欧美| 欧美精品一卡二卡| 欧美日韩亚洲不卡| 日韩一级片在线观看| 日韩欧美久久久| 国产三级精品视频| 亚洲视频在线观看一区| 亚洲精品老司机| 亚洲国产成人在线| 中文字幕一区在线观看视频| 亚洲国产精品久久久男人的天堂| 亚洲国产日韩av| 日产欧产美韩系列久久99| 国产在线精品一区二区夜色 | 午夜精品免费在线观看| 亚洲成人综合视频| 国产一区免费电影| 91热门视频在线观看| 欧美大片在线观看一区二区| 欧美精品一区二区三区蜜桃视频 | 色老头久久综合| 4438x亚洲最大成人网| 欧美本精品男人aⅴ天堂| 制服丝袜亚洲网站| 一色桃子久久精品亚洲| 亚洲高清免费观看高清完整版在线观看| 日韩精品视频网| 国产69精品一区二区亚洲孕妇| 欧美调教femdomvk| 久久久99精品久久| 一区二区三区在线视频观看| 久久99国内精品| 欧美日韩一级大片网址| 久久久精品影视| 亚洲影院久久精品| 国产成人免费视| 精品三级在线观看| 一区二区三区波多野结衣在线观看| 日本成人在线电影网| 99久久精品免费精品国产| 2021中文字幕一区亚洲| 夜夜嗨av一区二区三区四季av| 久久成人免费电影| 欧美日韩和欧美的一区二区| 亚洲精品欧美在线| 日韩视频在线永久播放| 国产精品免费网站在线观看| 亚洲成人精品在线观看| 97久久精品人人做人人爽| 91精品国产日韩91久久久久久| 国产精品毛片久久久久久久| 亚洲国产aⅴ天堂久久| 日本久久一区二区三区| 久久久精品国产99久久精品芒果| 日韩精品一卡二卡三卡四卡无卡| av福利精品导航| 精品国产一区二区三区忘忧草| 亚洲一二三专区| av网站免费线看精品| 久久亚洲一区二区三区明星换脸| 亚洲精品国产a久久久久久 | 欧美日韩国产成人在线91| 国产欧美一区二区在线观看| 国产在线精品一区在线观看麻豆| 日韩一级在线观看|