$SPAD/src/input realclos.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool realclos.output
)set message test on
)set message auto off
)clear all

———-

Computing without a table manipulation when creating objects — * —

--S 1 of 31
Ran := RECLOS(FRAC INT)
--R
--R
--R   (1)  RealClosure(Fraction(Integer))
--R                                                                 Type: Domain
--E 1

———-

Some simple signs for square roots, these correspond to an extension of degree 16 of the rational numbers.

— * —

--S 2 of 31
fourSquares(a:Ran,b:Ran,c:Ran,d:Ran):Ran ==
           sqrt(a)+sqrt(b) - sqrt(c)-sqrt(d)
--R
--R   Function declaration fourSquares : (RealClosure(Fraction(Integer)),
--R      RealClosure(Fraction(Integer)),RealClosure(Fraction(Integer)),
--R      RealClosure(Fraction(Integer))) -> RealClosure(Fraction(Integer))
--R      has been added to workspace.
--R                                                                   Type: Void
--E 2
--S 3 of 31
squareDiff := fourSquares(73,548,60,586)
--R
--R   Compiling function fourSquares with type (RealClosure(Fraction(

--R      Integer)),RealClosure(Fraction(Integer)),RealClosure(Fraction(
--R      Integer)),RealClosure(Fraction(Integer))) -> RealClosure(Fraction
--R      (Integer))
--R
--R           +---+    +--+    +---+    +--+
--R   (3)  - \|586  - \|60  + \|548  + \|73
--R                                         Type: RealClosure(Fraction(Integer))
--E 3
--S 4 of 31
recip(squareDiff)
--R
--R
--R   (4)
--R             +---+          +--+  +--+         +--+ +---+            +---+
--R     ((54602\|548  + 149602\|73 )\|60  + 49502\|73 \|548  + 9900895)\|586
--R   +
--R             +--+ +---+             +--+            +---+            +--+
--R     (154702\|73 \|548  + 30941947)\|60  + 10238421\|548  + 28051871\|73
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 4
--S 5 of 31
sign(squareDiff)
--R
--R
--R   (5)  1
--R                                                        Type: PositiveInteger
--E 5
--S 6 of 31
squareDiff := fourSquares(165,778,86,990)
--R
--R
--R           +---+    +--+    +---+    +---+
--R   (6)  - \|990  - \|86  + \|778  + \|165
--R                                         Type: RealClosure(Fraction(Integer))
--E 6
--S 7 of 31
recip(squareDiff)
--R
--R
--R   (7)
--R                +---+           +---+  +--+          +---+ +---+
--R       ((556778\|778  + 1209010\|165 )\|86  + 401966\|165 \|778  + 144019431)
--R    *
--R        +---+
--R       \|990
--R   +

--R              +---+ +---+              +--+             +---+             +---+
--R     (1363822\|165 \|778  + 488640503)\|86  + 162460913\|778  + 352774119\|165
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 7
--S 8 of 31
sign(squareDiff)
--R
--R
--R   (8)  1
--R                                                        Type: PositiveInteger
--E 8
--S 9 of 31
squareDiff := fourSquares(217,708,226,692)
--R
--R
--R           +---+    +---+    +---+    +---+
--R   (9)  - \|692  - \|226  + \|708  + \|217
--R                                         Type: RealClosure(Fraction(Integer))
--E 9
--S 10 of 31
recip(squareDiff)
--R
--R
--R   (10)
--R               +---+         +---+  +---+         +---+ +---+             +---+
--R     ((- 34102\|708  - 61598\|217 )\|226  - 34802\|217 \|708  - 13641141)\|692
--R   +
--R              +---+ +---+             +---+            +---+            +---+
--R     (- 60898\|217 \|708  - 23869841)\|226  - 13486123\|708  - 24359809\|217
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 10
--S 11 of 31
sign(squareDiff)
--R
--R
--R   (11)  - 1
--R                                                                Type: Integer
--E 11
--S 12 of 31
squareDiff := fourSquares(155,836,162,820)
--R
--R
--R            +---+    +---+    +---+    +---+
--R   (12)  - \|820  - \|162  + \|836  + \|155
--R                                         Type: RealClosure(Fraction(Integer))

--E 12
--S 13 of 31
recip(squareDiff)
--R
--R
--R   (13)
--R               +---+         +---+  +---+         +---+ +---+             +---+
--R     ((- 37078\|836  - 86110\|155 )\|162  - 37906\|155 \|836  - 13645107)\|820
--R   +
--R              +---+ +---+             +---+            +---+            +---+
--R     (- 85282\|155 \|836  - 30699151)\|162  - 13513901\|836  - 31384703\|155
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 13
--S 14 of 31
sign(squareDiff)
--R
--R
--R   (14)  - 1
--R                                                                Type: Integer
--E 14
--S 15 of 31
squareDiff := fourSquares(591,772,552,818)
--R
--R
--R            +---+    +---+    +---+    +---+
--R   (15)  - \|818  - \|552  + \|772  + \|591
--R                                         Type: RealClosure(Fraction(Integer))
--E 15
--S 16 of 31
recip(squareDiff)
--R
--R
--R   (16)
--R             +---+         +---+  +---+         +---+ +---+             +---+
--R     ((70922\|772  + 81058\|591 )\|552  + 68542\|591 \|772  + 46297673)\|818
--R   +
--R            +---+ +---+             +---+            +---+            +---+
--R     (83438\|591 \|772  + 56359389)\|552  + 47657051\|772  + 54468081\|591
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 16
--S 17 of 31
sign(squareDiff)
--R
--R
--R   (17)  1

