Lines Matching refs:hi
21 (1) hi * 2**64 + lo = a * b
29 (3) R(hi, lo) = hi * z - hi + lo
35 a) Set (hi, lo) to the result of a * b.
37 b) Set (hi', lo') to the result of R(hi, lo).
39 c) Repeat step b) until 0 <= hi' * 2**64 + lo' < 2*p.
47 hi * 2**64 + lo == hi * z - hi + lo (mod p)
52 hi * 2**64 + lo = (2**64 - z + 1) * hi + z * hi - hi + lo
54 = p * hi + z * hi - hi + lo
56 == z * hi - hi + lo (mod p)
64 def R(hi, lo, z):
65 return divmod(hi * z - hi + lo, 2**64)
67 # For simplicity, assume hi=2**64-1, lo=2**64-1 after the
72 hi=2**64-1; lo=2**64-1; z=2**32
75 hi, lo = R(hi, lo, z) # First reduction
76 hi, lo = R(hi, lo, z) # Second reduction
77 hi * 2**64 + lo < 2 * p1 # True
80 hi=2**64-1; lo=2**64-1; z=2**34
83 hi, lo = R(hi, lo, z) # First reduction
84 hi, lo = R(hi, lo, z) # Second reduction
85 hi, lo = R(hi, lo, z) # Third reduction
86 hi * 2**64 + lo < 2 * p2 # True
89 hi=2**64-1; lo=2**64-1; z=2**40
92 hi, lo = R(hi, lo, z) # First reduction
93 hi, lo = R(hi, lo, z) # Second reduction
94 hi, lo = R(hi, lo, z) # Third reduction
95 hi * 2**64 + lo < 2 * p3 # True
101 Case hi = 0:
111 Case hi = 1: