On Tue, Jun 10, 2025 at 11:56:28AM +0200, Grégory Vanuxem wrote:
> Hello,
>
> Le mar. 10 juin 2025 à 00:50, Waldek Hebisch <[email protected]> a écrit :
>
> > There are some bugs that I looked up, but ATM do not know how to
> > solve.
> >
> > 1)
> >
> > ((%i*t-1)*z*(z^2-3*t^2-3))/(sqrt(2)*sqrt(3)*(t^4+4*%i*t^3-6*t^2-4*%i*t+1))
> >
> > give type UnivariatePolynomial(t,Expression(Complex(Integer))). Result
> > is biggish, so I do not put it here, but one can see that t-s from
> > numerater are treated as variable in UnivariatePolynomial, while
> > t-s in denominator are treated as belonging to
> > Expression(Complex(Integer)).
> >
>
<snip>
> Or
>
> --- /home/greg/Tmp/fricas/src/interp/i-resolv.boot 2025-06-08
> 17:07:09.731630604 +0200
> +++ src/interp/i-resolv.boot 2025-06-10 11:34:56.189106604 +0200
> @@ -190,12 +190,15 @@
> t1 = '(AlgebraicNumber) and (t2 = ['Complex, $Float] or t2 = ['Complex,
> $DoubleFloat]) =>
> ['Expression, CADR t2]
>
> - t1 = '(AlgebraicNumber) and t2 is ['Complex,.] =>
> - resolveTT1('(Expression (Integer)), t2)
> -
> t1 = ['AlgebraicNumber] and t2 is ['Polynomial, ['Fraction, ['Integer]]]
> =>
> ['Polynomial, ['AlgebraicNumber]]
>
> + t1 = '(AlgebraicNumber) and t2 is ['Polynomial,.] =>
> + resolveTT1('(Expression (Integer)), t2)
> +
> + t1 = '(AlgebraicNumber) and t2 is ['Complex,.] =>
> + resolveTT1('(Expression (Integer)), t2)
> +
> t1 = ['AlgebraicNumber] and
> t2 is ['Fraction, ['Polynomial, ['Fraction, ['Integer]]]] =>
> ['Fraction, ['Polynomial, ['AlgebraicNumber]]]
>
Looking more, this:
t1 = '(AlgebraicNumber) and t2 is ['Complex,.] =>
resolveTT1('(Expression (Integer)), t2)
- t1 = ['AlgebraicNumber] and t2 is ['Polynomial, ['Fraction, ['Integer]]] =>
- ['Polynomial, ['AlgebraicNumber]]
+ t1 = ['AlgebraicNumber] and t2 is ['Polynomial, t3] and
+ (t4 := resolveTT1(t1, t3)) =>
+ t4 is ['Expression, .] => t4
+ ['Polynomial, t4]
t1 = ['AlgebraicNumber] and
t2 is ['Fraction, ['Polynomial, ['Fraction, ['Integer]]]] =>
Seem to work without ill effects. Still, after applying it some
similar examples like:
(t + sqrt(2))*(%i*t + 1)
(t + sqrt(2))/(%i*t + 1)
(t + z + sqrt(2))*(%i*t + 1)
sqrt(2)*((t - 1)/(%i*t + 1))
either produce strange type or fail.
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/aEhN8EVgUpNFeIWI%40fricas.org.