Télécharger dlapy2.eso

Retour à la liste

Numérotation des lignes :

dlapy2
  1. C DLAPY2 SOURCE PV 22/04/19 16:18:02 11344
  2. *> \brief \b DLAPY2 returns sqrt(x2+y2).
  3. *
  4. * =========== DOCUMENTATION ===========
  5. *
  6. * Online html documentation available at
  7. * http://www.netlib.org/lapack/explore-html/
  8. *
  9. *> \htmlonly
  10. *> Download DLAPY2 + dependencies
  11. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlapy2.f">
  12. *> [TGZ]</a>
  13. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlapy2.f">
  14. *> [ZIP]</a>
  15. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlapy2.f">
  16. *> [TXT]</a>
  17. *> \endhtmlonly
  18. *
  19. * Definition:
  20. * ===========
  21. *
  22. * REAL*8 FUNCTION DLAPY2( X, Y )
  23. *
  24. * .. Scalar Arguments ..
  25. * REAL*8 X, Y
  26. * ..
  27. *
  28. *
  29. *> \par Purpose:
  30. * =============
  31. *>
  32. *> \verbatim
  33. *>
  34. *> DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary
  35. *> overflow.
  36. *> \endverbatim
  37. *
  38. * Arguments:
  39. * ==========
  40. *
  41. *> \param[in] X
  42. *> \verbatim
  43. *> X is DOUBLE PRECISION
  44. *> \endverbatim
  45. *>
  46. *> \param[in] Y
  47. *> \verbatim
  48. *> Y is DOUBLE PRECISION
  49. *> X and Y specify the values x and y.
  50. *> \endverbatim
  51. *
  52. * Authors:
  53. * ========
  54. *
  55. *> \author Univ. of Tennessee
  56. *> \author Univ. of California Berkeley
  57. *> \author Univ. of Colorado Denver
  58. *> \author NAG Ltd.
  59. *
  60. *> \date June 2017
  61. *
  62. *> \ingroup OTHERauxiliary
  63. *
  64. * =====================================================================
  65. FUNCTION DLAPY2( X, Y )
  66. *
  67. * -- LAPACK auxiliary routine (version 3.7.1) --
  68. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  69. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  70. * June 2017
  71. *
  72. * .. Scalar Arguments ..
  73. REAL*8 DLAPY2
  74. REAL*8 X, Y
  75. * ..
  76. *
  77. * =====================================================================
  78. *
  79. * .. Parameters ..
  80. REAL*8 ZERO
  81. PARAMETER ( ZERO = 0.0D0 )
  82. REAL*8 ONE
  83. PARAMETER ( ONE = 1.0D0 )
  84. * ..
  85. * .. Local Scalars ..
  86. REAL*8 W, XABS, YABS, Z
  87. LOGICAL X_IS_NAN, Y_IS_NAN
  88. * ..
  89. * .. External Functions ..
  90. LOGICAL DISNAN
  91. EXTERNAL DISNAN
  92. * ..
  93. ** .. Intrinsic Functions ..
  94. * INTRINSIC ABS, MAX, MIN, SQRT
  95. ** ..
  96. ** .. Executable Statements ..
  97. *
  98. DLAPY2 = 0.D0
  99. X_IS_NAN = DISNAN( X )
  100. Y_IS_NAN = DISNAN( Y )
  101. IF ( X_IS_NAN ) DLAPY2 = X
  102. IF ( Y_IS_NAN ) DLAPY2 = Y
  103. *
  104. IF ( .NOT.( X_IS_NAN.OR.Y_IS_NAN ) ) THEN
  105. XABS = ABS( X )
  106. YABS = ABS( Y )
  107. W = MAX( XABS, YABS )
  108. Z = MIN( XABS, YABS )
  109. IF( Z.EQ.ZERO ) THEN
  110. DLAPY2 = W
  111. ELSE
  112. DLAPY2 = W*SQRT( ONE+( Z / W )**2 )
  113. END IF
  114. END IF
  115. RETURN
  116. *
  117. * End of DLAPY2
  118. *
  119. END
  120.  
  121.  
  122.  
  123.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales