You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3abd4d9
Browse filesBrowse the repository at this point in the historyBrowse files
product took a range and nothing else, so product(f, x in S) threw an arity
error where sum(f, x in S) worked. ProductOverSetf is the sum over a set's
counterpart: the variable is bound over the factor and the set (FreeVariables,
Substitute, DomainCondition scoping), it prints product(f, x in S) and
\prod_{x \in S} f, MathS.Product(f, x, S) builds it, and the compilers refuse
it as they refuse the sum. Its factors are multiplied out exactly where the sum
adds its terms up -- a listed set of numbers distinct by value, the roots of a
polynomial the solver writes all of, numerically the Durand-Kerner roots, and
the interval evaluator's enclosed roots -- and it is left as written where the
sum is. The empty product is 1. SymPy export as a Mul over the listed members or
the CRootOf roots of the square-free part. product(p, p in PP /\ [1; 30]) is
6469693230 and product(1 - 1/p^2, p in {2, 3, 5}) is 16/25.
The derivative is the product rule over the set,
sum(f'(m) product(f(n), n in S \ { m }), m in S), which holds where a factor
is zero. For that to evaluate over roots, a set of roots with listed members
taken out is now read by the sum and the product alike: a member taken out is
found as written, a number whose value is none of them takes nothing out, and
anything else is undecided. That changes sum(x, x in { w : w^2 - 2 = 0 } \
{ sqrt(2) }) from unevaluated to -sqrt(2); recorded in BREAKING-CHANGES.md
with the parse error that became an answer, as #2455 recorded its refusals.
Grammar: one action, the product( rule, takes the sum( rule's two-argument
branch; the unmodified grammar regenerated to an empty diff first.
Part of #2449
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
**Silent, for the sum too:** a set of roots with listed members taken out, `{ w : p(w) = 0 } \ { m }`, is now read,
253
+
since the product rule over a set writes one. A member taken out is found as it was written; a number whose value is
254
+
none of the roots takes nothing out; anything else, a symbol among them, leaves the sum as written.
255
+
256
+
| Input | Was (2.7.0) | Now |
257
+
|---|---|---|
258
+
| `"product(p, p in PP /\\ [1; 30])".ToEntity().Simplify()` | throws `FunctionArgumentCountException` | `6469693230` |
259
+
| `"product(1 - 1/p^2, p in {2, 3, 5})".ToEntity().Simplify()` | throws `FunctionArgumentCountException` | `16/25` |
260
+
| `"product(x, x in {})".ToEntity().Simplify()` | throws `FunctionArgumentCountException` | `1` |
261
+
| `"product(x, x in {a, b})".ToEntity().Simplify()` | throws `FunctionArgumentCountException` | `product(x, x in { a, b })`, left |
262
+
| `"product(w + y, w in { w : w^3 + w + 1 = 0 })".ToEntity().Differentiate("y")` at `y = 1`, `.Evaled` | throws `FunctionArgumentCountException` | `4` |
263
+
| `"sum(x, x in { w : w^2 - 2 = 0 } \\ { sqrt(2) })".ToEntity().Simplify()` | `sum(x, x in { w : w ^ 2 - 2 = 0 } \ { sqrt(2) })` | `-sqrt(2)` |
264
+
| `"sum(x, x in { w : w^2 - 3w + 2 = 0 } \\ { 1 })".ToEntity().Simplify()` | `sum(x, x in { w : w ^ 2 - 3 * w + 2 = 0 } \ { 1 })` | `2` |
265
+
243
266
### A system row that is not a solution declines the system
244
267
245
268
**Silent: a wrong row is now no answer.** With `P + Q sqrt(2) = (1 + sqrt(2))^70`, the coefficient `P - Q y` is
0 commit comments