numerical_approx for polynomials

31 views
Skip to first unread message

Vincent Delecroix

unread,
May 30, 2019, 5:41:08 AM5/30/19
to sage-devel
Dear devs,

Is it fine if I implement numerical_approx on polynomials by calling
it recursively on coefficients? For example, we would have

sage: x = polygen(QQ)
sage: p = 1343235439458/23 * x^2 - 234 / 143425*x + 1432/6512
sage: p.numerical_approx()
5.84015408460000e10*x^2 - 0.00163151472895241*x + 0.219901719901720

Right now, it does raise a TypeError (raised inside the generic
numerical_approx).

It would fit with what we have for matrices

sage: matrix(2, [11/23, -5/3, 132/7, 77/12]).n()
[0.478260869565217 -1.66666666666667]
[ 18.8571428571429 6.41666666666667]

Best
Vincent

Thierry

unread,
May 30, 2019, 6:30:39 AM5/30/19
to sage-...@googlegroups.com
Hi,

i would prefer to raise an error promoting the use of change_ring (same
for matrices), which allows more tuning on the base ring.

By the way, note that the best approx with floating-point coefficients
(e.g. for the sup norm on [-1,1]), is not necessarilly obtained with the
best approx on each coefficients.

Ciao,
Thierry
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f75cfe1a-5856-03be-4940-aafd7a4812f5%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages