Ask Your Question

Problem/bug with constant incomplete gamma inside numerical integration?

asked 2020-08-16 14:16:39 +0200

KvS gravatar image

HI there,

straightforward one, in Sage v9.0 on Ubuntu Linux the following code:


results in the following error:

SystemError                               Traceback (most recent call last)
/usr/lib/python3/dist-packages/sage/ in <module>
      1 __tmp__=var("x"); g = symbolic_expression(gamma_inc(Integer(2),Integer(11)/Integer(5))*x).function(x)
      2 show(g)
----> 3 numerical_integral(g,Integer(2),Integer(5))

/usr/lib/python3/dist-packages/sage/calculus/integration.pyx in sage.calculus.integration.numerical_integral (build/cythonized/sage/calculus/integration.c:4042)()
    353          _b = b
    354          W = <gsl_integration_workspace*> gsl_integration_workspace_alloc(n)
--> 355          sig_on()
    356          gsl_integration_qag(&F,_a,_b,eps_abs,eps_rel,n,rule,W,&result,&abs_err)
    357          sig_off()

SystemError: calling remove_from_pari_stack() inside sig_on()

This integral does work fine if gamma_inc is replaced by a constant involving the gamma function, and n(gamma_inc(2,11/5)) works fine as well. A bug?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-08-17 01:19:43 +0200

Emmanuel Charpentier gravatar image

This is a bug, now Trac#30379.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2020-08-16 14:16:39 +0200

Seen: 39 times

Last updated: Aug 17 '20