Waldek Hebisch <[EMAIL PROTECTED]> writes:
> Martin Rubey wrote:
> >
> > Waldek,
> >
> > didn't you want to release? Is there something missing?
> >
>
> We will have release, I was just pretty busy last few days so there
> is a delay.
Great. Actually, given the amount of work you usually put into fricas, I was
already afraid something happened. You didn't show up for more than one day :-)
> > * patches to packageCall and InputForms for Segment
>
> That one can go on.
done.
> > * patches to plot with non gcl
> >
>
> Looked reasonable, but ATM I do not remember if something needs
> to change.
For convenience, attached below. Main idea is to return max()$DoubleFloat
instead of 0 in case of floating point error. Such values are then filtered by
the current plotting routines. Should not change results with gcl under usual
circumstances, although in theory it might affect some comparisons.
> > * the patch by Francois Maltey for asin, acos, etc.
> Somebody should check (re-check ?) branch cuts and singularities with this
> patch.
Could you be more precise, i.e., formulate a test?
One other thing: In vmlisp.lisp we have
(defun EBCDIC (x) (int-char x))
open-axiom has
(defun EBCDIC (x) (code-char x))
since int-char is undefined.
Shows up here:
(33) -> %b
>> System error:
The function VMLISP::INT-CHAR is undefined.
But using int-char, after entering %b I get strange output... No idea what
they are for, but I think %b and %d should be normal identifiers. (They are
useful in pattern matching)
(1) -> %b
(1) �
Type: Variable(�)
(2) -> %d
(2) A
Type: Variable(A)
(3) -> %a
(3) %a
Type: Variable(%a)
(4) -> )sh INT
Integer is a domain constructor
Abbreviation for Integer is INT
This constructor is exposed in this frame.
-------------------------------�OperationsA--------------------------------
�?*?A: (%,%) -> % �?*?A: (Integer,%) -> %
�?*?A: (PositiveInteger,%) -> % �?**?A: (%,PositiveInteger) -> %
�?+?A: (%,%) -> % �?-?A: (%,%) -> %
�-?A: % -> % �?<?A: (%,%) -> Boolean
Thanks,
Martin
-- new file: src/input/plot.input.pamphlet
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input lode.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991.
@
<<*>>=
<<license>>
)set break resume
)expose UnittestCount UnittestAux Unittest
testsuite "plotting"
testcase "plotting large values"
testTrue("(close draw(exp(-1/x)*sin(1/x), x=-1..1); true)")
testTrue("(close draw(exp(-1/x^3)*sin(1/x), x=-1..1); true)")
testTrue("(close draw(Gamma x, x=10^(-100)..1); true)")
testTrue("(close draw((x:DFLOAT):DFLOAT +-> log2 x, 10^-10..1); true)")
testTrue("(close draw((x:DFLOAT):DFLOAT +-> tan x, -10..10); true)")
testTrue("(close draw((x:DFLOAT):DFLOAT +-> sec(1/exp x), -10..10); true)")
expected() ==
messagePrint("testsuite | testcases: failed (total) | tests: failed
(total)")$OutputForm;
messagePrint("plotting 0 (1) 0
(6)")$OutputForm
statistics()
expected()
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
Index: src/algebra/clip.spad.pamphlet
===================================================================
--- src/algebra/clip.spad.pamphlet (revision 432)
+++ src/algebra/clip.spad.pamphlet (working copy)
@@ -95,13 +95,18 @@
Fnan? x == x~=x
Pnan? p == any?(Fnan?,p)
+ safeNorm(x: Pt): SF ==
+ s := trapNumericErrors(norm(x))$Lisp :: Union(SF, "failed")
+ s case "failed" => max()$SF
+ s::SF
+
iClipParametric(pointLists,fraction,scale) ==
-- error checks and special cases
(fraction < 0) or (fraction > 1) =>
error "clipDraw: fraction should be between 0 and 1"
empty? pointLists => [nil(),segment(0,0),segment(0,0)]
-- put all points together , sort them according to norm
- sortedList := sort(norm(#1) < norm(#2),select(not Pnan? #1,concat
pointLists))
+ sortedList := sort(safeNorm(#1) < safeNorm(#2),select(not Pnan?
#1,concat pointLists))
empty? sortedList => [nil(),segment(0,0),segment(0,0)]
n := # sortedList
num := numer fraction
Index: src/algebra/draw.spad.pamphlet
===================================================================
--- src/algebra/draw.spad.pamphlet (revision 432)
+++ src/algebra/draw.spad.pamphlet (working copy)
@@ -318,7 +318,7 @@
myTrap1: (SF-> SF, SF) -> SF
myTrap1(ff:SF-> SF, f:SF):SF ==
s := trapNumericErrors(ff(f))$Lisp :: Union(SF, "failed")
- s case "failed" => 0
+ s case "failed" => max()$SF
r:=s::SF
r >max()$SF => max()$SF
r < min()$SF => min()$SF
Index: src/algebra/plot.spad.pamphlet
===================================================================
--- src/algebra/plot.spad.pamphlet (revision 432)
+++ src/algebra/plot.spad.pamphlet (working copy)
@@ -278,6 +278,20 @@
yRange := select(q,yCoord,min) .. select(q,yCoord,max)
[ f, [nRange,xRange,yRange], c, q]
+ computes1s2dp: (P, P, P, F, F) -> List F
+ computes1s2dp(sp1, sp2, sp3, xDiff, yDiff) ==
+ x0 := xCoord sp1; y0 := yCoord sp1
+ x1 := xCoord sp2; y1 := yCoord sp2
+ x2 := xCoord sp3; y2 := yCoord sp3
+
+ a1 := (x1-x0)/xDiff; b1 := (y1-y0)/yDiff
+ a2 := (x2-x1)/xDiff; b2 := (y2-y1)/yDiff
+
+ s1 := sqrt(a1**2+b1**2) -- distance between sp1 and sp2
+ s2 := sqrt(a2**2+b2**2) -- distance between sp2 and sp3
+ dp := a1*a2+b1*b2 --
+ [s1, s2, dp]
+
adaptivePlot(curve,tRange,xRange,yRange,pixelfraction) ==
xDiff := hi xRange - lo xRange
yDiff := hi yRange - lo yRange
@@ -324,21 +338,21 @@
todo2 := rest todo2
if not null todo1 then (t := first(todo1); p := first(todo2))
sp := first(todo2)
- x0 := xCoord first(sp); y0 := yCoord first(sp)
- x1 := xCoord second(sp); y1 := yCoord second(sp)
- x2 := xCoord third(sp); y2 := yCoord third(sp)
- a1 := (x1-x0)/xDiff; b1 := (y1-y0)/yDiff
- a2 := (x2-x1)/xDiff; b2 := (y2-y1)/yDiff
- s1 := sqrt(a1**2+b1**2); s2 := sqrt(a2**2+b2**2)
- dp := a1*a2+b1*b2
- s1 < maxLength and s2 < maxLength and _
- (s1 = 0::F or s2 = 0::F or
- s1 < minLength and s2 < minLength or _
- dp/s1/s2 > ANGLEBOUND) =>
+ safes1s2dp :=
+ trapNumericErrors(computes1s2dp(first sp, second sp, third sp,
+ xDiff, yDiff))$Lisp
+ ::Union(List F, "failed")
+
+ (not (safes1s2dp case "failed")) and
+ (s := safes1s2dp::List F).1 < maxLength and s.2 < maxLength and _
+ (s.1 = 0::F or s.2 = 0::F or
+ s.1 < minLength and s.2 < minLength or _
+ s.3/s.1/s.2 > ANGLEBOUND) =>
todo1 := rest todo1
todo2 := rest todo2
if not null todo1 then (t := first(todo1); p := first(todo2))
+
if n > MAXPOINTS then leave else n := n + 1
st := rest t
if not null rest rest st then
Index: src/input/Makefile.in
===================================================================
--- src/input/Makefile.in (revision 432)
+++ src/input/Makefile.in (working copy)
@@ -152,8 +152,8 @@
${OUT}/pascal1.input \
ricFailure|)))
+ (arithmetic-error () |$numericFailure|)
+ (simple-type-error () |$numericFailure|)))
;;;;;; considering this version for kcl
;;(defmacro |trapNumericErrors| (form)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel