$SPAD/src/input tanatan.input

Timothy Daly December 3, 2016

Abstract

Contents

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

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

———-

Here’s an equation — * —

--S 1 of 9
eq:=2*tan(x)+2*tan(2*x)
--R
--R
--R   (1)  2tan(2x) + 2tan(x)
--R                                                    Type: Expression(Integer)
--E 1

———-

Solve it — * —

--S 2 of 9
thesols:=solve(eq,x)
--R
--R
--R                 2%pi      2%pi    %pi      %pi
--R   (2)  [x= 0,x= ----,x= - ----,x= ---,x= - ---]
--R                   3         3      3        3
--R                                    Type: List(Equation(Expression(Integer)))
--E 2

———-

Verify the solutions — * —

--S 3 of 9
theproofs:=[eval(eq,i) for i in thesols]
--R
--R
--R   (3)  [0,0,0,0,0]
--R                                              Type: List(Expression(Integer))
--E 3

———-

Problem with simplification of tan(n*atan(y)) Get the tower for each expression — * —

--S 4 of 9
thetowers:=[tower i for i in theproofs];
--R
--R
--R                                Type: List(List(Kernel(Expression(Integer))))
--E 4
--S 5 of 9
thesubs:LIST Record (a:LIST KERNEL EXPR INT ,b:LIST EXPR INT)
--R
--R                                                                   Type: Void
--E 5
--S 6 of 9
thetans:LIST LIST Record(i:INT,k:KERNEL EXPR INT,z:List Equation EXPR INT)
--R
--R                                                                   Type: Void
--E 6

———-

Apply pattern-matching to find tan(n*atan(y)) and construct the structures needed — * —

--S 7 of 9
thetans:=_
 [[construct(j,i.j,Is(argument(i.j).1,n * atan(y))) for j in 1..#i_
      |is?(i.j,tan) and is?(argument(i.j).1,n * atan(y))] _
          for i in thetowers] ;
--R
--R
--IType: List(List(Record(i: Integer,k: Kernel(Expression(Integer)),...
--E 7

———-

Construct the evaluation rules for tan(n*atan(y)) -¿ tanNa(a,n)

— * —

--S 8 of 9
thesubs:=_
  [construct([j.k for j in thetans.i],_
             [tanNa(rhs(j.z.2),rhs(j.z.1) ::INT)$TangentExpansions(EXPR INT)_
                        for j in thetans.i]) _
            for i in 1..#theproofs];
--R
--R
--IType: List(Record(a: List(Kernel(Expression(Integer))),b: List(...
--E 8

———-

Apply the evaluation rules — * —

--S 9 of 9
thezeros:=[eval(i,j.a,j.b) for i in theproofs for j in thesubs]
--R
--R
--R   (9)  [0,0,0,0,0]
--R                                              Type: List(Expression(Integer))
--E 9
)spool
)lisp (bye)

———-

References^{[1] nothing}

5