Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-24 Thread Waldek Hebisch
On Wed, Nov 22, 2023 at 08:29:11AM +0800, Qian Yun wrote: > Now I understand most of your points. > > So what are the possible improvements regarding algebraic number > in the future? I do not think about deep changes to AlgebraicNumber or Expression, at least in reasonably near future. Rather,

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-21 Thread Qian Yun
Now I understand most of your points. So what are the possible improvements regarding algebraic number in the future? For example, in a "locally breaking symmetry" use case, a "real?" function to determine if an algebraic number is real, is that useful? (e.g.

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-21 Thread Waldek Hebisch
On Tue, Nov 21, 2023 at 08:38:49PM +0800, Qian Yun wrote: > > > On 11/21/23 20:26, Waldek Hebisch wrote: > > On Tue, Nov 21, 2023 at 06:35:57PM +0800, Qian Yun wrote: > > > > > > If so, I want to confirm that is 'nthRoot already a kind of > > > algebraic number? > > > > I am not sure what you

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-21 Thread Qian Yun
On 11/21/23 20:26, Waldek Hebisch wrote: On Tue, Nov 21, 2023 at 06:35:57PM +0800, Qian Yun wrote: If so, I want to confirm that is 'nthRoot already a kind of algebraic number? I am not sure what you want to say here: 'nthRoot is in AlgebraicNumber which under right conditions models

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-21 Thread Waldek Hebisch
On Tue, Nov 21, 2023 at 06:35:57PM +0800, Qian Yun wrote: > > If so, I want to confirm that is 'nthRoot already a kind of > algebraic number? I am not sure what you want to say here: 'nthRoot is in AlgebraicNumber which under right conditions models algebraic numbers and in Expression, where we

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-21 Thread Qian Yun
On 11/21/23 10:02, Waldek Hebisch wrote: On Tue, Nov 21, 2023 at 08:24:39AM +0800, Qian Yun wrote: On 11/20/23 20:48, Waldek Hebisch wrote: Extra remark: it should be possible to get much of effect of RealClosure by considering pairs of AlgebraicNumber and floating point approximation.

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-20 Thread Waldek Hebisch
On Tue, Nov 21, 2023 at 08:24:39AM +0800, Qian Yun wrote: > > > On 11/20/23 20:48, Waldek Hebisch wrote: > > > > Extra remark: it should be possible to get much of effect > > of RealClosure by considering pairs of AlgebraicNumber > > and floating point approximation. Namely, we can compute > >

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-20 Thread Qian Yun
On 11/20/23 20:48, Waldek Hebisch wrote: Extra remark: it should be possible to get much of effect of RealClosure by considering pairs of AlgebraicNumber and floating point approximation. Namely, we can compute minimal polynomial of algebraic number and moderately accurate floating point

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-20 Thread Dima Pasechnik
On Mon, Nov 20, 2023 at 12:48 PM Waldek Hebisch wrote: > > On Mon, Nov 20, 2023 at 06:20:45PM +0800, Qian Yun wrote: > > Answer to myself: some real algebraic number need sqrt(-1) to > > represent them (e.g. some root of degree 3 polynomial). > > So RealClosure can't handle them I guess. > > No,

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-20 Thread Waldek Hebisch
On Mon, Nov 20, 2023 at 06:20:45PM +0800, Qian Yun wrote: > Answer to myself: some real algebraic number need sqrt(-1) to > represent them (e.g. some root of degree 3 polynomial). > So RealClosure can't handle them I guess. No, this is not a problem. RealClosure can handle real roots of

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-20 Thread Qian Yun
Answer to myself: some real algebraic number need sqrt(-1) to represent them (e.g. some root of degree 3 polynomial). So RealClosure can't handle them I guess. - Qian On 11/20/23 07:45, Qian Yun wrote: Does RealClosure work with Expression? (e.g doing integration) Currently we can't do so in

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread Qian Yun
Does RealClosure work with Expression? (e.g doing integration) Currently we can't do so in FriCAS. Is that possible in theory? - Qian On 11/19/23 23:12, Waldek Hebisch wrote: On Sun, Nov 19, 2023 at 10:50:17PM +0800, oldk1331 wrote: Then is there a way to specify the algebraic number which

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread Waldek Hebisch
On Sun, Nov 19, 2023 at 10:50:17PM +0800, oldk1331 wrote: > Then is there a way to specify the algebraic number > which square is 2 and is near +1.41421? (1) -> rC := RealClosure(Fraction(Integer)) (1) RealClosure(Fraction(Integer))

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread oldk1331
Then is there a way to specify the algebraic number which square is 2 and is near +1.41421? - Qian -- 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

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread Waldek Hebisch
On Sun, Nov 19, 2023 at 09:49:10PM +0800, Qian Yun wrote: > > > On 11/19/23 21:36, Waldek Hebisch wrote: > > On Sun, Nov 19, 2023 at 07:58:50PM +0800, Qian Yun wrote: > > > "real? sqrt (-sqrt 2)" returns "true" by default. > > > > You mean should return false? We get this when working > > with

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread Qian Yun
On 11/19/23 21:36, Waldek Hebisch wrote: On Sun, Nov 19, 2023 at 07:58:50PM +0800, Qian Yun wrote: "real? sqrt (-sqrt 2)" returns "true" by default. You mean should return false? We get this when working with expressions: (2) -> real? sqrt (-sqrt 2::EXPR(INT)) (2) false Because

Re: [fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread Waldek Hebisch
On Sun, Nov 19, 2023 at 07:58:50PM +0800, Qian Yun wrote: > "real? sqrt (-sqrt 2)" returns "true" by default. You mean should return false? We get this when working with expressions: (2) -> real? sqrt (-sqrt 2::EXPR(INT)) (2) false > Because interpreter prefers CTRIGMNP over TRIGMNIP > as

[fricas-devel] real? sqrt (-sqrt 2)

2023-11-19 Thread Qian Yun
"real? sqrt (-sqrt 2)" returns "true" by default. Because interpreter prefers CTRIGMNP over TRIGMNIP as shown by ")set mes bot on": Function Selection for real? Arguments: AN [1] signature: EXPR(COMPLEX(INT)) -> BOOLEAN implemented: slot (Boolean)(Expression (Complex