# Copyright (c) 1980 Regents of the University of California.
# All rights reserved. The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
# @(#)badtan.s 5.1 (Berkeley) 5/8/85
#method: range reduction to [0,pi/4] followed by polynomial
# approximation: Hart&Cheney TAN 4285 D=19.74
clrl r10 # sign flag, !=0 negate result
emodd fopi,fopix,r0,r2,r6
a0: .word a1-a0,a2-a0,a3-a0,a4-a0
a2: subd3 r6,$0d1.0e+0,r6
jneq b2 # tests final result cmptd in rtan
b2: divd3 r0,$0d1.0e+0,r0
b3: xorw2 r10,r0 # negate result if flag != 0
a4: subd3 r6,$0d1.0e+0,r6
.double 0d0.33866386426771720960e-4
.double 0d0.34225543872410034353e-1
.double 0d-0.15506856534832663769e+2
.double 0d0.10559709017149531936e+4
.double 0d-0.13068202647548256682e+5
.double 0d-0.15550331640317099669e+3
.double 0d0.47657513629164836989e+4
.double 0d-0.16638952389471190018e+5
.double 0d1.27323954473516268e+0