/usr/share/axiom-20170501/src/algebra/CTRIGMNP.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 108 109 110 111 112 | )abbrev package CTRIGMNP ComplexTrigonometricManipulations
++ Author: Manuel Bronstein
++ Date Created: 11 June 1993
++ Date Last Updated: 14 June 1993
++ Description:
++ \spadtype{ComplexTrigonometricManipulations} provides function that
++ compute the real and imaginary parts of complex functions.
ComplexTrigonometricManipulations(R, F) : SIG == CODE where
R : Join(IntegralDomain, OrderedSet, RetractableTo Integer)
F : Join(AlgebraicallyClosedField, TranscendentalFunctionCategory,
FunctionSpace Complex R)
SY ==> Symbol
FR ==> Expression R
K ==> Kernel F
SIG ==> with
complexNormalize : F -> F
++ complexNormalize(f) rewrites \spad{f} using the least possible number
++ of complex independent kernels.
complexNormalize : (F, SY) -> F
++ complexNormalize(f, x) rewrites \spad{f} using the least possible
++ number of complex independent kernels involving \spad{x}.
complexElementary : F -> F
++ complexElementary(f) rewrites \spad{f} in terms of the 2 fundamental
++ complex transcendental elementary functions: \spad{log, exp}.
complexElementary : (F, SY) -> F
++ complexElementary(f, x) rewrites the kernels of \spad{f} involving
++ \spad{x} in terms of the 2 fundamental complex
++ transcendental elementary functions: \spad{log, exp}.
real : F -> FR
++ real(f) returns the real part of \spad{f} where \spad{f} is a complex
++ function.
imag : F -> FR
++ imag(f) returns the imaginary part of \spad{f} where \spad{f}
++ is a complex function.
real? : F -> Boolean
++ real?(f) returns \spad{true} if \spad{f = real f}.
trigs : F -> F
++ trigs(f) rewrites all the complex logs and exponentials
++ appearing in \spad{f} in terms of trigonometric functions.
complexForm : F -> Complex FR
++ complexForm(f) returns \spad{[real f, imag f]}.
CODE ==> add
import InnerTrigonometricManipulations(R, FR, F)
import ElementaryFunctionStructurePackage(Complex R, F)
rreal?: Complex R -> Boolean
kreal?: Kernel F -> Boolean
localexplogs : (F, F, List SY) -> F
real f == real complexForm f
imag f == imag complexForm f
rreal? r == zero? imag r
kreal? k == every?(real?, argument k)$List(F)
complexForm f == explogs2trigs f
trigs f ==
GF2FG explogs2trigs f
real? f ==
every?(rreal?, coefficients numer f)
and every?(rreal?, coefficients denom f) and every?(kreal?, kernels f)
localexplogs(f, g, lx) ==
trigs2explogs(g, [k for k in tower f
| is?(k, "tan"::SY) or is?(k, "cot"::SY)], lx)
complexElementary f ==
any?(x +-> has?(x, "rtrig"),
operators(g := realElementary f))$List(BasicOperator) =>
localexplogs(f, g, variables g)
g
complexElementary(f, x) ==
any?(y +-> has?(operator y, "rtrig"),
[k for k in tower(g := realElementary(f, x))
| member?(x, variables(k::F))]$List(K))$List(K) =>
localexplogs(f, g, [x])
g
complexNormalize(f, x) ==
any?(y +-> has?(operator y, "rtrig"),
[k for k in tower(g := realElementary(f, x))
| member?(x, variables(k::F))]$List(K))$List(K) =>
(rischNormalize(localexplogs(f, g, [x]), x).func)
rischNormalize(g, x).func
complexNormalize f ==
l := variables(g := realElementary f)
any?(y +-> has?(y, "rtrig"), operators g)$List(BasicOperator) =>
h := localexplogs(f, g, l)
for x in l repeat h := rischNormalize(h, x).func
h
for x in l repeat g := rischNormalize(g, x).func
g
|