/146
On Automatically Proving the Correctness of math.h Implementations
Wonyeol Lee1,2 Rahul Sharma3 Alex Aiken1
1 Stanford University 2 KAIST 3 Microsoft Research
1
POPL 2018
the Correctness of math.h Implementations Wonyeol Lee 1,2 Rahul - - PowerPoint PPT Presentation
On Automatically Proving the Correctness of math.h Implementations Wonyeol Lee 1,2 Rahul Sharma 3 Alex Aiken 1 1 Stanford University 2 KAIST 3 Microsoft Research POPL 2018 1 /146 Our Goal mathematical specification Industry
/146
Wonyeol Lee1,2 Rahul Sharma3 Alex Aiken1
1 Stanford University 2 KAIST 3 Microsoft Research
1
POPL 2018
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
mathematical specification 2
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
math.h implementation
<log>
... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 3
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
math.h implementation
<log>
... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 4
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
math.h implementation
<log>
... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 5 infinite bits fixed bits
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
math.h implementation
<log>
... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 6 infinite bits fixed bits
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
math.h implementation
<log>
... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 7
infinite bits fixed bits
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
math.h implementation
<log>
... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 8
infinite bits fixed bits
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
9
… −1 1 …
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
10
𝑚𝑝 𝑦 … −1 1 …
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
11
𝑚𝑝 𝑦 … −1 1 … log has precision loss of < 1 ulp:
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
12
𝑚𝑝 𝑦 log(𝑦) … −1 1 … log has precision loss of < 1 ulp:
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
13
𝑚𝑝 𝑦 log(𝑦) … −1 1 … log has precision loss of < 1 ulp:
/146
Industry standard implementations of math.h claim: “precision loss is less than 1 ulp”
14
𝑚𝑝 𝑦 log(𝑦) … −1 1 … log has precision loss of < 1 ulp:
/146
1 ⊕ 2100 ⊖ 2100 = 1 ≠ 0 = 1 ⊕ 2100 ⊖ 2100
15
1 01111111111 1100⋯00 (2) = −1 1 ∙ 21023−1023 ∙ 1.110 ⋯ 00 2
significand
/146
1 ⊕ 2100 ⊖ 2100 = 1 ≠ 0 = 1 ⊕ 2100 ⊖ 2100
16
1 01111111111 1100⋯00 (2) = −1 1 ∙ 21023−1023 ∙ 1.110 ⋯ 00 2
significand
/146
1 ⊕ 2100 ⊖ 2100 = 1 ≠ 0 = 1 ⊕ 2100 ⊖ 2100
17
1 01111111111 1100⋯00 (2) = −1 1 ∙ 21023−1023 ∙ 1.110 ⋯ 00 2
significand
floating-point
/146
1 ⊕ 2100 ⊖ 2100 = 1 ≠ 0 = 1 ⊕ 2100 ⊖ 2100
18
1 01111111111 1100⋯00 (2) = −1 1 ∙ 21023−1023 ∙ 1.110 ⋯ 00 2
significand
floating-point
/146
ErrUlp 𝑏, 𝑐 = 𝑏 − 𝑐 ulp 𝑏
19
/146
20
𝑏 𝑐
/146
21
𝑏 𝑐 ulp 𝑏
/146
ErrUlp 𝑏, 𝑐 = 𝑏 − 𝑐 ulp 𝑏
22
𝑏 𝑐 ulp 𝑏
/146
ErrUlp 𝑏, 𝑐 = 𝑏 − 𝑐 ulp 𝑏
23
𝑏 𝑐 ulp 𝑏 2.7 ulps
/146
ErrUlp(𝑔 𝑦 , 𝑄 𝑦 ) ≤ Θ for all 𝑦 ∈ 𝑌
24 math.h implementation 𝑄
<log> ... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 𝑔
/146
ErrUlp(𝑔 𝑦 , 𝑄 𝑦 ) ≤ Θ for all 𝑦 ∈ 𝑌
25 input interval 𝑌
(0, 21024)
math.h implementation 𝑄
<log> ... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 𝑔
/146
ErrUlp(𝑔 𝑦 , 𝑄 𝑦 ) ≤ Θ for all 𝑦 ∈ 𝑌
26 input interval 𝑌
(0, 21024)
math.h implementation 𝑄
<log> ... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 𝑔
/146
ErrUlp(𝑔 𝑦 , 𝑄 𝑦 ) ≤ Θ for all 𝑦 ∈ 𝑌
27 input interval 𝑌
(0, 21024)
math.h implementation 𝑄
<log> ... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 𝑔
/146
ErrUlp(𝑔 𝑦 , 𝑄 𝑦 ) ≤ Θ for all 𝑦 ∈ 𝑌
28 input interval 𝑌
(0, 21024)
math.h implementation 𝑄
<log> ... mulpd %xmm2, %xmm6 addsd %xmm0, %xmm5 addsd %xmm7, %xmm3 addsd %xmm5, %xmm1 ...
mathematical specification 𝑔
/146
“Intel’s sin has precision loss of < 0.574 ulps”
considerable persistence.” [FMSD’00]
MathSAT [FMCAD’12], Rosa [POPL’14], FPTaylor [FM’15], Lee/Sharma/Aiken [PLDI’16], ⋯
29
/146
“Intel’s sin has precision loss of < 0.574 ulps”
considerable persistence.” [FMSD’00]
MathSAT [FMCAD’12], Rosa [POPL’14], FPTaylor [FM’15], Lee/Sharma/Aiken [PLDI’16], ⋯
30
/146
“Intel’s sin has precision loss of < 0.574 ulps”
considerable persistence.” [FMSD’00]
MathSAT [FMCAD’12], Rosa [POPL’14], FPTaylor [FM’15], Lee/Sharma/Aiken [PLDI’16], ⋯
31
/146
“Intel’s sin has precision loss of < 0.574 ulps”
considerable persistence.” [FMSD’00]
MathSAT [FMCAD’12], Rosa [POPL’14], FPTaylor [FM’15], Lee/Sharma/Aiken [PLDI’16], ⋯
32
/146
𝑏 ⊛ 𝑐 = 𝑏 ∗ 𝑐 1 + 𝜀 for some 𝜀 < 𝜗
That is,
33
/146
𝑏 ⊛ 𝑐 = 𝑏 ∗ 𝑐 1 + 𝜀 for some 𝜀 < 𝜗
34
/146
𝑏 ⊛ 𝑐 = 𝑏 ∗ 𝑐 1 + 𝜀 for some 𝜀 < 𝜗
That is,
35
𝑏 ⊛ 𝑐
1
/146
𝑏 ⊛ 𝑐 = 𝑏 ∗ 𝑐 1 + 𝜀 for some 𝜀 < 𝜗
That is,
36
𝑏 ⊛ 𝑐 𝑏 ∗ 𝑐
1
/146
𝑏 ⊛ 𝑐 = 𝑏 ∗ 𝑐 1 + 𝜀 for some 𝜀 < 𝜗
That is,
37
𝑏 ⊛ 𝑐 𝑏 ∗ 𝑐
1
𝑏 ∗ 𝑐 1 + 𝜀 ∶ 𝜀 < 𝜗
/146
𝑏 ⊛ 𝑐 = 𝑏 ∗ 𝑐 1 + 𝜀 for some 𝜀 < 𝜗
That is,
38
𝑏 ⊛ 𝑐 𝑏 ∗ 𝑐
1
𝑏 ∗ 𝑐 1 + 𝜀 ∶ 𝜀 < 𝜗
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
39
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
40
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
41
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
42
⊕ ⊗ =
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
43
=
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
44
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
𝐵𝜀 𝑦 = 1 + 0.5 × 𝑦 1 + 𝜀1 1 + 𝜀2
𝑓 𝑦 ∈ {𝐵𝜀 𝑦 ∶ 𝜀1 , 𝜀2 < 𝜗} for all 𝑦 ∈ 𝑌
45
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
Θ𝑠𝑓𝑚 = max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 𝑔(𝑦)−𝐵𝜀 𝑦 𝑔(𝑦)
= max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 1+𝑦− 1+ 0.5 × 𝑦 1+𝜀1 1+𝜀2 1+𝑦
Θ𝑣𝑚𝑞 = Θ𝑠𝑓𝑚/𝜗
46
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
Θ𝑠𝑓𝑚 = max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 𝑔(𝑦)−𝐵𝜀 𝑦 𝑔(𝑦)
= max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 1+𝑦− 1+ 0.5 × 𝑦 1+𝜀1 1+𝜀2 1+𝑦
Θ𝑣𝑚𝑞 = Θ𝑠𝑓𝑚/𝜗
47
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
Θ𝑠𝑓𝑚 = max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 𝑔(𝑦)−𝐵𝜀 𝑦 𝑔(𝑦)
= max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 1+𝑦− 1+ 0.5 × 𝑦 1+𝜀1 1+𝜀2 1+𝑦
Θ𝑣𝑚𝑞 = Θ𝑠𝑓𝑚/𝜗
48
Theorem ErrUlp 𝑏, 𝑐 ≤ ErrRel 𝑏, 𝑐 /𝜗
/146
𝑔 𝑦 = 1 + 𝑦 over 𝑌 = [−0.1, 0.1] 𝑓 = 1 ⊕ 0.5 ⊗ 𝑦 ⟵ implementation of 𝑔 𝑦
Θ𝑠𝑓𝑚 = max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 𝑔(𝑦)−𝐵𝜀 𝑦 𝑔(𝑦)
= max
𝑦∈ −0.1,0.1 , 𝜀1,𝜀2∈ −𝜗,𝜗 1+𝑦− 1+ 0.5 × 𝑦 1+𝜀1 1+𝜀2 1+𝑦
Θ𝑣𝑚𝑞 = Θ𝑠𝑓𝑚/𝜗
49
Theorem ErrUlp 𝑏, 𝑐 ≤ ErrRel 𝑏, 𝑐 /𝜗
/146
50
/146
51
error bounds from [PLDI’16] input value
Intel’s log
1014 ⋮
ulp error
based on standard error analysis
/146
52
error bounds from [PLDI’16] input value
Intel’s log
1014 ⋮
ulp error 1 ulp
based on standard error analysis
3 ulps
/146
53
error bounds from [PLDI’16] input value
Intel’s log
1014 ⋮
ulp error
4095 4096 , 1
1 ulp
based on standard error analysis
3 ulps
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
54
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
55
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
56
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
57
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
58
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
59
/146
0.125 ⊗ 𝑦 = 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 𝑦 ⊖ 1 0 = 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2
0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 if 0.125𝑦 ≥ 2−1022 0.125 ⊗ 𝑦 ⊑ 0.125 × 𝑦 (1 + 𝜀) 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 if 0.5 ≤ 𝑦 ≤ 2 𝑦 ⊖ 1 0 ⊑ 𝑦 − 1 (1 + 𝜀′)
60
/146
4095 4096 , 1 , log computes
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 ≈ 𝑦 − 1
𝑠 𝑦 − 1 2 𝑠 𝑦 2 + ⋯ + 1 7 𝑠 𝑦 7
(precision loss of log) ≥ (precision loss of 𝑠 𝑦 )
61
/146
4095 4096 , 1 , log computes
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 ≈ 𝑦 − 1
𝑠 𝑦 − 1 2 𝑠 𝑦 2 + ⋯ + 1 7 𝑠 𝑦 7
(precision loss of log) ≥ (precision loss of 𝑠 𝑦 )
62
/146
4095 4096 , 1 , log computes
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 ≈ 𝑦 − 1
𝑠 𝑦 − 1 2 𝑠 𝑦 2 + ⋯ + 1 7 𝑠 𝑦 7
(precision loss of log) ≥ (precision loss of 𝑠 𝑦 )
63
/146
4095 4096 , 1 , log computes
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 ≈ 𝑦 − 1
𝑠 𝑦 − 1 2 𝑠 𝑦 2 + ⋯ + 1 7 𝑠 𝑦 7
(precision loss of log) ≥ (precision loss of 𝑠 𝑦 )
64
/146
4095 4096 , 1 , log computes
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 ≈ 𝑦 − 1
𝑠 𝑦 − 1 2 𝑠 𝑦 2 + ⋯ + 1 7 𝑠 𝑦 7
(precision loss of log) ≥ (precision loss of 𝑠 𝑦 )
65
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
66
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
67
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
68
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
69
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
70
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
71
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
72
unbounded
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵𝜀 𝑦 = 2 × 𝑦 1 + 𝜀0 − 255 128 1 + 𝜀1 × 1 2 1 + 𝜀2 + ⋯ = 𝑦 − 1 + 𝑦 − 255 256 𝜀1 + ⋯ 00000000000000
max
. 4095 4096≤𝑦<1, 𝜀𝑗 <𝜗
𝐵𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 ≥ max
. 4095 4096≤𝑦<1
𝑦 − 255 256 𝑦 − 1 𝜗
73
1014 ulps for log
near 𝑦 = 1 [PLDI’16]
unbounded
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1 max
. 4095 4096≤𝑦<1, 𝜀′ <𝜗
𝐵′𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 = max
. 4095 4096≤𝑦<1
𝑦 − 1 𝑦 − 1 𝜗 0000000000000 = 𝜗
74
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
75
exact
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
76
exact
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
77
exact
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
78
exact
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵′𝜀 𝑦 = 𝑦 − 1 + 𝑦 − 1 𝜀′
79
exact
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵′𝜀 𝑦 = 𝑦 − 1 + 𝑦 − 1 𝜀′
max
. 4095 4096≤𝑦<1, 𝜀′ <𝜗
𝐵′𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 = max
. 4095 4096≤𝑦<1
𝑦 − 1 𝑦 − 1 𝜗 0000000000000 = 𝜗
80
exact
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵′𝜀 𝑦 = 𝑦 − 1 + 𝑦 − 1 𝜀′
max
. 4095 4096≤𝑦<1, 𝜀′ <𝜗
𝐵′𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 = max
. 4095 4096≤𝑦<1
𝑦 − 1 𝑦 − 1 𝜗 0000000000000 = 𝜗
81
exact
We prove a bound of
0.583 ulps for log
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵′𝜀 𝑦 = 𝑦 − 1 + 𝑦 − 1 𝜀′
max
. 4095 4096≤𝑦<1, 𝜀′ <𝜗
𝐵′𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 = max
. 4095 4096≤𝑦<1
𝑦 − 1 𝑦 − 1 𝜗 0000000000000 = 𝜗
82
exact
We prove a bound of
0.583 ulps for log
/146
𝑠 𝑦 = 2 ⊗ 𝑦 ⊖ 255 128 ⊗ 1 2 ⊕ 255 128 ⊗ 1 2 ⊖ 1 4095 4096 ≤ 𝑦 < 1
𝐵′𝜀 𝑦 = 𝑦 − 1 + 𝑦 − 1 𝜀′
max
. 4095 4096≤𝑦<1, 𝜀′ <𝜗
𝐵′𝜀 𝑦 − (𝑦 − 1) 𝑦 − 1 = max
. 4095 4096≤𝑦<1
𝑦 − 1 𝑦 − 1 𝜗 0000000000000 = 𝜗
83
exact
We prove a bound of
0.583 ulps for log
/146
1 2 𝑏 ≤ 𝑐 ≤ 2𝑏
⟹ 𝑏 ⊖ 𝑐 = 𝑏 − 𝑐
84
/146
1 2 𝑏 ≤ 𝑐 ≤ 2𝑏
⟹ 𝑏 ⊖ 𝑐 = 𝑏 − 𝑐
4095 4096 , 1 85
/146
1 2 𝑏 ≤ 𝑐 ≤ 2𝑏
⟹ 𝑏 ⊖ 𝑐 = 𝑏 − 𝑐
4095 4096 , 1
𝜌 64 , 2𝜌 + 𝜌 64
1 3! 𝑧3 + ⋯ + 1 9! 𝑧9
≈ 𝑡𝑗𝑜 𝑧
86
/146
1 2 𝑏 ≤ 𝑐 ≤ 2𝑏
⟹ 𝑏 ⊖ 𝑐 = 𝑏 − 𝑐
4095 4096 , 1
𝜌 64 , 2𝜌 + 𝜌 64
1 3! 𝑧3 + ⋯ + 1 9! 𝑧9
≈ 𝑡𝑗𝑜 𝑧
87
/146
1 2 𝑏 ≤ 𝑐 ≤ 2𝑏
⟹ 𝑏 ⊖ 𝑐 = 𝑏 − 𝑐
4095 4096 , 1
𝜌 64 , 2𝜌 + 𝜌 64
1 3! 𝑧3 + ⋯ + 1 9! 𝑧9
≈ 𝑡𝑗𝑜 𝑧
88
exact
/146
1 2 𝑏 ≤ 𝑐 ≤ 2𝑏
⟹ 𝑏 ⊖ 𝑐 = 𝑏 − 𝑐
4095 4096 , 1
𝜌 64 , 2𝜌 + 𝜌 64
1 3! 𝑧3 + ⋯ + 1 9! 𝑧9
≈ 𝑡𝑗𝑜 𝑧
89
exact
precision loss
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
90
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
91
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
92
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
93
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
94
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
95
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
96
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
97
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
98
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
99
can apply the theorem
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
100
𝐵𝜀 𝑦 − 𝐵′
𝜀 𝑦
can apply the theorem
/146
𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊖ 𝑓′
𝜀
min
𝑦, 𝜀
𝐵′𝜀 𝑦 − 1
2 𝐵𝜀 𝑦
≥ 0 and
𝑦, 𝜀
𝐵′𝜀 𝑦 − 2𝐵𝜀 𝑦 ≤ 0
⟹
1 2 𝐵𝜀 𝑦 ≤ 𝐵′ 𝜀 𝑦 ≤ 2𝐵𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
1 2 𝑓 𝑦 ≤ 𝑓′ 𝑦 ≤ 2𝑓 𝑦
for all 𝑦 ∈ 𝑌
101
𝐵𝜀 𝑦 − 𝐵′
𝜀 𝑦
can apply the theorem
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
102
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
103
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
𝑏 ⊕ 𝑐 ⊕ 𝑑 ⊖ 𝑠
104
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
105
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
𝑏 ⊕ 𝑐 ⊕ 𝑑 ⊖ 𝑠
106
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
𝑏 ⊕ 𝑐 ⊕ 𝑑 ⊖ 𝑠
107
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
𝑏 ⊕ 𝑐 ⊕ 𝑑 ⊖ 𝑠
108
𝑏 + 𝑐 + 𝑠 =
/146
𝑏 ≥ 𝑐 and 𝑠 = 𝑏 ⊕ 𝑐 ⊖ 𝑏 ⊖ 𝑐 ⟹ 𝑠 = 𝑏 ⊕ 𝑐 − 𝑏 + 𝑐
𝑏 ⊕ 𝑐 ⊕ 𝑑 ⊖ 𝑠
109
𝑏 + 𝑐 + 𝑠 =
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
110
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
111
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
112
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
113
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
114
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
115
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
116
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
117
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
118
can apply the theorem
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
119
𝐵𝜀 𝑦 + 𝐵′
𝜀 𝑦
𝜀
can apply the theorem
/146
𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′ ⊑ ? 𝑓 ⊕ 𝑓′ ⊖ 𝑓 ⊖ 𝑓′
𝜀, 𝑓 ⊕ 𝑓′ ⊑ 𝐵𝜀 𝑦 + 𝐵′ 𝜀 𝑦
1 + 𝜀
min
𝑦, 𝜀
𝐵𝜀 𝑦 ≥ max
𝑦, 𝜀
𝐵′𝜀 𝑦
⟹
𝐵𝜀 𝑦 ≥ 𝐵′𝜀 𝑦
for all 𝑦 ∈ 𝑌, all 𝜀𝑗 < 𝜗
⟹
𝑓 𝑦 ≥ 𝑓′ 𝑦
for all 𝑦 ∈ 𝑌
120
𝐵𝜀 𝑦 + 𝐵′
𝜀 𝑦
𝜀
can apply the theorem
/146
121
/146
𝑦, 𝜀
⋯ 𝐵𝜀 𝑦 ⋯ is difficult
122
/146
𝑦, 𝜀
⋯ 𝐵𝜀 𝑦 ⋯ is difficult
123
/146
𝑦, 𝜀
⋯ 𝐵𝜀 𝑦 ⋯ is difficult
124
/146
𝑦, 𝜀
⋯ 𝐵𝜀 𝑦 ⋯ is difficult
125
/146
𝑦, 𝜀
⋯ 𝐵𝜀 𝑦 ⋯ is difficult
126
/146
→ Results in multiple independent subproblems (on subintervals)
127
/146
→ Results in multiple independent subproblems (on subintervals)
128
/146
→ Results in multiple independent subproblems (on subintervals)
129
/146
→ Results in multiple independent subproblems (on subintervals)
130
/146
131
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value
/146
132
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value
/146
133
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value 0.530 ulps
/146
134
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value 0.530 ulps
/146
135
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value (log scale)
/146
136
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value (log scale)
/146
137
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value (log scale) 0.583 ulps
/146
138
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value (log scale)
0.583 ulps
/146
139
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value (log scale)
0.583 ulps
/146
13 128 , 17𝜌 64 , 17𝜌 64 , 𝜌 2
140
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value
/146
13 128 , 17𝜌 64 , 17𝜌 64 , 𝜌 2
141
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value 0.595 ulps
/146
13 128 , 17𝜌 64 , 17𝜌 64 , 𝜌 2
142
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value 13 ulps 0.595 ulps
/146
13 128 , 17𝜌 64 , 17𝜌 64 , 𝜌 2
143
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value 13 ulps 0.595 ulps
/146
13 128 , 17𝜌 64 , 17𝜌 64 , 𝜌 2
144
error bounds from [PLDI’16]
1 ulp actual ulp errors ulp error (log scale) input value 13 ulps 0.595 ulps Our abstraction must be linear in 𝜀 variables → Results in imprecise abstractions
/146
automatically
automatically
145
/146
automatically
automatically
146