On Fri, Nov 08, 2024 at 12:59:59PM +0100, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote: > On 11/8/24 12:54, Waldek Hebisch wrote: > > In your example solver could cheat, that is recognize that all > > numbers are rational and hand work to integer solver. But such case > > is probably quite rare in normal use and when testing there is > > advantage in passing such problems to general solver. > > Yes, probably, my example is in a zero-set. I was not suggesting to create a > special case solver, but wouldn't it make sense to add some post-processing > to show a nicer result. That should be cheap for constant-coefficient linear > recurrences.
My point is that recurrence-finding part is generic, it works over quite general rings. Any simplification to "show a nicer result" must depend on a special structure, so we will need a special case simplifier. For algebraic numbers and for Expression(Integer) there is an easy trick: treat than as rational functions (or plynomials) in kernels and compute common divisors over integers. But you can easily invent a type for which it will not work. So problem is where to stop. For example currently factoring code has a special cases for several common and not so common cases and there is PolynomialFactorizationExplicit to handle "general" case. But it is not clear to me if adding many special simplifications to guessing is very useful (Expression(Integer) and AlgebraicNumber are probably worth doing). -- 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 fricas-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/ZzA9amRQ9pH5LsN5%40fricas.org.