Veltkamp splitting returns an exact split into short parts full
This proof shows: correctness.
Setting. Radix 2, precision p, round to nearest with a symmetric tie rule (the rounded value of −x is the negative of the rounded value of x), 1≤s≤p−1, σ=2s, C=σ+1. The input a is a normal float, and no operation overflows. We use two facts about binary floats.
- (F1) If U is a power of two and k is an integer with ∣k∣≤2p, then kU is a float, provided U≥2emin−p+1 and no overflow occurs.
- (F2) If x lies in a binade [2e,2e+1], every float in that binade is a multiple of 2e−p+1, and rounding to nearest gives the nearest multiple of 2e−p+1 (ties by the tie rule).
Theorem. Lines L1 to L5 return ah and al with ah+al=a, ah a multiple of σulp(a), and ∣al∣≤2σulp(a).
Proof. Everything commutes with multiplication by a power of two (as long as nothing underflows or overflows) and with negation (by the symmetric tie rule), so assume 1≤a<2. Then ulp(a)=q=21−p, and a is a multiple of q.
Step 1: γ is a multiple of σq and γ≥σ+1. The exact product Ca=σa+a satisfies σ+1≤Ca<2σ+2. If Ca<2σ, it lies in [σ,2σ), where the float spacing is σq; otherwise it lies in [2σ,4σ), with spacing 2σq. In both cases γ=fl(Ca) is a multiple of σq by (F2). Since σ+1 is a float (by (F1), as s≤p−1) and rounding is monotone, γ≥σ+1.
Step 2: σ≤γ−a≤2σ. Write γ=Ca+ϵ1, so γ−a=σa+ϵ1.
- Upper bound. If γ≤2σ, then γ−a≤2σ−1. If γ>2σ, then Ca≥2σ, because 2σ is a float and rounding is monotone; so Ca lies in [2σ,4σ), the spacing there is 2σq, ∣ϵ1∣≤σq, and γ−a=σa+ϵ1≤σ(2−q)+σq=2σ.
- Lower bound. If a=1, then Ca=σ+1 is a float, ϵ1=0 and γ−a=σ. If a≥1+q and γ<2σ, then ∣ϵ1∣≤σq/2 and γ−a≥σ(1+q)−σq/2>σ. If γ≥2σ, then γ−a>2σ−2≥σ, since a<2 and σ≥2.
Step 3: δ=−rndσq(γ−a). By Step 2, γ−a lies in [σ,2σ]. Every float in that interval is a multiple of σq and every multiple of σq in it is a float by (F1), so rounding γ−a to nearest is rounding it to the nearest multiple of σq. By the symmetric tie rule, δ=fl(a−γ)=−fl(γ−a) is a multiple of σq with ∣δ−(a−γ)∣≤σq/2.
Step 4: line L4 is exact and ah is a rounded to a multiple of σq. Since γ is a multiple of σq, γ+δ is a multiple of σq, and γ+δ=a+(δ−(a−γ)), so ∣γ+δ−a∣≤σq/2. With x=γ−a, γ+δ=γ−rndσq(x), and since γ is a multiple of σq this is the multiple of σq nearest to γ−x=a (ties resolved by the tie rule applied to x). Because 1 and 2 are multiples of σq=2s+1−p≤1 and 1≤a<2, we get 1≤γ+δ≤2, and γ+δ=kσq with ∣k∣≤2/(σq)=2p−s. By (F1) it is a float, so ah=γ+δ exactly.
Step 5: line L5 is exact. a−ah is a multiple of q with ∣a−ah∣≤σq/2=2s−1q. Since s−1≤p−2, by (F1) it is a float, so al=a−ah exactly. Consequently ah+al=a.
Bit counts. ah=kσq with 2p−s−1≤∣k∣≤2p−s, so ah has at most p−s significant bits (when ∣k∣=2p−s it is a power of two). al=mq with ∣m∣≤2s−1; if ∣m∣=2s−1 it is a power of two, otherwise ∣m∣<2s−1 and al has at most s−1 bits. So for s≥2 the low part has at most s−1 significant bits. □
Where the hypotheses are used. Normality of a and of the intermediate values lets (F1) and (F2) use the binade spacing; overflow of Ca breaks Step 1. The symmetric tie rule is used in Step 3. Under directed rounding Steps 3 and 4 no longer give the nearest multiple of σq, and this proof does not cover that case.