Arithmetic underflow
The term arithmetic underflow (also floating point underflow, or just underflow) is a condition in a computer program where the result of a calculation is a number of more precise absolute value than the computer can actually represent in memory on its central processing unit (CPU).
Arithmetic underflow can occur when the true result of a floating point operation is smaller in magnitude (that is, closer to zero) than the smallest value representable as a normal floating point number in the target datatype.[1] Underflow can in part be regarded as negative overflow of the exponent of the floating point value. For example, if the exponent part can represent values from −128 to 127, then a result with a value less than −128 may cause underflow.
Storing values that are too low in an integer variable (e.g., attempting to store −1 in an unsigned integer) is properly referred to as integer overflow, or more broadly, integer wraparound. The term underflow normally refers to floating point numbers only, which is a separate issue. It is not possible in most floating-point designs to store a too-low value, as usually they are signed and have a negative infinity value.
Underflow gap
The interval between −fminN and fminN, where fminN is the smallest positive normal floating point value, is called the underflow gap. This is because the size of this interval is many orders of magnitude larger than the distance between adjacent normal floating point values just outside the gap. For instance, if the floating point datatype can represent 20 bits, the underflow gap is 221 times larger than the absolute distance between adjacent floating point values just outside the gap.[2]
오래된 설계에서, 저유량 간격은 0이라는 하나의 사용 가능한 값만 가지고 있었다. 언더플로우가 발생했을 때, 실제 결과는 0으로 대체되었다(하드웨어에 의해 직접 또는 일차 언더플로 조건을 처리하는 시스템 소프트웨어에 의해). 이 대체물을 "flush to zero"라고 부른다.
1984년판 IEEE 754에는 보통 이하의 숫자가 도입되었다. 최소 정규수(0을 포함)는 인접한 값 사이의 절대 거리가 언더플로우 간격 바로 바깥쪽의 인접 값과 동일한 값으로 언더플로우 간격을 채운다. 이를 통해 "단계적 저유동"을 가능하게 하며, 가능한 한 가장 가까운 정상 값을 사용한다. 점진적인 언더플로우를 사용할 때에도 가장 가까운 값은 0일 수 있다.[3]
간격 바로 바깥에 인접한 부동소수 값 사이의 절대 거리는 기계 엡실론이라고 불리며, 일반적으로 값 1을 합한 값이 그 부동소수점 체계에서 값 1을 가진 해답이 되는 가장 큰 값으로 특징지어진다.[4] 이것은 (+ )= 1 로 쓸 수 있으며 여기서 () 은 실제 값을 부동소수점 표현으로 변환하는 함수다. 기계 엡실론은 저유량 수준과 혼동해서는 안 되지만(정상 이하의 숫자를 가정)밀접한 관계가 있다. 기계 엡실론은 의미와 의미를 구성하는 비트 수에 따라 달라지는 반면, 언더플로 수준은 지수 필드를 구성하는 자릿수에 따라 달라진다. 대부분의 부동소수점 시스템에서는 기계의 엡실론보다 저유량 수준이 작다.
언더플로 처리
언더플로의 발생은 ("딱딱딱") 상태 비트를 설정하거나 예외를 제기하거나 하드웨어 수준에서 인터럽트를 발생시키거나 이러한 효과의 조합을 유발할 수 있다.
IEEE 754에 명시한 바와 같이, 과부하 조건은 정밀도 상실이 있는 경우에만 표시된다. 전형적으로 이것은 부정확한 최종 결과로 결정된다. 단, 사용자가 저유량에서 트랩을 하는 경우 정밀도 상실의 고려와 관계없이 이러한 현상이 발생할 수 있다. IEEE 754의 언더플로(기타 예외 사항뿐만 아니라)에 대한 기본 처리 방법은 언더플로(Uderflow)가 발생한 부동 소수점 상태로 기록하는 것이다. 이는 애플리케이션 프로그래밍 수준에 대해 지정되지만 하드웨어 수준에서 처리하는 방법으로도 해석된다.
참고 항목
참조
- ^ Coonen, Jerome T (1980). "An implementation guide to a proposed standard for floating-point arithmetic". Computer. 13 (1): 68–79. doi:10.1109/mc.1980.1653344. S2CID 206445847.
- ^ Sun Microsystems (2005). Numerical Computation Guide. Oracle. Retrieved 21 April 2018.
- ^ Demmel, James (1984). "Underflow and the Reliability of Numerical Software". SIAM Journal on Scientific and Statistical Computing. 5 (4): 887–919. doi:10.1137/0905062.
- ^ Heath, Michael T. (2002). Scientific Computing (Second ed.). New York: McGraw-Hill. p. 20. ISBN 0-07-239910-4.
