# What does undef mean

Am getting terms with expressions like:

7.10000000000000undef + 3.98967171417774e277x

That is 7.10000000000000 times undef

what does undef mean in sage math and how can I simplify the expression or remove the undef?

EXAMPLE:

beta= 7.10000000000000

y = 2.66778786276411e493*t^3*x - 1.93258971534823e247*x

result=beta*(integral(y, t,0,1))

print('value is:',result)

integral(y, t,0,1)

edit retag close merge delete

I haven't seen this personally so please post a (minimal) reproducible example of SageMath code producing such a result, so it can be properly investigated.

( 2024-05-05 10:14:14 +0200 )edit

Interesting, the huge coefficients break every algorithm used by Sage: integral(y, t, 0, 1, algorithm=a) breaks for each a in ['maxima', 'sympy', 'mathematica_free', 'fricas', 'giac', 'libgiac']. The undef comes from libgiac. The error from choosing 'sympy' looks like it should be fixable (on the developer side, not the user side).

( 2024-05-05 10:55:39 +0200 )edit

Thanks for investigating. I see the point. As an alternative is there a way to round the expression? round(y,10) <- something like that

( 2024-05-06 06:43:13 +0200 )edit

Sort by ยป oldest newest most voted

This is a bug in SageMath. I've reported it here: https://github.com/sagemath/sage/issu...

Here is a workaround, specific to polynomials:

var('x,t')
beta = 7.10000000000000
y = 2.66778786276411e493*t^3*x - 1.93258971534823e247*x
Y = SR(y.polynomial(RR).integral(t))
result = beta*(Y.subs(t=1) - Y.subs(t=0))

more

Understood. Very grateful for the help.

( 2024-05-08 01:16:07 +0200 )edit