You can subscribe to this list here.
2014 |
Jan
|
Feb
(232) |
Mar
(323) |
Apr
(383) |
May
(359) |
Jun
(435) |
Jul
(252) |
Aug
(172) |
Sep
(265) |
Oct
(263) |
Nov
(350) |
Dec
(359) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2015 |
Jan
(267) |
Feb
(220) |
Mar
(311) |
Apr
(269) |
May
(388) |
Jun
(403) |
Jul
(172) |
Aug
(399) |
Sep
(364) |
Oct
(269) |
Nov
(357) |
Dec
(468) |
2016 |
Jan
(618) |
Feb
(592) |
Mar
(625) |
Apr
(516) |
May
(375) |
Jun
(155) |
Jul
(346) |
Aug
(262) |
Sep
(346) |
Oct
(291) |
Nov
(333) |
Dec
(335) |
2017 |
Jan
(436) |
Feb
(460) |
Mar
(370) |
Apr
(189) |
May
(252) |
Jun
(272) |
Jul
(286) |
Aug
(293) |
Sep
(303) |
Oct
(331) |
Nov
(346) |
Dec
(273) |
2018 |
Jan
(295) |
Feb
(343) |
Mar
(265) |
Apr
(290) |
May
(233) |
Jun
(201) |
Jul
(234) |
Aug
(125) |
Sep
(287) |
Oct
(322) |
Nov
(274) |
Dec
(293) |
2019 |
Jan
(406) |
Feb
(255) |
Mar
(418) |
Apr
(187) |
May
(247) |
Jun
(282) |
Jul
(84) |
Aug
(108) |
Sep
(175) |
Oct
(161) |
Nov
(215) |
Dec
(184) |
2020 |
Jan
(205) |
Feb
(287) |
Mar
(180) |
Apr
(285) |
May
(272) |
Jun
(266) |
Jul
(133) |
Aug
(253) |
Sep
(281) |
Oct
(346) |
Nov
(293) |
Dec
(253) |
2021 |
Jan
(218) |
Feb
(194) |
Mar
(399) |
Apr
(312) |
May
(425) |
Jun
(358) |
Jul
(160) |
Aug
(251) |
Sep
(110) |
Oct
(113) |
Nov
(257) |
Dec
(99) |
2022 |
Jan
(233) |
Feb
(184) |
Mar
(284) |
Apr
(221) |
May
(178) |
Jun
(231) |
Jul
(337) |
Aug
(264) |
Sep
(181) |
Oct
(183) |
Nov
(281) |
Dec
(406) |
2023 |
Jan
(479) |
Feb
(263) |
Mar
(278) |
Apr
(149) |
May
(186) |
Jun
(215) |
Jul
(353) |
Aug
(195) |
Sep
(232) |
Oct
(140) |
Nov
(211) |
Dec
(197) |
2024 |
Jan
(348) |
Feb
(167) |
Mar
(131) |
Apr
(222) |
May
(113) |
Jun
(136) |
Jul
(242) |
Aug
(105) |
Sep
(94) |
Oct
(237) |
Nov
(110) |
Dec
(155) |
2025 |
Jan
(372) |
Feb
(234) |
Mar
(332) |
Apr
(310) |
May
(203) |
Jun
(63) |
Jul
(254) |
Aug
(151) |
Sep
(49) |
Oct
|
Nov
|
Dec
|
From: David K. <drk...@ki...> - 2025-09-13 00:23:42
|
Is there any chance of someone producing binaries for Macs? I know some students that want Mac binaries. I dont have a Mac myself. Dr David Kirkby Ph.D Kirkby Microwave Ltd Email: drk...@ki... Web: https://www.kirkbymicrowave.co.uk/ Telephone 07910 441670 (UK) or +44 7910 441670 (international) Registered in England and Wales, company number 08914892. Registered office: Stokes Hall Lodge, Burnham Rd, Althorne, Essex, CM3 6DT |
From: Michel T. <ta...@lp...> - 2025-09-12 22:03:23
|
Hello, i have just compiled sbcl 2.5.8 (with a standard dynamic space size of 2Gb) and maxima 5.48.1 with this sbcl. All of this went perfectly smooth. However i just tried a somewhat compute intensive problem with my new maxima and the performance is dismal. I have no idea where the problem lies, but i can only show what goes on: With the maxima coming with my ubuntu installation: Maxima 5.43.2 http://maxima.sourceforge.net using Lisp SBCL 2.0.1.debian (%i1) load("~/Documents/pro/maxima/atwood.mac"); solve: dependent equations eliminated: (2) solve: dependent equations eliminated: (1) N is 300 S is 10 time is 15.226 delta= 0.0340000000000007 N is 300 S is 20 time is 15.294 delta= 0.06799999999999962 N is 300 S is 30 time is 15.431 delta= 0.1369999999999987 N is 300 S is 40 time is 15.653 delta= 0.2220000000000013 N is 300 S is 50 time is 15.952 delta= 0.2989999999999995 ...... N is 300 S is 290 time is 145.421 delta= 13.798 N is 300 S is 300 time is 160.416 delta= 14.995 With my brand new maxima: maxima Loading /home/michel/.maxima/maxima-init.mac Maxima 5.48.1 https://maxima.sourceforge.io using Lisp SBCL 2.5.8 (%i1) load("~/Documents/pro/maxima/atwood.mac"); N is 300 S is 10 time is 21.045967 delta= 1.187887 N is 300 S is 20 time is 224.49405 delta= 203.448083 ..... I stopped here. The deltas are the time in seconds to run 10 computations. So maxima 5.48.1 runs more than 100 times slower than 5.43.2. The program in question atwood.mac is attached below. The printings showed above are caused by if mod(S,10)=0 then ( TT:elapsed_real_time (), print("N is ",N," S is ", S, "time is",TT, "delta= ",TT-TTT), TTT: TT) so the computation is really a bunch of rectforms followed by the solution of a linear system of small size 4x4. -- Michel Talon |
From: <dav...@fl...> - 2025-09-12 20:33:55
|
Barton and Raymond, thank you for the patches and fixes. On 2025-09-12 11:48, Barton Willis via Maxima-discuss wrote: > Thanks for finding my flub. > > I fixed that, removed the flet function in favor of defining new > function `reduce-angle-mod-2pi`. For now, > I retained the feature that unless the ceiling function gives an > explicit integer, the code does not do the > simplification atan2(sin(x),cos(x)) --> x. > > Also, I extended code to do atan2(a*y,x) -> atan2(y, x/|a|) is either > negative or positive. The testsuite runs OK with two failures. Both > are related to the following: > > This is OK, because y^2 + 1 is positive > > (%i5) atan2(y^2+1,x); > (%o5) atan2(1,x/(y^2+1)) > > But this causes two testsuite failures > > (%i6) at(%,[y=%i,x=0]); > (%o6) %pi/2 > > Who is at fault? > > (a) The user who substituted a non-real value for y that is by > default real. > (b) The function at for not being more careful. > (c) The atan2 simplifier for dividing by y^2+1. > (d) Something else. > > ------------------------- > > From: Raymond Toy <toy...@gm...> > Sent: Thursday, September 11, 2025 6:37 PM > To: Barton Willis <wi...@un...>; > max...@li... > <max...@li...> > Subject: Re: [Maxima-discuss] atan2 problem > > Caution: Non-NU Email > > On 9/11/25 12:26 PM, Barton Willis wrote: > >> This patch does atan2(a*y, x) -> atan2(y,x/a) where a is positive, >> and atan2(sin(x), cos(x)) -> x when >> `x ∈ (-π ,π] mod 2 π`. Examples > > Haven't tried this out yet, but I did notice this: > > + ;; We are looking at atan2(sin(theta), cos(theta)) > + ((and (sinp y) (cosp x) (alike1 (cadr y) (cadr y)) > > Is (alike1 (cadr y) (cadr y)) ever false? Maybe you meant something > else like (cadr x) for the second arg of alike1? > ​ > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |
From: Barton W. <wi...@un...> - 2025-09-12 11:48:53
|
Thanks for finding my flub. I fixed that, removed the flet function in favor of defining new function `reduce-angle-mod-2pi`. For now, I retained the feature that unless the ceiling function gives an explicit integer, the code does not do the simplification atan2(sin(x),cos(x)) --> x. Also, I extended code to do atan2(a*y,x) -> atan2(y, x/|a|) is either negative or positive. The testsuite runs OK with two failures. Both are related to the following: This is OK, because y^2 + 1 is positive (%i5) atan2(y^2+1,x); (%o5) atan2(1,x/(y^2+1)) But this causes two testsuite failures (%i6) at(%,[y=%i,x=0]); (%o6) %pi/2 Who is at fault? (a) The user who substituted a non-real value for y that is by default real. (b) The function at for not being more careful. (c) The atan2 simplifier for dividing by y^2+1. (d) Something else. ________________________________ From: Raymond Toy <toy...@gm...> Sent: Thursday, September 11, 2025 6:37 PM To: Barton Willis <wi...@un...>; max...@li... <max...@li...> Subject: Re: [Maxima-discuss] atan2 problem Caution: Non-NU Email On 9/11/25 12:26 PM, Barton Willis wrote: This patch does atan2(a*y, x) -> atan2(y,x/a) where a is positive, and atan2(sin(x), cos(x)) -> x when `x ∈ (-π ,π] mod 2 π`. Examples Haven't tried this out yet, but I did notice this: + ;; We are looking at atan2(sin(theta), cos(theta)) + ((and (sinp y) (cosp x) (alike1 (cadr y) (cadr y)) Is (alike1 (cadr y) (cadr y)) ever false? Maybe you meant something else like (cadr x) for the second arg of alike1? ​ |
From: Raymond T. <toy...@gm...> - 2025-09-11 23:38:04
|
On 9/11/25 12:26 PM, Barton Willis wrote: > This patch does |atan2(a*y, x) -> atan2(y,x/a)| where |a| is positive, > and |atan2(sin(x), cos(x)) -> x when | > |`x |∈ (-π ,π] mod 2 π`. Examples Haven't tried this out yet, but I did notice this: |+ ;; We are looking at atan2(sin(theta), cos(theta)) + ((and (sinp y) (cosp x) (alike1 (cadr y) (cadr y)) | Is |(alike1 (cadr y) (cadr y))| ever false? Maybe you meant something else like |(cadr x)| for the second arg of |alike1|? ​ |
From: Raymond T. <toy...@gm...> - 2025-09-11 23:32:39
|
On 9/11/25 5:33 AM, Barton Willis via Maxima-discuss wrote: > > I /experimentally /added a handful of lines to the atan2 simplifier. > I think that x -> x-2*%pi*ceiling((x-%pi)/(2*%pi)) is the sawtooth > with the needed left/right continuity. Maybe somebody can check my > logic on that. > > > (%i10) assume(a> 0)$ > > (%i11) atan2(a*sin(x), a*cos(x)); > > (%o11) x-2*%pi*ceiling((x-%pi)/(2*%pi)) > > But I doubt that a user wants to see expressions such as `|%o11`|. > We could simplify atan2(sin(x),cos(x)) only when the ceiling function > simplifies away, I suppose. What do you all think? I don't think it's terrible. We do something like this for |sin(x/2),halfangles|. ​ |
From: Barton W. <wi...@un...> - 2025-09-11 21:08:41
|
I experimentally added a handful of lines to the atan2 simplifier. I think that x -> x-2*%pi*ceiling((x-%pi)/(2*%pi)) is the sawtooth with the needed left/right continuity. Maybe somebody can check my logic on that. (%i10) assume(a> 0)$ (%i11) atan2(a*sin(x), a*cos(x)); (%o11) x-2*%pi*ceiling((x-%pi)/(2*%pi)) But I doubt that a user wants to see expressions such as `%o11`. We could simplify atan2(sin(x),cos(x)) only when the ceiling function simplifies away, I suppose. What do you all think? -bw ________________________________ From: Petros EZ <pet...@gm...> Sent: Thursday, September 11, 2025 4:58 AM To: max...@li... <max...@li...> Subject: Re: [Maxima-discuss] atan2 problem Caution: Non-NU Email On Wed, Sep 10, 2025 at 10:47 PM <dav...@fl...<mailto:dav...@fl...>> wrote: " I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for me so I think that I may be missing or misunderstanding something. Here's a batch file where I tried everything I could think of to get it to work, but all of the statements return atan2( sin(ANGLE), cos(ANGLE) ). I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping there is already an automatic simplification built-in, otherwise I expect I can do it manually using subst or ratsubst, etc. assume( ANGLE > -%pi, ANGLE < %pi ); atan2( sin(ANGLE), cos(ANGLE) ); ev( atan2( sin(ANGLE), cos(ANGLE) ) ); ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); " Hello. Please, correct the upper end of interval values for the argument from "less than" to "less than or equal". Sincerely, pez arg iaoi nfi lab at eu |
From: Barton W. <wi...@un...> - 2025-09-11 19:26:41
|
This patch does atan2(a*y, x) -> atan2(y,x/a) where a is positive, and atan2(sin(x), cos(x)) -> x when `x ∈ (-π ,π] mod 2 π`. Examples (%i1) assume(a > 0)$ (%i2) atan2(a*sin(s),a*cos(s)); (%o2) atan2(sin(s), cos(s)) (%i3) assume(-%pi < s, s <= %pi); (%o3) [s > - %pi, s <= %pi] (%i4) atan2(a*sin(s),a*cos(s)); %o4) s (%i11) assume(-%pi + 2*%pi < q, q <= %pi + 2*%pi); (%o11) [q > %pi, 3 %pi >= q] (%i12) atan2(a*sin(q),a*cos(q)); (%o12) q - 2 %pi ________________________________ From: Raymond Toy <toy...@gm...> Sent: Thursday, September 11, 2025 9:46 AM To: max...@li... <max...@li...> Subject: Re: [Maxima-discuss] atan2 problem Caution: Non-NU Email On 9/10/25 2:27 PM, Richard Fateman wrote: you can easily add this simplification via tellsimp or tellsimpafter. Yeah, but I think these should be built in. There should also be other simplifications such as the fact that tan(x/2),halfangles is (1-cos(x))/sin(x), then atan2(1-cos(x),sin(x)) should be x/2 with appropriate restrictions on x. Or atan2(y,x) can simplify to atan(y/x) if x^2+y^2=c^2 for some constant c. I've run into lots of simplifications of atan2 that I've had to do manually. They've always been one-of-a-kind things I needed at the time so I never bothered to try to generalize them or implement them. On Wed, Sep 10, 2025 at 1:45 PM <dav...@fl...<mailto:dav...@fl...>> wrote: I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for me so I think that I may be missing or misunderstanding something. Here's a batch file where I tried everything I could think of to get it to work, but all of the statements return atan2( sin(ANGLE), cos(ANGLE) ). I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping there is already an automatic simplification built-in, otherwise I expect I can do it manually using subst or ratsubst, etc. assume( ANGLE > -%pi, ANGLE < %pi ); atan2( sin(ANGLE), cos(ANGLE) ); ev( atan2( sin(ANGLE), cos(ANGLE) ) ); ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); _______________________________________________ Maxima-discuss mailing list Max...@li...<mailto:Max...@li...> https://lists.sourceforge.net/lists/listinfo/maxima-discuss<https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!CJeuP7VItIKk2BTT1oZvATHRwCpJ4nlSTOEfdV9MYXsS5SaVzs3TyOSeopaQ6VT-GHyG6B5Z5Wilc9eW07c$> _______________________________________________ Maxima-discuss mailing list Max...@li...<mailto:Max...@li...> https://lists.sourceforge.net/lists/listinfo/maxima-discuss<https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!CJeuP7VItIKk2BTT1oZvATHRwCpJ4nlSTOEfdV9MYXsS5SaVzs3TyOSeopaQ6VT-GHyG6B5Z5Wilc9eW07c$> ​ |
From: Stavros M. <mac...@gm...> - 2025-09-11 14:57:59
|
I certainly agree that the manual can be improved. In particular, the explanation of *numer* in *ev* is misleading. *numer* does not force numerical evaluation of functions -- all it does is convert symbolic constants (like *%e *and *%pi*) to floats and also (by turning on *float*) convert integers and rationals to floats. It is *simplification *that transforms *sin(0.2) *to *0.1987*. In Maxima, "evaluation" means replacing symbolic variables with their value, and calling functions. It isn't directly related to "numerical evaluation". I suggest you start by (re)reading the Evaluation <https://maxima.sourceforge.io/docs/manual/Evaluation.html> and Simplification <https://maxima.sourceforge.io/docs/manual/Simplification.html> sections of the manual. Sorry I don't have time to write a fuller explanation. On Thu, Sep 11, 2025, 05:36 Igor Pesando <ipe...@gm...> wrote: > Thanks a lot for the useful suggestions. > > My suggestion is to add some clarification to the manual. > > In ev there is > > • ‘numer’ causes some mathematical functions (including > exponentiation) with numerical arguments to be evaluated > in floating point. It causes variables in <expr> which > have been given numervals to be replaced by their values. > It also sets the ‘float’ switch on. > > while in subst > > Substitutes <a> for <b> in <c>. > > And there is no mention of the numerical evaluation. > > Moreover if you want the numerical value of 3/7 it is natural to write > > 3/7, numer; > > since the trick 3/7*1.0; is less obvious imho. > > Bests > > Igor > > > > On 9/10/25 19:29, Stavros Macrakis wrote: > > scanmap works better bottomup: > > > > scanmap('rectform, EXPR, bottomup) > > > > > > On Wed, Sep 10, 2025, 09:43 Raymond Toy <toy...@gm...> wrote: > > > > On 9/9/25 10:46 PM, Igor Pesando wrote: > > > >> Hi *, > >> > >> a little bug in numerical evaluation of complex numbers > >> > >> (%i1) u:sqrt(Ms+3); > >> (%o1) sqrt(Ms + 3) > >> (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); > >> %i 0.5 > >> (%o2) ( -------- + 3.1) > >> 10000000 > >> > >> (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > >> (%o4) 2.839809171235323E-8 %i + 1.760681686165901 > >> > >> So in this case you can work around. > >> > >> Things are a little more complex with > >> > >> u:log_gamma(Ms+sqrt(Ms+u)); > > > > This works better: > > > > |(%i1) u:sqrt(Ms+3); (%o1) sqrt(Ms + 3) (%i2) > > u:log_gamma(Ms+sqrt(Ms+u)); (%o2) log_gamma(sqrt(sqrt(Ms + 3) + > > Ms) + Ms) (%i3) subst(Ms=0.1+%i*10**(-7), u); (%o3) > > 3.4627030590443545e-10 %i - 0.12148342172514415 | > > > > No |rectform| needed in this case. > > > > I think the general advice is not to use |ev| unless you know what > > you're doing. Not sure if that's the cause or not in this case, > > but the above code is easier to understand and, in this case, > > produces your desired numerical result. > > > > ​ > > _______________________________________________ > > Maxima-discuss mailing list > > Max...@li... > > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > > > > > _______________________________________________ > > Maxima-discuss mailing list > > Max...@li... > > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |
From: Raymond T. <toy...@gm...> - 2025-09-11 14:51:08
|
On 9/11/25 5:36 AM, Igor Pesando wrote: > Thanks a lot for the useful suggestions. > > My suggestion is to add some clarification to the manual. > > In ev there is > > • ‘numer’ causes some mathematical functions (including > exponentiation) with numerical arguments to be evaluated > in floating point. It causes variables in <expr> which > have been given numervals to be replaced by their values. > It also sets the ‘float’ switch on. I personally almost never use |numer| and use |float()| instead. AFAIK, there is no |float| switch. > > while in subst > > Substitutes <a> for <b> in <c>. > > And there is no mention of the numerical evaluation. That's because it doesn't. The numerical evaluation happens because in |c|, the simplifier decides that the argument is a number. > > Moreover if you want the numerical value of 3/7 it is natural to write > > 3/7, numer; > > since the trick 3/7*1.0; is less obvious imho. I always do |float(3/7)|. The interaction between |numer| and |float()| is messy and rather inconsistent. There are some bugs filed for this. Stavros knows more about this. ​ |
From: Raymond T. <toy...@gm...> - 2025-09-11 14:46:30
|
On 9/10/25 2:27 PM, Richard Fateman wrote: > you can easily add this simplification via tellsimp or tellsimpafter. Yeah, but I think these should be built in. There should also be other simplifications such as the fact that |tan(x/2),halfangles| is |(1-cos(x))/sin(x)|, then |atan2(1-cos(x),sin(x))| should be |x/2| with appropriate restrictions on |x|. Or |atan2(y,x)| can simplify to |atan(y/x)| if |x^2+y^2=c^2| for some constant |c|. I've run into lots of simplifications of atan2 that I've had to do manually. They've always been one-of-a-kind things I needed at the time so I never bothered to try to generalize them or implement them. > > > > On Wed, Sep 10, 2025 at 1:45 PM <dav...@fl...> wrote: > > I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to > ANGLE > if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work > for me > so I think that I may be missing or misunderstanding something. > Here's > a batch file where I tried everything I could think of to get it to > work, but all of the statements return atan2( sin(ANGLE), > cos(ANGLE) ). > I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping > there is > already an automatic simplification built-in, otherwise I expect I > can > do it manually using subst or ratsubst, etc. > > assume( ANGLE > -%pi, ANGLE < %pi ); > atan2( sin(ANGLE), cos(ANGLE) ); > ev( atan2( sin(ANGLE), cos(ANGLE) ) ); > ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); > trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); > trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); > ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss ​ |
From: <dav...@fl...> - 2025-09-11 14:45:13
|
Richard, Daniel, and Petros: thank you for the suggestions and info! Petros: I corrected the upper bound to ANGLE <= %pi, but my test program still did not simplify the atan2 expressions. Dave On 2025-09-11 09:58, Petros EZ wrote: > On Wed, Sep 10, 2025 at 10:47 PM <dav...@fl...> > wrote: > " > I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE > if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for > me so I think that I may be missing or misunderstanding something. > Here's a batch file where I tried everything I could think of to get > it to work, but all of the statements return atan2( sin(ANGLE), > cos(ANGLE) ). I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am > hoping there is already an automatic simplification built-in, > otherwise I expect I can do it manually using subst or ratsubst, etc. > > assume( ANGLE > -%pi, ANGLE < %pi ); > atan2( sin(ANGLE), cos(ANGLE) ); > ev( atan2( sin(ANGLE), cos(ANGLE) ) ); > ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); > trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); > trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); > ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); > " > > Hello. > > Please, correct the upper end of interval values for the argument from > "less than" to "less than or equal". > > Sincerely, > > pez > > arg iaoi nfi lab at eu > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |
From: Igor P. <ipe...@gm...> - 2025-09-11 12:36:30
|
Thanks a lot for the useful suggestions. My suggestion is to add some clarification to the manual. In ev there is • ‘numer’ causes some mathematical functions (including exponentiation) with numerical arguments to be evaluated in floating point. It causes variables in <expr> which have been given numervals to be replaced by their values. It also sets the ‘float’ switch on. while in subst Substitutes <a> for <b> in <c>. And there is no mention of the numerical evaluation. Moreover if you want the numerical value of 3/7 it is natural to write 3/7, numer; since the trick 3/7*1.0; is less obvious imho. Bests Igor On 9/10/25 19:29, Stavros Macrakis wrote: > scanmap works better bottomup: > > scanmap('rectform, EXPR, bottomup) > > > On Wed, Sep 10, 2025, 09:43 Raymond Toy <toy...@gm...> wrote: > > On 9/9/25 10:46 PM, Igor Pesando wrote: > >> Hi *, >> >> a little bug in numerical evaluation of complex numbers >> >> (%i1) u:sqrt(Ms+3); >> (%o1) sqrt(Ms + 3) >> (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); >> %i 0.5 >> (%o2) ( -------- + 3.1) >> 10000000 >> >> (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); >> (%o4) 2.839809171235323E-8 %i + 1.760681686165901 >> >> So in this case you can work around. >> >> Things are a little more complex with >> >> u:log_gamma(Ms+sqrt(Ms+u)); > > This works better: > > |(%i1) u:sqrt(Ms+3); (%o1) sqrt(Ms + 3) (%i2) > u:log_gamma(Ms+sqrt(Ms+u)); (%o2) log_gamma(sqrt(sqrt(Ms + 3) + > Ms) + Ms) (%i3) subst(Ms=0.1+%i*10**(-7), u); (%o3) > 3.4627030590443545e-10 %i - 0.12148342172514415 | > > No |rectform| needed in this case. > > I think the general advice is not to use |ev| unless you know what > you're doing. Not sure if that's the cause or not in this case, > but the above code is easier to understand and, in this case, > produces your desired numerical result. > > ​ > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |
From: Petros EZ <pet...@gm...> - 2025-09-11 09:58:51
|
On Wed, Sep 10, 2025 at 10:47 PM <dav...@fl...> wrote: " I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for me so I think that I may be missing or misunderstanding something. Here's a batch file where I tried everything I could think of to get it to work, but all of the statements return atan2( sin(ANGLE), cos(ANGLE) ). I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping there is already an automatic simplification built-in, otherwise I expect I can do it manually using subst or ratsubst, etc. assume( ANGLE > -%pi, ANGLE < %pi ); atan2( sin(ANGLE), cos(ANGLE) ); ev( atan2( sin(ANGLE), cos(ANGLE) ) ); ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); " Hello. Please, correct the upper end of interval values for the argument from "less than" to "less than or equal". Sincerely, pez arg iaoi nfi lab at eu |
From: Daniel V. <dan...@ya...> - 2025-09-10 21:49:37
|
Hi Dave, I had the same problem 5 years ago, perhaps this thread can be of some use to you:Thread: [Maxima-discuss] Different behavior between atan and atan2 | Maxima -- GPL CAS based on DOE-MACSYMA Daniel Volinski En miércoles, 10 de septiembre de 2025, 23:51:41 GMT+3, dav...@fl... <dav...@fl...> escribió: I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for me so I think that I may be missing or misunderstanding something. Here's a batch file where I tried everything I could think of to get it to work, but all of the statements return atan2( sin(ANGLE), cos(ANGLE) ). I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping there is already an automatic simplification built-in, otherwise I expect I can do it manually using subst or ratsubst, etc. assume( ANGLE > -%pi, ANGLE < %pi ); atan2( sin(ANGLE), cos(ANGLE) ); ev( atan2( sin(ANGLE), cos(ANGLE) ) ); ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); _______________________________________________ Maxima-discuss mailing list Max...@li... https://lists.sourceforge.net/lists/listinfo/maxima-discuss |
From: Richard F. <fa...@gm...> - 2025-09-10 21:27:30
|
you can easily add this simplification via tellsimp or tellsimpafter. On Wed, Sep 10, 2025 at 1:45 PM <dav...@fl...> wrote: > I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE > if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for me > so I think that I may be missing or misunderstanding something. Here's > a batch file where I tried everything I could think of to get it to > work, but all of the statements return atan2( sin(ANGLE), cos(ANGLE) ). > I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping there is > already an automatic simplification built-in, otherwise I expect I can > do it manually using subst or ratsubst, etc. > > assume( ANGLE > -%pi, ANGLE < %pi ); > atan2( sin(ANGLE), cos(ANGLE) ); > ev( atan2( sin(ANGLE), cos(ANGLE) ) ); > ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); > trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); > trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); > ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |
From: <dav...@fl...> - 2025-09-10 20:45:04
|
I expect that atan2( sin(ANGLE), cos(ANGLE) ) should simplify to ANGLE if ANGLE is restricted to -%pi < ANGLE < %pi, but it doesn't work for me so I think that I may be missing or misunderstanding something. Here's a batch file where I tried everything I could think of to get it to work, but all of the statements return atan2( sin(ANGLE), cos(ANGLE) ). I tried it with Maxima 5.46.0, 5.47.0, and 5.48.1. I am hoping there is already an automatic simplification built-in, otherwise I expect I can do it manually using subst or ratsubst, etc. assume( ANGLE > -%pi, ANGLE < %pi ); atan2( sin(ANGLE), cos(ANGLE) ); ev( atan2( sin(ANGLE), cos(ANGLE) ) ); ev( atan2( sin(ANGLE), cos(ANGLE) ), simp, nouns, eval ); trigsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); trigreduce( atan2( sin(ANGLE), cos(ANGLE) ) ); ratsimp( atan2( sin(ANGLE), cos(ANGLE) ) ); |
From: Stavros M. <mac...@gm...> - 2025-09-10 17:30:18
|
scanmap works better bottomup: scanmap('rectform, EXPR, bottomup) On Wed, Sep 10, 2025, 09:43 Raymond Toy <toy...@gm...> wrote: > On 9/9/25 10:46 PM, Igor Pesando wrote: > > Hi *, > > a little bug in numerical evaluation of complex numbers > > (%i1) u:sqrt(Ms+3); > (%o1) sqrt(Ms + 3) > (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); > %i 0.5 > (%o2) ( -------- + 3.1) > 10000000 > > (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > (%o4) 2.839809171235323E-8 %i + 1.760681686165901 > > So in this case you can work around. > > Things are a little more complex with > > u:log_gamma(Ms+sqrt(Ms+u)); > > This works better: > > > (%i1) u:sqrt(Ms+3); > (%o1) sqrt(Ms + 3) > (%i2) u:log_gamma(Ms+sqrt(Ms+u)); > (%o2) log_gamma(sqrt(sqrt(Ms + 3) + Ms) + Ms) > (%i3) subst(Ms=0.1+%i*10**(-7), u); > (%o3) 3.4627030590443545e-10 %i - 0.12148342172514415 > > No rectform needed in this case. > > I think the general advice is not to use ev unless you know what you're > doing. Not sure if that's the cause or not in this case, but the above code > is easier to understand and, in this case, produces your desired numerical > result. > ​ > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |
From: Raymond T. <toy...@gm...> - 2025-09-10 16:43:12
|
On 9/9/25 10:46 PM, Igor Pesando wrote: > Hi *, > > a little bug in numerical evaluation of complex numbers > > (%i1) u:sqrt(Ms+3); > (%o1) sqrt(Ms + 3) > (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); > %i 0.5 > (%o2) ( -------- + 3.1) > 10000000 > > (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > (%o4) 2.839809171235323E-8 %i + 1.760681686165901 > > So in this case you can work around. > > Things are a little more complex with > > u:log_gamma(Ms+sqrt(Ms+u)); This works better: |(%i1) u:sqrt(Ms+3); (%o1) sqrt(Ms + 3) (%i2) u:log_gamma(Ms+sqrt(Ms+u)); (%o2) log_gamma(sqrt(sqrt(Ms + 3) + Ms) + Ms) (%i3) subst(Ms=0.1+%i*10**(-7), u); (%o3) 3.4627030590443545e-10 %i - 0.12148342172514415 | No |rectform| needed in this case. I think the general advice is not to use |ev| unless you know what you're doing. Not sure if that's the cause or not in this case, but the above code is easier to understand and, in this case, produces your desired numerical result. ​ |
From: Raymond T. <toy...@gm...> - 2025-09-10 14:03:20
|
On 9/10/25 12:38 AM, Stavros Macrakis wrote: > Could you explain what you think is a bug? This looks correct to me. I think he's saying that |(%i50) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); %i %i %i 0.5 0.5 (%o50) 0.5 (log_gamma(──────── + (──────── + (──────── + 3.1) + 0.1) 10000000 10000000 10000000 0.5 0.5 + 0.1) + log_gamma(- 1.0e-7 %i + (- 1.0e-7 %i + (3.1 - 1.0e-7 %i) + 0.1) + 0.1)) - 0.5 (log_gamma(- 1.0e-7 %i 0.5 0.5 + (- 1.0e-7 %i + (3.1 - 1.0e-7 %i) + 0.1) + 0.1) %i %i %i 0.5 0.5 - log_gamma(──────── + (──────── + (──────── + 3.1) + 0.1) + 0.1)) 10000000 10000000 10000000 (%i51) expand(%); %i %i %i 0.5 0.5 (%o51) 1.0 log_gamma(──────── + (──────── + (──────── + 3.1) + 0.1) 10000000 10000000 10000000 + 0.1) | So the result is a messy expression involving |log_gamma| instead of a numerical value. I can't find an easy way to get the numerical value other than pulling out the arg of |log_gamma|, applying |rectform| on that, and then taking |log_gamma| of the result. I thought maybe |scanmap(rectform, %o51)| would wok, but it's taking a very long time.... > > On Tue, Sep 9, 2025, 22:46 Igor Pesando <ipe...@gm...> wrote: > > Hi *, > > a little bug in numerical evaluation of complex numbers > > (%i1) u:sqrt(Ms+3); > (%o1) sqrt(Ms + 3) > (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); > %i 0.5 > (%o2) ( -------- + 3.1) > 10000000 > > (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > (%o4) 2.839809171235323E-8 %i + 1.760681686165901 > > So in this case you can work around. > > Things are a little more complex with > > u:log_gamma(Ms+sqrt(Ms+u)); > > where > > ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > > gives an ugly result. > > In this case you have first to evaluate the argument and then pass > it to > log_gamma > > Bests, > > Igor > > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss ​ |
From: Stavros M. <mac...@gm...> - 2025-09-10 07:39:06
|
Could you explain what you think is a bug? This looks correct to me. On Tue, Sep 9, 2025, 22:46 Igor Pesando <ipe...@gm...> wrote: > Hi *, > > a little bug in numerical evaluation of complex numbers > > (%i1) u:sqrt(Ms+3); > (%o1) sqrt(Ms + 3) > (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); > %i 0.5 > (%o2) ( -------- + 3.1) > 10000000 > > (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > (%o4) 2.839809171235323E-8 %i + 1.760681686165901 > > So in this case you can work around. > > Things are a little more complex with > > u:log_gamma(Ms+sqrt(Ms+u)); > > where > > ev(rectform(u), Ms=0.1+%i*10**(-7), numer); > > gives an ugly result. > > In this case you have first to evaluate the argument and then pass it to > log_gamma > > Bests, > > Igor > > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |
From: Igor P. <ipe...@gm...> - 2025-09-10 05:46:17
|
Hi *, a little bug in numerical evaluation of complex numbers (%i1) u:sqrt(Ms+3); (%o1) sqrt(Ms + 3) (%i2) ev(u, Ms=0.1+%i*10**(-7), numer); %i 0.5 (%o2) ( -------- + 3.1) 10000000 (%i4) ev(rectform(u), Ms=0.1+%i*10**(-7), numer); (%o4) 2.839809171235323E-8 %i + 1.760681686165901 So in this case you can work around. Things are a little more complex with u:log_gamma(Ms+sqrt(Ms+u)); where ev(rectform(u), Ms=0.1+%i*10**(-7), numer); gives an ugly result. In this case you have first to evaluate the argument and then pass it to log_gamma Bests, Igor |
From: Raymond T. <toy...@gm...> - 2025-09-09 15:07:51
|
On 9/8/25 1:40 PM, Michel Talon wrote: > > Le 08/09/2025 à 21:08, Raymond Toy a écrit : >> >> The only thing that doesn't pass is Jaime's example which still fails >> for me: >> >> |(%i5) (3/17)*[1, -2, 5]/sqrt(11) + (8/13); 3 8 8 6 15 8 (%o5) >> [─────────── + ──, ── - ───────────, ─────────── + ──] 17 sqrt(11) 13 >> 13 17 sqrt(11) 17 sqrt(11) 13 (%i6) cf(%); Argument Y is not a >> NUMBER: ((MPLUS SIMP) ((RAT SIMP) 8 13) ((MTIMES SIMP) ((RAT SIMP) 15 >> 17) ((MEXPT SIMP) 11 ((RAT SIMP) -1 2)))). [Condition of type >> SIMPLE-TYPE-ERROR] | >> >> Curiously, >> >> |(%i9) cf((3/17)*[1, -2, 5]/sqrt(11) + (8/13)); (%o9) [0, 1, 1, 1, 3, >> 2, 1, 4, 2, 6, 8, 2] | >> >> Not sure what the difference is. Also don't know if that's right or not. >> > > In the first case [1,-2,5] is seen as a maxima list and %o9 is > expanded correspondingly as a maxima list. > Oh, right. I forgot about that. Setting |listarith:false| makes this case work. I'll merge your fixes later today. Thank you! ​ |
From: Stavros M. <mac...@gm...> - 2025-09-08 23:30:13
|
As you know, *cf* evaluates its argument in a very special way (which is weird and problematic, but let's deal with that separately). In any case, even *cf([1/2])* is illegal, let alone *cf([3/(17*sqrt(11))+8/13,8/13-6/(17*sqrt(11)),15/(17*sqrt(11))+8/13])* -- it should report a cleaner error, though. On Mon, Sep 8, 2025 at 12:09 PM Raymond Toy <toy...@gm...> wrote: > On 9/8/25 5:40 AM, Michel Talon wrote: > > > Le 05/09/2025 à 15:54, Michel Talon a écrit : > > Le 02/09/2025 à 19:35, Stavros Macrakis a écrit : > > cf([1,4]*[1,3]) => [1,1,2] -- correct > cf([1,3]*[1,3]) ERROR > cf: argument of sqrt must be an integer; found [3, 6, 4, 3] and also:* > cf(1/sqrt(2)) *and *cf(1/[1,2]) *also report this error > > > I have looked at these errors, they are caused by incorrect stuff in > function cfeval, by the way tracing this function shows clearly the > problem. In fact cfeval is some sort of replacement for meval, so when it > sees a list, such as [1,3] it interprets it as a continued fraction,when it > sees a * it interprets it as a special way to multiply continuous > fractions, etc. But when emitting cf([1,3]*[1,3]) some simplification > occurs before cfeval is called and it sees[1,3]^2 which it is not prepared > to manage. > > Hello, > > i think i have solved the two bugs described above by the modification of > cfeval attached below, hoping it doesn't cause trouble elsewhere ... Here > is the diff with the original cfeval: > > Thanks for the fixes. I ran the testsuite with this, and everything > passes. The original test case passes and so does Stavros' example of > cf([1,3]*[1,3]). I didn't check to see if these are correct or not, > though. > > The only thing that doesn't pass is Jaime's example which still fails for > me: > > > (%i5) (3/17)*[1, -2, 5]/sqrt(11) + (8/13); > 3 8 8 6 15 8 > (%o5) [─────────── + ──, ── - ───────────, ─────────── + ──] > 17 sqrt(11) 13 13 17 sqrt(11) 17 sqrt(11) 13 > (%i6) cf(%); > > Argument Y is not a NUMBER: ((MPLUS SIMP) ((RAT SIMP) 8 13) > ((MTIMES SIMP) ((RAT SIMP) 15 17) > ((MEXPT SIMP) 11 ((RAT SIMP) -1 2)))). > [Condition of type SIMPLE-TYPE-ERROR] > > Curiously, > > > (%i9) cf((3/17)*[1, -2, 5]/sqrt(11) + (8/13)); > (%o9) [0, 1, 1, 1, 3, 2, 1, 4, 2, 6, 8, 2] > > Not sure what the difference is. Also don't know if that's right or not. > ​ > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |
From: Michel T. <ta...@lp...> - 2025-09-08 20:40:33
|
Le 08/09/2025 à 21:08, Raymond Toy a écrit : > > The only thing that doesn't pass is Jaime's example which still fails > for me: > > |(%i5) (3/17)*[1, -2, 5]/sqrt(11) + (8/13); 3 8 8 6 15 8 (%o5) > [─────────── + ──, ── - ───────────, ─────────── + ──] 17 sqrt(11) 13 > 13 17 sqrt(11) 17 sqrt(11) 13 (%i6) cf(%); Argument Y is not a NUMBER: > ((MPLUS SIMP) ((RAT SIMP) 8 13) ((MTIMES SIMP) ((RAT SIMP) 15 17) > ((MEXPT SIMP) 11 ((RAT SIMP) -1 2)))). [Condition of type > SIMPLE-TYPE-ERROR] | > > Curiously, > > |(%i9) cf((3/17)*[1, -2, 5]/sqrt(11) + (8/13)); (%o9) [0, 1, 1, 1, 3, > 2, 1, 4, 2, 6, 8, 2] | > > Not sure what the difference is. Also don't know if that's right or not. > In the first case [1,-2,5] is seen as a maxima list and %o9 is expanded correspondingly as a maxima list. Then cf chokes on a list which is not composed of numbers, as a continued fraction should be. In the second case [1,-2,5] is seen inside cf as a continued fraction, so cf sees just one expression which it can copes with. So there is no bug here. The point is that cfeval in cf bypasses meval. Is the result correct? let us check. (%i1) rat(cfdisrep([1, -2, 5])); 4 (%o1)/R/ - 9 (%i2) float((3/17)*(4/9)/sqrt(11)+(8/13)); (%o2) 0.6390325639789498 (%i3) float(cfdisrep([0, 1, 1, 1, 3, 2, 1, 4, 2, 6, 8, 2])); (%o3) 0.6390385213914627 So up to reasonable precision, the result is correct. -- Michel Talon |