Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uva
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
uva
Commits
923e3c48
Commit
923e3c48
authored
14 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
ssh://vo20.nl/home/git/repos/uva
parents
5d35c0c1
134e61e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modsim/ass2/q5.c
+2
-2
2 additions, 2 deletions
modsim/ass2/q5.c
modsim/ass2/report.tex
+32
-27
32 additions, 27 deletions
modsim/ass2/report.tex
with
34 additions
and
29 deletions
modsim/ass2/q5.c
+
2
−
2
View file @
923e3c48
...
...
@@ -22,8 +22,8 @@ double f2(double x) {
#define PRINT_INTEGRAL(func, a, b, method, real) { \
_i = integral(&func, &method, a, b, atoi(argv[1])); \
printf(#func " from " #a " to " #b " using %-19s %.
80
e (%.
2f%%
)\n", \
#method " method:", _i, fabs((real - _i)
/ real * 100
)); \
printf(#func " from " #a " to " #b " using %-19s %.
12
e (%.
12e
)\n", \
#method " method:", _i, fabs((real - _i))); \
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
This diff is collapsed.
Click to expand it.
modsim/ass2/report.tex
+
32
−
27
View file @
923e3c48
\documentclass
[10pt,a4paper]
{
article
}
\usepackage
{
float,url,graphicx
}
\usepackage
{
float,url,graphicx
,booktabs
}
\usepackage
[dutch]
{
babel
}
...
...
@@ -147,32 +147,37 @@ double sin(x);
\noindent
Dit heeft het volgende resultaat gegeven als we het programma met
1.000.000 steps uitvoeren:
\begin{verbatim}
f1 from 0 to 1 using rectangle method: 6.32120558829e-01
f1 from 0 to 1 using trapezoidal method: 6.32120558829e-01
f1 from 0 to 1 using simpson method: 6.32120558829e-01
f1 from 0 to 1 using gauss method: 6.32120558829e-01
f2 from 0 to 2 using rectangle method: 5.93994150290e-01
f2 from 0 to 2 using trapezoidal method: 5.93994150290e-01
f2 from 0 to 2 using simpson method: 5.93994150290e-01
f2 from 0 to 2 using gauss method: 5.93994150290e-01
f2 from 0 to 20 using rectangle method: 9.99999956716e-01
f2 from 0 to 20 using trapezoidal method: 9.99999956715e-01
f2 from 0 to 20 using simpson method: 9.99999956716e-01
f2 from 0 to 20 using gauss method: 9.99999956716e-01
f2 from 0 to 200 using rectangle method: 1.00000000001e+00
f2 from 0 to 200 using trapezoidal method: 9.99999999965e-01
f2 from 0 to 200 using simpson method: 9.99999999998e-01
f2 from 0 to 200 using gauss method: 9.99999999998e-01
sin from 0 to 8 * M
_
PI using rectangle method: -1.04730878509e-13
sin from 0 to 8 * M
_
PI using trapezoidal method: -1.08168370335e-13
sin from 0 to 8 * M
_
PI using simpson method: -8.63149135973e-14
sin from 0 to 8 * M
_
PI using gauss method: -8.55165510887e-14
\end{verbatim}
\begin{table}
[H]
\begin{tabular}
{
llllrr
}
\toprule
f
&
a
&
b
&
methode
&
\multicolumn
{
1
}{
l
}{
benadering
}
&
\multicolumn
{
1
}{
l
}{
afwijking
}
\\
\midrule
f1
&
0
&
1
&
rectangle
&
$
6
.
321205588285
\cdot
10
^{
-
01
}$
&
$
3
.
952393967666
\cdot
10
^{
-
14
}$
\\
f1
&
0
&
1
&
trapezoidal
&
$
6
.
321205588286
\cdot
10
^{
-
01
}$
&
$
4
.
141131881852
\cdot
10
^{
-
14
}$
\\
f1
&
0
&
1
&
simpson
&
$
6
.
321205588285
\cdot
10
^{
-
01
}$
&
$
1
.
276756478319
\cdot
10
^{
-
14
}$
\\
f1
&
0
&
1
&
gauss
&
$
6
.
321205588285
\cdot
10
^{
-
01
}$
&
$
1
.
276756478319
\cdot
10
^{
-
14
}$
\\
\midrule
f2
&
0
&
2
&
rectangle
&
$
5
.
939941502904
\cdot
10
^{
-
01
}$
&
$
2
.
019495681793
\cdot
10
^{
-
13
}$
\\
f2
&
0
&
2
&
trapezoidal
&
$
5
.
939941502898
\cdot
10
^{
-
01
}$
&
$
3
.
644862189844
\cdot
10
^{
-
13
}$
\\
f2
&
0
&
2
&
simpson
&
$
5
.
939941502902
\cdot
10
^{
-
01
}$
&
$
1
.
454392162259
\cdot
10
^{
-
14
}$
\\
f2
&
0
&
2
&
gauss
&
$
5
.
939941502902
\cdot
10
^{
-
01
}$
&
$
1
.
454392162259
\cdot
10
^{
-
14
}$
\\
\midrule
f2
&
0
&
20
&
rectangle
&
$
9
.
999999567325
\cdot
10
^{
-
01
}$
&
$
1
.
671296434580
\cdot
10
^{
-
11
}$
\\
f2
&
0
&
20
&
trapezoidal
&
$
9
.
999999566825
\cdot
10
^{
-
01
}$
&
$
3
.
332367715103
\cdot
10
^{
-
11
}$
\\
f2
&
0
&
20
&
simpson
&
$
9
.
999999567158
\cdot
10
^{
-
01
}$
&
$
2
.
831068712794
\cdot
10
^{
-
14
}$
\\
f2
&
0
&
20
&
gauss
&
$
9
.
999999567158
\cdot
10
^{
-
01
}$
&
$
2
.
808864252302
\cdot
10
^{
-
14
}$
\\
\midrule
f2
&
0
&
200
&
rectangle
&
$
1
.
000000001666
\cdot
10
^{
+
00
}$
&
$
1
.
666276006063
\cdot
10
^{
-
09
}$
\\
f2
&
0
&
200
&
trapezoidal
&
$
9
.
999999966665
\cdot
10
^{
-
01
}$
&
$
3
.
333514797532
\cdot
10
^{
-
09
}$
\\
f2
&
0
&
200
&
simpson
&
$
9
.
999999999998
\cdot
10
^{
-
01
}$
&
$
1
.
918465386552
\cdot
10
^{
-
13
}$
\\
f2
&
0
&
200
&
gauss
&
$
9
.
999999999998
\cdot
10
^{
-
01
}$
&
$
1
.
918465386552
\cdot
10
^{
-
13
}$
\\
\midrule
sin
&
0
&
$
8
\pi
$
&
rectangle
&
$
1
.
649022273643
\cdot
10
^{
-
14
}$
&
$
1
.
649022273643
\cdot
10
^{
-
14
}$
\\
sin
&
0
&
$
8
\pi
$
&
trapezoidal
&
$
-
2
.
597858752022
\cdot
10
^{
-
14
}$
&
$
2
.
597858752022
\cdot
10
^{
-
14
}$
\\
sin
&
0
&
$
8
\pi
$
&
simpson
&
$
-
1
.
797341770030
\cdot
10
^{
-
14
}$
&
$
1
.
797341770030
\cdot
10
^{
-
14
}$
\\
sin
&
0
&
$
8
\pi
$
&
gauss
&
$
-
1
.
797258919631
\cdot
10
^{
-
14
}$
&
$
1
.
797258919631
\cdot
10
^{
-
14
}$
\\
\bottomrule
\end{tabular}
\end{table}
% }}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment