Veltkamp's split of a double into two halves of 26 bits: .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a | |||
| real(kind=dp), | intent(out) | :: | h | |||
| real(kind=dp), | intent(out) | :: | l |
pure subroutine split(a, h, l) real(dp),intent(in) :: a real(dp),intent(out) :: h, l real(dp),parameter :: factor = 134217729.0_dp !! 2^27 + 1 real(dp) :: c c = factor * a h = c - (c - a) l = a - h end subroutine split