xref: /original-bsd/old/libm/liboldnm/sin.s (revision e59fb703)
1#
2# Copyright (c) 1980 Regents of the University of California.
3# All rights reserved.  The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
6#	@(#)sin.s	5.1 (Berkeley) 05/08/85
7#
8#
9# double float sin(),cos()
10#coefficients are from Hart & Cheney  SIN3370 (18.80D)
11.text
12.align 1
13.globl _sin
14.globl _cos
15_sin:
16	.word 0x03c0
17	bispsw	$0xe0
18	clrl	r9
19	movd	4(ap),r0
20	jgeq	range
21	movl	$2,r9
22	jbr	negarg
23
24.align 1
25_cos:
26	.word	0x0fc0
27	bispsw	$0xe0
28	movl	$1,r9
29	movd	4(ap),r0
30	jgeq	range
31negarg:
32	mnegd	r0,r0
33
34range:
35	emodd	twoopi,twoopix,r0,r8,r6
36	addl2	r9,r8
37	bicb2	$~03,r8
38	caseb	r8,$0,$3
39bse:	.word	qda-bse,qdb-bse,qdc-bse,qdd-bse
40qdb:	subd3	r6,$0d1.0e+0,r6
41	jbr	qda
42qdc:	mnegd	r6,r6
43	jbr	qda
44qdd:	subd2	$0d1.0e+0,r6
45qda:
46	muld3	r6,r6,r8
47	polyd	r8,$4,pcoef
48	muld2	r0,r6
49	polyd	r8,$4,qcoef
50	divd3	r0,r6,r0
51	ret
52.data
53.align 2
54twoopi:.double	0d6.36619772367581340000e-01
55qcoef:.double	0d1.00000000000000000000e+00
56 .double	0d1.32653490878613630000e+02
57 .double	0d9.46309610153820810000e+03
58 .double	0d4.08179225234329970000e+05
59 .double	0d8.64455865292253430000e+06
60pcoef:.double	0d1.45968840666576870000e+02
61 .double	0d-1.38472724998245280000e+04
62 .double	0d4.40103053537526640000e+05
63 .double	0d-4.94290810090284410000e+06
64 .double	0d1.35788409787737560000e+07
65twoopix: .byte 0x29
66