UNPKG

1.83 kBtext/coffeescriptView Raw
1test_legendre = ->
2 run_test [
3 "legendre(x,n)",
4 "legendre(x,n,0)",
5
6 "legendre(x,n,m)",
7 "legendre(x,n,m)",
8
9 "legendre(x,0)-1",
10 "0",
11
12 "legendre(x,1)-x",
13 "0",
14
15 "legendre(x,2)-1/2*(3*x^2-1)",
16 "0",
17
18 "legendre(x,3)-1/2*(5*x^3-3*x)",
19 "0",
20
21 "legendre(x,4)-1/8*(35*x^4-30*x^2+3)",
22 "0",
23
24 "legendre(x,5)-1/8*(63*x^5-70*x^3+15*x)",
25 "0",
26
27 "legendre(x,6)-1/16*(231*x^6-315*x^4+105*x^2-5)",
28 "0",
29
30 "legendre(x,0,0)-1",
31 "0",
32
33 "legendre(x,1,0)-x",
34 "0",
35
36 "legendre(x,1,1)+(1-x^2)^(1/2)",
37 "0",
38
39 "legendre(x,2,0)-1/2*(3*x^2-1)",
40 "0",
41
42 "legendre(x,2,1)+3*x*(1-x^2)^(1/2)",
43 "0",
44
45 "legendre(x,2,2)-3*(1-x^2)",
46 "0",
47
48 "legendre(x,3,0)-1/2*x*(5*x^2-3)",
49 "0",
50
51 "legendre(x,3,1)-3/2*(1-5*x^2)*(1-x^2)^(1/2)",
52 "0",
53
54 "legendre(x,3,2)-15*x*(1-x^2)",
55 "0",
56
57 "legendre(x,3,3)+15*(1-x^2)^(3/2)",
58 "0",
59
60 "legendre(x,4,0)-1/8*(35*x^4-30*x^2+3)",
61 "0",
62
63 "legendre(x,4,1)-5/2*x*(3-7*x^2)*(1-x^2)^(1/2)",
64 "0",
65
66 "legendre(x,4,2)-15/2*(7*x^2-1)*(1-x^2)",
67 "0",
68
69 "legendre(x,4,3)+105*x*(1-x^2)^(3/2)",
70 "0",
71
72 "legendre(x,4,4)-105*(1-x^2)^2",
73 "0",
74
75 "legendre(x,5,0)-1/8*x*(63*x^4-70*x^2+15)",
76 "0",
77
78 "legendre(cos(theta),0,0)-1",
79 "0",
80
81 "legendre(cos(theta),1,0)-cos(theta)",
82 "0",
83
84 "legendre(cos(theta),1,1)+abs(sin(theta))",
85 "0",
86
87 "legendre(cos(theta),2,0)-1/2*(3*cos(theta)^2-1)",
88 "0",
89
90 "legendre(cos(theta),2,1)+3*cos(theta)*abs(sin(theta))",
91 "0",
92
93 "legendre(cos(theta),2,2)-3*sin(theta)^2",
94 "0",
95
96 "legendre(cos(theta),3,0)-1/2*cos(theta)*(5*cos(theta)^2-3)",
97 "0",
98
99 "legendre(cos(theta),3,1)- (3/2*abs(sin(theta))-15/2*cos(theta)^2*abs(sin(theta)))",
100 "0",
101
102 "legendre(cos(theta),3,2)-15*cos(theta)*sin(theta)^2",
103 "0",
104
105 "legendre(cos(theta),3,3)+15*(sin(theta)^2)^(3/2)",
106 "0",
107
108 "legendre(a-b,10)-eval(subst(a-b,x,legendre(x,10)))",
109 "0",
110 ]