You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(20) |
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(39) |
Feb
(21) |
Mar
(33) |
Apr
(135) |
May
(53) |
Jun
(88) |
Jul
(47) |
Aug
(59) |
Sep
(207) |
Oct
(40) |
Nov
(7) |
Dec
(26) |
| 2003 |
Jan
(49) |
Feb
(39) |
Mar
(117) |
Apr
(50) |
May
(62) |
Jun
(6) |
Jul
(19) |
Aug
(24) |
Sep
(11) |
Oct
(11) |
Nov
(49) |
Dec
(9) |
| 2004 |
Jan
(29) |
Feb
(123) |
Mar
(32) |
Apr
(53) |
May
(52) |
Jun
(19) |
Jul
(33) |
Aug
(10) |
Sep
(76) |
Oct
(86) |
Nov
(171) |
Dec
(163) |
| 2005 |
Jan
(147) |
Feb
(121) |
Mar
(120) |
Apr
(126) |
May
(120) |
Jun
(213) |
Jul
(76) |
Aug
(79) |
Sep
(140) |
Oct
(83) |
Nov
(156) |
Dec
(202) |
| 2006 |
Jan
(181) |
Feb
(171) |
Mar
(157) |
Apr
(98) |
May
(96) |
Jun
(97) |
Jul
(193) |
Aug
(76) |
Sep
(130) |
Oct
(63) |
Nov
(196) |
Dec
(253) |
| 2007 |
Jan
(256) |
Feb
(293) |
Mar
(276) |
Apr
(258) |
May
(181) |
Jun
(91) |
Jul
(108) |
Aug
(69) |
Sep
(107) |
Oct
(179) |
Nov
(137) |
Dec
(121) |
| 2008 |
Jan
(124) |
Feb
(129) |
Mar
(192) |
Apr
(201) |
May
(90) |
Jun
(86) |
Jul
(115) |
Aug
(142) |
Sep
(49) |
Oct
(91) |
Nov
(95) |
Dec
(218) |
| 2009 |
Jan
(230) |
Feb
(149) |
Mar
(118) |
Apr
(72) |
May
(77) |
Jun
(68) |
Jul
(102) |
Aug
(72) |
Sep
(89) |
Oct
(76) |
Nov
(125) |
Dec
(86) |
| 2010 |
Jan
(75) |
Feb
(90) |
Mar
(89) |
Apr
(121) |
May
(111) |
Jun
(66) |
Jul
(75) |
Aug
(66) |
Sep
(66) |
Oct
(166) |
Nov
(121) |
Dec
(73) |
| 2011 |
Jan
(74) |
Feb
|
Mar
|
Apr
(14) |
May
(22) |
Jun
(31) |
Jul
(53) |
Aug
(37) |
Sep
(23) |
Oct
(25) |
Nov
(31) |
Dec
(28) |
| 2012 |
Jan
(18) |
Feb
(11) |
Mar
(32) |
Apr
(17) |
May
(48) |
Jun
(37) |
Jul
(23) |
Aug
(54) |
Sep
(15) |
Oct
(11) |
Nov
(19) |
Dec
(22) |
| 2013 |
Jan
(11) |
Feb
(32) |
Mar
(24) |
Apr
(37) |
May
(31) |
Jun
(14) |
Jul
(26) |
Aug
(33) |
Sep
(40) |
Oct
(21) |
Nov
(36) |
Dec
(84) |
| 2014 |
Jan
(23) |
Feb
(20) |
Mar
(27) |
Apr
(24) |
May
(31) |
Jun
(27) |
Jul
(34) |
Aug
(26) |
Sep
(21) |
Oct
(45) |
Nov
(23) |
Dec
(73) |
| 2015 |
Jan
(33) |
Feb
(8) |
Mar
(24) |
Apr
(45) |
May
(27) |
Jun
(19) |
Jul
(21) |
Aug
(51) |
Sep
(43) |
Oct
(29) |
Nov
(61) |
Dec
(86) |
| 2016 |
Jan
(99) |
Feb
(52) |
Mar
(80) |
Apr
(61) |
May
(24) |
Jun
(23) |
Jul
(36) |
Aug
(30) |
Sep
(41) |
Oct
(43) |
Nov
(27) |
Dec
(46) |
| 2017 |
Jan
(57) |
Feb
(34) |
Mar
(40) |
Apr
(31) |
May
(78) |
Jun
(49) |
Jul
(72) |
Aug
(33) |
Sep
(26) |
Oct
(82) |
Nov
(69) |
Dec
(29) |
| 2018 |
Jan
(43) |
Feb
(9) |
Mar
|
Apr
(40) |
May
(34) |
Jun
(49) |
Jul
(45) |
Aug
(8) |
Sep
(51) |
Oct
(75) |
Nov
(103) |
Dec
(80) |
| 2019 |
Jan
(153) |
Feb
(78) |
Mar
(47) |
Apr
(48) |
May
(63) |
Jun
(54) |
Jul
(10) |
Aug
(7) |
Sep
(17) |
Oct
(24) |
Nov
(29) |
Dec
(17) |
| 2020 |
Jan
(22) |
Feb
(74) |
Mar
(47) |
Apr
(48) |
May
(12) |
Jun
(44) |
Jul
(13) |
Aug
(18) |
Sep
(26) |
Oct
(36) |
Nov
(25) |
Dec
(23) |
| 2021 |
Jan
(28) |
Feb
(25) |
Mar
(58) |
Apr
(76) |
May
(72) |
Jun
(70) |
Jul
(25) |
Aug
(67) |
Sep
(17) |
Oct
(24) |
Nov
(30) |
Dec
(30) |
| 2022 |
Jan
(51) |
Feb
(39) |
Mar
(72) |
Apr
(65) |
May
(30) |
Jun
(72) |
Jul
(129) |
Aug
(44) |
Sep
(45) |
Oct
(30) |
Nov
(48) |
Dec
(275) |
| 2023 |
Jan
(235) |
Feb
(232) |
Mar
(68) |
Apr
(16) |
May
(52) |
Jun
(87) |
Jul
(143) |
Aug
(32) |
Sep
(26) |
Oct
(15) |
Nov
(20) |
Dec
(74) |
| 2024 |
Jan
(119) |
Feb
(32) |
Mar
(64) |
Apr
(68) |
May
(30) |
Jun
(50) |
Jul
(37) |
Aug
(32) |
Sep
(10) |
Oct
(27) |
Nov
(47) |
Dec
(36) |
| 2025 |
Jan
(94) |
Feb
(68) |
Mar
(79) |
Apr
(66) |
May
(46) |
Jun
(21) |
Jul
(134) |
Aug
(134) |
Sep
(53) |
Oct
(24) |
Nov
(69) |
Dec
(68) |
| 2026 |
Jan
(48) |
Feb
(49) |
Mar
(56) |
Apr
(155) |
May
(58) |
Jun
(14) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: peterpall <pet...@us...> - 2026-06-08 19:23:10
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 7af0eeed9f0343e3a8d51004dd8349997bcd168e (commit)
from 03eb6bbde0ecb0c91897b22c047f36d30fbe8575 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7af0eeed9f0343e3a8d51004dd8349997bcd168e
Author: Gunter Königsmann <gu...@pe...>
Date: Mon Jun 8 21:22:09 2026 +0200
Windows installer: Update wxMaxima
Changes:
- Optimize drawing during mouse moves (bracket autohide): redraw only the actual height of the cell, rather than drawing all the way to the absolute bottom coordinate.
- Change the "Jump to first error" menu item to "Jump to last error" and fix its implementation to scroll to the most recent error cell.
- Fix handling of to_lisp() and (to-maxima).
- Fix redundant Maxima process spawns when opening worksheets and in batch mode.
- A Diff Viewer that compares two wxmx files from the same origin that were saved with this wxMaxima version or newer.
- Fix startup keyboard focus: The worksheet now correctly gains focus on application start.
- New `wx_matrix()` command for advanced matrix formatting (lines, headers, custom brackets).
- Persistent matrix formatting: Style flags are now saved within the matrix object.
- Major XML performance optimization: Faster worksheet loading via hash-based attribute filtering.
- Improved XML integrity: Automated validation tests to prevent duplicate attributes and malformed files.
- Windows Accessibility: Fixed several bugs in the `wxAccessible` implementation for better screen reader support.
- Script rendering: Fixed issues where complex subscripts/superscripts would flatten into standard subscripts.
- High-DPI: Optimized SVG rendering and resolved redundant resource requests.
- Editor performance: Optimized drawing by rendering only visible text tokens.
- Non-interactive mode: Automated tests now skip most blocking modal dialogues.
- The log now contains errors maxima encountered.
- Many improvements to the Doxygen documentation.
- Fix the cursor position after autocompletion (#2090).
- Fix XML for saving as wxmx, when Maxima warnings are displayed (#2092).
- Fix XML output for definite integrals. It was saved without the limits.
- Resolved a Crash on encountering some integrals (#2095)
- A complete overhaul of the worksheet's layout and display engine.
- Opening <file.wxmx>#UUID opens the file and scrolls to the Group with
that UUID
- Many stability improvements, most of these AI-driven (#2072, #2061)
- The size of subscripts is now calculated correctly
- The table of contents can now show section numbers
- Massive improvement of the search within the worksheet
- Ctrl+G now interrupts the current command again on MS windows
- Reduced the time windows in which wxMaxima blocks because it is
processing data
- Fixed a deadlock when closing the application while background
autocompletion tasks were running.
- Fixed a bug where finding an item in an output cell didn't trigger a
scroll to the found item.
- Fixed a bug where text from long output cells couldn't be selected
if the beginning of the cell was scrolled out of view (#2069)
- MS Windows: The "maxima is running" indicator should now work correctly
- HI-DPI improvements
- A few Autocompletion fixes
- Better SVGZ support
- Some fixes for selection of output
- Improved MathML and RTF output
- Big find-and-replace functionality additions
- A compiler supporting C++20 is required now
- Files opened by double-clicking now have a consistent layout
- Added more automatic tests and repaired others.
diff --git a/crosscompile-windows/wxmaxima/CMakeLists.txt b/crosscompile-windows/wxmaxima/CMakeLists.txt
index f378cc24c..5ed0beb25 100644
--- a/crosscompile-windows/wxmaxima/CMakeLists.txt
+++ b/crosscompile-windows/wxmaxima/CMakeLists.txt
@@ -10,9 +10,9 @@
# If no further patches are needed, you should get a
# updated setup-file automatically.
-set(WXMAXIMAVERSION "26.05.0")
+set(WXMAXIMAVERSION "26.06.0")
-set(WXMAXIMA_MD5 "345cd167eb9abb0d5f3b0595d10550b0")
+set(WXMAXIMA_MD5 "da5bfc60250bfae46bae2dac0947c4ac")
set(WXMAXIMA_URL "https://github.com/wxMaxima-developers/wxmaxima/archive/refs/tags/Version-${WXMAXIMAVERSION}.tar.gz")
-----------------------------------------------------------------------
Summary of changes:
crosscompile-windows/wxmaxima/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-07 15:52:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 03eb6bbde0ecb0c91897b22c047f36d30fbe8575 (commit)
via 59f0c7e15b69651271e8b9b94d8169eddd4ba9df (commit)
from a005a38fb4a72b946c86c2de1964b2776bc30775 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 03eb6bbde0ecb0c91897b22c047f36d30fbe8575
Author: David Scherfgen <d.s...@go...>
Date: Sun Jun 7 17:51:58 2026 +0200
Update change log to reflect all closed tickets after 5.49 release
diff --git a/ChangeLog b/ChangeLog
index 721b58853..f2498f3f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,16 +3,86 @@ Maxima 5.49-post change log
Bug fixes for numbered bugs:
----------------------------
+ * \#282 EZGCD: ratsimp((%i+2)/(%i+1)),gcd:ez inf loop
+ * \#895 limit x->inf sin(100/x)*x very slow
+ * \#1700 Lisp error in factor
+ * \#2140 integrate: needless nounform return
+ * \#2288 x^2<1 can't get x^2<2, but can get x^2<100
+ * \#2366 limit of gamma_incomplete
+ * \#3155 is(abs(cos(x))<=1) is unknown, but is(cos(x)<=1) and is(cos(x)>=-1) are true
+ * \#3386 documentation: assoc actually allows non-list arguments
+ * \#3826 limit returns temp variable expression
+ * \#4037 Error in symbolic integral
+ * \#4067 integrate(sqrt(u)/(sqrt(u-u*v)),u) --> expt: undefined: 0 to a negative exponent
+ * \#4085 limit((2-%i)^a/a!,a,inf);
+ * \#4236 Repeated run_testsuite leads to out of memory error
+ * \#4338 limit((1+%i)^(2*a)*2^(-a),x,inf) when logexpand is true
+ * \#4399 recent commit involving display2d breaks imaxima and drawdf
+ * \#4425 Frame_bracket fix in ctensor.mac
+ * \#4452 configure --disable-build-docs not working
+ * \#4457 simplus or great bug
+ * \#4517 Maxima crashes on repeated run of rtest_rules (SBCL 2.5.2)
+ * \#4558 Can't control matrix 2d print formatting
* \#4585 Taylor polynomials involving tangent & a quotient
+ * \#4592 integrate causes sign: argument cannot be imaginary error
+ * \#4623 gcfactor(4), expand(%%) => -4
+ * \#4630 expand not idempotent (simplus)
* \#4634 Divergent integral simplifies to -1/4 with simplify_sum
+ * \#4655 sign("foo") => Lisp error
+ * \#4656 lurkmathml broken
+ * \#4657 lurkmathml uses mfenced
+ * \#4658 factor should check that second argument is irreducible
+ * \#4661 gives bogus error message something about compile which i never asked it to do and hangs when it shouldn't
+ * \#4662 apply1 sets match to zero when instead the replacement is zero.
+ * \#4663 Bucket table for undeclared array keeps growing beyond 32768 buckets
+ * \#4664 verbify("!!")
+ * \#4667 rk_adpative test suite failure
+ * \#4669 non numeric value for factlim
+ * \#4671 build_info outputs extraneous empty lines
+ * \#4673 binomial(a,a-b) doesn't simplify to binomial(a,b)
+ * \#4677 Read should respect the batch_answers_from_file flag
+ * \#4678 deffnx in Texinfo leads to redundant items in documentation index
+ * \#4680 lurkmathml uses deprecated mathspace lengths
+ * \#4681 lurkmathml produces non-validating mathml
+ * \#4682 draw with terminal=epslatex_standalone generate faulty latex file
+ * \#4683 lurkmathml does not typeset z[2]^3 correctly
+ * \#4684 lurkmathml does not typeset x_1 correctly
+ * \#4688 sign(zeroa) should be pos
* \#4689 limit of a spherical_bessel_j function
+ * \#4690 inverse_erf(erf(x)) and erf(inverse_erf(x)) don't simplify to x, even if x is real
+ * \#4693 makelist completely fails with simp:false
+ * \#4694 lurkmathml does not know how to typeset box
+ * \#4695 tex output for an input label %i1 is inconsistent
+ * \#4697 Symbol $box being changed to mbox
+ * \#4698 alt-display breaks trace's output
+ * \#4699 displa, tex and lurkmathml display of partial derivatives is incorrect
+ * \#4703 Remove sys-proclaim stuff used by gcl
+ * \#4704 Fix dependencies in maxima.system and maxima.asd
+ * \#4707 No derivatives for gamma_incomplete_lower
+ * \#4710 lurkmathml does not know how to typeset del
+ * \#4711 Pretty-printer slightly incorrect output for 'product(...)
+ * \#4712 Circular dependencies in maxima.system
+ * \#4714 lurkmathml does not co-operate with ordergreat/less
+ * \#4715 rtest_gamma test with makelist(k!!, k, -1, 2) fails
+ * \#4717 limit(signum(exp(%i*x)*exp(x)),x,inf);
+ * \#4718 Restructure module translated packages
+ * \#4721 test-directory-cached is slow
* \#4724 xreduce with init arg and declared nary function
- * \#4729 rtest_limit.mac: Problem 230 (line 866)
+ * \#4728 Building German documentation fails with texinfo-7.3
+ * \#4729 rtest_limit.mac: Problem 230 (line 866)
+ * \#4730 ei-asymptotic-expansion
+ * \#4731 draw() does not work on new debian 13 installation
+ * \#4732 histogram incorrectly normalized when frequency = density
* \#4735 rtest_limit_gruntz problem 21, line 121 has sign error in expected limit
+ * \#4736 Taylor called on polygamma function with symbolic order
* \#4737 atan2 with bfloat arg(s) is inconsistent on negative x-axis
- * \#4740 limit(expintegral_e(3/4,-log(1-1/x))*(-log(1-1/x))^(1/4),x,inf)
+ * \#4739 ratsubst(0,exp(-x),2);
+ * \#4740 limit(expintegral_e(3/4,-log(1-1/x))*(-log(1-1/x))^(1/4),x,inf);
+ * \#4742 limit result contains "false"
* \#4747 limits of some exponential integrals when expintrep : gamma_incomplete
-
+ * \#4752 csign doesn't handle subscripted functions like li correctly
+ * \#4757 %e^2.0, %emode:false stays %e^2.0
+
Bug fixes for unnumbered bugs:
-----------------------------
* rtest_gruntz test #38
commit 59f0c7e15b69651271e8b9b94d8169eddd4ba9df
Author: David Scherfgen <d.s...@go...>
Date: Sun Jun 7 10:06:29 2026 +0200
Correct comments regarding simplified arguments for ADDK and TIMESK
The original comments for the functions ADDK and TIMESK stated that
"The arguments must not be simplified." This was likely a translation error
(a false friend from the German "müssen nicht"), meaning the arguments
"need not be simplified."
However, the code actually expects the arguments to be simplified (reduced, in
the case of Maxima rationals). Passing in unreduced rationals can result in
unreduced results or even errors, for example:
:lisp (TIMESK '((RAT) 4 -2) 1)
((RAT) 4 -2)
:lisp (ADDK '((BIGFLOAT SIMP 56) 1 1) '((RAT) 1 -1))
Maxima encountered a Lisp error:
The assertion (> EXTRA 1) failed with EXTRA = 0.
diff --git a/src/simp.lisp b/src/simp.lisp
index ff488a1ca..46f240f81 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -413,7 +413,7 @@
;;; ADDK adds two Maxima numbers and returns a simplified Maxima number.
;;; ADDK can be called in Lisp code, whenever the arguments are valid
;;; Maxima numbers, these are integer, float, Maxima rational, or
-;;; Maxima bigfloat numbers. The arguments must not be simplified. The
+;;; Maxima bigfloat numbers. The arguments must be simplified. The
;;; precision of a bigfloat result depends on the setting of the
;;; global variable $FPPREC. If the option variable $FLOAT is T, a
;;; Maxima rational number as a result is converted to a float number.
@@ -511,7 +511,7 @@
;;; TIMESK Multiplies two Maxima numbers and returns a simplified Maxima
;;; number. TIMESK can be called in Lisp code, whenever the arguments are
;;; valid Maxima numbers, these are integer, float, Maxima rational, or
-;;; Maxima bigfloat numbers. The arguments must not be simplified. The
+;;; Maxima bigfloat numbers. The arguments must be simplified. The
;;; precision of a bigfloat result depends on the setting of the
;;; global variable $FPPREC. If the option variable $FLOAT is T, a
;;; Maxima rational number as a result is converted to a float number.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
src/simp.lisp | 4 ++--
2 files changed, 75 insertions(+), 5 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-07 05:01:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via a005a38fb4a72b946c86c2de1964b2776bc30775 (commit)
via a84283151975c49a54e4be7a934c1aa8f306d76b (commit)
via 0465239815dda4c84b2c6e5e9e68ee2578601454 (commit)
via 9ca4afa79cb2c8bfb6f2b28f057b35ab4b24ea57 (commit)
via fe1ee8adcefca436cb10354fe4ca5775ddb3f00b (commit)
from c66d6a30289a13325c7b2879d6befe582c7558e3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a005a38fb4a72b946c86c2de1964b2776bc30775
Merge: a84283151 c66d6a302
Author: David Scherfgen <d.s...@go...>
Date: Sun Jun 7 07:01:21 2026 +0200
Merge branch 'master' of https://git.code.sf.net/p/maxima/code
commit a84283151975c49a54e4be7a934c1aa8f306d76b
Author: David Scherfgen <d.s...@go...>
Date: Sun Jun 7 07:01:09 2026 +0200
Fix thread-local storage (TLS) exhaustion on SBCL via symbol pooling
The pattern matching compiler generates and dynamically binds interned symbols
for each new rule. On SBCL, each such symbol permanently occupies a thread-local
storage (TLS) slot that can never be reclaimed even when the symbols get GC-ed.
Once the TLS is exhausted, e.g. after running the RTEST_RULES test multiple
times, Maxima crashes. Another problem is that the interned symbols can
increasingly bloat the package's symbol table.
This patch introduces a symbol pool (*RULE-SYMBOL-POOL*) to recycle symbols
of deleted rules:
- GET-RULE-SYMBOL draws from the pool or generates a new interned symbol.
- FREE-RULE-SYMBOLS "scrubs" symbols (MAKUNBOUND, FMAKUNBOUND, clearing property
list) before returning them to the pool.
- Rule compilation functions (PROC-$DEFRULE, PROC-$TELLSIMP, etc.) now track
symbols for each rule and attach a list of them to the rule's properties.
- Symbols are reclaimed when a rule is deleted (KILL1-ATOM) or overwritten,
or when rule compilation fails.
TLS consumption is now bounded by the concurrently existing rules rather than
the historical total, generally preventing the crash. The package's symbol table
no longer keeps growing.
This fixes bug #4517.
diff --git a/src/globals.lisp b/src/globals.lisp
index 316613cee..e76e0dc9a 100644
--- a/src/globals.lisp
+++ b/src/globals.lisp
@@ -1910,3 +1910,6 @@
(defmvar *preserve-direction* ()
"Makes `limit' return Direction info.")
+(defvar *rule-symbol-pool* nil
+ "List of symbols used by deleted rules, ready to be re-used in order to
+ prevent thread-local storage (TLS) exhaustion on SBCL.")
diff --git a/src/matcom.lisp b/src/matcom.lisp
index f9117232a..b68172415 100644
--- a/src/matcom.lisp
+++ b/src/matcom.lisp
@@ -18,10 +18,32 @@
(defmvar $announce_rules_firing nil)
+(defvar *current-rule-symbols* nil
+ "Serves as an accumulator for collecting symbols used by a rule while it's
+ being created.")
+
(defmspec $matchdeclare (form)
(let ((meta-prop-p nil))
(proc-$matchdeclare (cdr form))))
+(defun get-rule-symbol ()
+ "Generates a new interned symbol for the rule system or returns a recycled
+ existing one from the symbol pool (*RULE-SYMBOL-POOL*)."
+ (let ((sym (if *rule-symbol-pool*
+ (pop *rule-symbol-pool*)
+ (intern (symbol-name (gensym "RULE-SYMBOL-")) :maxima))))
+ (push sym *current-rule-symbols*)
+ sym))
+
+(defun free-rule-symbols (symbols)
+ "Frees the symbols SYMBOLS by clearing their values, functions and property lists,
+ then adding them to the symbol pool (*RULE-SYMBOL-POOL*) for recycling."
+ (dolist (sym symbols)
+ (makunbound sym)
+ (fmakunbound sym)
+ (setf (symbol-plist sym) nil)
+ (push sym *rule-symbol-pool*)))
+
(defun proc-$matchdeclare (x)
(if (oddp (length x))
(merror (intl:gettext "matchdeclare: must be an even number of arguments.")))
@@ -66,10 +88,10 @@
(defun makepreds (l gg)
(cond ((null l) nil)
(t (cons (cond ((atom (car l))
- (list 'lambda (list (setq gg (gensym)))
+ (list 'lambda (list (setq gg (get-rule-symbol)))
`(declare (special ,gg))
(getdec (car l) gg)))
- (t (defmatch1 (car l) (gensym))))
+ (t (defmatch1 (car l) (get-rule-symbol))))
(makepreds (cdr l) nil)))))
(defun defmatch1 (pt e)
@@ -313,6 +335,7 @@
(proc-$defmatch (cdr form))))
(defun proc-$defmatch (l)
+ (let (*current-rule-symbols*)
(prog (pt pt* args a boundlist reflist topreflist program name tem)
(setq name (car l))
(setq pt (copy-tree (setq pt* (simplify (cadr l)))))
@@ -325,6 +348,7 @@
(setq boundlist args)
(setq a (genref))
(cond ((atom (errset (compilematch a pt)))
+ (free-rule-symbols *current-rule-symbols*)
(merror (intl:gettext "defmatch: failed to compile match for pattern ~M") pt))
(t (meta-fset name
(list 'lambda
@@ -348,7 +372,9 @@
(t t))))))))
(meta-add2lnc name '$rules)
(meta-mputprop name (list '(mlist) pt* (cons '(mlist) args)) '$rule)
- (return name)))))
+ (free-rule-symbols (get name 'rule-symbols))
+ (putprop name *current-rule-symbols* 'rule-symbols)
+ (return name))))))
(defmspec $tellsimp (form)
(twoargcheck form)
@@ -361,6 +387,7 @@
do (setf (mget v 'rulenum) nil)))
(defun proc-$tellsimp (l)
+ (let (*current-rule-symbols*)
(prog (pt rhs boundlist reflist topreflist a program name tem
oldstuff pgname oname rulenum)
(setq pt (copy-tree (simplifya (car l) nil)))
@@ -374,6 +401,7 @@
(mtell (intl:gettext "tellsimp: warning: rule will treat '~M' as noncommutative and nonassociative.~%") name)))
(setq a (genref))
(cond ((atom (errset (compileeach a (cdr pt))))
+ (free-rule-symbols *current-rule-symbols*)
(merror (intl:gettext "tellsimp: failed to compile match for pattern ~M") (cdr pt))))
(setq oldstuff (get name 'operators))
(setq rulenum (mget name 'rulenum))
@@ -449,10 +477,12 @@
(list (get name 'operators))
'oldrules)))
(meta-putprop name pgname 'operators)
+ (free-rule-symbols (get pgname 'rule-symbols))
+ (putprop pgname *current-rule-symbols* 'rule-symbols)
(return (cons '(mlist)
(meta-mputprop name
(cons pgname (mget name 'oldrules))
- 'oldrules)))))
+ 'oldrules))))))
(defun %to$ (l) (cond ((eq (car l) '%) (rplaca l '$)) (l)))
@@ -463,6 +493,7 @@
(proc-$tellsimpafter (cdr form))))
(defun proc-$tellsimpafter (l)
+ (let (*current-rule-symbols*)
(prog (pt rhs boundlist reflist topreflist a program name oldstuff plustimes pgname oname tem
rulenum my*afterflag)
(setq pt (copy-tree (simplifya (car l) nil)))
@@ -474,8 +505,9 @@
(merror (intl:gettext "tellsimpafter: main operator of pattern must not be match variable; found: ~A") (fullstrip1 (getop name)))))
(setq a (genref))
(setq plustimes (member name '(mplus mtimes) :test #'eq))
- (if (atom (if plustimes (errset (compilematch a pt))
+ (when (atom (if plustimes (errset (compilematch a pt))
(errset (compileeach a (cdr pt)))))
+ (free-rule-symbols *current-rule-symbols*)
(merror (intl:gettext "tellsimpafter: failed to compile match for pattern ~M") (cdr pt)))
(setq oldstuff (get name 'operators))
(setq rulenum (mget name 'rulenum))
@@ -483,7 +515,7 @@
(setq oname (getop name))
(setq pgname (implode (append (%to$ (explodec oname))
'(|r| |u| |l| |e|) (mexploden rulenum))))
- (setq my*afterflag (gensym "*AFTERFLAG-"))
+ (setq my*afterflag (get-rule-symbol))
(proclaim `(special ,my*afterflag))
(setf (symbol-value my*afterflag) nil)
(meta-mputprop pgname name 'ruleof)
@@ -537,10 +569,12 @@
(cond ((null (mget name 'oldrules))
(meta-mputprop name (list (get name 'operators)) 'oldrules)))
(meta-putprop name pgname 'operators)
+ (free-rule-symbols (get pgname 'rule-symbols))
+ (putprop pgname *current-rule-symbols* 'rule-symbols)
(return (cons '(mlist)
(meta-mputprop name
(cons pgname (mget name 'oldrules))
- 'oldrules)))))
+ 'oldrules))))))
(defun announce-rule-firing (rulename expr simplified-expr)
(let (($display2d nil) ($stringdisp nil))
@@ -553,6 +587,7 @@
;;(defvar *match-specials* nil);;Hell lets declare them all special, its safer--wfs
(defun proc-$defrule (l)
+ (let (*current-rule-symbols*)
(prog (pt rhs boundlist reflist topreflist name a program lhs* rhs* tem)
(if (not (= (length l) 3)) (wna-err '$defrule))
(setq name (car l))
@@ -562,6 +597,7 @@
(setq rhs (copy-tree (setq rhs* (simplify (caddr l)))))
(setq a (genref))
(cond ((atom (errset (compilematch a pt)))
+ (free-rule-symbols *current-rule-symbols*)
(merror (intl:gettext "defrule: failed to compile match for pattern ~M") pt))
(t (meta-fset name
(list 'lambda
@@ -585,7 +621,9 @@
(meta-add2lnc name '$rules)
(meta-mputprop name (setq l (list '(mequal) lhs* rhs*)) '$rule)
(meta-mputprop name '$defrule '$ruletype)
- (return (list '(msetq) name (cons '(marrow) (cdr l))))))))
+ (free-rule-symbols (get name 'rule-symbols))
+ (putprop name *current-rule-symbols* 'rule-symbols)
+ (return (list '(msetq) name (cons '(marrow) (cdr l)))))))))
; GETDEC constructs an expression of the form ``if <match> then <assign value> else <match failed>''.
@@ -698,7 +736,7 @@
(defun genref nil
(prog (a)
- (setq a (tr-gensym))
+ (setq a (get-rule-symbol))
(setq topreflist (cons a topreflist))
(return (car (setq reflist (cons a reflist))))))
(defun compileeach (elist plist)
diff --git a/src/suprv1.lisp b/src/suprv1.lisp
index 7f2b5f433..ef1ed84af 100644
--- a/src/suprv1.lisp
+++ b/src/suprv1.lisp
@@ -206,6 +206,8 @@
(when (member x (cdr $contexts) :test #'equal)
($killcontext x))
(when (mget x '$rule)
+ (free-rule-symbols (get x 'rule-symbols))
+ (remprop x 'rule-symbols)
(let ((y (ruleof x)))
(cond (y ($remrule y x))
(t (when (not (member x *builtin-$rules* :test #'equal))
commit 0465239815dda4c84b2c6e5e9e68ee2578601454
Author: David Scherfgen <d.s...@go...>
Date: Sat Jun 6 16:56:02 2026 +0200
In SIMPEXPT, don't use (EQUAL POT *BIGFLOATONE*)
This doesn't work correctly when POT's precision is not the current precision.
At this place it's already clear that its value is 1, so it's sufficient to test
whether it's actually a bigfloat.
diff --git a/src/simp.lisp b/src/simp.lisp
index cc9570091..ff488a1ca 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -2215,7 +2215,7 @@
;; A numeric constant like %e, %pi, ... and
;; exponent is a float or bigfloat value.
(return (if (and (member gr *builtin-numeric-constants*)
- (equal pot *bigfloatone*))
+ ($bfloatp pot))
;; Return a bigfloat value.
($bfloat gr)
;; Return a float value.
commit 9ca4afa79cb2c8bfb6f2b28f057b35ab4b24ea57
Author: David Scherfgen <d.s...@go...>
Date: Sat Jun 6 16:35:48 2026 +0200
In $BFLOAT, use (ZEROP1 X) instead of (EQUAL X *BIGFLOATZERO*)
The latter doesn't work correctly when X's precision is not the current
precision.
diff --git a/src/float.lisp b/src/float.lisp
index ec3480c9c..6bd07bff7 100644
--- a/src/float.lisp
+++ b/src/float.lisp
@@ -728,7 +728,7 @@
;; that and signal a domain error if so. There
;; are no other bfloat values where tan(x) or
;; sin(x) is zero.
- (when (equal (second x) *bigfloatzero*)
+ (when (zerop1 (second x))
(domain-error (second x) (caar x)))
(invertbigfloat
($bfloat (list (ncons (safe-get (caar x) 'recip)) y))))
commit fe1ee8adcefca436cb10354fe4ca5775ddb3f00b
Author: David Scherfgen <d.s...@go...>
Date: Sat Jun 6 16:27:50 2026 +0200
Fix %emode = false incorrectly preventing %e^2.0 from being simplified to float
This fixes bug #4757.
diff --git a/src/simp.lisp b/src/simp.lisp
index 78bc48e1b..cc9570091 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -2224,7 +2224,6 @@
(return (exptrl gr pot)))))
((eq gr '$%e)
;; Numerically evaluate if the power is a flonum.
- (when $%emode
(let ((val (flonum-eval '%exp pot)))
(when (float-inf-p val)
;; needed for gcl and sbcl - (sometimes) no trap of overflow
@@ -2242,7 +2241,7 @@
((or ($bfloatp x) ($bfloatp y))
(let ((z (add ($bfloat x) (mul '$%i ($bfloat y)))))
(setq z ($rectform `((mexpt simp) $%e ,z)))
- (return ($bfloat z))))))))
+ (return ($bfloat z)))))))
(cond ((and $logsimp (among '%log pot)) (return (%etolog pot)))
((and $demoivre (setq z (demoivre pot))) (return z))
((and $%emode
diff --git a/tests/rtest16.mac b/tests/rtest16.mac
index c54f5ddcc..7f35b42b4 100644
--- a/tests/rtest16.mac
+++ b/tests/rtest16.mac
@@ -3384,6 +3384,20 @@ sublist
kill(x);
done;
+/* Bug #4757: "%e^2.0, %emode:false stays %e^2.0" */
+
+%e^2.0, %emode: true;
+7.38905609893065;
+
+%e^2.0, %emode: false;
+7.38905609893065;
+
+%e^(%i*%pi), %emode: true;
+-1;
+
+string(%e^(%i*%pi)), %emode: false;
+"%e^(%i*%pi)";
+
/* Leave this at the end of the file! */
-----------------------------------------------------------------------
Summary of changes:
src/float.lisp | 2 +-
src/globals.lisp | 3 +++
src/matcom.lisp | 56 ++++++++++++++++++++++++++++++++++++++++++++++---------
src/simp.lisp | 5 ++---
src/suprv1.lisp | 2 ++
tests/rtest16.mac | 14 ++++++++++++++
6 files changed, 69 insertions(+), 13 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: vttoth <vt...@us...> - 2026-06-06 21:58:38
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via c66d6a30289a13325c7b2879d6befe582c7558e3 (commit)
via e0591ae0c02830bf25d15714ef6ea550590dc476 (commit)
via 3d5e01d29ff2938a52fd90539aabff150cccc305 (commit)
from 7d2076343db52ef9f20fdef7e290b421ba525454 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c66d6a30289a13325c7b2879d6befe582c7558e3
Author: Viktor T. Toth <vt...@vt...>
Date: Sat Jun 6 16:48:54 2026 -0400
Removed stale folder reference from RPM spec file
diff --git a/maxima.spec.in b/maxima.spec.in
index bba196c0e..7efada7f3 100644
--- a/maxima.spec.in
+++ b/maxima.spec.in
@@ -229,8 +229,8 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/icons
%{_datadir}/mime
%{_datadir}/metainfo/
-%dir %{_libexecdir}/maxima
-%{_libexecdir}/maxima/*
+# %dir %{_libexecdir}/maxima
+# %{_libexecdir}/maxima/*
%{_infodir}/*
%exclude %{_infodir}/xmaxima.info*
%if %{enable_lang_es}
commit e0591ae0c02830bf25d15714ef6ea550590dc476
Author: Viktor T. Toth <vt...@vt...>
Date: Sat Jun 6 16:48:28 2026 -0400
Added rk_adaptive.texi to info build
diff --git a/doc/info/Makefile.am b/doc/info/Makefile.am
index 3259d0ddb..417b1f766 100644
--- a/doc/info/Makefile.am
+++ b/doc/info/Makefile.am
@@ -44,9 +44,9 @@ maxima_TEXINFOS = include-maxima.texi category-macros.texi Introduction.texi \
lapack.texi levin.texi lbfgs.texi lindstedt.texi linearalgebra.texi lsquares.texi \
minpack.texi makeOrders.texi mnewton.texi numericalio.texi opsubst.texi \
operatingsystem.texi orthopoly.texi pytranslate.texi quantum_computing.texi \
- ratpow.texi romberg.texi simplex.texi simplifications.texi solve_rec.texi \
- stats.texi stirling.texi stringproc.texi to_poly_solve.texi unit.texi \
- zeilberger.texi errormessages.texi commandline-options.texi \
+ ratpow.texi rk_adaptive.texi romberg.texi simplex.texi simplifications.texi \
+ solve_rec.texi stats.texi stirling.texi stringproc.texi to_poly_solve.texi \
+ unit.texi zeilberger.texi errormessages.texi commandline-options.texi \
pslq.texi trigtools.texi format.texi
figurefiles = $(wildcard figures/*.png)
commit 3d5e01d29ff2938a52fd90539aabff150cccc305
Author: Viktor T. Toth <vt...@vt...>
Date: Sat Jun 6 16:47:36 2026 -0400
Removed stale reference from Windows build
diff --git a/crosscompile-windows/Makefile.am b/crosscompile-windows/Makefile.am
index 639fbc7fe..1d4ee3ed5 100644
--- a/crosscompile-windows/Makefile.am
+++ b/crosscompile-windows/Makefile.am
@@ -10,4 +10,4 @@ EXTRA_DIST =\
gnuplot/CMakeLists.txt sbcl/CMakeLists.txt tcltk/CMakeLists.txt abcl/CMakeLists.txt ccl/CMakeLists.txt\
vtk/CMakeLists.txt wine/CMakeLists.txt wxmaxima/CMakeLists.txt wxwidgets/CMakeLists.txt\
texinfo/CMakeLists.txt maxima_longnames.c clisp/CMakeLists.txt \
- ecl/strm_os.d ecl/CMakeLists.txt winlibs/CMakeLists.txt
+ ecl/strm_os.d ecl/CMakeLists.txt
-----------------------------------------------------------------------
Summary of changes:
crosscompile-windows/Makefile.am | 2 +-
doc/info/Makefile.am | 6 +++---
maxima.spec.in | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: vttoth <vt...@us...> - 2026-06-05 23:39:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 7d2076343db52ef9f20fdef7e290b421ba525454 (commit)
from 6f964815a3c43b118de53d80ee68ad54daf5c032 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7d2076343db52ef9f20fdef7e290b421ba525454
Author: Viktor T. Toth <vt...@vt...>
Date: Fri Jun 5 19:38:47 2026 -0400
Added another generate .tex file to .gitignore
diff --git a/.gitignore b/.gitignore
index 5a251cc2d..41c391436 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,5 +42,6 @@ src/tools
gp_image_01.png
interfaces/emacs/imaxima/texinfo.tex
+interfaces/emacs/imaxima/doc/texinfo.tex
auto/
/build-html-index.log
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 1 +
1 file changed, 1 insertion(+)
hooks/post-receive
--
Maxima CAS
|
|
From: <ap...@us...> - 2026-06-04 15:51:18
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 6f964815a3c43b118de53d80ee68ad54daf5c032 (commit)
from 909aa61d7716451bf9061aeb57ef2cf43808a84b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6f964815a3c43b118de53d80ee68ad54daf5c032
Author: Robert Dodier <rob...@so...>
Date: Thu Jun 4 08:43:05 2026 -0700
Package ezunits: call sublis instead of subst in the macro "dimensionally",
which resolves a bug reported to maxima-discuss 2026-06-01, "Solving Equation with Ezunits Problem".
sublist makes substitutions in parallel, while subst makes them in sequence;
subst calls SIMPLIFYA between one substitution and the next.
The result was that subst was creating an expression of the form (a`foo + b`bar)`baz
which is handled incorrectly by "``" -- now the result is a`foo*baz + b`bar*baz,
which is handled correctly.
Another way to resolve this would be to make "`" distribute over "+" --
might want to do that too. In any event, parallel substitution makes
more sense than serial, since the substitutions are independent.
diff --git a/share/ezunits/ezunits_functions.mac b/share/ezunits/ezunits_functions.mac
index bf99a637a..2756f8dcf 100644
--- a/share/ezunits/ezunits_functions.mac
+++ b/share/ezunits/ezunits_functions.mac
@@ -642,8 +642,8 @@ dimensionally (e%) ::=
units_gensyms : make_array ('hashed),
unitless_args : applyb1 (e%_args, rununitify),
reunitification_eqs : map (lambda ([e], lhs (e) = 1 ` rhs (e)), inverse_gensym_map (units_gensyms)),
- reunitified : subst (reunitification_eqs, apply (e%_op, unitless_args)),
- rezeroified : subst (makelist (x = 0, x, listarray (qtys_gensyms)), reunitified),
+ reunitified : sublis (reunitification_eqs, apply (e%_op, unitless_args)),
+ rezeroified : sublis (makelist (x = 0, x, listarray (qtys_gensyms)), reunitified),
killcontext (context_name),
rezeroified));
diff --git a/share/ezunits/rtest_ezunits_mroz_examples.mac b/share/ezunits/rtest_ezunits_mroz_examples.mac
index 894958284..f624b0a98 100644
--- a/share/ezunits/rtest_ezunits_mroz_examples.mac
+++ b/share/ezunits/rtest_ezunits_mroz_examples.mac
@@ -50,3 +50,23 @@ true;
e6h: approximately_equal (e6g, 0.0031 ` (1/nF), 0.00005));
true;
+/* maxima-discuss 2026-06-01, "Solving Equation with Ezunits Problem" */
+
+(R_1: 1 `kOhm,
+ R_2: 100 `Ohm,
+ V_1: 10 `V,
+ I: 3/2 `mA,
+ expr: V_1 = (R_1 + R_2) * I + V_2);
+10 ` V=V_2+(3/2 ` mA)*(100 ` Ohm+1 ` kOhm);
+
+foo1: solve(expr, V_2)[1];
+V_2=10 ` V+-(3/2) ` kOhm*mA+-150 ` Ohm*mA;
+
+rhs(foo1) ``V;
+167/20 ` V;
+
+foo2: dimensionally(solve(expr, V_2))[1];
+V_2 = -((300 ` Ohm*mA+3 ` kOhm*mA+(-20) ` V)/2);
+
+rhs(foo2) ``V;
+167/20 ` V;
-----------------------------------------------------------------------
Summary of changes:
share/ezunits/ezunits_functions.mac | 4 ++--
share/ezunits/rtest_ezunits_mroz_examples.mac | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: dgildea <dg...@us...> - 2026-06-04 15:45:22
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 909aa61d7716451bf9061aeb57ef2cf43808a84b (commit)
from 258d3ea3119dc8e8905b36a55e5e43875dae112c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 909aa61d7716451bf9061aeb57ef2cf43808a84b
Author: Dan Gildea <dgildea>
Date: Thu Jun 4 11:43:47 2026 -0400
time test case with elapsed_real_time rather than absolute_real_time
absolute_real_time returns an integer number of seconds - test can
fail if it happens to run just when the second counter ticks over.
diff --git a/tests/rtest_limit.mac b/tests/rtest_limit.mac
index 9597f128d..0736112ce 100644
--- a/tests/rtest_limit.mac
+++ b/tests/rtest_limit.mac
@@ -980,11 +980,11 @@ limit(signum(x)*x/sin(x),x,0);
ind;
/* #895 limit x->inf sin(100/x)*x very slow */
-block([start : absolute_real_time()],
+block([start : elapsed_real_time()],
[limit(sin(100/x)*x,x,inf),
limit(sin(10000/x)*x,x,inf),
limit(sin(10000000/x)*x,x,inf),
- is(absolute_real_time()-start < 1)]);
+ is(elapsed_real_time()-start < 1)]);
[100, 10000, 10000000, true]$
/* #4273 limit(integrate(f(x)*g(x), x), x, a) incorrect results */
-----------------------------------------------------------------------
Summary of changes:
tests/rtest_limit.mac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-04 14:02:00
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 258d3ea3119dc8e8905b36a55e5e43875dae112c (commit)
via bf68bd4f0202ef62779e85cfc250caa807414a4e (commit)
via 0e821f6dc137b0b8dfb535535a2f449a7443d03b (commit)
via e9b7facad93187e27f9bb47fbcd012f3a46db8c4 (commit)
via cdc692133acd87c1a7a7326e8cac2f3e4fe8a437 (commit)
via dfa0b6421abd41e5ae881a25b6e791d0fd53e758 (commit)
via 0fbcb131dac743749f4efa55ee018afad7a60e31 (commit)
via 6e1bf83117dd65e8bda4868286acbb5ffb89dfaf (commit)
from 1eed9421451526999df0e72682ba30d3add12ac4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 258d3ea3119dc8e8905b36a55e5e43875dae112c
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 15:56:57 2026 +0200
SIMPCHECK: first simplify (if necessary), then disrep special representations
SIMPCHECK's task is to return a simplified expression in general form.
However, it had a flaw in its logic: It first checked if the original, possibly
unsimplified expression was in special representation. If yes, it would convert
it to general form and return it.
For expressions in top-level general form, it would call SIMPLIFYA if required.
But it would not check if the result of that simplification was in general form.
When the simplification resulted in a special form, this could trigger an error:
:lisp (simplifya '((%sin) ((mplus) ((mrat simp) 1 . 1) ((mrat simp) 1 . 1))) nil)
Maxima encountered a Lisp error:
GREAT: internal error: unexpected MRAT argument
The %SIN simplifier uses SIMPCHECK on its argument. SIMPCHECK sees an MPLUS
expression, which is a general form. It simplifies it, but since its terms are
CRE forms (MRAT), the result is also a CRE. SIMPCHECK doesn't notice this,
and so the %SIN simplifier tries to work with a CRE. Since it rightfully
expected a general form, it causes an error while manipulating its argument.
diff --git a/src/simp.lisp b/src/simp.lisp
index 42726f8f8..78bc48e1b 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -105,12 +105,14 @@
(defun sratsimp (e) (simplifya ($ratsimp e) nil))
(defun simpcheck (e flag)
- (cond ((specrepp e) (specdisrep e))
- (flag e)
- (t (let (($%enumer $numer))
- ;; Switch $%enumer on, when $numer is TRUE to allow
- ;; simplification of $%e to its numerical value.
- (simplifya e nil)))))
+ (let ((e (if flag
+ e
+ ;; Switch $%enumer on, when $numer is TRUE to allow
+ ;; simplification of $%e to its numerical value.
+ (let (($%enumer $numer)) (simplifya e nil)))))
+ (if (specrepp e)
+ (specdisrep e)
+ e)))
(defun mratcheck (e) (if ($ratp e) (ratdisrep e) e))
commit bf68bd4f0202ef62779e85cfc250caa807414a4e
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 15:22:50 2026 +0200
SIMPMATRIX: simplify arguments (if necessary) before inspecting them
Bug demo:
scalarmatrixp : all$
:lisp (simplifya '((%matrix) ((mplus) ((mlist) 1) ((mlist) 1))) nil)
((%MATRIX SIMP) ((MLIST SIMP) 2))
... but it should be simply 2.
This is caused by SIMPMATRIX checking for the $SCALARMATRIXP case before making
sure that the arguments are simplified.
diff --git a/src/simp.lisp b/src/simp.lisp
index 8e8f5e88b..42726f8f8 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -2712,15 +2712,15 @@
(defun simpmatrix (x vestigial z)
(declare (ignore vestigial))
+ (let ((x (cons (car x) (simpmap (cdr x) z))))
(if (and (null (cddr x))
$scalarmatrixp
(or (eq $scalarmatrixp '$all) (member 'mult (cdar x)))
($listp (cadr x)) (cdadr x) (null (cddadr x)))
- (if z (cadadr x) (simplifya (cadadr x) nil))
- (let ((badp (dolist (row (cdr x)) (if (not ($listp row)) (return t))))
- (args (simpmap (cdr x) z)))
- (if (and args (not badp)) (matcheck args))
- (cons (if badp '(%matrix simp) '($matrix simp)) args))))
+ (cadadr x)
+ (let ((badp (dolist (row (cdr x)) (if (not ($listp row)) (return t)))))
+ (if (and (cdr x) (not badp)) (matcheck (cdr x)))
+ (cons (if badp '(%matrix simp) '($matrix simp)) (cdr x))))))
(defun %itopot (pot)
(if (fixnump pot)
commit 0e821f6dc137b0b8dfb535535a2f449a7443d03b
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 14:29:16 2026 +0200
Fix argument simplification in SIMP-EXP
Previously, SIMP-EXP would just return $E^ARG without calling the simplifier
on that expression, when the Z argument indicated that the argument is already
simplified.
(Sorry for probably introducing this bug and the one in SIMP-SQRT a couple of
years ago while hunting for simplifiers that ignore the Z argument.)
diff --git a/src/simp.lisp b/src/simp.lisp
index fef647bab..8e8f5e88b 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -1689,9 +1689,10 @@
(defprop %exp simp-exp operators)
(defun simp-exp (x y z)
+ (declare (ignore y))
(oneargcheck x)
- (setq y (list '(mexpt) '$%e (cadr x)))
- (if z y (simplifya y nil)))
+ (let ((arg (if z (cadr x) (simplifya (cadr x) nil))))
+ (simplifya (list '(mexpt) '$%e arg) t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
commit e9b7facad93187e27f9bb47fbcd012f3a46db8c4
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 14:23:08 2026 +0200
In SIMPQUOT, don't compare bigfloat denominator to *BIGFLOATZERO*
If the denominator has a different precision than the current one,
it can be zero, but not equal to *BIGFLOATZERO*.
diff --git a/src/simp.lisp b/src/simp.lisp
index aa1e2e883..fef647bab 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -1295,7 +1295,7 @@
(/ num den))
((and (floatp num) (floatp den) #-ieee-floating-point (not (zerop den)))
(/ num den))
- ((and ($bfloatp num) ($bfloatp den) (not (equal *bigfloatzero* den)))
+ ((and ($bfloatp num) ($bfloatp den) (not (zerop (cadr den))))
;; Call BIGFLOATP to ensure that arguments have same precision.
;; Otherwise FPQUOTIENT could return a spurious value.
(bcons (fpquotient (cdr (bigfloatp num)) (cdr (bigfloatp den)))))
commit cdc692133acd87c1a7a7326e8cac2f3e4fe8a437
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 13:24:42 2026 +0200
Minor change: in SIMP-SQRT, let ARG be the simplified argument
diff --git a/src/simp.lisp b/src/simp.lisp
index 47fe3ebb7..aa1e2e883 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -1277,8 +1277,8 @@
(defun simp-sqrt (x y z)
(declare (ignore y))
(oneargcheck x)
- (let ((arg (cadr x)))
- (simplifya (list '(mexpt) (if z arg (simplifya arg nil)) '((rat simp) 1 2)) t)))
+ (let ((arg (if z (cadr x) (simplifya (cadr x) nil))))
+ (simplifya (list '(mexpt) arg '((rat simp) 1 2)) t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
commit dfa0b6421abd41e5ae881a25b6e791d0fd53e758
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 13:23:19 2026 +0200
Optimize SIMPQUOT (simplifier of /) by pre-simplifying arguments
Previously, SIMPQUOT applied its numeric fast-paths (INTEGERP, NUMBERP, etc.)
to the raw, unsimplified arguments. As a result, expressions that dynamically
evaluated to numbers (e.g., (1+1)/2) bypassed native Lisp division and were
routed through the heavy algebraic simplifier via MTIMES and MEXPT.
Furthermore, the fallback branch redundantly simplified the -1 exponent.
This commit refactors the logic to pre-simplify the numerator and denominator
up front and using local variables, yielding the following benefits:
1. More expressions successfully hit the O(1) native Lisp numeric division
fast-paths.
2. The algebraic fallback branch now correctly passes the T flag to SIMPLIFYA
when constructing DEN^(-1) and NUM * DEN^(-1), avoiding redundant traversal
of the already-simplified arguments.
3. More readable code and size reduction of the compiled function.
Note: Because many floating-point divisions now correctly execute via native
hardware division (A / B) rather than reciprocal multiplication (A * B^(-1)),
this introduces a small IEEE 754 precision shift. This required an update to the
expected output in a test involving heavy float math.
diff --git a/share/stats/rtest_stats.mac b/share/stats/rtest_stats.mac
index 335c1f110..3a1de7cb1 100644
--- a/share/stats/rtest_stats.mac
+++ b/share/stats/rtest_stats.mac
@@ -113,42 +113,34 @@ inference_result("SHAPIRO - WILK TEST",
z:simple_linear_regression(matrix([125,140.7],[130,155.1],[135,160.3],[140,167.2],[145,169.8]),
'conflevel=0.99);
inference_result("SIMPLE LINEAR REGRESSION",
- [[model,1.405999999999985*x-31.18999999999804],
- [means,[135.0,158.62]],
- [variances,[50.0,106.9896000000008]],
- [correlation,.9611685255255155],
- [adc,.8984599126145604],
- [a_estimation,-31.18999999999804],
- [a_conf_int,[-215.2179151598772,152.8379151598812]],
- [b_estimation,1.405999999999985],
- [b_conf_int,[.04469633662525307,2.767303663374718]],
- [hypotheses,"H0: b = 0 ,H1: b # 0"],
- [statistic,6.032686683658114],
- [distribution,[student_t,3]],
- [p_value,.009131954735741799],
- [v_estimation,13.57966666666665],
- [v_conf_int,[3.173274925102496,568.0143894218797]],
- [cond_mean_conf_int,
- [1.405999999999985*x
- -21.52410081697646*(0.004*(135.0-x)^2+0.2)^0.5
- -31.18999999999804,
- 1.405999999999985*x
- +21.52410081697646*(0.004*(135.0-x)^2+0.2)^0.5
- -31.18999999999804]],
- [new_pred_conf_int,
- [1.405999999999985*x
- -21.52410081697646*(0.004*(135.0-x)^2+1.2)^0.5
- -31.18999999999804,
- 1.405999999999985*x
- +21.52410081697646*(0.004*(135.0-x)^2+1.2)^0.5
- -31.18999999999804]],
- [residuals,
- [[144.5600000000001,-3.860000000000156],
- [151.5900000000001,3.509999999999906],
- [158.62,1.680000000000007],
- [165.6499999999999,1.550000000000068],
- [172.6799999999999,-2.879999999999853]]]],
- [1,4,14,9,10,11,12,13]);
+ [[model,1.4059999999999855*x-31.189999999998037],
+ [means,[135.0,158.62]],
+ [variances,[50.0,106.98960000000079]],
+ [correlation,0.9611685255255155],
+ [adc,0.8984599126145604],
+ [a_estimation,-31.189999999998037],
+ [a_conf_int,[-215.21791515987724,152.83791515988116]],
+ [b_estimation,1.4059999999999855],
+ [b_conf_int,[0.044696336625253075,2.767303663374718]],
+ [hypotheses,"H0: b = 0 ,H1: b # 0"],
+ [statistic,6.032686683658114],
+ [distribution,[student_t,3]],
+ [p_value,0.009131954735741799],
+ [v_estimation,13.579666666666645],
+ [v_conf_int,[3.173274925102496,568.0143894218797]],
+ [cond_mean_conf_int,
+ [1.4059999999999855*x-21.524100816976457*sqrt(0.004*(135.0-x)^2+0.2)-31.189999999998037,
+ 1.4059999999999855*x+21.524100816976457*sqrt(0.004*(135.0-x)^2+0.2)-31.189999999998037]],
+ [new_pred_conf_int,
+ [1.4059999999999855*x-21.524100816976457*sqrt(0.004*(135.0-x)^2+1.2)-31.189999999998037,
+ 1.4059999999999855*x+21.524100816976457*sqrt(0.004*(135.0-x)^2+1.2)-31.189999999998037]],
+ [residuals,
+ [[144.56000000000014,-3.8600000000001558],
+ [151.5900000000001,3.5099999999999056],
+ [158.62,1.6800000000000068],
+ [165.64999999999992,1.5500000000000682],
+ [172.67999999999986,-2.8799999999998533]]]],
+ [1,4,14,9,10,11,12,13]);
diff --git a/src/simp.lisp b/src/simp.lisp
index 27536f5f4..47fe3ebb7 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -1285,20 +1285,25 @@
;;; Simplification of the "/" operator.
(defun simpquot (x y z)
+ (declare (ignore y))
(twoargcheck x)
- (cond ((and (integerp (cadr x)) (integerp (caddr x)) (not (zerop (caddr x))))
- (*red (cadr x) (caddr x)))
- ((and (numberp (cadr x)) (numberp (caddr x)) (not (zerop (caddr x))))
- (/ (cadr x) (caddr x)))
- ((and (floatp (cadr x)) (floatp (caddr x)) #-ieee-floating-point (not (zerop (caddr x))))
- (/ (cadr x) (caddr x)))
- ((and ($bfloatp (cadr x)) ($bfloatp (caddr x)) (not (equal *bigfloatzero* (caddr x))))
+ (let ((num (if z (cadr x) (simplifya (cadr x) nil)))
+ (den (if z (caddr x) (simplifya (caddr x) nil))))
+ (cond ((and (integerp num) (integerp den) (not (zerop den)))
+ (*red num den))
+ ((and (numberp num) (numberp den) (not (zerop den)))
+ (/ num den))
+ ((and (floatp num) (floatp den) #-ieee-floating-point (not (zerop den)))
+ (/ num den))
+ ((and ($bfloatp num) ($bfloatp den) (not (equal *bigfloatzero* den)))
;; Call BIGFLOATP to ensure that arguments have same precision.
;; Otherwise FPQUOTIENT could return a spurious value.
- (bcons (fpquotient (cdr (bigfloatp (cadr x))) (cdr (bigfloatp (caddr x))))))
- (t (setq y (if z (cadr x) (simplifya (cadr x) nil)))
- (setq x (simplifya (list '(mexpt) (caddr x) -1) z))
- (if (equal y 1) x (simplifya (list '(mtimes) y x) t)))))
+ (bcons (fpquotient (cdr (bigfloatp num)) (cdr (bigfloatp den)))))
+ (t
+ (let ((inv-den (simplifya (list '(mexpt) den -1) t)))
+ (if (equal num 1)
+ inv-den
+ (simplifya (list '(mtimes) num inv-den) t)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
commit 0fbcb131dac743749f4efa55ee018afad7a60e31
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 12:35:19 2026 +0200
In new SIMP-SQRT, add (DECLARE (IGNORE Y)) to prevent warning
diff --git a/src/simp.lisp b/src/simp.lisp
index 468e7b2ed..27536f5f4 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -1275,6 +1275,7 @@
(defprop %sqrt simp-sqrt operators)
(defun simp-sqrt (x y z)
+ (declare (ignore y))
(oneargcheck x)
(let ((arg (cadr x)))
(simplifya (list '(mexpt) (if z arg (simplifya arg nil)) '((rat simp) 1 2)) t)))
commit 6e1bf83117dd65e8bda4868286acbb5ffb89dfaf
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 12:19:22 2026 +0200
Fix argument simplification in SIMP-SQRT
Previously, SIMP-SQRT would just return ARG^(1/2) without calling the simplifier
on that expression, when the Z argument indicated that the arguments are already
simplified:
(SIMPLIFYA '((%SQRT) ((MEXPT SIMP) $X 3)) T)
-> ((MEXPT) ((MEXPT SIMP) $X 3) ((RAT SIMP) 1 2)),
which is (x^3)^(1/2), not the correct result of x^(3/2)
diff --git a/src/simp.lisp b/src/simp.lisp
index 08355c9bf..468e7b2ed 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -1276,8 +1276,8 @@
(defun simp-sqrt (x y z)
(oneargcheck x)
- (setq y (list '(mexpt) (cadr x) '((rat simp) 1 2)))
- (if z y (simplifya y nil)))
+ (let ((arg (cadr x)))
+ (simplifya (list '(mexpt) (if z arg (simplifya arg nil)) '((rat simp) 1 2)) t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-----------------------------------------------------------------------
Summary of changes:
share/stats/rtest_stats.mac | 64 ++++++++++++++++++++-------------------------
src/simp.lisp | 61 ++++++++++++++++++++++++------------------
2 files changed, 63 insertions(+), 62 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-04 09:39:19
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 1eed9421451526999df0e72682ba30d3add12ac4 (commit)
from 43a9362220b09efe83ce48d7a959b2ab0fe8b368 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1eed9421451526999df0e72682ba30d3add12ac4
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 11:33:37 2026 +0200
Optimize SIMPARGS for lists (MLIST) and equations (MEQUAL)
Previously, when SIMPARGS processed a list (MLIST) or equation (MEQUAL), it
would call SIMPLIFYA on each element without making use of the "arguments
already simplified" flag (Y).
With this patch, lists and equations with arguments already simplified are
passed directly to EQTEST, while those with unsimplified arguments have their
arguments processed by SIMPLIFY.
For non-lists and non-equations, the original behavior of feeding the arguments
through SIMPCHECK (via SIMPMAP) remains identical.
diff --git a/src/simp.lisp b/src/simp.lisp
index 6cff86841..08355c9bf 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -384,12 +384,19 @@
(twoargcheck x))
(if (and (member 'array (cdar x)) (null (margs x)))
(merror (intl:gettext "SIMPARGS: subscripted variable found with no subscripts.")))
- (eqtest (let ((flag (member (caar x) '(mlist mequal))))
- (cons (ncons (caar x))
- (mapcar #'(lambda (u)
- (if flag (simplifya u y)
- (simpcheck u y)))
- (cdr x))))
+ (eqtest (if (member (caar x) '(mlist mequal))
+ ;; MLIST or MEQUAL: Arguments will not be converted from special
+ ;; representations to the general form.
+ (if y
+ ;; Arguments are already simplified - nothing to do here.
+ x
+ ;; Arguments are not simplified. Strip any flags from the header,
+ ;; and simplify arguments.
+ (cons (ncons (caar x)) (mapcar #'simplify (cdr x))))
+ ;; Not MLIST or MEQUAL. Strip any flags from the header, and call
+ ;; SIMPMAP, which will convert special representations to general
+ ;; form and simplify, if necessary (depending on flag Y).
+ (cons (ncons (caar x)) (simpmap (cdr x) y)))
x))
;;;-----------------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
src/simp.lisp | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-03 22:04:33
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 43a9362220b09efe83ce48d7a959b2ab0fe8b368 (commit)
via ec0105f1db714f827043ae87278d397c1fb399e2 (commit)
from 4c2ce86affd66fae5d9d9331cc0761725b2155fd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 43a9362220b09efe83ce48d7a959b2ab0fe8b368
Author: David Scherfgen <d.s...@go...>
Date: Thu Jun 4 00:03:20 2026 +0200
Fix logic for some SIMPARGS/SIMPMAP calls when arguments already simplified
For some old-style simplifiers (not defined via DEF-SIMPLIFIER), when the
function's third argument (mostly named Z) indicates that the arguments are
already simplified, SIMPARGS and SIMPMAP still need to be called (with the Z
flag forwarded to them).
Reason: Contrary to their names, SIMPARGS and SIMPMAP do not just simplify
(if necessary), but they also convert special representations to the general
form. The latter is done regardless of the "already simplified" flag.
diff --git a/src/simp.lisp b/src/simp.lisp
index 3d907dd5f..6cff86841 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -384,12 +384,12 @@
(twoargcheck x))
(if (and (member 'array (cdar x)) (null (margs x)))
(merror (intl:gettext "SIMPARGS: subscripted variable found with no subscripts.")))
- (eqtest (if y x (let ((flag (member (caar x) '(mlist mequal))))
+ (eqtest (let ((flag (member (caar x) '(mlist mequal))))
(cons (ncons (caar x))
(mapcar #'(lambda (u)
- (if flag (simplifya u nil)
- (simpcheck u nil)))
- (cdr x)))))
+ (if flag (simplifya u y)
+ (simpcheck u y)))
+ (cdr x))))
x))
;;;-----------------------------------------------------------------------------
@@ -1625,7 +1625,7 @@
y)
(unless (or (= l1 2) (= l1 4) (= l1 5))
(merror (intl:gettext "limit: wrong number of arguments.")))
- (setq y (if z (cdr x) (simpmap (cdr x) nil)))
+ (setq y (simpmap (cdr x) z))
(cond ((and (= l1 5) (not (member (cadddr y) '($plus $minus))))
(merror (intl:gettext "limit: direction must be either 'plus' or 'minus': ~M") (cadddr y)))
((mnump (cadr y))
@@ -1641,7 +1641,7 @@
y)
(unless (or (= l1 3) (= l1 5))
(merror (intl:gettext "integrate: wrong number of arguments.")))
- (setq y (if z (cdr x) (simpmap (cdr x) nil)))
+ (setq y (simpmap (cdr x) z))
(cond ((mnump (cadr y))
(merror (intl:gettext "integrate: variable must not be a number; found: ~M") (cadr y)))
((and (= l1 5) (alike1 (caddr y) (cadddr y)))
@@ -1766,7 +1766,7 @@
(cond ((not (even (length x)))
(cond ((and (cdr x) (null (cdddr x))) (nconc x '(1)))
(t (wna-err '%derivative)))))
- (setq w (cons '(%derivative) (if z (cdr x) (simpmap (cdr x) nil))))
+ (setq w (cons '(%derivative) (simpmap (cdr x) z)))
(setq y (cadr w))
(do ((u (cddr w) (cddr u))) ((null u))
(cond ((mnump (car u))
@@ -2704,7 +2704,7 @@
($listp (cadr x)) (cdadr x) (null (cddadr x)))
(if z (cadadr x) (simplifya (cadadr x) nil))
(let ((badp (dolist (row (cdr x)) (if (not ($listp row)) (return t))))
- (args (if z (cdr x) (simpmap (cdr x) nil))))
+ (args (simpmap (cdr x) z)))
(if (and args (not badp)) (matcheck args))
(cons (if badp '(%matrix simp) '($matrix simp)) args))))
commit ec0105f1db714f827043ae87278d397c1fb399e2
Author: David Scherfgen <d.s...@go...>
Date: Wed Jun 3 17:46:26 2026 +0200
Move definition of +HASHER-MOD+ to top of file to prevent a compiler warning
diff --git a/src/mlisp.lisp b/src/mlisp.lisp
index 6c19b110b..acdae7afc 100644
--- a/src/mlisp.lisp
+++ b/src/mlisp.lisp
@@ -58,6 +58,9 @@ or if apply is being used are printed.")
"Holds the value to which a variable is about to be set when a
'setcheckbreak' occurs.")
+(defconstant +hasher-mod+ 32768
+ "Modulus used by the HASHER function - must be a power of 2.")
+
(defun mapply1 (fn args fnname form)
(cond ((atom fn)
@@ -1949,9 +1952,6 @@ wrapper for this."
(aexpr (mapply1 (cadr arrfun) subs (cadr arrfun) form))
(a-subr (apply (cadr arrfun) subs)))))
-(defconstant +hasher-mod+ 32768
- "Modulus used by the HASHER function - must be a power of 2.")
-
(defun hasher (l) ; This is not the best way to write a hasher. But,
(if (null l) ; please don't change this code or you're liable to
0 ; break SAVE files.
-----------------------------------------------------------------------
Summary of changes:
src/mlisp.lisp | 6 +++---
src/simp.lisp | 16 ++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-03 11:00:38
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 4c2ce86affd66fae5d9d9331cc0761725b2155fd (commit)
from 8ccfb47b479bcd135ee901916624479154eabeaa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4c2ce86affd66fae5d9d9331cc0761725b2155fd
Author: David Scherfgen <d.s...@go...>
Date: Wed Jun 3 13:00:31 2026 +0200
Fix SIGN handling of subscripted functions and introduce DECL-IMAGINARYP
This fixes bug #4752.
SIGN, when in complex mode, would only look at the CAAR of an expression, which
isn't correct for subscripted functions.
To make the code more consistent, introduce DECL-IMAGINARYP along the existing
DECL-REALP and DECL-COMPLEXP functions and use it instead of $FEATUREP for
symbols.
diff --git a/src/compar.lisp b/src/compar.lisp
index 4fddd039a..a6776204f 100644
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@ -1373,20 +1373,17 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(t (sign-any x)))))))
(defun sign-any (x)
+ (let (op)
(cond ((and *complexsign*
(symbolp x)
(decl-complexp x))
;; In Complex Mode look for symbols declared to be complex.
- (if ($featurep x '$imaginary)
- (setq sign '$imaginary)
- (setq sign '$complex)))
+ (setq sign (if (decl-imaginaryp x) '$imaginary '$complex)))
((and *complexsign*
(not (atom x))
- (decl-complexp (caar x)))
- ;; A function f(x), where f is declared to be imaginary or complex.
- (if ($featurep (caar x) '$imaginary)
- (setq sign '$imaginary)
- (setq sign '$complex)))
+ (decl-complexp (setq op (if (mqapplyp x) (subfunname x) (caar x)))))
+ ;; A function f(x) or f[n](x), where f is declared to be imaginary or complex.
+ (setq sign (if (decl-imaginaryp op) '$imaginary '$complex)))
(t
(dcompare x 0)
(if (and $assume_pos
@@ -1399,7 +1396,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(setq sign '$pos))
(setq minus nil evens nil
odds (if (not (member sign '($pos $neg $zero) :test #'eq))
- (ncons x))))))
+ (ncons x)))))))
(defun sign-mtimes (x)
(setq x (cdr x))
diff --git a/src/simp.lisp b/src/simp.lisp
index a24af4507..3d907dd5f 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -2779,11 +2779,15 @@
(defun decl-complexp (e)
(kindp e '$complex))
-;; TRUE, if the symbol e is declared to be $real, $rational, $irrational
-;; or $integer
+;; TRUE, if the symbol e is declared to be $real, $rational, $irrational,
+;; $integer, $even or $odd.
(defun decl-realp (e)
(kindp e '$real))
+;; TRUE, if the symbol e is declared to be $imaginary.
+(defun decl-imaginaryp (e)
+ (kindp e '$imaginary))
+
;; WARNING: Exercise extreme caution when modifying this function!
;;
;; Richard Fateman and Stavros Macrakis both say that changing the
diff --git a/tests/rtest_sign.mac b/tests/rtest_sign.mac
index e83d91993..6cf9ad656 100644
--- a/tests/rtest_sign.mac
+++ b/tests/rtest_sign.mac
@@ -1665,3 +1665,17 @@ forget(x > -1, x < 1);
is(abs(cos(x)) <= 1);
true;
+
+/* Bug #4752: "csign doesn't handle subscripted functions like li correctly" */
+
+csign(li[n](x));
+complex;
+
+declare(f, imaginary);
+done;
+
+csign(f[n](x));
+imaginary;
+
+forget(kind(f, imaginary));
+[kind(f, imaginary)];
-----------------------------------------------------------------------
Summary of changes:
src/compar.lisp | 15 ++++++---------
src/simp.lisp | 8 ++++++--
tests/rtest_sign.mac | 14 ++++++++++++++
3 files changed, 26 insertions(+), 11 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-03 10:17:29
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 8ccfb47b479bcd135ee901916624479154eabeaa (commit)
via 1c86ba205e9937389ef99679026fad304e7ac161 (commit)
from f5b27223490fbbf0f96a7e2a80d9600fe5a42c37 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8ccfb47b479bcd135ee901916624479154eabeaa
Author: David Scherfgen <d.s...@go...>
Date: Wed Jun 3 12:14:24 2026 +0200
Introduce and use KIND-ANY-OF and KIND-ALL-OF-P
(KIND-ANY-OF X KINDS) avoids the repeated database access overhead caused by
(OR (KINDP X K1) (KINDP X K2) ...) constructs, where K1, K2, ... are mutually
exclusive kinds, e.g. '$EVEN and '$ODD. It resolves the query in a single
database pass. It returns the first kind found during traversal of X's kinds
that is a member of KINDS.
Similarly, (KIND-ALL-OF-P X KINDS) is a faster single-pass replacement for
(AND (KINDP X K1) (KINDP X K2) ...).
Refactored existing usage of KINDP to take advantage of these new functions,
in some cases significantly simplifying the code.
diff --git a/src/compar.lisp b/src/compar.lisp
index 0be22b6cc..4fddd039a 100644
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@ -1349,6 +1349,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(list '$li #'(lambda (x)
(let ((z (first (margs x))) (n (cadadr x)))
(if (and (mnump n) (eq t (mgrp z 0)) (eq t (mgrp 1 z))) (sign z) (sign-any x)))))))
+
(defun sign (x)
(cond ((mnump x) (setq sign (rgrp x 0) minus nil odds nil evens nil))
((and *complexsign* (symbolp x) (eq x '$%i))
@@ -1364,9 +1365,12 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
((and (not (specrepp x)) ($subvarp (mop x)) (get (mop (mop x)) 'sign-function))
(funcall (get (mop (mop x)) 'sign-function) x))
((specrepp x) (sign (specdisrep x)))
- ((kindp (caar x) '$posfun) (sign-posfun x))
- ((kindp (caar x) '$oddfun) (sign-oddfun x))
- (t (sign-any x))))
+ (t
+ (let ((kind (kind-any-of (caar x) '($posfun $oddfun))))
+ (cond
+ ((eq kind '$posfun) (sign-posfun x))
+ ((eq kind '$oddfun) (sign-oddfun x))
+ (t (sign-any x)))))))
(defun sign-any (x)
(cond ((and *complexsign*
@@ -2074,10 +2078,11 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
evens nil))
(defun sign-oddfun (x)
- (cond ((kindp (caar x) '$increasing)
+ (let ((kind (kind-any-of (caar x) '($increasing $decreasing))))
+ (cond ((eq kind '$increasing)
; Take the sign of the argument
(sign (cadr x)))
- ((kindp (caar x) '$decreasing)
+ ((eq kind '$decreasing)
; Take the sign of negative of the argument
(sign (neg (cadr x))))
(t
@@ -2085,7 +2090,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
; the function value is the same). Otherwise, punt to SIGN-ANY.
(sign (cadr x))
(unless (eq sign '$zero)
- (sign-any x)))))
+ (sign-any x))))))
(defun imag-err (x)
(if sign-imag-errp
@@ -2210,11 +2215,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(kindp (caddr fact) '$integer))
(return t))
((eq mode 'evod)
- (cond ((kindp (caddr fact) '$odd)
- (return '$odd))
- ((kindp (caddr fact) '$even)
- (return '$even))
- (t (return nil))))
+ (kind-any-of (caddr fact) '($even $odd)))
(t (return nil))))
(t
(cond ((eq mode 'integer)
@@ -2230,11 +2231,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(kindp (cadr fact) '$integer))
(return t))
((eq mode 'evod)
- (cond ((kindp (cadr fact) '$odd)
- (return '$odd))
- ((kindp (cadr fact) '$even)
- (return '$even))
- (t (return nil))))
+ (kind-any-of (cadr fact) '($even $odd)))
(t (return nil))))
(t
(cond ((eq mode 'integer)
@@ -2295,11 +2292,10 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(defun evod (e)
(cond ((integerp e) (if (oddp e) '$odd '$even))
((mnump e) nil)
- ((atom e)
- (cond ((kindp e '$odd) '$odd)
- ((kindp e '$even) '$even)
- ;; Check the database for facts.
- ((symbolp e) (check-integer-facts e 'evod))))
+ ((symbolp e)
+ (or (kind-any-of e '($even $odd))
+ ;; Check the database for facts.
+ (check-integer-facts e 'evod)))
((eq 'mtimes (caar e)) (evod-mtimes e))
((eq 'mplus (caar e)) (evod-mplus e))
((eq 'mabs (caar e)) (evod (cadr e))) ;; extra code
@@ -2526,8 +2522,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(if (and (equal rhs 0)
(or (mexptp lhs)
(and (not (atom lhs))
- (kindp (caar lhs) '$oddfun)
- (kindp (caar lhs) '$increasing))))
+ (kind-all-of-p (caar lhs) '($oddfun $increasing)))))
(setq lhs (cadr lhs)))
(values lhs rhs)))
diff --git a/src/db.lisp b/src/db.lisp
index 1ed18b459..c80683b92 100644
--- a/src/db.lisp
+++ b/src/db.lisp
@@ -411,6 +411,40 @@
(return t)
(mark+ p (+labs p))))))
+(defun kind-any-of (x kinds)
+ "Looks up the kind information on symbol X and returns the first kind that is
+ encountered that is a member of KINDS. The order of symbols in KINDS doesn't
+ affect the result. This function should only be used for mutually exclusive
+ kinds, e.g. '$EVEN and '$ODD. Returns NIL if no matching kind is found.
+ This is faster than (OR (KINDP X K1) (KINDP X K2) ...), since it only requires
+ a single database query."
+ (when (and (symbolp x) (get x 'data))
+ (clear)
+ (beg x 1)
+ (do ((p (dq+) (dq+)))
+ ((null p))
+ (let ((k (member p kinds :test #'eq)))
+ (if k
+ (return (car k))
+ (mark+ p (+labs p)))))))
+
+(defun kind-all-of-p (x kinds)
+ "Returns T iff (KINDP X K) would return T for all K in KINDS. This is faster
+ than (AND (KINDP X K1) (KINDP X K2) ...), since it only requires a single
+ database query. The implementation relies on counting matching kinds, therefore
+ KINDS should not contain repeated items."
+ (let ((remaining (length kinds)))
+ (when (and (symbolp x) (get x 'data))
+ (clear)
+ (beg x 1)
+ (do ((p (dq+) (dq+)))
+ ((or (null p)
+ (zerop remaining)))
+ (when (member p kinds :test #'eq)
+ (decf remaining))
+ (mark+ p (+labs p))))
+ (zerop remaining)))
+
(defun true* (pat)
(let ((dum (semant pat)))
(if dum
commit 1c86ba205e9937389ef99679026fad304e7ac161
Author: David Scherfgen <d.s...@go...>
Date: Wed Jun 3 11:11:34 2026 +0200
Make some of my previous tests more elegant and more verbose in case of failure
diff --git a/tests/rtest_integrate.mac b/tests/rtest_integrate.mac
index 64eb23f72..9c8ca9141 100644
--- a/tests/rtest_integrate.mac
+++ b/tests/rtest_integrate.mac
@@ -6350,26 +6350,20 @@ forget(x > 0, x < 1);
/* Bug #4037: "Error in symbolic integral" */
/* Test that the antiderivatives of a whole family of functions are correct. */
/* Certain cases are left out because they print "CQUOTIENT: quotient is not exact" errors. */
-map(
- lambda([e],
- block([f, u],
- f : x^e[1]*log(x)^e[2]/(1+x^e[3]),
- u : integrate(f, x),
- freeof('integrate, u) and zeroequiv(diff(u, x) - f, x) = true
- )
- ),
+sublist(
[[1,1,1],[1,1,2],[1,1,4],[1,2,1],[1,2,2],[1,2,4],[1,3,1],[1,3,2],[1,4,1],
[1,4,2],[1,5,1],[1,5,2],[2,1,1],[2,1,2],[2,2,1],[2,2,2],[2,3,1],[2,3,2],
[2,4,1],[2,4,2],[2,5,1],[2,5,2],[3,1,1],[3,1,2],[3,1,4],[3,2,1],[3,2,2],
[3,2,4],[3,3,1],[3,3,2],[3,3,4],[3,4,1],[3,4,2],[3,4,4],[3,5,1],[3,5,2],
[3,5,4],[4,1,1],[4,1,2],[4,1,5],[4,2,1],[4,2,2],[4,2,5],[4,3,1],[4,3,2],
[4,3,5],[4,4,1],[4,4,2],[4,4,5],[4,5,1],[4,5,2],[4,5,5],[5,1,1],[5,1,2],
- [5,1,4],[5,2,1],[5,2,2],[5,3,1],[5,3,2],[5,4,1],[5,4,2],[5,5,1],[5,5,2]]
+ [5,1,4],[5,2,1],[5,2,2],[5,3,1],[5,3,2],[5,4,1],[5,4,2],[5,5,1],[5,5,2]],
+ lambda([e],
+ block([f, u],
+ f : x^e[1]*log(x)^e[2]/(1+x^e[3]),
+ u : integrate(f, x),
+ not freeof('integrate, u) or zeroequiv(diff(u, x) - f, x) # true
+ )
+ )
);
-[true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true];
+[];
diff --git a/tests/rtest_numth.mac b/tests/rtest_numth.mac
index 671a6fd6c..bf6a4d2cd 100644
--- a/tests/rtest_numth.mac
+++ b/tests/rtest_numth.mac
@@ -811,14 +811,6 @@ gcfactor (%i / 2);
*/
/* Bug #4623: "gcfactor(4), expand(%%) => -4" */
-
-create_list(is(a + %i * b = expand(gcfactor(a + %i * b))), a, makelist(i, i, -4, 4), b, makelist(i, i, -4, 4));
-[true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true];
+sublist(create_list([r, i], r, makelist(r, r, -4, 4), i, makelist(i, i, -4, 4)),
+ lambda([ri], ri[1] + %i * ri[2] # expand(gcfactor(ri[1] + %i * ri[2]))));
+[];
-----------------------------------------------------------------------
Summary of changes:
src/compar.lisp | 41 ++++++++++++++++++-----------------------
src/db.lisp | 34 ++++++++++++++++++++++++++++++++++
tests/rtest_integrate.mac | 26 ++++++++++----------------
tests/rtest_numth.mac | 14 +++-----------
4 files changed, 65 insertions(+), 50 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: dauti <da...@us...> - 2026-06-02 22:26:05
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via f5b27223490fbbf0f96a7e2a80d9600fe5a42c37 (commit)
from 46cd19a89f63d02d858cc965f5527c56f456c412 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f5b27223490fbbf0f96a7e2a80d9600fe5a42c37
Author: Wolfgang Dautermann <da...@us...>
Date: Wed Jun 3 00:25:19 2026 +0200
Windows installer: Update SBCL.
diff --git a/crosscompile-windows/sbcl/CMakeLists.txt b/crosscompile-windows/sbcl/CMakeLists.txt
index 0a80efc87..7048a5b14 100644
--- a/crosscompile-windows/sbcl/CMakeLists.txt
+++ b/crosscompile-windows/sbcl/CMakeLists.txt
@@ -11,8 +11,8 @@
# updated setup-file automatically.
if(BUILD_64BIT)
- set(SBCLVERSION "2.6.4")
- set(SBCL_MD5 "859347c9282bce27a8fe26c6b7a0c4d1")
+ set(SBCLVERSION "2.6.5")
+ set(SBCL_MD5 "70001dea450b46d59fde931a70ab1254")
set(SBCL_INSTALLERNAME "sbcl-${SBCLVERSION}-x86-64-windows-binary.msi")
else()
set(SBCLVERSION "2.3.2")
-----------------------------------------------------------------------
Summary of changes:
crosscompile-windows/sbcl/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-06-02 06:59:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 46cd19a89f63d02d858cc965f5527c56f456c412 (commit)
from 7fc142f5436bcfa02107388d8d25c6119ec482c5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 46cd19a89f63d02d858cc965f5527c56f456c412
Author: David Scherfgen <d.s...@go...>
Date: Tue Jun 2 08:58:34 2026 +0200
Prevent some inconsistent type declarations and restore/add kind inferences
This commit partially resolves bug #4749 by tightening Maxima's property
declaration engine and restoring foundational numeric inferences that had been
commented out in compar.lisp since 2009.
Summary of changes:
* Restored standard numeric tower inferences: integer -> rational,
and par(rational, irrational) -> real.
* Added missing lateral inferences: irrational -> noninteger and
imaginary -> noninteger (Maxima seems to treat zero as non-imaginary).
* Modified DECLAREKIND to explicitly block mathematically invalid
cross-declarations (e.g., real and imaginary, rational and imaginary),
while relying on the inference engine to handle subset exclusions.
* Removed redundant property checks in DECL-REALP and across compar.lisp, as the
restored inferences now handle transitive types natively. This greatly reduces
the number of potentially expensive KINDP checks.
* Cleaned up kind declarations for mathematical constants to rely on the
inferencing engine.
* Added exhaustive tests for errors on inconsistent declarations and
inferencing.
Note that complex and real aren't treated as mutually exclusive (yet). This
might require further discussion and deeper code changes.
diff --git a/src/compar.lisp b/src/compar.lisp
index fc3221589..0be22b6cc 100644
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@ -2165,8 +2165,6 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
((mnump x) nil)
((and (symbolp x)
(or (kindp x '$integer)
- (kindp x '$even)
- (kindp x '$odd)
(check-integer-facts x))))
(t (let ((x-op (and (consp x) (consp (car x)) (caar x))) ($prederror nil))
(cond ((null x-op) nil)
@@ -2209,9 +2207,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
;; Case equal(x,expr): Test expr to be an integer.
(cond ((symbolp (caddr fact))
(cond ((and (eq mode 'integer)
- (or (kindp (caddr fact) '$integer)
- (kindp (caddr fact) '$odd)
- (kindp (caddr fact) '$even)))
+ (kindp (caddr fact) '$integer))
(return t))
((eq mode 'evod)
(cond ((kindp (caddr fact) '$odd)
@@ -2231,9 +2227,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
;; Case equal(expr,x): Test expr to be an integer.
(cond ((symbolp (caddr fact))
(cond ((and (eq mode 'integer)
- (or (kindp (cadr fact) '$integer)
- (kindp (cadr fact) '$odd)
- (kindp (cadr fact) '$even)))
+ (kindp (cadr fact) '$integer))
(return t))
((eq mode 'evod)
(cond ((kindp (cadr fact) '$odd)
@@ -2250,7 +2244,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(t (return nil)))))))))))
(defun nonintegerp (e)
- (cond ((and (symbolp e) (or (kindp e '$noninteger) (check-noninteger-facts e) (kindp e '$irrational)))) ;declared noninteger
+ (cond ((and (symbolp e) (or (kindp e '$noninteger) (check-noninteger-facts e)))) ;declared noninteger
((mnump e)
(if (integerp e) nil t)) ;all floats are noninteger and integers are not nonintegers
(($ratp e)
@@ -2601,14 +2595,27 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(let (prop2)
(cond ((truep (list 'kind var prop)) t)
((or (falsep (list 'kind var prop))
- (and (setq prop2 (assoc prop '(($integer . $noninteger)
+ (and (setq prop2 (assoc prop
+ ;; Note that the following list of inconsistent type
+ ;; declaration pairs intentionally omits cases that are
+ ;; handled by the inferencing engine in the above FALSEP
+ ;; call, e.g., ($even . $odd).
+ ;; Similarly, the pair ($imaginary . $real) also covers
+ ;; $rational, $irrational, $integer, $even and $odd on
+ ;; the right hand side via inferencing in the below
+ ;; TRUEP call.
+ '(($integer . $noninteger)
($noninteger . $integer)
+ ($even . $noninteger)
+ ($odd . $noninteger)
+ ($rational . $imaginary) ; Maxima doesn't seem to think of zero
+ ($irrational . $imaginary) ; as an imaginary number,
+ ($real . $imaginary) ; therefore these pairs are all
+ ($imaginary . $real) ; inconsistent.
($increasing . $decreasing)
($decreasing . $increasing)
($symmetric . $antisymmetric)
($antisymmetric . $symmetric)
- ($rational . $irrational)
- ($irrational . $rational)
($oddfun . $evenfun)
($evenfun . $oddfun)) :test #'eq))
(truep (list 'kind var (cdr prop2)))))
@@ -2782,35 +2789,34 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(eval-when (:load-toplevel :execute)
(mapc #'true*
- '(;; even and odd are integer
+ '(;; Even and odd numbers partition the integers.
(par ($even $odd) $integer)
-; Cutting out inferences for integer, rational, real, complex (DK 10/2009).
-; (kind $integer $rational)
-; (par ($rational $irrational) $real)
-; (par ($real $imaginary) $complex)
+ ;; Integers are rationals.
+ (kind $integer $rational)
+
+ ;; Irrationals are nonintegers.
+ (kind $irrational $noninteger)
+
+ ;; Rationals and irrationals partition the reals.
+ (par ($rational $irrational) $real)
- ;; imaginary is complex
+ ;; Imaginary numbers are complex and nonintegers
+ ;; (Maxima doesn't seem to think of zero as an imaginary number).
(kind $imaginary $complex)
+ (kind $imaginary $noninteger)
+
+ ;; Declarations for constants
+ (kind $%i $imaginary)
+ (kind $%e $irrational)
+ (kind $%pi $irrational)
+ (kind $%gamma $noninteger) ; when proven irrational,
+ (kind $%gamma $real) ; replace with a single $irrational
+ (kind $%phi $irrational)
+ (kind $%catalan $noninteger) ; when proven irrational,
+ (kind $%catalan $real) ; replace with a single $irrational
- ;; Declarations for constants
- (kind $%i $noninteger)
- (kind $%i $imaginary)
- (kind $%e $noninteger)
- (kind $%e $real)
- (kind $%pi $noninteger)
- (kind $%pi $real)
- (kind $%gamma $noninteger)
- (kind $%gamma $real)
- (kind $%phi $noninteger)
- (kind $%phi $real)
- (kind $%pi $irrational)
- (kind $%e $irrational)
- (kind $%phi $irrational)
- (kind $%catalan $noninteger)
- (kind $%catalan $real)
-
- ;; Declarations for functions
+ ;; Declarations for functions
(kind %log $increasing)
(kind %asin $increasing) (kind %asin $oddfun)
(kind %atan $increasing) (kind %atan $oddfun)
diff --git a/src/simp.lisp b/src/simp.lisp
index 950ff5b1a..a24af4507 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -2777,17 +2777,12 @@
;; TRUE, if the symbol e is declared to be $complex or $imaginary.
(defun decl-complexp (e)
- (and (symbolp e)
- (kindp e '$complex)))
+ (kindp e '$complex))
;; TRUE, if the symbol e is declared to be $real, $rational, $irrational
;; or $integer
(defun decl-realp (e)
- (and (symbolp e)
- (or (kindp e '$real)
- (kindp e '$rational)
- (kindp e '$irrational)
- (kindp e '$integer))))
+ (kindp e '$real))
;; WARNING: Exercise extreme caution when modifying this function!
;;
diff --git a/tests/rtest16.mac b/tests/rtest16.mac
index 0d9c766d3..c54f5ddcc 100644
--- a/tests/rtest16.mac
+++ b/tests/rtest16.mac
@@ -3293,6 +3293,99 @@ factor(a^2*g+a*g-a^2, second(factor(g^3-1)));
kill(x);
done$
+/*
+Bug #4749: "Declaring a symbol both real and complex or real and imaginary"
+Test all(?) pairs of inconsistent declarations and make sure they cause errors.
+*/
+
+sublist
+(
+ [
+ ['integer, 'noninteger],
+ ['even, 'noninteger],
+ ['odd, 'noninteger],
+ ['rational, 'irrational],
+ ['integer, 'irrational],
+ ['even, 'irrational],
+ ['odd, 'irrational],
+ ['real, 'imaginary],
+ ['rational, 'imaginary],
+ ['irrational, 'imaginary],
+ ['integer, 'imaginary],
+ ['even, 'imaginary],
+ ['odd, 'imaginary],
+ ['even, 'odd],
+ ['increasing, 'decreasing],
+ ['symmetric, 'antisymmetric],
+ ['evenfun, 'oddfun],
+ ['scalar, 'nonscalar]
+ ],
+ lambda
+ (
+ [pair],
+ block
+ (
+ [[a, b] : pair],
+ /* first a, then b */
+ kill(x),
+ apply('declare, ['x, a]),
+ if errcatch(apply('declare, ['x, b])) # [] then return(true),
+ /* first b, then a */
+ kill(y),
+ apply('declare, ['y, b]),
+ if errcatch(apply('declare, ['y, a])) # [] then return(true),
+ false
+ )
+ )
+);
+[];
+
+kill(x, y);
+done;
+
+/*
+Test inferencing, e.g. irrational -> noninteger
+A list entry ['rational, ['rational, 'real, -'irrational, -'imaginary]] means
+that for a symbol x declared rational,
+featurep(x, rational) and featurep(x, real) should return true, and
+featurep(x, irrational) and featurep(x, imaginary) should return false.
+*/
+
+sublist
+(
+ [
+ ['even, ['even, 'integer, 'rational, 'real, -'odd, -'noninteger, -'imaginary]],
+ ['odd, ['odd, 'integer, 'rational, 'real, -'even, -'noninteger, -'imaginary]],
+ ['integer, ['integer, 'rational, 'real, -'noninteger, -'imaginary]],
+ ['rational, ['rational, 'real, -'irrational, -'imaginary]],
+ ['irrational, ['irrational, 'real, 'noninteger, -'rational, -'integer, -'even, -'odd, -'imaginary]],
+ ['imaginary, ['imaginary, 'complex, 'noninteger, -'real, -'rational, -'irrational, -'integer, -'even, -'odd]]
+ ],
+ lambda
+ (
+ [entry],
+ block
+ (
+ [[source, targets] : entry, failed : false, expected, res],
+ kill(x),
+ apply('declare, ['x, source]),
+ for target in targets do
+ (
+ if atom(target) then expected : true
+ else [target, expected] : [-target, false],
+ if apply('featurep, ['x, target]) # expected then failed : true
+ ),
+ failed
+ )
+ )
+);
+[];
+
+kill(x);
+done;
+
+
+
+/* Leave this at the end of the file! */
contexts;
[initial, global]$
-
-----------------------------------------------------------------------
Summary of changes:
src/compar.lisp | 78 ++++++++++++++++++++++++---------------------
src/simp.lisp | 9 ++----
tests/rtest16.mac | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 138 insertions(+), 44 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-31 18:56:22
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 7fc142f5436bcfa02107388d8d25c6119ec482c5 (commit)
from 629708218e6af8ea11de83916cac1813ba005c55 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7fc142f5436bcfa02107388d8d25c6119ec482c5
Author: David Scherfgen <d.s...@go...>
Date: Sun May 31 20:55:44 2026 +0200
PARTITION: remove call to SIMPLIFYA
If the input EXP is simplified, a call to SIMPLIFYA on the result is not
necessary, since a subset of at least 2 terms/factors of a simplified
MPLUS/MTIMES expression is also simplified.
If EXP is not simplified, it's not PARTITION's job to simplify.
Let the output MPLUS/MTIMES expressions have the SIMP flag iff EXP has it.
Skip any extra header flags, such as IRREDUCIBLE or FACTORED.
Related: In the PARTITION-BY comment, mention that the order of elements is
reversed in the output (PARTITION makes use of this).
diff --git a/src/csimp.lisp b/src/csimp.lisp
index ebd5e1b9e..2f0396ee0 100644
--- a/src/csimp.lisp
+++ b/src/csimp.lisp
@@ -84,7 +84,7 @@
;; (VALUES YES NO),
;;
;; where YES and NO are lists consisting of elements for which PREDICATE is true
-;; or false, respectively.
+;; or false, respectively. The order of elements is reversed compared to SEQ.
(defun partition-by (predicate seq)
(let ((yes) (no))
(map nil
@@ -118,14 +118,13 @@
(t
(multiple-value-bind (constant variable)
(partition-by (lambda (x) (freeof var1 x)) (cdr exp))
+ (let ((header (if (member 'simp (cdar exp)) (get op 'msimpind) (list op))))
(cons (cond ((null constant) k)
((null (cdr constant)) (car constant))
- (t (simplifya
- (cons (list op) (nreverse constant)) t)))
+ (t (cons header (nreverse constant))))
(cond ((null variable) k)
((null (cdr variable)) (car variable))
- (t (simplifya
- (cons (list op) (nreverse variable)) t)))))))))
+ (t (cons header (nreverse variable)))))))))))
;;To use this INTEGERINFO and *ASK* need to be special.
;;(defun integerpw (x)
-----------------------------------------------------------------------
Summary of changes:
src/csimp.lisp | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: dauti <da...@us...> - 2026-05-30 15:35:13
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 629708218e6af8ea11de83916cac1813ba005c55 (commit)
from 49168e159c981be4b9882f92edc2c4e1e31d34f1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 629708218e6af8ea11de83916cac1813ba005c55
Author: Wolfgang Dautermann <da...@us...>
Date: Sat May 30 17:33:57 2026 +0200
Add more project licenses to the Windows installer.
ECL (and required projects) may be included too.
diff --git a/crosscompile-windows/LICENSE_APPENDIX.txt b/crosscompile-windows/LICENSE_APPENDIX.txt
index b3e93f8cd..835f0ef54 100644
--- a/crosscompile-windows/LICENSE_APPENDIX.txt
+++ b/crosscompile-windows/LICENSE_APPENDIX.txt
@@ -1,7 +1,7 @@
-This installer for Maxima does not contain only Maxima, but also other free software, which is required for Maxima.
+This Windows installer for Maxima does not contain only Maxima, but also other free software, which is required for Maxima.
The following projects are included in the installer:
@@ -20,6 +20,15 @@ The following projects are included in the installer:
* CCL (maybe)
Website: https://ccl.clozure.com/
License: https://github.com/Clozure/ccl/blob/master/LICENSE
+* ECL (maybe)
+ Website: https://ecl.common-lisp.dev/
+ License: https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/COPYING
+* w64devkit (maybe)
+ Website: https://github.com/skeeto/w64devkit
+ License: https://github.com/skeeto/w64devkit/blob/master/UNLICENSE
+* Gmplib (maybe)
+ Website: https://gmplib.org/
+ License: https://gmplib.org/manual/Copying
* TCL/TK
Website: https://tcl.tk
License: https://tcl.tk/software/tcltk/license.html
-----------------------------------------------------------------------
Summary of changes:
crosscompile-windows/LICENSE_APPENDIX.txt | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-29 13:12:33
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 49168e159c981be4b9882f92edc2c4e1e31d34f1 (commit)
via d530c320287c0c1037665ca828134f2234067b78 (commit)
from 76e6b850b2ac06f1cdd3891ce1c23fa7091ce6d4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 49168e159c981be4b9882f92edc2c4e1e31d34f1
Merge: d530c3202 76e6b850b
Author: David Scherfgen <d.s...@go...>
Date: Fri May 29 15:10:57 2026 +0200
Merge branch 'master' of git://git.code.sf.net/p/maxima/code
diff --cc src/compar.lisp
index 3b9dfe0d8,22ee4e03e..fc3221589
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@@ -1582,11 -1582,11 +1582,11 @@@ TDNEG TDZERO TDPN) to store it, and als
;; For the following test, swap XLHS and XRHS, if necessary, so that XRHS is
;; the number, e.g. x^2 - 3 -> 3 - x^2, and remember to flip the result.
- (when (and (mnump xlhs) (not (mnump xrhs)))
+ (when (and (null sgn) (mnump xlhs) (not (mnump xrhs)))
(psetq xlhs xrhs xrhs xlhs flip-sign (not flip-sign)))
- ;; sign(a^pos_int - b) = sign(abs_if_even(a) - b^(1/pos_int))
- ;; with real a, b >= 0 (for even pos_int), and b^(1/pos_int) being the real root
+ ;; sign(a^pos_int - b) = sign((if evenp(pos_int) then abs(a) else a) - b^(1/pos_int))
+ ;; with real a, real b (>= 0 for evenp(pos_int)), and b^(1/pos_int) being the real root
(when (and (null sgn)
(mnump xrhs)
(mexptp xlhs)
commit d530c320287c0c1037665ca828134f2234067b78
Author: David Scherfgen <d.s...@go...>
Date: Fri May 29 07:35:12 2026 +0200
Minor comment improvement in SIGNDIFF-SPECIAL
diff --git a/src/compar.lisp b/src/compar.lisp
index 3e33b3800..3b9dfe0d8 100644
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@ -1566,7 +1566,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(t ;; -1 < c < 1, but c # 0
(setq sgn '$pn))))
- ;; sign(abs(a) - b) = sign_max(sign(a - b), sign(-a - b)) with real a, b
+ ;; sign(abs(a) - b) = sign_max(sign(a - b), sign(-a - b)) with real a, real b
(when (and (null sgn)
(not (atom xlhs))
(eq (caar xlhs) 'mabs)
@@ -1585,8 +1585,8 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(when (and (mnump xlhs) (not (mnump xrhs)))
(psetq xlhs xrhs xrhs xlhs flip-sign (not flip-sign)))
- ;; sign(a^pos_int - b) = sign(abs_if_even(a) - b^(1/pos_int))
- ;; with real a, b >= 0 (for even pos_int), and b^(1/pos_int) being the real root
+ ;; sign(a^pos_int - b) = sign((if evenp(pos_int) then abs(a) else a) - b^(1/pos_int))
+ ;; with real a, real b (>= 0 for evenp(pos_int)), and b^(1/pos_int) being the real root
(when (and (null sgn)
(mnump xrhs)
(mexptp xlhs)
-----------------------------------------------------------------------
Summary of changes:
src/compar.lisp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-29 13:06:28
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 76e6b850b2ac06f1cdd3891ce1c23fa7091ce6d4 (commit)
from 96ea422c6c5dbf5440ea544500fe8fc885247b64 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 76e6b850b2ac06f1cdd3891ce1c23fa7091ce6d4
Author: David Scherfgen <d.s...@go...>
Date: Fri May 29 14:26:37 2026 +0200
SIGNDIFF-SPECIAL: if SGN already set, prevent swap/flip
Fix an oversight from previous commit
diff --git a/src/compar.lisp b/src/compar.lisp
index 3e33b3800..22ee4e03e 100644
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@ -1582,7 +1582,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
;; For the following test, swap XLHS and XRHS, if necessary, so that XRHS is
;; the number, e.g. x^2 - 3 -> 3 - x^2, and remember to flip the result.
- (when (and (mnump xlhs) (not (mnump xrhs)))
+ (when (and (null sgn) (mnump xlhs) (not (mnump xrhs)))
(psetq xlhs xrhs xrhs xlhs flip-sign (not flip-sign)))
;; sign(a^pos_int - b) = sign(abs_if_even(a) - b^(1/pos_int))
-----------------------------------------------------------------------
Summary of changes:
src/compar.lisp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-28 22:14:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 96ea422c6c5dbf5440ea544500fe8fc885247b64 (commit)
from 72870542c3f841c1aad2537bf86215afc9df3bbb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 96ea422c6c5dbf5440ea544500fe8fc885247b64
Author: David Scherfgen <d.s...@go...>
Date: Fri May 29 00:11:25 2026 +0200
SIGNDIFF-SPECIAL: handle sign(abs(a)-b) and sign(a^pos_int-b)
Maxima can now determine more signs without using factoring or when factoring
wouldn't work, for example sign(x^2-2) with -1 < x < 1.
Absolute value handling allows Maxima to, e.g., determine that abs(cos(x)) <= 1.
Also, to make sure that the cases handled by SIGNDIFF-SPECIAL work correctly
regardless of whether XLHS and XRHS are swapped, a simple "swap and flip sign"
logic is introduced.
This fixes bugs #2288 and #3155.
diff --git a/src/compar.lisp b/src/compar.lisp
index 8a5bf0bc6..3e33b3800 100644
--- a/src/compar.lisp
+++ b/src/compar.lisp
@@ -1481,7 +1481,7 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(defun signdiff-special (xlhs xrhs)
;; xlhs may be a constant
- (let ((sgn nil))
+ (let ((sgn nil) flip-sign)
(when (or (and (realp xrhs) (minusp xrhs)
(not (atom xlhs)) (eq (sign* xlhs) '$pos))
; e.g. sign(a^3+%pi-1) where a>0
@@ -1506,7 +1506,16 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(eq (sign* (sub (cadr xlhs) 1)) '$pos)
(eq (sign* (sub (caddr xlhs) (caddr xrhs))) '$pos)))
(setq sgn '$pos))
-
+
+ ;; For the following test, swap XLHS and XRHS, if necessary, so that XLHS
+ ;; is one of the operators that we can handle, and remember to flip the result.
+ (let ((operators '(%sin %cos %cosh %sech %signum mabs)))
+ (when (and (not (atom xrhs))
+ (member (caar xrhs) operators :test #'eq)
+ (or (atom xlhs)
+ (not (member (caar xlhs) operators :test #'eq))))
+ (psetq xlhs xrhs xrhs xlhs flip-sign (not flip-sign))))
+
;; sign(sin(x)+c)
(when (and (not (atom xlhs))
(member (caar xlhs) '(%sin %cos))
@@ -1556,10 +1565,46 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN."
(setq sgn '$pnz))
(t ;; -1 < c < 1, but c # 0
(setq sgn '$pn))))
-
+
+ ;; sign(abs(a) - b) = sign_max(sign(a - b), sign(-a - b)) with real a, b
+ (when (and (null sgn)
+ (not (atom xlhs))
+ (eq (caar xlhs) 'mabs)
+ (zerop1 ($imagpart (cadr xlhs)))
+ (zerop1 ($imagpart xrhs)))
+ (let* ((a (cadr xlhs))
+ (b xrhs)
+ (s1 (sign* (sub a b)))
+ (s2 (sign* (sub (neg a) b)))
+ (max-sign (sminmax '$max s1 s2)))
+ (when (not (eq max-sign '$pnz))
+ (setq sgn max-sign))))
+
+ ;; For the following test, swap XLHS and XRHS, if necessary, so that XRHS is
+ ;; the number, e.g. x^2 - 3 -> 3 - x^2, and remember to flip the result.
+ (when (and (mnump xlhs) (not (mnump xrhs)))
+ (psetq xlhs xrhs xrhs xlhs flip-sign (not flip-sign)))
+
+ ;; sign(a^pos_int - b) = sign(abs_if_even(a) - b^(1/pos_int))
+ ;; with real a, b >= 0 (for even pos_int), and b^(1/pos_int) being the real root
+ (when (and (null sgn)
+ (mnump xrhs)
+ (mexptp xlhs)
+ (integerp (caddr xlhs))
+ (> (caddr xlhs) 0)
+ (or (oddp (caddr xlhs)) (not (mnegp xrhs)))
+ (zerop1 ($imagpart (cadr xlhs))))
+ (let* ((exponent (caddr xlhs))
+ (root (mul (if (mnegp xrhs) -1 1) (power (ftake 'mabs xrhs) (div 1 exponent))))
+ (base (cadr xlhs))
+ (maybe-abs-base (if (evenp exponent) (ftake 'mabs base) base))
+ (diff-sign (sign* (sub maybe-abs-base root))))
+ (when (not (eq diff-sign '$pnz))
+ (setq sgn diff-sign))))
+
(when (and $useminmax (or (minmaxp xlhs) (minmaxp xrhs)))
(setq sgn (signdiff-minmax xlhs xrhs)))
- (when sgn (setq sign sgn minus nil odds nil evens nil)
+ (when sgn (setq sign (if flip-sign (flip sgn) sgn) minus nil odds nil evens nil)
t)))
;;; Look for symbols with an assumption a > n or a < -n, where n is a number.
diff --git a/tests/rtest_sign.mac b/tests/rtest_sign.mac
index 62f02312f..e83d91993 100644
--- a/tests/rtest_sign.mac
+++ b/tests/rtest_sign.mac
@@ -1606,3 +1606,62 @@ block ([S: make_string_output_stream (), S1],
S1);
"sign: sign undefined for foo
";
+
+/* Bug #2288: "x^2<1 can't get x^2<2, but can get x^2<100" */
+/* and related tests */
+
+assume(x > -1, x < 1);
+[x > -1, x < 1];
+
+[sign(abs(x) - 1), sign(1 - abs(x))];
+[neg, pos];
+
+[sign(abs(x) - 2), sign(2 - abs(x))];
+[neg, pos];
+
+[sign(abs(x) - 1/2), sign(1/2 - abs(x))];
+[pnz, pnz];
+
+[sign(x^2 - 1), sign(1 - x^2)];
+[neg, pos];
+
+[sign(x^2 - 2), sign(2 - x^2)];
+[neg, pos];
+
+[sign(x^2 - 1/2), sign(1/2 - x^2)];
+[pnz, pnz];
+
+[sign(x^2 - 100), sign(100 - x^2)];
+[neg, pos];
+
+[sign(x^2 - 10000), sign(10000 - x^2)];
+[neg, pos];
+
+[sign(x^4 - 2), sign(2 - x^4)];
+[neg, pos];
+
+[sign(x^3 - 1), sign(1 - x^3)];
+[neg, pos];
+
+[sign(x^3 - 2), sign(2 - x^3)];
+[neg, pos];
+
+[sign(x^3 - 1/2), sign(1/2 - x^3)];
+[pnz, pnz];
+
+[sign(x^3 + 1), sign(-1 - x^3)];
+[pos, neg];
+
+[sign(x^3 + 2), sign(-2 - x^3)];
+[pos, neg];
+
+[sign(x^3 + 1/2), sign(-1/2 - x^3)];
+[pnz, pnz];
+
+forget(x > -1, x < 1);
+[x > -1, x < 1];
+
+/* Bug #3155: "is(abs(cos(x))<=1) is unknown, but is(cos(x)<=1) and is(cos(x)>=-1) are true" */
+
+is(abs(cos(x)) <= 1);
+true;
-----------------------------------------------------------------------
Summary of changes:
src/compar.lisp | 53 ++++++++++++++++++++++++++++++++++++++++++----
tests/rtest_sign.mac | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 108 insertions(+), 4 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: rtoy <rt...@us...> - 2026-05-28 14:56:46
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 72870542c3f841c1aad2537bf86215afc9df3bbb (commit)
via 129bc45c2fd82b3f7e7f4813077e64d1a56bf71d (commit)
from 56c2d780393b641f0d6f0751d57b6750ca5dad68 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 72870542c3f841c1aad2537bf86215afc9df3bbb
Merge: 56c2d7803 129bc45c2
Author: Raymond Toy <toy...@gm...>
Date: Thu May 28 07:56:28 2026 -0700
Merge branch 'rtoy-rename-preserve-direction'
-----------------------------------------------------------------------
Summary of changes:
src/gamma.lisp | 4 ++--
src/globals.lisp | 5 +++++
src/hstep.lisp | 4 +---
src/limit.lisp | 30 ++++++++++++++----------------
src/nummod.lisp | 8 +++-----
src/sinc.lisp | 2 +-
src/tlimit.lisp | 4 ++--
7 files changed, 28 insertions(+), 29 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-28 07:55:51
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 56c2d780393b641f0d6f0751d57b6750ca5dad68 (commit)
via 6742a23049352a80984fbe53b138659cc9ddf7ec (commit)
from c295b89a4305bda4012e07943084f14d1d3e312a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 56c2d780393b641f0d6f0751d57b6750ca5dad68
Author: David Scherfgen <d.s...@go...>
Date: Thu May 28 09:53:52 2026 +0200
Correct explanatory comment in PLUSIN
diff --git a/src/simp.lisp b/src/simp.lisp
index 854280310..950ff5b1a 100644
--- a/src/simp.lisp
+++ b/src/simp.lisp
@@ -939,8 +939,8 @@
;; Example: X = 7*2^(1/4) gets added into FM = 2^(1/4) + 2^(3/8)
;; 7*2^(1/4) merges with 2^(1/4) to 8*2^(1/4), but this term is fed into
;; SIMPTIMES, which recognizes that 8 = 2^3, pushes the 3 into the
- ;; exponent and returns 2^(13/4). But 2^(13/4) now must come before the
- ;; already existing term 2^(3/8) to maintain canonical ordering.
+ ;; exponent and returns 2^(13/4). But 2^(13/4) now must come after the
+ ;; already existing term 2^(3/8) in FM to maintain canonical ordering.
(setq int-base-expt-p (and (mexptp x1) (integerp (cadr x1))))
start
(setq base-match-p nil)
commit 6742a23049352a80984fbe53b138659cc9ddf7ec
Author: David Scherfgen <d.s...@go...>
Date: Thu May 28 09:51:30 2026 +0200
Fix infinite loop in GCD $EZ/$MOD with algebraic variables
The GCD routines EZGCD2 ('$EZ) and NEWGCD ('$MOD) can fail on polynomials
containing algebraic variables. In PGCDA, which is the "dispatcher" that calls
the different GCD routines, intercept cases where $GCD is '$EZ or '$MOD and
algebraic variables are present, and dispatch to the OLDGCD ('$SUBRES) routine
instead. This is also what Maxima does when $GCD = '$ALGEBRAIC and algebraic
variables are present.
This fixes #282.
diff --git a/src/rat3c.lisp b/src/rat3c.lisp
index ab64a968b..5279a5ea9 100644
--- a/src/rat3c.lisp
+++ b/src/rat3c.lisp
@@ -118,9 +118,17 @@
(if (or (palgp x) (palgp y))
(let (($gcd '$subres)) (list (oldgcd x y)))
(let (($gcd '$spmod)) (list (zgcd x y)))))
- ((eq $gcd '$ez) (ezgcd2 x y))
+ ((eq $gcd '$ez)
+ (if (or (palgp x) (palgp y))
+ ;; EZGCD2 may loop infinitely on algebraic variables - switch to OLDGCD.
+ (let (($gcd '$subres)) (list (oldgcd x y)))
+ (ezgcd2 x y)))
((eq $gcd '$red) (list (oldgcd x y)))
- ((eq $gcd '$mod) (newgcd x y modulus))
+ ((eq $gcd '$mod)
+ (if (or (palgp x) (palgp y))
+ ;; NEWGCD gcd may loop infinitely on algebraic variables - switch to OLDGCD.
+ (let (($gcd '$subres)) (list (oldgcd x y)))
+ (newgcd x y modulus)))
((not (member $gcd *gcdl* :test #'eq))
(merror (intl:gettext "gcd: 'gcd' variable must be one of ~M; found: ~M") *gcdl* $gcd))
(t (list 1 x y))))
-----------------------------------------------------------------------
Summary of changes:
src/rat3c.lisp | 12 ++++++++++--
src/simp.lisp | 4 ++--
2 files changed, 12 insertions(+), 4 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-27 20:50:08
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via c295b89a4305bda4012e07943084f14d1d3e312a (commit)
from caa920e729bb170e62c04b7a96fa714aabe92715 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c295b89a4305bda4012e07943084f14d1d3e312a
Author: David Scherfgen <d.s...@go...>
Date: Wed May 27 22:49:49 2026 +0200
Fix GCSQR (wrong formula for squaring complex number, called by GCFACTOR)
The function GCSQR, which computes the square of a complex number R + %i * I,
wrongly computed the real part of the result as R^2 + I^2, when it should be
R^2 - I^2. This bug broke GCFACTOR for some numbers.
This fixes bug #4623.
diff --git a/src/numth.lisp b/src/numth.lisp
index 70e351319..61fba4e22 100644
--- a/src/numth.lisp
+++ b/src/numth.lisp
@@ -277,7 +277,7 @@
(let ((r (first a))
(i (second a)))
(declare (integer r i))
- (list (+ (* r r) (* i i)) (ash (* r i) 1))))
+ (list (- (* r r) (* i i)) (ash (* r i) 1))))
(defun gctime1 (a b)
(gctimes (car a) (cadr a) (car b) (cadr b)))
diff --git a/tests/rtest_numth.mac b/tests/rtest_numth.mac
index 06c65ee0a..671a6fd6c 100644
--- a/tests/rtest_numth.mac
+++ b/tests/rtest_numth.mac
@@ -809,3 +809,16 @@ gcfactor (%i / 2);
sublist (%%, lambda ([x], x # true)));
[];
*/
+
+/* Bug #4623: "gcfactor(4), expand(%%) => -4" */
+
+create_list(is(a + %i * b = expand(gcfactor(a + %i * b))), a, makelist(i, i, -4, 4), b, makelist(i, i, -4, 4));
+[true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true];
-----------------------------------------------------------------------
Summary of changes:
src/numth.lisp | 2 +-
tests/rtest_numth.mac | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
hooks/post-receive
--
Maxima CAS
|
|
From: tomasriker <tom...@us...> - 2026-05-27 20:14:12
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via caa920e729bb170e62c04b7a96fa714aabe92715 (commit)
from 6c7372506b5eb62bf2295b27b8b9b2ec1933a1d0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit caa920e729bb170e62c04b7a96fa714aabe92715
Author: David Scherfgen <d.s...@go...>
Date: Wed May 27 22:12:35 2026 +0200
Make FACTOR check that minimal polynomial is irreducible
factor(a^2*g+a*g-a^2, g^3-1) -> division by zero, because g^3-1 = (g-1)*(g^2+g+1).
This fixes bug #4658.
diff --git a/src/rat3e.lisp b/src/rat3e.lisp
index bf8b5f080..827d10c48 100644
--- a/src/rat3e.lisp
+++ b/src/rat3e.lisp
@@ -266,8 +266,14 @@
(setq minpoly* (cadr (ratrep* *alpha*)))
(when (or (pcoefp minpoly*)
(not (univar (cdr minpoly*)))
- (< (cadr minpoly*) 2))
- (merror (intl:gettext "factor: second argument must be a nonlinear, univariate polynomial; found: ~M") *alpha*))
+ (< (cadr minpoly*) 2)
+ ;; Detect a reducible polynomial: factor MINPOLY* with GAUSS = NIL,
+ ;; skip over the content and see if there is more than one factor
+ ;; or the single factor has a multiplicity > 1.
+ (let* ((pfac (let (gauss) (pfactor minpoly*)))
+ (facs (if (pcoefp (car pfac)) (cddr pfac) pfac)))
+ (or (cddr facs) (> (cadr facs) 1))))
+ (merror (intl:gettext "factor: second argument must be an irreducible, nonlinear, univariate polynomial; found: ~M") *alpha*))
(setq *alpha* (pdis (list (car minpoly*) 1 1))
mm* (cadr minpoly*))
(unless (equal (caddr minpoly*) 1)
diff --git a/tests/rtest16.mac b/tests/rtest16.mac
index 3a2c49e6e..0d9c766d3 100644
--- a/tests/rtest16.mac
+++ b/tests/rtest16.mac
@@ -3282,6 +3282,14 @@ expand((1 + sqrt(2)) * 2^(15/4) + (1 - sqrt(2)) * 2^(5/4));
(3^x + 3^(x + 1/2)) + 2*3^x;
3^(x+1)+3^(x+1/2);
+/* Bug #4658: "factor should check that second argument is irreducible" */
+
+errcatch(factor(a^2*g+a*g-a^2, g^3-1));
+[];
+
+factor(a^2*g+a*g-a^2, second(factor(g^3-1)));
+(a*(-g+3*a+1)*(g-1))/3;
+
kill(x);
done$
-----------------------------------------------------------------------
Summary of changes:
src/rat3e.lisp | 10 ++++++++--
tests/rtest16.mac | 8 ++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
hooks/post-receive
--
Maxima CAS
|
|
From: rtoy <rt...@us...> - 2026-05-27 17:20:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-rename-preserve-direction has been created
at 129bc45c2fd82b3f7e7f4813077e64d1a56bf71d (commit)
- Log -----------------------------------------------------------------
commit 129bc45c2fd82b3f7e7f4813077e64d1a56bf71d
Author: Raymond Toy <toy...@gm...>
Date: Wed May 27 10:17:49 2026 -0700
Rename preserve-direction to *prserve-direction*
Make it clear that it's a special variable. And move the definition
from limits.lisp to globals.lisp since it's used in many files.
Update all uses of preserve-direction, of course.
Remove the declare-top for this variable since it's defined in
globals.lisp before anything else is compiled.
diff --git a/src/gamma.lisp b/src/gamma.lisp
index 582665668..79139a82b 100644
--- a/src/gamma.lisp
+++ b/src/gamma.lisp
@@ -368,8 +368,8 @@
(defprop %gamma_incomplete simplim%gamma_incomplete simplim%function)
(defun simplim%gamma_incomplete (expr var val)
- ;; Set preserve-direction to true and find the limit of each argument.
- (let* ((preserve-direction t)
+ ;; Set *preserve-direction* to true and find the limit of each argument.
+ (let* ((*preserve-direction* t)
(a (limit (cadr expr) var val 'think))
(z (limit (caddr expr) var val 'think)))
(cond
diff --git a/src/globals.lisp b/src/globals.lisp
index d4feca29d..316613cee 100644
--- a/src/globals.lisp
+++ b/src/globals.lisp
@@ -1905,3 +1905,8 @@
(defvar *integer-info* nil
"If LIMITP is non-null ASK-INTEGER conses its assumptions onto this
list.")
+
+;; Originally from limits.lisp, but used in other files.
+(defmvar *preserve-direction* ()
+ "Makes `limit' return Direction info.")
+
diff --git a/src/hstep.lisp b/src/hstep.lisp
index 533db56cb..7149620c5 100644
--- a/src/hstep.lisp
+++ b/src/hstep.lisp
@@ -20,8 +20,6 @@
(in-package :maxima)
-(declaim (special preserve-direction))
-
($put '$hstep 1 '$version)
(setf (get '%hstep 'simplim%function) 'simplim%hstep)
@@ -65,7 +63,7 @@
(defun simplim%hstep (e x pt)
"Return limit(e,x,pt), where e = hstep(X)."
- (let* ((preserve-direction t)
+ (let* ((*preserve-direction* t)
(lim (limit (cadr e) x pt 'think))
(sgn (mnqp lim 0)))
(cond
diff --git a/src/limit.lisp b/src/limit.lisp
index 80086c899..367041bab 100644
--- a/src/limit.lisp
+++ b/src/limit.lisp
@@ -52,8 +52,6 @@
(defmvar limit-using-taylor ()
"Is the current limit computation using taylor expansion?")
-(defmvar preserve-direction () "Makes `limit' return Direction info.")
-
#+nil
(unless (boundp 'integer-info) (setq integer-info ()))
@@ -265,7 +263,7 @@
(defun clean-limit-exp (exp)
(setq exp (restorelim exp))
- (if preserve-direction exp (ridofab exp)))
+ (if *preserve-direction* exp (ridofab exp)))
;; Users who want limit to map over equality (mequal) will need to do that
;; manually.
@@ -319,9 +317,9 @@
(setq *integer-info* *old-integer-info*))))
;; The optional arg allows the caller to decide on the value of
-;; preserve-direction. Default is nil, since we immediately ridofab.
+;; *preserve-direction*. Default is nil, since we immediately ridofab.
(defun both-side (exp var val &optional (preserve nil))
- (let* ((preserve-direction preserve)
+ (let* ((*preserve-direction* preserve)
(la (toplevel-$limit exp var val '$plus)) lb)
; Immediately propagate an und without trying the
; other direction
@@ -409,7 +407,7 @@
;; it doesn't.
(defun getsignl (z)
(let ((sgn))
- (setq z (let ((preserve-direction nil)) (limit-catch z var val)))
+ (setq z (let ((*preserve-direction* nil)) (limit-catch z var val)))
(cond
;; Don't call csign on ind, und, infinity, zeroa, or zerob.
;; When z is either zeroa or zerob, return 0.
@@ -651,7 +649,7 @@ ignoring dummy variables and array indices."
((not (free small '$ind)) '$ind) ;Not exactly right but not
((not (free small '$und)) '$und) ;causing trouble now.
((mapatom small) small)
- (t (let ((preserve-direction t)
+ (t (let ((*preserve-direction* t)
(new-small (subst (m^ '$inf -1) '$zeroa
(subst (m^ '$minf -1) '$zerob small))))
(simpinf new-small)))))
@@ -2177,7 +2175,7 @@ ignoring dummy variables and array indices."
;; We're looking at (neg + {zerob, 0 zeroa} %i)^el. We need to
;; do a rectform on bas and decide if the imaginary part is
;; zerob, 0, or zeroa.
- (let ((x) (y) (xlim) (ylim) (preserve-direction t))
+ (let ((x) (y) (xlim) (ylim) (*preserve-direction* t))
(setq bas (risplit bas))
(setq x (car bas)
y (cdr bas))
@@ -2211,7 +2209,7 @@ ignoring dummy variables and array indices."
(t (equal (getsignl (m1- `((mabs) ,bl))) 0))))
(defun simplimit (exp var val)
- (let ((preserve-direction t) (op nil))
+ (let ((*preserve-direction* t) (op nil))
(cond
((eq var exp) val)
@@ -2290,7 +2288,7 @@ ignoring dummy variables and array indices."
(setq e (resimplify (subst (m// 1 var) var e)))
(let ((new-val (cond ((eq val '$zeroa) '$inf)
((eq val '$zerob) '$minf))))
- (if new-val (let ((preserve-direction t))
+ (if new-val (let ((*preserve-direction* t))
(toplevel-$limit e var new-val)) (throw 'limit t))))
(defun simplimtimes (exp)
@@ -2462,12 +2460,12 @@ ignoring dummy variables and array indices."
(throw 'limit t))
;; Blend the zerob, zeroa, and sum terms. When there are both zerob
- ;; and zeroa terms, ignore them. When preserve-direction is true and
+ ;; and zeroa terms, ignore them. When *preserve-direction* is true and
;; there are zerob terms, push zerob into the sum terms. And do the same
;; for zeroa. After that, add the terms in the list sum.
- (when (and preserve-direction zerobl (null zeroal))
+ (when (and *preserve-direction* zerobl (null zeroal))
(push '$zerob sum))
- (when (and preserve-direction zeroal (null zerobl))
+ (when (and *preserve-direction* zeroal (null zerobl))
(push '$zeroa sum))
;; When indl has two or more members, we attempt to condense the
@@ -3267,7 +3265,7 @@ ignoring dummy variables and array indices."
;;; Limit(log(XXX), var, 0, val), where val is either zerob (limit from below)
;;; or zeroa (limit from above).
(defun simplimln (expr var val)
- (let ((arglim (let ((preserve-direction t)) (limit (cadr expr) var val 'think))) (dir))
+ (let ((arglim (let ((*preserve-direction* t)) (limit (cadr expr) var val 'think))) (dir))
;; When arglim is 0, try using behavior to determine if the limit is zerob or zeroa.
(when (eql arglim 0)
(setq dir (behavior expr var val))
@@ -3477,8 +3475,8 @@ ignoring dummy variables and array indices."
(ylim-z)
(dir)
(q))
- (setq xlim (let ((preserve-direction t)) (limit x v pt 'think)))
- (setq ylim (let ((preserve-direction t)) (limit y v pt 'think)))
+ (setq xlim (let ((*preserve-direction* t)) (limit x v pt 'think)))
+ (setq ylim (let ((*preserve-direction* t)) (limit y v pt 'think)))
(when (eql 0 xlim)
(setq dir (behavior x v pt))
diff --git a/src/nummod.lisp b/src/nummod.lisp
index 197009563..fdd0c4c53 100644
--- a/src/nummod.lisp
+++ b/src/nummod.lisp
@@ -26,8 +26,6 @@
(in-package :maxima)
-(declare-top (special preserve-direction))
-
(macsyma-module nummod)
;; Let's have version numbers 1,2,3,...
@@ -253,7 +251,7 @@
(defun simplim%floor (expr var val)
(let* ((arg (cadr expr))
(b (behavior arg var val))
- (arglimab (let ((preserve-direction t)) (limit arg var val 'think))) ; with $zeroa $zerob
+ (arglimab (let ((*preserve-direction* t)) (limit arg var val 'think))) ; with $zeroa $zerob
(arglim (ridofab arglimab)))
(cond
((eq arglim '$ind) (throw 'limit nil))
@@ -325,7 +323,7 @@
(defun simplim%ceiling (expr var val)
(let* ((arg (cadr expr))
(b (behavior arg var val))
- (arglimab (let ((preserve-direction t)) (limit arg var val 'think))) ; with $zeroa $zerob
+ (arglimab (let ((*preserve-direction* t)) (limit arg var val 'think))) ; with $zeroa $zerob
(arglim (ridofab arglimab)))
(cond
((eq arglim '$ind) (throw 'limit nil))
@@ -415,7 +413,7 @@
(defun simplim%round (expr var val)
(let* ((arg (cadr expr))
(b (behavior arg var val))
- (arglimab (let ((preserve-direction t)) (limit arg var val 'think))) ; with $zeroa $zerob
+ (arglimab (let ((*preserve-direction* t)) (limit arg var val 'think))) ; with $zeroa $zerob
(arglim (ridofab arglimab)))
(cond
((eq arglim '$ind) (throw 'limit nil))
diff --git a/src/sinc.lisp b/src/sinc.lisp
index f7bc79ab7..726c56ba5 100644
--- a/src/sinc.lisp
+++ b/src/sinc.lisp
@@ -76,7 +76,7 @@
(defun simplim%sinc (e x pt)
"Return limit(sinc(X),x,pt)."
- (let* ((preserve-direction t)
+ (let* ((*preserve-direction* t)
(lim (limit (cadr e) x pt 'think)))
(cond ((eq lim '$ind) '$ind) ; sinc(ind) = ind
((or (eq lim '$minf) (eq lim '$inf)) 0) ; sinc(minf) = 0 & sinc(inf) = 0
diff --git a/src/tlimit.lisp b/src/tlimit.lisp
index 1cef71321..ecab7b170 100644
--- a/src/tlimit.lisp
+++ b/src/tlimit.lisp
@@ -10,7 +10,7 @@
(in-package :maxima)
-(declare-top (special taylored *limit-assumptions* preserve-direction *getsignl-asksign-ok*))
+(declare-top (special taylored *limit-assumptions* *getsignl-asksign-ok*))
(declaim (special *limit-method-depth* *already-processed-limits*))
@@ -239,7 +239,7 @@
(new-val (liminv-new-val val)))
(cond
(new-val
- (let ((preserve-direction t))
+ (let ((*preserve-direction* t))
(taylim ee var new-val nil)))
(t
(throw 'limit t)))))
-----------------------------------------------------------------------
hooks/post-receive
--
Maxima CAS
|
|
From: willisbl <wil...@us...> - 2026-05-27 16:56:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via 6c7372506b5eb62bf2295b27b8b9b2ec1933a1d0 (commit)
from 94c96353eb5e8644fe80e50eca3d95e168372635 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6c7372506b5eb62bf2295b27b8b9b2ec1933a1d0
Author: Barton Willis <wi...@un...>
Date: Wed May 27 11:56:26 2026 -0500
Fix for \#4689: limit of spherical_bessel_j
Modified colexpt so that it throws to 'limit when it cannot determine the required limit.
Removed one explicit call to simplimexpt from colexpt; dispatching such functions is the
responsibility of simplimit.
Deprecated the function limroot. It is no longer needed by colexpt and is not called by any
other function.
Added test cases, including the test suggested in the ticket, to rtest_limit_extra.mac.
Updated ChangeLog.
No unexpected testsuite or share testsuite failures using SBCL 2.6.4 or Clozure CL 1.13.1.
diff --git a/ChangeLog b/ChangeLog
index 86db0c245..721b58853 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ Bug fixes for numbered bugs:
----------------------------
* \#4585 Taylor polynomials involving tangent & a quotient
* \#4634 Divergent integral simplifies to -1/4 with simplify_sum
+ * \#4689 limit of a spherical_bessel_j function
* \#4724 xreduce with init arg and declared nary function
* \#4729 rtest_limit.mac: Problem 230 (line 866)
* \#4735 rtest_limit_gruntz problem 21, line 121 has sign error in expected limit
diff --git a/src/limit.lisp b/src/limit.lisp
index 702966924..80086c899 100644
--- a/src/limit.lisp
+++ b/src/limit.lisp
@@ -1512,27 +1512,48 @@ ignoring dummy variables and array indices."
(t ($gcd (getexp (car list))
(getexplist (cdr list))))))
-(defun limroot (exp power)
- (cond ((or (atom exp) (not (member (caar exp) '(mtimes mexpt) :test #'eq)))
- (limroot (list '(mexpt) exp 1) power)) ;This is strange-JIM.
- ((mexptp exp) (m^ (cadr exp)
- (sratsimp (m* (caddr exp) (m^ power -1.)))))
- (t (m*l (mapcar #'(lambda (x)
- (limroot x power))
- (cdr exp))))))
-
-;;NUMERATOR AND DENOMINATOR HAVE EXPONENTS WITH GCD OF GCP.
-;;; Used to call simplimit but some of the transformations used here
-;;; were not stable w.r.t. the simplifier, so try keeping exponent separate
-;;; from bas.
+(defun limroot (&rest args)
+ "limroot is deprecated and no longer available."
+ (declare (ignore args))
+ (merror "limroot is deprecated and no longer available."))
+
+(defun freeof-extended-real (e)
+ "Return T iff e is semantically free of extended-real numbers."
+ ($freeof '$minf '$zerob '$zeroa '$ind '$und '$inf '$infinity e))
+
+;; colexpt returns limit(n/dn, var, val). Assumptions:
+;; (a) n has the form a^P
+;; (b) dn has the form b^Q
+;; (c) gcp is a positive integer
+;;
+;; The function colexpt attempts to compute limit(a^P/b^Q, x, pt) using the identity
+;; limit(a^P / b^Q, x, pt) = limit(a^(P/gcp) / b^(Q/gcp), x, pt)^gcp.
+;; The value of gcp is passed to colexpt; the logic for finding a suitable gcp
+;; is not part of colexpt.
+;;
+;; When the assumptions are unmet, or when Maxima is unsuccessful in finding
+;; limit(a^(P/gcp) / b^(Q/gcp), x, pt), colexpt throws to 'limit.
+;;
+;; After determining lim = limit(a^(P/gcp) / b^(Q/gcp), x, pt), the code
+;; evaluates infsimp(lim^gcp). The function infsimp cleans up some cases, such
+;; as inf^2, but it misses others such as ind^2. To avoid returning expressions
+;; such as ind^2, the code performs a semantic check to determine whether the
+;; expression is either an extended real or does not involve an extended real.
(defun colexpt (n dn gcp)
- (let ((bas (m* (limroot n gcp) (limroot dn (m* -1 gcp))))
- (expo gcp)
- baslim expolim)
- (setq baslim (limit bas var val 'think))
- (setq expolim (limit expo var val 'think))
- (simplimexpt bas expo baslim expolim)))
+ (cond ((and (mexptp n) (mexptp dn) (integerp gcp) (> gcp 0))
+ (let* ((a (second n))
+ (p (div (third n) gcp))
+ (b (second dn))
+ (q (div (third dn) gcp))
+ (lim (limit (div (ftake 'mexpt a p) (ftake 'mexpt b q)) var val 'think))
+ (lim^gcp (if (successful-limit-result-p lim)
+ (infsimp (ftake 'mexpt lim gcp))
+ nil)))
+ (if (and lim^gcp (or (extended-real-p lim^gcp) (freeof-extended-real lim^gcp)))
+ lim^gcp
+ (throw 'limit nil))))
+ (t (throw 'limit nil))))
(defun zero-fixup (e x pt)
"Assuming `substitute(pt, x, e)` vanishes, attempt to determine if the zero is `zerob` or `zeroa`.
diff --git a/tests/rtest_limit_extra.mac b/tests/rtest_limit_extra.mac
index 6fd1aa6b9..966cef9e0 100644
--- a/tests/rtest_limit_extra.mac
+++ b/tests/rtest_limit_extra.mac
@@ -1493,6 +1493,22 @@ block([expintrep : gamma_incomplete],
limit(expintegral_ci(5 + cos(x)), x, inf));
ind$
+/* \#4689 limit of a spherical_bessel_j function */
+limit(spherical_bessel_j(1,x)^2,x,inf);
+0$
+
+limit(spherical_bessel_j(1,x)^2,x,minf);
+0$
+
+limit(spherical_bessel_j(1,x),x,inf);
+0$
+
+limit(spherical_bessel_j(3,x),x,inf);
+0$
+
+limit(spherical_bessel_j(3,x),x,minf);
+0$
+
/* clean up*/
/*(kill(values),0);
0$*/
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
src/limit.lisp | 59 ++++++++++++++++++++++++++++++---------------
tests/rtest_limit_extra.mac | 16 ++++++++++++
3 files changed, 57 insertions(+), 19 deletions(-)
hooks/post-receive
--
Maxima CAS
|