/usr/share/axiom-20140801/input/newton.input is in axiom-test 20140801-6.
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 | )set break resume
)spool newton.output
)set message test on
)set message auto off
)clear all
--S 1 of 5
newtonStep(f) ==
fun := complexNumericFunction f
deriv := complexDerivativeFunction(f,1)
(b:Complex DoubleFloat):Complex DoubleFloat +->
b - fun(b)/deriv(b)
--R
--R Type: Void
--E 1
--S 2 of 5
complexFunPack := _
MakeUnaryCompiledFunction(EXPR INT, Complex DoubleFloat, Complex DoubleFloat)
--R
--R
--R (2)
--R MakeUnaryCompiledFunction(Expression(Integer),Complex(DoubleFloat),Complex(Do
--R ubleFloat))
--R Type: Domain
--E 2
--S 3 of 5
complexNumericFunction x ==
v := theVariable x
compiledFunction(x, v)$complexFunPack
--R
--R Type: Void
--E 3
--S 4 of 5
complexDerivativeFunction(x,n) ==
v := theVariable x
df := differentiate(x,v,n)
compiledFunction(df, v)$complexFunPack
--R
--R Type: Void
--E 4
--S 5 of 5
theVariable x ==
vl := variables x
nv := # vl
nv > 1 => error "Expression is not univariate."
nv = 0 => 'x
first vl
--R
--R Type: Void
--E 5
)spool
)lisp (bye)
|