/usr/share/axiom-20170501/src/algebra/XEXPPKG.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 | )abbrev package XEXPPKG XExponentialPackage
++ Author: Michel Petitot (petitot@lifl.fr).
++ Date Created: 91
++ Date Last Updated: 7 Juillet 92
++ Description:
++ This package provides computations of logarithms and exponentials
++ for polynomials in non-commutative variables.
XExponentialPackage(R, VarSet, XPOLY) : SIG == CODE where
RN ==> Fraction Integer
R : Join(Ring, Module RN)
VarSet : OrderedSet
XPOLY : XPolynomialsCat(VarSet, R)
NNI ==> NonNegativeInteger
I ==> Integer
SIG ==> with
exp : (XPOLY, NNI) -> XPOLY
++ \axiom{exp(p, n)} returns the exponential of \axiom{p}
++ truncated at order \axiom{n}.
log : (XPOLY, NNI) -> XPOLY
++ \axiom{log(p, n)} returns the logarithm of \axiom{p}
++ truncated at order \axiom{n}.
Hausdorff : (XPOLY, XPOLY, NNI) -> XPOLY
++ \axiom{Hausdorff(a,b,n)} returns log(exp(a)*exp(b))
++ truncated at order \axiom{n}.
CODE ==> add
log (p,n) ==
p1 : XPOLY := p - 1
not quasiRegular? p1 =>
error "constant term <> 1, impossible log"
s : XPOLY := 0 -- resultat
k : I := n :: I
for i in 1 .. n repeat
k1 :RN := 1/k
k2 : R := k1 * 1$R
s := trunc( trunc(p1,i) * (k2 :: XPOLY - s) , i)
k := k - 1
s
exp (p,n) ==
not quasiRegular? p =>
error "constant term <> 0, exp impossible"
p = 0 => 1
s : XPOLY := 1$XPOLY -- resultat
k : I := n :: I
for i in 1 .. n repeat
k1 :RN := 1/k
k2 : R := k1 * 1$R
s := trunc( 1 +$XPOLY k2 * trunc(p,i) * s , i)
k := k - 1
s
Hausdorff(p,q,n) ==
p1: XPOLY := exp(p,n)
q1: XPOLY := exp(q,n)
log(p1*q1, n)
|