summaryrefslogtreecommitdiffstats
path: root/scilab_doc/scilabisnotnaive/scilabisnotnaive.tex
blob: aced19f92a7c39a81ea578d35b868236bdb81c61 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
%
% scilabisnotnaive.tex --
%   Some notes about floating point issues in Scilab.
%
% Copyright 2008 Michael Baudin
%
\documentclass[12pt]{article}

%% Good fonts for PDF
\usepackage[cyr]{aeguill}

%% Package for page headers
\usepackage{fancyhdr}

%% Package to include graphics
%% Comment for DVI
\usepackage[pdftex]{graphicx}

%% Figures formats: jpeg or pdf
%% Comment for DVI
\DeclareGraphicsExtensions{.jpg,.pdf}

%% Package to create Hyperdocuments
%% Comment for DVI
\usepackage[pdftex,colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}

%% Package to control printed area size
\usepackage{anysize}
%% ...by defining margins {left}{right}{top}{bottom}
\marginsize{22mm}{14mm}{12mm}{25mm}

%% Package used to include a bibliography
\usepackage{natbib}

%% R for real numbers
\usepackage{amssymb}

%% User defined commands

%% Figure reference
\newcommand{\figref}[1]{figure~\ref{#1}}

%% Equation reference
\newcommand{\Ref}[1]{(\ref{#1})}

%% Emphasize a word or a group of words
\newcommand{\empha}[1]{\textit{\textbf{#1}}}

%% Derivation operators
\newcommand{\D}{\partial}
\newcommand{\Dt}{\partial_t}
\newcommand{\Dx}{\partial_x}
\newcommand{\Dy}{\partial_y}

\usepackage{url}

% Scilab macros
\newcommand{\scimacro}[1]{\textit{#1}}
\newcommand{\scicommand}[1]{\textit{#1}}

% To highlight source code
\usepackage{listings}
\usepackage{algorithmic}

% Define theorem environments 
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\newenvironment{proof}[1][Proof]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{example}[1][Example]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newenvironment{remark}[1][Remark]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\newcommand{\qed}{\nobreak \ifvmode \relax \else
      \ifdim\lastskip<1.5em \hskip-\lastskip
      \hskip1.5em plus0em minus0.5em \fi \nobreak
      \vrule height0.75em width0.5em depth0.25em\fi}

% Maths shortcuts 
\newcommand{\RR}{\mathbb{R}}

% Algorithms
\usepackage{algorithm2e}
%%\usepackage{algorithmic}

\begin{document}
\author{Michael Baudin}
\date{February 2009}
\title{Scilab is not na´ve}
\maketitle
\begin{abstract}
Most of the time, the mathematical formula is 
directly used in the Scilab source code. 
But, in many algorithms, some additionnal work is 
performed, which takes into account the fact that 
the computer do not process mathematical real values,
but performs computations with their floating 
point representation.
The goal of this article is to show that, in many
situations, Scilab is not na´ve and use algorithms
which have been specifically tailored for floating point 
computers. We analyse in this article the 
particular case of the quadratic equation, the 
complex division and the numerical derivatives, 
and show that one these examples, the na´ve algorithm 
is not sufficiently accurate. 
\end{abstract}

\tableofcontents

\include{introduction}

\include{quadratic}

\include{numericalderivative}

\include{complexdivision}


\include{conclusion}

\clearpage

\appendix

\include{simpleexperiments}

%\include{pythagoreansum}

%% Bibliography


\addcontentsline{toc}{section}{Bibliography}
\bibliographystyle{plain}
\bibliography{scilabisnotnaive}


\end{document}