Skip to content
Snippets Groups Projects
Commit 6e8b5ad9 authored by Sander Mathijs van Veen's avatar Sander Mathijs van Veen
Browse files

Fixed GCC incompatiblity.

parent 66f10d33
No related branches found
No related tags found
No related merge requests found
......@@ -16,16 +16,19 @@ double df(double x) {
}
int main(void) {
unsigned int steps;
unsigned int steps = 0;
double tmp = bisec(&f, 1, 2, EPSILON, &steps);
printf("Square root of 2 using bisection method: %.20f (%d steps)\n",
bisec(&f, 1, 2, EPSILON, &steps), steps);
tmp, steps);
tmp = newton_raphson(&f, &df, 1.4, EPSILON, &steps, 100000);
printf("Square root of 2 using Newton-Raphson method: %.20f (%d steps)\n",
newton_raphson(&f, &df, 1.4, EPSILON, &steps, 100000), steps);
tmp, steps);
tmp = regula_falsi(&f, 1, 2, EPSILON, &steps, 100000);
printf("Square root of 2 using the Regula Falsi method: %.20f (%d steps)\n",
regula_falsi(&f, 1, 2, EPSILON, &steps, 100000), steps);
tmp, steps);
return 0;
}
......@@ -28,17 +28,17 @@ double f2(double x) {
int main(int argc, char **argv) {
if( argc != 2 ) {
printf("Usage: %s STEPS", argv[0]);
printf("Usage: %s STEPS\n", argv[0]);
return -1;
}
PRINT_INTEGRALS(f1, 0, 1, (M_E - 1) / M_E);
puts("");
PRINT_INTEGRALS(f2, 0, 2, 1 - 3/pow(M_E, 2));
PRINT_INTEGRALS(f2, 0, 2, 1 - 3 / pow(M_E, 2));
puts("");
PRINT_INTEGRALS(f2, 0, 20, 1 - 21/pow(M_E, 20));
PRINT_INTEGRALS(f2, 0, 20, 1 - 21 / pow(M_E, 20));
puts("");
PRINT_INTEGRALS(f2, 0, 200, 1 - 201/pow(M_E, 200));
PRINT_INTEGRALS(f2, 0, 200, 1 - 201 / pow(M_E, 200));
puts("");
PRINT_INTEGRALS(sin, 0, 8 * M_PI, 0.0);
......
\documentclass[10pt,a4paper]{article}
\usepackage{float,url,graphicx,booktabs}
\documentclass[10pt,a4paper]{article} % {{{
\usepackage{float,url,graphicx,booktabs}
\usepackage[dutch]{babel}
% }}}
\title{Modelleren, Simuleren \& Contin\"ue Wiskunde \\
Assignment 2: Differentiation, roots and Integration}
\author{Tadde\"us Kroes (6054129) \and Sander van Veen (6167969)}
......@@ -96,7 +98,6 @@ beoogde nauwkeurigheid.
% }}}
\section{Newton-Raphson} % {{{
\label{sec:Newton-Raphson}
......@@ -203,3 +204,4 @@ t/m 10 jaar).}
% }}}
\end{document}
% vim: foldmethod=marker:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment