|
From: peterpall <pet...@us...> - 2025-10-05 15:06:06
|
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 f450059a112c34cf8c110a96584392f93c50ec3a (commit)
from d8a058f9806ffafb1e8f59e439c82a85b607b1a1 (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 f450059a112c34cf8c110a96584392f93c50ec3a
Author: Gunter Königsmann <gu...@pe...>
Date: Sun Oct 5 17:05:52 2025 +0200
wrstcse: wc_ewc_simplify no more uses diff() and limit()
limit() sometimes needs hours when confronted with trivial equations
(which defeats wc_ewc_simplify's purpose as a function that speeds
up things), sometimes errors out with a floating-point exception and
as the testsuite would have shown if it didn't mimic a bug in wrstcse
the diff() sometimes predicts a different result at tol[n]=0 than we
get for the more-real-world-case of tol[n] being -1 or 1.
diff --git a/share/contrib/rtest_wrstcse.mac b/share/contrib/rtest_wrstcse.mac
index 2cf6eda6d..15e07734f 100644
--- a/share/contrib/rtest_wrstcse.mac
+++ b/share/contrib/rtest_wrstcse.mac
@@ -62,13 +62,17 @@ ratsimp(wc_systematic(vals));
wc_ewc_simplify( ratsimp(wc_systematic(vals)));
[[a=a,b=1],[a=a,b=2],[a=a,b=3],[a=b,b=1],[a=b,b=2],[a=b,b=3],[a=c,b=1],[a=c,b=2],[a=c,b=3]];
wc_ewc_simplify(7*(tol[1]+.1)/(6*tol[2]+.1));
-(7*(0.1-tol[2]))/(6*tol[2]+0.1);
+(7*(tol[1]+0.1))/(6*tol[2]+0.1);
+wc_ewc_simplify(7*(tol[1]+.1)/(6*tol[2]+10));
+(7*(0.1-tol[2]))/(6*tol[2]+10);
wc_ewc_simplify(7*(tol[1]+.1)/(6*tol[2]-.1));
-(7*(tol[2]+0.1))/(6*tol[2]-0.1);
+(7*(tol[1]+0.1))/(6*tol[2]-0.1);
wc_mintypmax_percent(tol[1]+.5*tol[2]+4,3);
[min=-(37.5*"%"),typ=4,max=37.5*"%"];
wc_mintypmax(tol[1]+.5*tol[2]+4,3);
[min=2.5,typ=4,max=5.5];
+wc_ewc_simplify(7*(tol[1]+.1)/(6*tol[2]-10));
+(7*(tol[2]+0.1))/(6*tol[2]-10);
subst(wc_mintypmax_rss(tol[1]+.5*tol[2]+4,3),'min),ratprint=false;
3.440983005625053;
subst(wc_mintypmax_rss(tol[1]+.5*tol[2]+4,3),'typ),ratprint=false;
diff --git a/share/contrib/wrstcse.mac b/share/contrib/wrstcse.mac
index 59039341d..14da33e60 100644
--- a/share/contrib/wrstcse.mac
+++ b/share/contrib/wrstcse.mac
@@ -302,10 +302,9 @@ defs allows to add things like
*/
wc_ewc_simplify(x,[defs]):=block(
[
- /* The derivate of x to the tol[n] we currently look at */
- wc_diffofwctol,
- /* wc_diffofwctol for the current tol being 0 */
- wc_diffofwctollimit,
+ wc_tolminus,
+ wc_tolplus,
+ wc_toltyp,
/*the tol[n] we merge as many tolerances as we can to */
mergedtol:[],
/* Is the tol[n] we merge as many tolerances as we can to positive? */
@@ -321,55 +320,22 @@ wc_ewc_simplify(x,[defs]):=block(
'wc_success
) # ['wc_success] then
error ("wc_ewc_simplify: parameters 2...n need to be assignments to tol[n]."),
+
/* Now let's see we can merge the remaining tol[n] */
+ wc_toltyp:wc_typicalvalues(x_defs),
+
for wc_tol in %wc_tols(x_defs) do
- /* If one step of this loop errors out this means one tolerance isn't merged, but
- the for loop can still continue. */
- errcatch(
- /* Let's see if increasing the current tol[n] increases x_defs*/
- wc_diffofwctol:%wc_typicalvalues(diff(x_defs,wc_tol),wc_tol),
- wc_diffofwctollimit:limit(wc_diffofwctol,wc_tol,0),
- if wc_diffofwctollimit='ind then block(
- [
- poslimit:sign(limit(wc_diffofwctol,wc_tol,0,'plus)),
- neglimit:sign(limit(wc_diffofwctol,wc_tol,0,'minus))
- ],
- if (poslimit='pos and (neglimit='pos or neglimit='zero)) or
- (neglimit='pos and (poslimit='pos or poslimit='zero)) then
- (
- /* increasing tol[n] increases x_defs */
- if mergedtol = [] then
- (
- /* merge this tol[n] with all future ones */
- mergedtol:wc_tol,
- wc_mergedtoldirection:1
- )
- else
- (
- x_defs:subst(wc_tol=wc_mergedtoldirection*mergedtol,x_defs),
- x :subst(wc_tol=wc_mergedtoldirection*mergedtol,x )
- )
- ),
- if (poslimit='neg and (neglimit='neg or neglimit='zero)) or
- (neglimit='neg and (poslimit='neg or poslimit='zero)) then
- (
- /* increasing tol[n] decreases x_defs */
- if mergedtol = [] then
- (
- /* merge this tol[n] with all future ones */
- mergedtol:wc_tol,
- wc_mergedtoldirection:-1
- )
- else
- (
- x_defs:subst(wc_tol=-wc_mergedtoldirection*mergedtol,x_defs),
- x :subst(wc_tol=-wc_mergedtoldirection*mergedtol,x )
- )
- )
- )
- else
- (
- if wc_diffofwctollimit > 0 then
+ /* If one step of this loop errors out this means one tolerance isn't merged, but
+ the for loop can still continue. */
+ errcatch(
+ /* Let's see if increasing the current tol[n] increases x_defs*/
+ wc_tolminus:wc_typicalvalues(subst(wc_tol=-1,x_defs)),
+ wc_tolplus :wc_typicalvalues(subst(wc_tol= 1,x_defs)),
+
+ if
+ ((wc_tolplus > wc_toltyp) and (wc_toltyp >= wc_tolminus)) or
+ ((wc_tolplus >= wc_toltyp) and (wc_toltyp > wc_tolminus))
+ then
(
/* increasing tol[n] increases x_defs */
if mergedtol = [] then
@@ -387,7 +353,10 @@ wc_ewc_simplify(x,[defs]):=block(
else
(
/* The above if might have resulted in true or unknown */
- if wc_diffofwctollimit < 0 then
+ if
+ ((wc_tolplus < wc_toltyp) and (wc_toltyp <= wc_tolminus)) or
+ ((wc_tolplus <= wc_toltyp) and (wc_toltyp < wc_tolminus))
+ then
(
/* increasing wc_tol decreases x_defs */
if mergedtol = [] then
@@ -403,8 +372,7 @@ wc_ewc_simplify(x,[defs]):=block(
x :subst(wc_tol=-wc_mergedtoldirection*mergedtol,x )
)
)
- )
- )
+ )
),
return(x)
);
-----------------------------------------------------------------------
Summary of changes:
share/contrib/rtest_wrstcse.mac | 8 +++--
share/contrib/wrstcse.mac | 76 ++++++++++++-----------------------------
2 files changed, 28 insertions(+), 56 deletions(-)
hooks/post-receive
--
Maxima CAS
|