Annotation of researchv10dc/libnm/badtan.s, revision 1.1.1.1

1.1       root        1: # double tan(arg)
                      2: # double arg;
                      3: #method: range reduction to [0,pi/4] followed by polynomial
                      4: # approximation:  Hart&Cheney TAN 4285 D=19.74
                      5: .globl _tan
                      6: .text
                      7: .align 1
                      8: _tan:
                      9:        .word   0x07c0
                     10:        clrl    r10     # sign flag, !=0 negate result
                     11:        movd    4(ap),r0
                     12:        jgeq    c1
                     13:        xorw2   $0x8000,r10
                     14:        mnegd   r0,r0
                     15: c1:
                     16:        emodd   fopi,fopix,r0,r2,r6
                     17:        bicl2   $~3,r2
                     18:        caseb   r2,$0,$3
                     19: a0:    .word   a1-a0,a2-a0,a3-a0,a4-a0
                     20: a2:    subd3   r6,$0d1.0e+0,r6
                     21:        jbr     b1
                     22: a3: xorw2      $0x8000,r10
                     23: b1:    bsbb    rtan
                     24:        jneq    b2      # tests final result cmptd in rtan
                     25:        movd    $0d1.7e+38,r0
                     26:        jmp     b3
                     27: b2:    divd3   r0,$0d1.0e+0,r0
                     28: b3:    xorw2   r10,r0  # negate result if flag != 0 
                     29:        ret
                     30: a4:    subd3   r6,$0d1.0e+0,r6
                     31:        xorw2   $0x8000,r10
                     32: a1:    bsbb    rtan
                     33:        xorw2   r10,r0
                     34:        ret
                     35: rtan:
                     36:        muld3   r6,r6,r8
                     37:        polyd   r8,$4,pcoef
                     38:        muld2   r0,r6
                     39:        polyd   r8,$3,qcoef
                     40:        divd3   r0,r6,r0
                     41:        rsb
                     42: .data
                     43: .align 2
                     44: pcoef:
                     45:        .double 0d0.33866386426771720960e-4
                     46:        .double 0d0.34225543872410034353e-1
                     47:        .double 0d-0.15506856534832663769e+2
                     48:        .double 0d0.10559709017149531936e+4
                     49:        .double 0d-0.13068202647548256682e+5
                     50: qcoef:
                     51:        .double 0d1.0e+0
                     52:        .double 0d-0.15550331640317099669e+3
                     53:        .double 0d0.47657513629164836989e+4
                     54:        .double 0d-0.16638952389471190018e+5
                     55: fopi:
                     56:        .double 0d1.27323954473516268e+0
                     57: fopix: .byte 0x29

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.