A Rapid Euclidean Norm Calculation Algorithm that Reduces Overflow and Underflow

2021 
The Euclidean norm is widely used in scientific and engineering calculations. However, a straightforward implementation may cause overflow/underflow and loss of accuracy. The Blue algorithm selects a scaling value from three conditional branches according to the absolute value to reduce overflow and underflow. We improve this algorithm and propose the Two-Accumulator method, which is expected to be faster by selecting it from two conditional branches. The input range of our method is slightly smaller than the Blue algorithm. However, we mitigate this problem by dynamically setting the scaling value depending on the vector size. Moreover, we combine it with double-double arithmetic to prevent rounding errors. An evaluation shows that our method combined with double-double arithmetic can be approximately 15% faster than the Blue algorithm while maintaining the same error level, but it can be approximately 46% slower, depending on the input range.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    10
    References
    0
    Citations
    NaN
    KQI
    []