Repository navigation
Commit e38da2b
A two-sided limit is the two one-sided ones agreeing, and AngouriMath could not
say so. The branch that compares them compares two `ComputeLimitDivideEtImpera`
results -- the bare descent -- where a caller who names a side gets that descent
*and* everything behind it: SolveAsIndeterminatePower, l'Hopital's rule, and the
substitution that moves a finite destination out to infinity.
The promotion could not be made before because the sides did not stay inside the
reals. Over the complex plane `lim x->0- x^x` answers 1 from the continuation,
so promoting agreement would give `lim x->0 x^x` the value 1 -- and `x^x` is not
real to the left of 0 at all. #755 gave limits a codomain to read; this uses it,
and **only under `Domain.Real`**, which is exactly what makes it sound: there
that side has no value to agree with, so the case this could get wrong is the
case that no longer arises.
The expression #596 reported, at 0, over the reals:
1/ln(x + sqrt(x^2+1)) - 1/ln(x+1)
left -1/2 already
right -1/2 already
both unevaluated -> -1/2
What must not be promoted, and is not:
x * ln(x), x^x, sqrt(x), ln(x) real on one side only, so unevaluated
1/x, abs(x)/x, e^(1/x), arctan(1/x) sides disagree, so still NaN
A second change came with it, and it belongs here rather than in #755 because
this is what exposed it. A **two-sided** limit is now withdrawn if *either*
approach leaves the reals, where the check asked about one direction only.
`lim x->0 sqrt(x)` answered 0 while its own left-hand limit had been withdrawn,
which is the two halves disagreeing about the same reading.
Asked only where the answer would otherwise be NaN or nothing, so no limit that
already answers pays for it, and bounded by a depth of two: each side may reach
a two-sided limit of a subexpression, and without a bound the two questions
branch into four and so on down the tree.
Nothing changes by default. The complex reading answers as it always has, which
is what keeps `LimitTest.TestNoLimit` meaning what it meant, and that is pinned.
Suite 5135 -> 5147 passed / 0 failed, F# 130/130, corpus 112/117 with every
verdict and answer byte-identical, rootcheck 596/596, propcheck 0 failures.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 52a6861 commit e38da2b
2 files changed
Lines changed: 149 additions & 19 deletions
File tree
- Sources
- AngouriMath/Functions/Continuous/Limits/Solvers
- Tests/UnitTests/Calculus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 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 | + | |
84 | 139 | | |
85 | 140 | | |
86 | 141 | | |
| |||
108 | 163 | | |
109 | 164 | | |
110 | 165 | | |
111 | | - | |
112 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
113 | 175 | | |
114 | 176 | | |
115 | 177 | | |
| |||
229 | 291 | | |
230 | 292 | | |
231 | 293 | | |
232 | | - | |
233 | | - | |
234 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
235 | 303 | | |
236 | 304 | | |
237 | 305 | | |
238 | | - | |
239 | | - | |
240 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
241 | 315 | | |
242 | 316 | | |
243 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
142 | 181 | | |
143 | 182 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 183 | + | |
149 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
150 | 206 | | |
151 | 207 | | |
0 commit comments