FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/elemental_02.py at main · Python51888/lpython · GitHub
Python51888
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
integration_tests
/
elemental_02.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (48 loc) · 1.45 KB
Breadcrumbs
lpython
/
integration_tests
/
elemental_02.py
Copy path
File metadata and controls
59 lines (48 loc) · 1.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from
lpython
import
i32
,
f64
,
f32
from
numpy
import
empty
,
tan
,
sin
,
cos
,
reshape
def
elemental_tan64
():
theta
:
f64
[
16
,
8
,
4
,
2
,
1
]
=
empty
((
16
,
8
,
4
,
2
,
1
))
theta1d
:
f64
[
1024
]
=
empty
(
1024
)
tantheta
:
f64
[
16
,
8
,
4
,
2
,
1
]
=
empty
((
16
,
8
,
4
,
2
,
1
))
observed
:
f64
[
16
,
8
,
4
,
2
,
1
]
=
empty
((
16
,
8
,
4
,
2
,
1
))
shapend
:
i32
[
5
]
=
empty
(
5
,
dtype
=
int
)
i
:
i32
j
:
i32
k
:
i32
l
:
i32
eps
:
f64
eps
=
1e-12
for
i
in
range
(
1024
):
theta1d
[
i
]
=
float
(
i
+
1
)
for
i
in
range
(
5
):
shapend
[
i
]
=
2
**
(
4
-
i
)
theta
=
reshape
(
theta1d
,
shapend
)
observed
=
sin
(
theta
)
/
cos
(
theta
)
tantheta
=
tan
(
theta
)
for
i
in
range
(
16
):
for
j
in
range
(
8
):
for
k
in
range
(
4
):
for
l
in
range
(
2
):
assert
abs
(
tantheta
[
i
,
j
,
k
,
l
,
0
]
-
observed
[
i
,
j
,
k
,
l
,
0
])
<=
eps
def
elemental_tan32
():
theta
:
f32
[
5
,
5
]
=
empty
((
5
,
5
))
theta1d
:
f32
[
25
]
=
empty
(
25
)
tantheta
:
f32
[
5
,
5
]
=
empty
((
5
,
5
))
observed
:
f32
[
5
,
5
]
=
empty
((
5
,
5
))
shapend
:
i32
[
2
]
=
empty
(
2
,
dtype
=
int
)
i
:
i32
j
:
i32
eps
:
f32
eps
=
f32
(
1e-6
)
for
i
in
range
(
25
):
theta1d
[
i
]
=
f32
(
i
+
1
)
shapend
[
0
]
=
5
shapend
[
1
]
=
5
theta
=
reshape
(
theta1d
,
shapend
)
observed
=
sin
(
theta
)
/
cos
(
theta
)
tantheta
=
tan
(
theta
)
for
i
in
range
(
5
):
for
j
in
range
(
5
):
assert
abs
(
tantheta
[
i
,
j
]
-
observed
[
i
,
j
])
<=
eps
elemental_tan64
()
elemental_tan32
()
Back
|
FazBrowse Home
|
New Git URL