On Wed, Jun 03, 2026 at 03:20:57PM +0200, Kurt Pagani wrote:
> I get the following error in certain sums when starting at k=0:
>
> (1) -> sum(4^k/binomial(2*k, k), k=0..n)
>
> >> Error detected within library code:
> catdef: division by zero
>
>
> eval(4^k/binomial(2*k, k),k=0) --> 1
>
> eval(4^k/binomial(2*k, k),k=-1) --> above error message
>
>
> I suspect the error could be triggered in innersum(x, k) in combfunc.spad
> (line 2785/eval k::F-1 ??) but am not sure.
There are similar examples like:
sum(n*factorial(n), n=0..m)
AFAICS the error is in line 2773:
eval(u@F, k, 1 + high(segment(s))) - eval(u@F, k, low(segment(s)))
Previous evals are symbolic, so should not signal error. The
above substitutes numeric value which is not always possible.
We need smarter function instead of 'eval' so that it can correctly
evaluate 0/0 things. Taking limit may help, but limits of
binomial expressions can be tricky, that is result may depend on
how exactly one approaches to limit. So it needs some analysis
before we implement something smarter.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/aiBw7GJoFwU8qaMI%40fricas.org.