ARCTANGENT/F 

    Purpose: To replace x = f.b.a (floating binary accumulator)
             by function value 
             
                     arc tan (x)   
                f(x)=-----------
                        pi

    Cue: Magnetic Storage: single half track
         electronic storage: tube 0
         control numbers: (1) $$, (2) E/

    Link: closed

    Input details: conventional procedure
                   this routine makes use of NORMALISE routine that 
                   should be available in tube 3, and ADD & MULTIPLY 
                   routine that should be available in tube 4.
                   Also uses the ARCTANGENT fixed point routine 
                   
                   Note by Roberto Sancho: the mem usage is 
                      S0-S1: routine  columns /E @A
                      S2   : PERM             :S           
                      S3   : NORMALISE        IU           
                      S4   : ADD & MULTIPLY   #D

                      S5-S7: free             RJ NF CK

    Effects:
    
    Lines /I to JI are used as working space.
    Line pair #I and RI are the floating binary accumulator (f.b.a)
    Line pair :I and II are the floating binary multiplicand (f.b.d)
       
        +---------+-------------------+-------------------+ 
        |  Lines  | Initial           | Final             |
        | altered | contents          | contents          |
        +---------+-------------------+-------------------+ 
        | /I @I   | Irrelevant        | Irrelevant        |
        +---------+-------------------+-------------------+
        |         |                   |         arc tan(x)|
        | #I RI   | f.b.a = x         | f.b.a = ----------|
        |         |                   |            pi     |
        +---------+-------------------+-------------------+
        | AL      | Irrelevant        | AL    = same as   |
        |         |                   |   f     above     |
        +---------+-------------------+-------------------+
        | AM      | Irrelevant        | Empty             |
        | D       | Irrelevant        | 2^10              |
        +---------+-------------------+-------------------+ 

    Each routine begins and terminates by normalising the f.b.a.
    If the argument is known to be in normal form then 
    normalising on entry can be ommited using control number (2).
    if the argument should be normalized on entry use control 
    number (1).

    Ferranti Mark I Programming Manual, third edition 
    Bodleian Special Collection 
    MS. Eng. misc. b. 260-C.41.pdf
    p62, p68
    
    [Routine ARCTANGENT/F    ] 

    [Col     / ]                        [        E ]              
                                                                          
    | / | //QO | normalises argument    | / | B//P |___ jump to enter ARCTANGENT             
    | E | CU/P |___ x=a.2^p             | E | MUTB | clears the switch
    | @ | A:QO | sets switch for the    | @ | BETK | \        
    | A | MUQB | case x<1               | A | RITN | !        
    | : | RIT# | 2(p-2)                 | : | RITA | !        
    | S | S:TN |                        | S | :ST/ | !        
    | I | OE/H | test: if p>=2          | I | #I/J | !        
    | U | A:TC |                        | U | BE/M | !
    | # | RITA |                        | # | DSTJ | ! These instructions 
    | D | D/QO | denormalises x/2       | D | E:TC | ! are identical with
    | R | YD/P |___ (see note below)    | R | E:/J | ! those of lines @/ to "/
    | J | #IT/ | sets arg for ARCTAN    | J | #I/S | ! of routine RECIPROCAL/F
    | N | DSQO | plant electronic       | N | @I/E | !
    | F | E/ZZ | link                   | F | @I/J | ! The effect is to 
    | C | VE/J | calls in ARCTANGENT    | C | @I/A | ! replace f.b.a. (already in
    | K | K/QO |                        | K | @I/K | ! normal form) by its
    | T | FS/P |___                     | T | #I/D | ! normalised reciprocal
    | Z | MU/Q |                        | Z | #I/J | !
    | L | DSTJ |                        | L | #I/A | !
    | W | ISTI |                        | W | @I/D | !
    | H | #ITA |                        | H | E:/M | !
    | Y | RITA |                        | Y | "E/P | !
    | P | P/QO | normalise result       | P | PEQO | !    
    | Q | CU/P |___                     | Q | CU/P | !    
    | O | LS/P |___ closure             | O | /E/P | !    
    | B | R/// |                        | B | A/// | !    
    | G | A:T/ | test magnitude of exp  | G | //// | !    
    | " | RITN | of normalises recipro- | " | FE// | /
    | M | BE/H | -cal: if p<=1 jump     | M | $$$$ | =0.5 approx
    | X | MET/ |                        | X | $$$K | 
    | V | #ITA | if p=2 replace         | V | $E// | (electronic) cue to
    | $ | RITA | f.b.a by 2            | $ | //$/ | ARCTANGENT

    Note: For space economy reasons the usual method for denormalising
          the argument (as used e.g. in COSINE/F) is not used here.
          Instead the effect is obtained by adding 0.2 to the f.b.a.
          with the aid of ADD & MULTIPLY

    [End]

Note by Roberto Sancho: on original code the switch is located at line HU
    This conflicts with autocode, so we change it to line MU

