Télécharger ieeeck.eso

Retour à la liste

Numérotation des lignes :

ieeeck
  1. C IEEECK SOURCE BP208322 20/09/18 21:17:01 10718
  2. *> \brief \b IEEECK
  3. *
  4. * =========== DOCUMENTATION ===========
  5. *
  6. * Online html documentation available at
  7. * http://www.netlib.org/lapack/explore-html/
  8. *
  9. *> \htmlonly
  10. *> Download IEEECK + dependencies
  11. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ieeeck.f">
  12. *> [TGZ]</a>
  13. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ieeeck.f">
  14. *> [ZIP]</a>
  15. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ieeeck.f">
  16. *> [TXT]</a>
  17. *> \endhtmlonly
  18. *
  19. * Definition:
  20. * ===========
  21. *
  22. * INTEGER FUNCTION IEEECK( ISPEC, ZERO, ONE )
  23. *
  24. * .. Scalar Arguments ..
  25. * INTEGER ISPEC
  26. * REAL ONE, ZERO
  27. * ..
  28. *
  29. *
  30. *> \par Purpose:
  31. * =============
  32. *>
  33. *> \verbatim
  34. *>
  35. *> IEEECK is called from the ILAENV to verify that Infinity and
  36. *> possibly NaN arithmetic is safe (i.e. will not trap).
  37. *> \endverbatim
  38. *
  39. * Arguments:
  40. * ==========
  41. *
  42. *> \param[in] ISPEC
  43. *> \verbatim
  44. *> ISPEC is INTEGER
  45. *> Specifies whether to test just for inifinity arithmetic
  46. *> or whether to test for infinity and NaN arithmetic.
  47. *> = 0: Verify infinity arithmetic only.
  48. *> = 1: Verify infinity and NaN arithmetic.
  49. *> \endverbatim
  50. *>
  51. *> \param[in] ZERO
  52. *> \verbatim
  53. *> ZERO is REAL
  54. *> Must contain the value 0.0
  55. *> This is passed to prevent the compiler from optimizing
  56. *> away this code.
  57. *> \endverbatim
  58. *>
  59. *> \param[in] ONE
  60. *> \verbatim
  61. *> ONE is REAL
  62. *> Must contain the value 1.0
  63. *> This is passed to prevent the compiler from optimizing
  64. *> away this code.
  65. *>
  66. *> RETURN VALUE: INTEGER
  67. *> = 0: Arithmetic failed to produce the correct answers
  68. *> = 1: Arithmetic produced the correct answers
  69. *> \endverbatim
  70. *
  71. * Authors:
  72. * ========
  73. *
  74. *> \author Univ. of Tennessee
  75. *> \author Univ. of California Berkeley
  76. *> \author Univ. of Colorado Denver
  77. *> \author NAG Ltd.
  78. *
  79. *> \date December 2016
  80. *
  81. *> \ingroup OTHERauxiliary
  82. *
  83. * =====================================================================
  84. INTEGER FUNCTION IEEECK( ISPEC, ZERO, ONE )
  85. *
  86. * -- LAPACK auxiliary routine (version 3.7.0) --
  87. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  88. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  89. * December 2016
  90.  
  91. IMPLICIT INTEGER(I-N)
  92. IMPLICIT REAL*8(A-H,O-Z)
  93. *
  94. * .. Scalar Arguments ..
  95. INTEGER ISPEC
  96. REAL*8 ONE, ZERO
  97. * ..
  98. *
  99. * =====================================================================
  100. *
  101. * .. Local Scalars ..
  102. REAL*8 NAN1, NAN2, NAN3, NAN4, NAN5, NAN6, NEGINF,
  103. & NEGZRO, NEWZRO, POSINF
  104. * ..
  105. * .. Executable Statements ..
  106. IEEECK = 1
  107. *
  108. POSINF = ONE / ZERO
  109. IF ( POSINF.LE.ONE ) THEN
  110. IEEECK = 0
  111. RETURN
  112. END IF
  113. *
  114. NEGINF = -ONE / ZERO
  115. IF ( NEGINF.GE.ZERO ) THEN
  116. IEEECK = 0
  117. RETURN
  118. END IF
  119. *
  120. NEGZRO = ONE / ( NEGINF+ONE )
  121. IF ( NEGZRO.NE.ZERO ) THEN
  122. IEEECK = 0
  123. RETURN
  124. END IF
  125. *
  126. NEGINF = ONE / NEGZRO
  127. IF ( NEGINF.GE.ZERO ) THEN
  128. IEEECK = 0
  129. RETURN
  130. END IF
  131. *
  132. NEWZRO = NEGZRO + ZERO
  133. IF ( NEWZRO.NE.ZERO ) THEN
  134. IEEECK = 0
  135. RETURN
  136. END IF
  137. *
  138. POSINF = ONE / NEWZRO
  139. IF ( POSINF.LE.ONE ) THEN
  140. IEEECK = 0
  141. RETURN
  142. END IF
  143. *
  144. NEGINF = NEGINF*POSINF
  145. IF ( NEGINF.GE.ZERO ) THEN
  146. IEEECK = 0
  147. RETURN
  148. END IF
  149. *
  150. POSINF = POSINF*POSINF
  151. IF ( POSINF.LE.ONE ) THEN
  152. IEEECK = 0
  153. RETURN
  154. END IF
  155. * Return if we were only asked to check infinity arithmetic
  156. *
  157. IF( ISPEC.EQ.0 )
  158. & RETURN
  159. *
  160. NAN1 = POSINF + NEGINF
  161. *
  162. NAN2 = POSINF / NEGINF
  163. *
  164. NAN3 = POSINF / POSINF
  165. *
  166. NAN4 = POSINF*ZERO
  167. *
  168. NAN5 = NEGINF*NEGZRO
  169. *
  170. NAN6 = NAN5*ZERO
  171. *
  172. IF ( NAN1.EQ.NAN1 ) THEN
  173. IEEECK = 0
  174. RETURN
  175. END IF
  176. *
  177. IF ( NAN2.EQ.NAN2 ) THEN
  178. IEEECK = 0
  179. RETURN
  180. END IF
  181. *
  182. IF ( NAN3.EQ.NAN3 ) THEN
  183. IEEECK = 0
  184. RETURN
  185. END IF
  186. *
  187. IF ( NAN4.EQ.NAN4 ) THEN
  188. IEEECK = 0
  189. RETURN
  190. END IF
  191. *
  192. IF ( NAN5.EQ.NAN5 ) THEN
  193. IEEECK = 0
  194. RETURN
  195. END IF
  196. *
  197. IF ( NAN6.EQ.NAN6 ) THEN
  198. IEEECK = 0
  199. RETURN
  200. END IF
  201. *
  202. RETURN
  203. END
  204.  
  205.  
  206.  

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