--R                                                        Type: PositiveInteger
--E 17
--S 18 of 31
squareDiff := fourSquares(434,1053,412,1088)
--R
--R
--R            +----+    +---+    +----+    +---+
--R   (18)  - \|1088  - \|412  + \|1053  + \|434
--R                                         Type: RealClosure(Fraction(Integer))
--E 18
--S 19 of 31
recip(squareDiff)
--R
--R
--R   (19)
--R                +----+          +---+  +---+          +---+ +----+
--R       ((115442\|1053  + 179818\|434 )\|412  + 112478\|434 \|1053  + 76037291)
--R    *
--R        +----+
--R       \|1088
--R   +
--R           +---+ +----+              +---+            +----+             +---+
--R   (182782\|434 \|1053  + 123564147)\|412  + 77290639\|1053  + 120391609\|434
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 19
--S 20 of 31
sign(squareDiff)
--R
--R
--R   (20)  1
--R                                                        Type: PositiveInteger
--E 20
--S 21 of 31
squareDiff := fourSquares(514,1049,446,1152)
--R
--R
--R            +----+    +---+    +----+    +---+
--R   (21)  - \|1152  - \|446  + \|1049  + \|514
--R                                         Type: RealClosure(Fraction(Integer))
--E 21
--S 22 of 31
recip(squareDiff)
--R
--R
--R   (22)

--R                +----+          +---+  +---+          +---+ +----+
--R       ((349522\|1049  + 499322\|514 )\|446  + 325582\|514 \|1049  + 239072537)
--R    *
--R        +----+
--R       \|1152
--R   +
--R           +---+ +----+              +---+             +----+             +---+
--R   (523262\|514 \|1049  + 384227549)\|446  + 250534873\|1049  + 357910443\|514
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 22
--S 23 of 31
sign(squareDiff)
--R
--R
--R   (23)  1
--R                                                        Type: PositiveInteger
--E 23
--S 24 of 31
squareDiff := fourSquares(190,1751,208,1698)
--R
--R
--R            +----+    +---+    +----+    +---+
--R   (24)  - \|1698  - \|208  + \|1751  + \|190
--R                                         Type: RealClosure(Fraction(Integer))
--E 24
--S 25 of 31
recip(squareDiff)
--R
--R
--R   (25)
--R                     +----+          +---+  +---+          +---+ +----+
--R           (- 214702\|1751  - 651782\|190 )\|208  - 224642\|190 \|1751
--R         +
--R           - 129571901
--R    *
--R        +----+
--R       \|1698
--R   +
--R               +---+ +----+              +---+             +----+
--R     (- 641842\|190 \|1751  - 370209881)\|208  - 127595865\|1751
--R   +
--R                 +---+
--R     - 387349387\|190
--R                              Type: Union(RealClosure(Fraction(Integer)),...)
--E 25
--S 26 of 31

sign(squareDiff)
--R
--R
--R   (26)  - 1
--R                                                                Type: Integer
--E 26
)cl prop s2 s5 s10 l

———-

A more complicated test that involve an extension of degree 256 — * —

--S 27 of 31
(s2, s5, s10) := (sqrt(2)$Ran, sqrt(5)$Ran, sqrt(10)$Ran);
--R
--R
--R                                         Type: RealClosure(Fraction(Integer))
--E 27
--S 28 of 31
sqrt(s10+3)*sqrt(s5+2) - sqrt(s10-3)*sqrt(s5-2) = sqrt(10*s2+10)
--R
--R
--R            +---------+ +--------+    +---------+ +--------+   +-----------+
--R            | +--+      | +-+         | +--+      | +-+        |   +-+
--R   (28)  - \|\|10  - 3 \|\|5  - 2  + \|\|10  + 3 \|\|5  + 2 = \|10\|2  + 10
--R                               Type: Equation(RealClosure(Fraction(Integer)))
--E 28
--S 29 of 31
%::Boolean
--R
--R
--R   (29)  true
--R                                                                Type: Boolean
--E 29

———-

The sum of these 4 numbers is 0 — * —

--S 30 of 31
l := allRootsOf((x^2-2)^2-2)$Ran
--R
--R
--R   (30)  [%A41,%A42,%A43,%A44]
--R                                   Type: List(RealClosure(Fraction(Integer)))
--E 30

--S 31 of 31
l.1+l.2+l.3+l.4
--R
--R
--R   (31)  0
--R                                         Type: RealClosure(Fraction(Integer))
--E 31
)spool
)lisp (bye)

———-

References^{[1] nothing}

11