login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for Sqrt3Demo revision 3 of 4

1 2 3 4
Editor: kratt6
Time: 2008/08/16 06:37:55 GMT-7
Note:

changed:
-
-
Alternatively, we could also use Renaud Rioboo's 'RECLOS package, which has both mathematical equality and ordering.  Unfortunately, it is not as easy to use - most importantly, you have to "name" your real roots, if you want simple answers:
\begin{axiom}
RAN ==> RECLOS FRAC INT
x1 := (sqrt(3)$RAN-3)*(sqrt(3)$RAN+1)/6
xx1 := -1/sqrt(3)$RAN
(x1=xx1)@Boolean
\end{axiom}
It's preferable to give names to the roots:
\begin{axiom}
s3 := sqrt(3)$RAN
(s3-3)*(s3+1)/6
\end{axiom}
'AlgebraicNumber' doesn't like the following:
\begin{axiom}
f3 := sqrt(3,5)$RAN
f25 := sqrt(1/25,5)$RAN;
f32 := sqrt(32/5,5)$RAN;
f27 := sqrt(27/5,5)$RAN;
sqrt(f32-f27,3)-f25*(1+f3-f3^2)
\end{axiom}

Although the main point of 'RECLOS' is supposed do be mathematical ordering and approximation, I could not find a convincing exmaple.  From the 'examples' section of 'RECLOS':
\begin{axiom}
s := sqrt(190)$RAN+sqrt(1751)$RAN-sqrt(208)$RAN-sqrt(1698)$RAN
approximate(s, 10^-15)::Float
\end{axiom}
But we get the same without 'RECLOS':
\begin{axiom}
t := sqrt(190)+sqrt(1751)-sqrt(208)-sqrt(1698)
digits(30);
numeric t - approximate(s, 10^-30)::Float
\end{axiom}


Some demo involving the algebraic number LatexWiki Image.

axiom
t1 := (sqrt(3)-3)*(sqrt(3)+1)/6
LatexWiki Image(1)
Type: AlgebraicNumber?
axiom
tt1 := -1/sqrt(3)
LatexWiki Image(2)
Type: AlgebraicNumber?
axiom
t2 := sqrt(3)/6
LatexWiki Image(3)
Type: AlgebraicNumber?
axiom
t1+t2
LatexWiki Image(4)
Type: AlgebraicNumber?
axiom
tt1+t2
LatexWiki Image(5)
Type: AlgebraicNumber?

Note that in PanAxiom? the above are not generic expressions but of type AlgebraicNumber?.

Alternatively, we could also use Renaud Rioboo's 'RECLOS package, which has both mathematical equality and ordering. Unfortunately, it is not as easy to use - most importantly, you have to "name" your real roots, if you want simple answers:

axiom
RAN ==> RECLOS FRAC INT
Type: Void
axiom
x1 := (sqrt(3)$RAN-3)*(sqrt(3)$RAN+1)/6
LatexWiki Image(6)
Type: RealClosure? Fraction Integer
axiom
xx1 := -1/sqrt(3)$RAN
LatexWiki Image(7)
Type: RealClosure? Fraction Integer
axiom
(x1=xx1)@Boolean
LatexWiki Image(8)
Type: Boolean

It's preferable to give names to the roots:

axiom
s3 := sqrt(3)$RAN
LatexWiki Image(9)
Type: RealClosure? Fraction Integer
axiom
(s3-3)*(s3+1)/6
LatexWiki Image(10)
Type: RealClosure? Fraction Integer

AlgebraicNumber doesn't like the following:

axiom
f3 := sqrt(3,5)$RAN
LatexWiki Image(11)
Type: RealClosure? Fraction Integer
axiom
f25 := sqrt(1/25,5)$RAN;
Type: RealClosure? Fraction Integer
axiom
f32 := sqrt(32/5,5)$RAN;
Type: RealClosure? Fraction Integer
axiom
f27 := sqrt(27/5,5)$RAN;
Type: RealClosure? Fraction Integer
axiom
sqrt(f32-f27,3)-f25*(1+f3-f3^2)
LatexWiki Image(12)
Type: RealClosure? Fraction Integer

Although the main point of RECLOS is supposed do be mathematical ordering and approximation, I could not find a convincing exmaple. From the examples section of 'RECLOS':

axiom
s := sqrt(190)$RAN+sqrt(1751)$RAN-sqrt(208)$RAN-sqrt(1698)$RAN
LatexWiki Image(13)
Type: RealClosure? Fraction Integer
axiom
approximate(s, 10^-15)::Float
LatexWiki Image(14)
Type: Float

But we get the same without 'RECLOS':

axiom
t := sqrt(190)+sqrt(1751)-sqrt(208)-sqrt(1698)
LatexWiki Image(15)
Type: AlgebraicNumber?
axiom
digits(30);
Type: PositiveInteger?
axiom
numeric t - approximate(s, 10^-30)::Float
LatexWiki Image(16)
Type: Float