@@ -77,12 +77,13 @@ module LA_CONSTANTS
7777 (minexponent (0._sp ) - 1 ) * 0.5_sp )
7878 real (sp), parameter :: stbig = real (radix (0._sp ), sp)** floor ( &
7979 (maxexponent (0._sp ) - digits (0._sp ) + 1 ) * 0.5_sp )
80- ! ssml = 1/s, where s was defined in https://doi.org/10.1145/355769.355771
80+ ! ssml >= 1/s, where s was defined in https://doi.org/10.1145/355769.355771
81+ ! The correction was added in https://doi.org/10.1145/3061665 to scale denormalized numbers correctly
8182 real (sp), parameter :: sssml = real (radix (0._sp ), sp)** ( - floor ( &
82- (minexponent (0._sp ) - 1 ) * 0.5_sp ))
83- ! ssml = 1/S, where S was defined in https://doi.org/10.1145/355769.355771
83+ (minexponent (0._sp ) - digits ( 0._sp ) ) * 0.5_sp ))
84+ ! sbig = 1/S, where S was defined in https://doi.org/10.1145/355769.355771
8485 real (sp), parameter :: ssbig = real (radix (0._sp ), sp)** ( - ceiling ( &
85- (maxexponent (0._sp ) - digits (0._sp ) + 1 ) * 0.5_sp ))
86+ (maxexponent (0._sp ) + digits (0._sp ) - 1 ) * 0.5_sp ))
8687
8788! Standard constants for
8889 integer , parameter :: dp = kind (1.d0 )
@@ -119,11 +120,12 @@ module LA_CONSTANTS
119120 (minexponent (0._dp ) - 1 ) * 0.5_dp )
120121 real (dp), parameter :: dtbig = real (radix (0._dp ), dp)** floor ( &
121122 (maxexponent (0._dp ) - digits (0._dp ) + 1 ) * 0.5_dp )
122- ! ssml = 1/s, where s was defined in https://doi.org/10.1145/355769.355771
123+ ! ssml >= 1/s, where s was defined in https://doi.org/10.1145/355769.355771
124+ ! The correction was added in https://doi.org/10.1145/3061665 to scale denormalized numbers correctly
123125 real (dp), parameter :: dssml = real (radix (0._dp ), dp)** ( - floor ( &
124- (minexponent (0._dp ) - 1 ) * 0.5_dp ))
125- ! ssml = 1/S, where S was defined in https://doi.org/10.1145/355769.355771
126+ (minexponent (0._dp ) - digits ( 0._dp ) ) * 0.5_dp ))
127+ ! sbig = 1/S, where S was defined in https://doi.org/10.1145/355769.355771
126128 real (dp), parameter :: dsbig = real (radix (0._dp ), dp)** ( - ceiling ( &
127- (maxexponent (0._dp ) - digits (0._dp ) + 1 ) * 0.5_dp ))
129+ (maxexponent (0._dp ) + digits (0._dp ) - 1 ) * 0.5_dp ))
128130
129131end module LA_CONSTANTS
0 commit comments