/usr/share/axiom-20170501/src/algebra/FLOATRP.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | )abbrev package FLOATRP FloatingRealPackage
++ Author: P. Gianni
++ Date Created: January 1990
++ Description:
++ This is a package for the approximation of real solutions for
++ systems of polynomial equations over the rational numbers.
++ The results are expressed as either rational numbers or floats
++ depending on the type of the precision parameter which can be
++ either a rational number or a floating point number.
FloatingRealPackage(Par) : SIG == CODE where
Par : Join(OrderedRing, Field) -- RN or NewFloat
I ==> Integer
NNI ==> NonNegativeInteger
P ==> Polynomial
EQ ==> Equation
L ==> List
SUP ==> SparseUnivariatePolynomial
RN ==> Fraction Integer
NF ==> Float
CF ==> Complex Float
GI ==> Complex Integer
GRN ==> Complex RN
SE ==> Symbol
RFI ==> Fraction P I
INFSP ==> InnerNumericFloatSolvePackage
SIG ==> with
solve : (L RFI,Par) -> L L EQ P Par
++ solve(lp,eps) finds all of the real solutions of the
++ system lp of rational functions over the rational numbers
++ with respect to all the variables appearing in lp,
++ with precision eps.
solve : (L EQ RFI,Par) -> L L EQ P Par
++ solve(leq,eps) finds all of the real solutions of the
++ system leq of equationas of rational functions
++ with respect to all the variables appearing in lp,
++ with precision eps.
solve : (RFI,Par) -> L EQ P Par
++ solve(p,eps) finds all of the real solutions of the
++ univariate rational function p with rational coefficients
++ with respect to the unique variable appearing in p,
++ with precision eps.
solve : (EQ RFI,Par) -> L EQ P Par
++ solve(eq,eps) finds all of the real solutions of the
++ univariate equation eq of rational functions
++ with respect to the unique variables appearing in eq,
++ with precision eps.
realRoots : (L RFI,L SE,Par) -> L L Par
++ realRoots(lp,lv,eps) computes the list of the real
++ solutions of the list lp of rational functions with rational
++ coefficients with respect to the variables in lv,
++ with precision eps. Each solution is expressed as a list
++ of numbers in order corresponding to the variables in lv.
realRoots : (RFI,Par) -> L Par
++ realRoots(rf, eps) finds the real zeros of a univariate
++ rational function with precision given by eps.
CODE ==> add
makeEq(nres:L Par,lv:L SE) : L EQ P Par ==
[equation(x::(P Par),r::(P Par)) for x in lv for r in nres]
-- find the real zeros of an univariate rational polynomial --
realRoots(p:RFI,eps:Par) : L Par ==
innerSolve1(numer p,eps)$INFSP(I,Par,Par)
-- real zeros of the system of polynomial lp --
realRoots(lp:L RFI,lv:L SE,eps: Par) : L L Par ==
lnum:=[numer p for p in lp]
lden:=[dp for p in lp |(dp:=denom p)^=1]
innerSolve(lnum,lden,lv,eps)$INFSP(I,Par,Par)
solve(lp:L RFI,eps : Par) : L L EQ P Par ==
lnum:=[numer p for p in lp]
lden:=[dp for p in lp |(dp:=denom p)^=1]
lv:="setUnion"/[variables np for np in lnum]
if lden^=[] then
lv:=setUnion(lv,"setUnion"/[variables dp for dp in lden])
[makeEq(numres,lv) for numres
in innerSolve(lnum,lden,lv,eps)$INFSP(I,Par,Par)]
solve(le:L EQ RFI,eps : Par) : L L EQ P Par ==
lp:=[lhs ep - rhs ep for ep in le]
lnum:=[numer p for p in lp]
lden:=[dp for p in lp |(dp:=denom p)^=1]
lv:="setUnion"/[variables np for np in lnum]
if lden^=[] then
lv:=setUnion(lv,"setUnion"/[variables dp for dp in lden])
[makeEq(numres,lv) for numres
in innerSolve(lnum,lden,lv,eps)$INFSP(I,Par,Par)]
solve(p : RFI,eps : Par) : L EQ P Par ==
(mvar := mainVariable numer p ) case "failed" =>
error "no variable found"
x:P Par:=mvar::SE::(P Par)
[equation(x,val::(P Par)) for val in realRoots(p,eps)]
solve(eq : EQ RFI,eps : Par) : L EQ P Par ==
solve(lhs eq - rhs eq,eps)
|