Commit a2f9553
committed
Fix bugs in floating point optimizations
1. Fix type of (/ 0.0): Changed from (-> -NonPosReal -NonPosReal) to
(-> -NegReal -NonPosReal) to correctly handle (/ (min 0.0 0)).
2. Avoid optimizing float exprs when conversion can change result:
Added safe-to-convert? check to prevent converting large exact
numbers to infinity before operations.
3. Fix float-complex multiplication crash with exact integer operands:
The imaginary part calculation was using unsafe-fl* with exact
integers when non-float optimization preserved exact arithmetic.
Based on PR #1381. Fixes #1042.1 parent 7179772 commit a2f9553
File tree
4 files changed
+60
-9
lines changed- typed-racket-lib/typed-racket
- base-env
- optimizer
- typed-racket-test/optimizer
4 files changed
+60
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
1252 | | - | |
| 1252 | + | |
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
211 | 216 | | |
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
216 | | - | |
217 | | - | |
| 221 | + | |
| 222 | + | |
218 | 223 | | |
219 | | - | |
220 | | - | |
| 224 | + | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
115 | 140 | | |
116 | 141 | | |
117 | 142 | | |
| |||
129 | 154 | | |
130 | 155 | | |
131 | 156 | | |
132 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
133 | 162 | | |
134 | 163 | | |
135 | 164 | | |
| |||
141 | 170 | | |
142 | 171 | | |
143 | 172 | | |
| 173 | + | |
| 174 | + | |
144 | 175 | | |
145 | 176 | | |
146 | 177 | | |
| 178 | + | |
| 179 | + | |
147 | 180 | | |
148 | | - | |
| 181 | + | |
| 182 | + | |
149 | 183 | | |
150 | 184 | | |
151 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| |||
0 commit comments