On Thursday, December 20, 2018 at 11:17:54 AM UTC-8, vdelecroix wrote: > > Le 20/12/2018 à 17:40, Vincent Delecroix a écrit : > > My use case is that I have one billion of number field elements that > > I want to plot. That goes through __float__ that calls > > numerical_approx that goes through conversion to MPFR real field. > > > > Considering my use case, I know how to make it faster (implement > > __float__ on nf elements). Though I thought I would also make the > > general real floating point conversion faster and I failed. > > Computing embeddings to specified precision can be remarkably tricky, so I think it depends a bit on what you want to use this for. If it's just for plotting, you are probably not interested in knowing that basically all digits computed are correct. However, for general float semantics, we probably SHOULD guarantee that. It looks like some gains should be achievable because presently there just seems to be coercion overhead, but for a really "fast" conversion I think you might want to abandon the idea of using the general purpose coercion. For your special purpose you can probably do *much* better (I imagine just taking the appropriate Q-linear combination of the embedding of a basis might do -- generically that is certainly not the case. Interesting algebraic numbers tend to be numerically very poorly conditioned).
-- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.