PPPK_03

332 days ago by fresl

 

Algebarske strukture

 


Monoid:  $\mathcal{M} = (\mathcal{S}, *)$, pri čemu su $\mathcal{S}$ skup i $*$ binarna operacija

  1. zatvorenost:  $x, y \in \mathcal{S} \; \Rightarrow \; x*y \in \mathcal{S}$
  2. asocijativnost:  $(x * y) * z = x * (y * z)$
  3. neutralni (jedinični) element:  $\exists e \in \mathcal{S} \; : \; x * e = e * x = x \;\;\: \forall x \in\mathcal{S}$

 

Grupa:  $\mathcal{G} = (\mathcal{S}, *)$

  1. monoid 
  2. inverzni element:  $\forall x \in \mathcal{S}\;\;\; \exists y \in \mathcal{A} \; : \; x * y = y * x = e$;    česte oznake:  $y = x^{-1}$ ili $y = -x$

 

Abelova ili komutativna grupa

  1. grupa
  2. komutativnost: $x * y = y * x$


Primjeri

  • skupovi $\mathbb{Z},\; \mathbb{Q}, \; \mathbb{R}$ i operacija $+$ :   Abelove grupe
  • skup $\mathbb{N}_0 = \mathbb{N} \cup \{0\}$ i operacija $+$ :   monoid u kojem vrijedi komutativnost (nije grupa jer nema inverznog elementa)
  • skupovi $\mathbb{Q} \setminus \{0\},\; \mathbb{R}\setminus \{0\}, \; \mathbb{Q}^+, \; \mathbb{R}^+$ i operacija $\cdot$ :   Abelove grupe
  • skup regularnih matrica tipa $n\times n$ i operacija množenja :   grupa (ali ne Abelova, jer ${\mathbf{AB}} \ne {\mathbf{BA}}$)
  • skup bijekcija na skupu $\mathcal{S}$ i kompozicija funkcija :   grupa (ali ne Abelova, jer $f\circ g \ne g \circ f$ za $f, g : \mathcal{S} \to \mathcal{}S$)

 

Prsten: $\mathcal{R} = (\mathcal{S}, +, \cdot)$, pri čemu su $+$ i $\cdot$ binarne operacije

  1. zatvorenost obje operacije
  2. $(\mathcal{S}, +)$  Abelova grupa
  3. asocijativnost operacije $\cdot$
  4. distributivnost:  $x\cdot (y + z) = x\cdot y + x \cdot z$  i  $(x + y)\cdot z = x\cdot z + y \cdot z$

 

Komutativni prsten

  1. prsten
  2. komutativnost operacije $\cdot$

 

Prsten s jedinicom

  1. prsten
  2. neutralni element za $\cdot$ :   $x\cdot 1 = 1\cdot x = x$; $1 \ne 0$,  gdje je $0$ neutralni element za $+$

 

Prsten s dijeljenjem

  1. prsten s jedinicom
  2. inverzni element za $\cdot$ :   $\forall x \ne 0\;\;\; \exists y \; : \; x \cdot y = y \cdot x = 1$

 

Polje — komutativni prsten s dijeljenjem


Primjeri

  • $(\mathbb{N}_0, +, \cdot)$  komutativni poluprsten s jedinicom (poluprsten ima svojstva prstena, osim što je 2. slabije: $(\mathcal{S}, +)$  komutativni monoid)
  • $(\mathbb{Z}, +, \cdot)$  komutativni prsten s jedinicom
  • $(\mathbb{Q}, +, \cdot)$,   $(\mathbb{R}, +, \cdot)$,  $(\mathbb{C}, +, \cdot)$  polja
  • regularne matrice tipa $n\times n$ s operacijama zbrajanja i množenja :  prsten s dijeljenjem (množenje nije komutativno)

 

Vektorski prostor $\boldsymbol{\mathcal{V}}$ nad poljem $\boldsymbol{\mathcal{S}}$:   $(\mathcal{V},\, \mathcal{S},\, +,\, \cdot)$, pri čemu su

  • $\mathcal{V}$  -  skup vektora,
  • $\mathcal{S}$  -  polje skalara
  • $+$  -  zbrajanje vektora  $+ : \mathcal{V}\times \mathcal{V}  \to \mathcal{V}$,
  • $\cdot$  -  množenje skalarom   $\cdot : \mathcal{S}\times \mathcal{V}  \to \mathcal{V}$
  1. zbrajanje je Abelova grupa (neutralni element  $\mathbf{0}$,  inverzni element  $-\mathbf{x}$)
  2. zatvorenost množenja skalarom:  $\alpha \in \mathcal{S},\: \mathbf{x}\in\mathcal{V} \; \Rightarrow \; \alpha\,\mathbf{x} = \alpha\cdot\mathbf{x}\in \mathcal{V}$
  3. $(\alpha\,\beta)\,\mathbf{x} = \alpha\,(\beta\,\mathbf{x}) \;\;\;\: \forall \alpha,\, \beta \in \mathcal{S}\;\;\; \text{i} \;\;\; \forall \mathbf{x}\in\mathcal{V}$
  4. $\alpha\,(\mathbf{x} + \mathbf{y}) = \alpha\,\mathbf{x} + \alpha\mathbf{y} \;\;\;\: \forall \alpha \in \mathcal{S}\;\;\; \text{i} \;\;\; \forall \mathbf{x},\,\mathbf{y}\in\mathcal{V}$
  5. $(\alpha + \beta)\,\mathbf{x} = \alpha\,\mathbf{x} + \beta\,\mathbf{x} \;\;\;\: \forall \alpha,\, \beta \in \mathcal{S}\;\;\; \text{i} \;\;\; \forall \mathbf{x}\in\mathcal{V}$
  6. $\exists\, 1\! \in \mathcal{S} \; : \; 1\,\mathbf{x} = \mathbf{x} \;\;\; \forall \mathbf{x}\in\mathcal{V}$

 

Primjeri

  • „klasični” vektori u ravnini i prostoru (nad poljem $\mathbb{R}$) 
  • poopćenje „klasičnih” vektora u $n$-dimenzionalnom prostoru $\mathbb{R}^n$
  • matrice tipa $m\times n$ (nad poljem $\mathbb{R}$)
  • skup svih funkcija  $f : [0,1] \to \mathbb{R}$,  pri čemu su  $(f+g)(x) = f(x) + g(x)$  i  $(\alpha f)(x) = \alpha\, f(x)$  za $\alpha \in \mathbb{R}$
  • skup svih neprekinutih funkcija  $f : [0,1] \to \mathbb{R}$
  • skup svih funkcija  $f : [0,1] \to \mathbb{R}$ s neprekinutom prvom derivacijom
  • skup svih polinoma s realnim koeficijentima


Slobodni modul:  $(\mathcal{V},\, \mathcal{S},\, +,\, \cdot)$, ali je, za razliku od vektorskog prostora, $\mathcal{S}$ prsten s jedinicom

 

Algebra (nad poljem):  vektorski prostor s množenjem

 

Primjeri

  • kompleksni brojevi — komutativna asocijativna algebra
  • matrice tipa $n\times n$ — nekomutativna asocijativna algebra
  • prostor $\mathbb{R}^3$ s vektorskim produktom — nekomutativna neasocijativna algebra

 

       
1
1
       
Integer Ring
Integer Ring
       
Integer Ring
Integer Ring
       
1/2
1/2
       

                                
                            

                                
       
Rational Field
Rational Field
       
1.00000000000000
1.00000000000000
       
Real Field with 53 bits of precision
Real Field with 53 bits of precision
       
Real Field with 80 bits of precision
Real Field with 80 bits of precision
       
1.0000000000000000000000
1.0000000000000000000000
       
Real Field with 80 bits of precision
Real Field with 80 bits of precision
       
Real Field with 53 bits of precision
Real Field with 53 bits of precision
       
Complex Field with 53 bits of precision
Complex Field with 53 bits of precision

 

Oznake skupova brojeva:

  • ZZ  —  $\mathbb{Z}$, prsten cijelih brojeva (Integer Ring
  • QQ  —  $\mathbb{Q}$, polje racionalnih brojeva (Rational Field)
  • RR  —  $\mathbb{R}$, polje realnih brojeva (Real Field) s točnošću zapisa od 53 bita (približno 16 značajnih dekadskih znamenaka)
  • RealField (n)  —  $\mathbb{R}$, polje realnih brojeva (Real Field) s točnošću zapisa od $n$ bitova  (približno $n\cdot \log_{10}2$  značajnih dekadskih znamenaka)
  • CC  —  $\mathbb{C}$, polje kompleksnih brojeva (Complex Field) s točnošću zapisa od 53 bita za realni i za imaginarni dio

 

       
(0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000,
0.000000000000000)
(0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000)
       
Vector space of dimension 5 over Real Field with 53 bits of precision
Vector space of dimension 5 over Real Field with 53 bits of precision
       
(0.00000000000000000000000, 0.00000000000000000000000,
0.00000000000000000000000, 0.00000000000000000000000, 0.00000000000000000000000)
(0.00000000000000000000000, 0.00000000000000000000000, 0.00000000000000000000000, 0.00000000000000000000000, 0.00000000000000000000000)
       
Vector space of dimension 5 over Real Field with 80 bits of precision
Vector space of dimension 5 over Real Field with 80 bits of precision
       
(0.000, 0.000, 0.000, 0.000, 0.000)
(0.000, 0.000, 0.000, 0.000, 0.000)
       
Vector space of dimension 5 over Real Field with 14 bits of precision
Vector space of dimension 5 over Real Field with 14 bits of precision
       
(1/2, 2/3, 3/4)
(1/2, 2/3, 3/4)
       

                                
                            

                                
       
Vector space of dimension 3 over Rational Field
Vector space of dimension 3 over Rational Field
       
Vector space of dimension 2 over Real Field with 53 bits of precision
Vector space of dimension 2 over Real Field with 53 bits of precision
       
(0.500000000000000, 0.500000000000000)
(0.500000000000000, 0.500000000000000)
       
(13, 14, 15)
Ambient free module of rank 3 over the principal ideal domain Integer Ring
(13, 14, 15)
Ambient free module of rank 3 over the principal ideal domain Integer Ring
       
Ambient free module of rank 3 over the principal ideal domain Integer Ring
Ambient free module of rank 3 over the principal ideal domain Integer Ring
       
[ 1.00000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000  1.00000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000  1.00000000000000]
[ 1.00000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000  1.00000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000  1.00000000000000]
       
Full MatrixSpace of 3 by 3 dense matrices over Real Field with 53 bits of
precision
Full MatrixSpace of 3 by 3 dense matrices over Real Field with 53 bits of precision
       

                                
                            

                                
       
Full MatrixSpace of 4 by 3 dense matrices over Real Field with 80 bits of
precision
Full MatrixSpace of 4 by 3 dense matrices over Real Field with 80 bits of precision


Cijeli brojevi

       
10
10
       
6
6
       
13/2
13/2
       
6
6
       
1
1
       
(6, 1)
(6, 1)
       
13
13
       
6.50000000000000
6.50000000000000
       
Real Field with 53 bits of precision
Real Field with 53 bits of precision
       
6.5
6.5
       
Real Field with 10 bits of precision
Real Field with 10 bits of precision
       
302875106592253
302875106592253
       
1/302875106592253
1/302875106592253
       
3.30169095523012e-15
3.30169095523012e-15
       
'1000111'
'1000111'

binarni prikaz:

$(1000111)_2 = 1\cdot 2^0 + 1\cdot 2^1 + 1\cdot 2^2 +  0\cdot 2^3 + 0\cdot 2^4 + 0\cdot 2^5 + 1\cdot 2^6 = 1 + 2 + 4 + 0\cdot 8 + 0\cdot 16 + 0\cdot 32 + 64 = 71$

       
'-1000111'
'-1000111'
       
'11111111111111111111111110111001'
'11111111111111111111111110111001'

dvojni komplement:

negativni broj $-x$:    $2^{32} - x$

 

$\phantom{+}(\phantom{1}00000000000000000000000001000111)_2$

$+(\phantom{1}11111111111111111111111110111001)_2$

$=\!(100000000000000000000000000000000)_2$

 

$x \,-\, y \:=\: x \,+\, (-y)$:    $x \,+\, (2^{32} - y) \:=\: 2^{32} \,-\, (y - x)$

 

 

„Realni” brojevi

 

I am HAL Nine Thousand computer Production Number 3. I became operational at the Hal Plant in Urbana, Illinois, on January 12, 1997.

The quick brown fox jumps over the lazy dog.

The rain in Spain is mainly in the plain.

Dave—are you still here?

Did you know that the square root of 10 is 3.162277660168379?

Log 10 to the base $e$ is 0.43429481903252$\,\ldots$

correction, that is log $e$ to the base 10$\,\ldots$

The reciprocal of 3 is 0.3333333333333333333$\,\ldots$

2 times 2 is$\:\ldots\:$2 times 2 is$\,\ldots$

approximately 4.10101010101010$\,\ldots$

I seem to be having difficulty$\,\ldots$

 

—HAL, in 2001: A Space Odyssey


       
6.50000000000000
6.50000000000000
       
6.50000000000000
6.50000000000000
       
6.50000000000000
6.50000000000000

 

„Realne” se konstante (s točnošću zapisa od 53 bita) mogu pisati na pet načina:

  • kao decimalni brojevi s točkom (može se izostaviti dio ispred ili iza točke, ali točka mora postojati, jer je inače riječ o cijelom broju):
       
(3.14000000000000, -1.41000000000000, 0.000000000000000, 0.510000000000000)
(3.14000000000000, -1.41000000000000, 0.000000000000000, 0.510000000000000)
  • u eksponencijalnom obliku:
       
(1.30000000000000e13, 1.30000000000000e-13)
(1.30000000000000e13, 1.30000000000000e-13)
  • pomoću funkcije RR():
       
(1.00000000000000, 0.500000000000000)
(1.00000000000000, 0.500000000000000)
  • pomoću funkcija N(), n(), numerical_approx():
       
(0.500000000000000,
 0.333333333333333,
 0.250000000000000,
 0.0909090909090909,
 0.0769230769230769)
(0.500000000000000,
 0.333333333333333,
 0.250000000000000,
 0.0909090909090909,
 0.0769230769230769)
       
(-1.0, -0.3333333333333333, -0.25)
(-1.0, -0.3333333333333333, -0.25)

Prva četiri načina daju brojeve koji pripadaju tipu RealField(53), a peti broj koji pripada tipu RealDoubleField:

       
Real Field with 53 bits of precision
Real Field with 53 bits of precision
Real Field with 53 bits of precision
Real Field with 53 bits of precision
Real Double Field
Real Field with 53 bits of precision
Real Field with 53 bits of precision
Real Field with 53 bits of precision
Real Field with 53 bits of precision
Real Double Field

Pomoću funkcija RealField()() i N() mogu se zadati „realni” brojevi drugih točnosti:

       
-1.20
-1.20
       
Real Field with 170 bits of precision
Real Field with 170 bits of precision
       
-1.2000000000000000000000000000000000000000000000000
-1.2000000000000000000000000000000000000000000000000
       
-1.2000000000000000000000000000000000000000000000000
-1.2000000000000000000000000000000000000000000000000
       
-1.2000000000000000000000000000000000000000000000000
-1.2000000000000000000000000000000000000000000000000

 

Realni brojevi (u matematici):

  • neprebrojivi (kardinalni broj skupa $\mathbb{R}$: $\mathsf{C} = 2^{\aleph_0}\!$), 
  • racionalni i iracionalni ($\sqrt{2},\; \pi,\; e$)

Racionalni brojevi:

  • prebrojivi (kardinalni broj skupova $\mathbb{N}, \mathbb{Z}$ i $\mathbb{Q}$: $\aleph_0\!$),
  • mogu se napisati u obliku $\dfrac{m}{n}$, gdje su $m \in \mathbb{Z}$ i $n \in \mathbb{N}$,
  • ovisno o bazi, u zapisu sa zarezom (ili, u engleskom, s točkom) mogu imati konačan ili beskonačan broj znamenaka; ako je znamenaka beskonačno mnogo, one se prije ili kasnije počnu ponavljati:  $\dfrac{1}{3} = 0,\!333\ldots = 0,\!\dot{3}$;  $\dfrac{1}{10} = 0,\!1 = (0,\!00011001100110011\ldots)_2 = (0,\!0\overline{0011})_2$
       
13/7
13/7
       
1.85714285714286
1.85714285714286
       
18.5714285714286
18.5714285714286
       
18571.4285714286
18571.4285714286
       
0.0185714285714286
0.0185714285714286
       
0.0000185714285714286
0.0000185714285714286
       
1.85714285714286e-35
1.85714285714286e-35

Značajnim znamenkama broja $x\ne 0$ u zapisu sa zarezom nazivaju se prva znamenka slijeva različita od nule i sve znamenke desno od nje do kraja zapisa; za $x = 0$ sve su znamenke u zapisu značajne.

       
0.000000000000000
0.000000000000000

 

Prikaz s pomičnim (plivajućim) zarezom (u engleskom: s plivajućom točkom — floating point)

 

dekadski sustav:  $x = \pm m \cdot 10^e$

    $m$ — normalizirana mantisa,  $1 \le m < 10$  ili  $m = 0$

    $e$ — eksponent

          $123456780000000000000,\!0 = 1,\!2345678 \cdot 10^{20}$

          $123,\!45678 = 1,\!2345678 \cdot 10^2$

          $0,\!00012345678 = 1,\!2345678 \cdot 10^{-4}$

          $0,\!000000000000000000012345678 = 1,\!2345678 \cdot 10^{-20}$

          normalizacija omogućava zapis najvećeg broja značajnih znamenaka ako je broj znamenaka u prikazu broja ograničen

 

binarni sustav (najjednostavnije):  $x = s \cdot m \cdot 2^e$

    $s \in \{ -1,\, 1 \}$

    $1 \le m < 2$  ili  $m = 0$ 

          ako je  $m \in [1,\, 2)$,  prva je znamenka u binarnom prikazu uvijek 1  $\rightarrow$  skriveni bit

 

binarni sustav (u GNU MPFR-u i SageMath-u (RealField())):  $x = s \cdot m \cdot 2^{e - p}$

    $p$ — točnost (broj bitova mantise)

    $2^{p-1} \le m < 2^p$  ili  $m = 0$

    $-2^B + 1 \: \le \: e \: \le \: 2^B - 1$

          ($B = 30$ na 32-bitnim računalima, $B = 62$ na 64-bitnim računalima)

 [GNU MPFR — GNU Multiple Precision Floating-Point Reliable Library; GNU (GNU's Not Unix!)  — an extensive collection of free software

       
-1.00000000000000
-1.00000000000000
       
(-1, 4503599627370496, -52, 1/4503599627370496)
(-1, 4503599627370496, -52, 1/4503599627370496)
       
-1
-1
       
0.333333333333333
0.333333333333333
       
(1, 6004799503160661, -54, 1/18014398509481984)
(1, 6004799503160661, -54, 1/18014398509481984)
       

                                
                            

                                
       

                                
                            

                                
       
0.100000000000000
0.100000000000000
       
(1, 7205759403792794, -56, 1/72057594037927936)
(1, 7205759403792794, -56, 1/72057594037927936)
       

                                
                            

                                
       

                                
                            

                                
       
-1.0000000000000000000000
-1.0000000000000000000000
       
Real Field with 80 bits of precision
Real Field with 80 bits of precision
       
(-1, 604462909807314587353088, -79, 1/604462909807314587353088)
(-1, 604462909807314587353088, -79, 1/604462909807314587353088)
       
-1
-1
       
-0.33333333333333333333333
-0.33333333333333333333333
       
(-1, 805950546409752783137451, -81, 1/2417851639229258349412352)
(-1, 805950546409752783137451, -81, 1/2417851639229258349412352)
       

                                
                            

                                
       

                                
                            

                                
       
(-0.33333333333333333333333, Real Field with 80 bits of precision)
(-0.33333333333333333333333, Real Field with 80 bits of precision)
       
(-0.333333333333333, Real Field with 53 bits of precision)
(-0.333333333333333, Real Field with 53 bits of precision)


točnost (precision) prikaza s pomičnim zarezom ovisi o broju bitova mantise (binarnih značajnih znamenaka)

veza između broja značajnih znamenaka u binarnom i u dekadskom zapisu:

  • ako je u binarnom sustavu mantisa broja zapisana s $b$ bitova (binarnih znamenaka), onda će u dekadskom sustavu broj imati približno  $b\cdot \log_{10}2$  značajnih znamenaka
  • za zapis $d$ dekadskih značajnih znamenaka potrebno je približno  $d\cdot \log_{2}10$ bitova
       
9007199254740991
9007199254740992
9007199254740991
9007199254740992
       
9999999999999999
10000000000000000
9999999999999999
10000000000000000
       
9007199254740992
10000000000000000
9007199254740992
10000000000000000
       
15.9545897701910
15.9545897701910
       
53.1508495181978
53.1508495181978
       
       
16
16
       
53
53
       
24
24
       
80
80
  • SageMath je pri ispisu brojeva na „(ne)sigurnoj strani”:
       
Real Field with 53 bits of precision
Real Field with 53 bits of precision
       
1.3333333333333333
1.33333333333333
1.3333333333333333
1.33333333333333
       
15
15
       
7
7
       
2.71828182845905
2.718282
2.71828182845905
2.718282
       
2.71828
2.71828
       
Traceback (click to the left of this block for traceback)
...
TypeError: cannot approximate to a precision of 27 bits, use at most 24 bits
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_6.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TiAoZWUsIGRpZ2l0cyA9IDcp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpqkbP9v/___code___.py", line 3, in <module>
    exec compile(u'N (ee, digits = _sage_const_7 )
  File "", line 1, in <module>
    
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/misc/functional.py", line 1419, in numerical_approx
    return n(prec, algorithm=algorithm)
  File "sage/structure/element.pyx", line 850, in sage.structure.element.Element.numerical_approx (build/cythonized/sage/structure/element.c:7829)
  File "sage/arith/numerical_approx.pyx", line 65, in sage.arith.numerical_approx.numerical_approx_generic (build/cythonized/sage/arith/numerical_approx.c:2666)
TypeError: cannot approximate to a precision of 27 bits, use at most 24 bits
       
2.718282
2.718282
       
Real Field with 47 bits of precision
Real Field with 47 bits of precision


strojna točnost (machine epsilon)  —  najmanji pozitivni broj $\epsilon_{\mathrm{m}}$ koji pribrojen broju 1 daje broj različit od 1:   $1 + \epsilon_{\mathrm{m}} \ne 1$

       najmanji broj veći od 1:   $\bar{x} = (1,\!000\ldots001)_2 = 1 + 2^{-(p-1)} = 1 + \epsilon_{\mathrm{m}} \quad\Rightarrow\quad \epsilon_{\mathrm{m}} = 2^{-(p-1)}$

       
Real Field with 53 bits of precision
Real Field with 53 bits of precision
       
1/4503599627370496
1/4503599627370496
       
False
False
       
True
True
       
2.22044604925031e-16
2.22044604925031e-16
       
1.11022302462516e-16
1.11022302462516e-16
       
       
0 :  1.00000000000000
1 :  0.500000000000000
2 :  0.250000000000000
3 :  0.125000000000000
4 :  0.0625000000000000
5 :  0.0312500000000000
6 :  0.0156250000000000
7 :  0.00781250000000000
8 :  0.00390625000000000
9 :  0.00195312500000000
10 :  0.000976562500000000
11 :  0.000488281250000000
12 :  0.000244140625000000
13 :  0.000122070312500000
14 :  0.0000610351562500000
15 :  0.0000305175781250000
16 :  0.0000152587890625000
17 :  7.62939453125000e-6
18 :  3.81469726562500e-6
19 :  1.90734863281250e-6
20 :  9.53674316406250e-7
21 :  4.76837158203125e-7
22 :  2.38418579101562e-7
23 :  1.19209289550781e-7
24 :  5.96046447753906e-8
25 :  2.98023223876953e-8
26 :  1.49011611938477e-8
27 :  7.45058059692383e-9
28 :  3.72529029846191e-9
29 :  1.86264514923096e-9
30 :  9.31322574615479e-10
31 :  4.65661287307739e-10
32 :  2.32830643653870e-10
33 :  1.16415321826935e-10
34 :  5.82076609134674e-11
35 :  2.91038304567337e-11
36 :  1.45519152283669e-11
37 :  7.27595761418343e-12
38 :  3.63797880709171e-12
39 :  1.81898940354586e-12
40 :  9.09494701772928e-13
41 :  4.54747350886464e-13
42 :  2.27373675443232e-13
43 :  1.13686837721616e-13
44 :  5.68434188608080e-14
45 :  2.84217094304040e-14
46 :  1.42108547152020e-14
47 :  7.10542735760100e-15
48 :  3.55271367880050e-15
49 :  1.77635683940025e-15
50 :  8.88178419700125e-16
51 :  4.44089209850063e-16
52 :  2.22044604925031e-16
2.22044604925031e-16
0 :  1.00000000000000
1 :  0.500000000000000
2 :  0.250000000000000
3 :  0.125000000000000
4 :  0.0625000000000000
5 :  0.0312500000000000
6 :  0.0156250000000000
7 :  0.00781250000000000
8 :  0.00390625000000000
9 :  0.00195312500000000
10 :  0.000976562500000000
11 :  0.000488281250000000
12 :  0.000244140625000000
13 :  0.000122070312500000
14 :  0.0000610351562500000
15 :  0.0000305175781250000
16 :  0.0000152587890625000
17 :  7.62939453125000e-6
18 :  3.81469726562500e-6
19 :  1.90734863281250e-6
20 :  9.53674316406250e-7
21 :  4.76837158203125e-7
22 :  2.38418579101562e-7
23 :  1.19209289550781e-7
24 :  5.96046447753906e-8
25 :  2.98023223876953e-8
26 :  1.49011611938477e-8
27 :  7.45058059692383e-9
28 :  3.72529029846191e-9
29 :  1.86264514923096e-9
30 :  9.31322574615479e-10
31 :  4.65661287307739e-10
32 :  2.32830643653870e-10
33 :  1.16415321826935e-10
34 :  5.82076609134674e-11
35 :  2.91038304567337e-11
36 :  1.45519152283669e-11
37 :  7.27595761418343e-12
38 :  3.63797880709171e-12
39 :  1.81898940354586e-12
40 :  9.09494701772928e-13
41 :  4.54747350886464e-13
42 :  2.27373675443232e-13
43 :  1.13686837721616e-13
44 :  5.68434188608080e-14
45 :  2.84217094304040e-14
46 :  1.42108547152020e-14
47 :  7.10542735760100e-15
48 :  3.55271367880050e-15
49 :  1.77635683940025e-15
50 :  8.88178419700125e-16
51 :  4.44089209850063e-16
52 :  2.22044604925031e-16
2.22044604925031e-16
       
0 :  1.00
1 :  0.500
2 :  0.250
3 :  0.125
4 :  0.0625
5 :  0.0312
6 :  0.0156
7 :  0.00781
8 :  0.00391
9 :  0.00195
10 :  0.000977
11 :  0.000488
12 :  0.000244
13 :  0.000122
0.000122
0 :  1.00
1 :  0.500
2 :  0.250
3 :  0.125
4 :  0.0625
5 :  0.0312
6 :  0.0156
7 :  0.00781
8 :  0.00391
9 :  0.00195
10 :  0.000977
11 :  0.000488
12 :  0.000244
13 :  0.000122
0.000122
       
1.6543612251060553497428e-24
1.6543612251060553497428e-24
       
1/604462909807314587353088
1/604462909807314587353088
       
1.6543612251060553497428e-24
1.6543612251060553497428e-24


jedinica na posljednjem mjestu (unit in the last place, ULP) — za (prikazivi) broj $x > 0$, razmak između $x$ i prvoga prikazivog većeg broja

       
2.22044604925031e-16
2.22044604925031e-16
       
1.77635683940025e-15
1.77635683940025e-15
       
1.42108547152020e-14
1.42108547152020e-14
       
False
False
       
True
True
       
False
False
       
True
True
       
True
True
       
True
True
       
False
False
       
True
True
       
False
False
  • ULP za brojeve  $2^{i_b},\, 2^{i_b+1}, ... ,\, 2^{i_e-1}$:
       
       
-10  :  0.000976562500000000  :  2.16840434497101e-19
-9  :  0.00195312500000000  :  4.33680868994202e-19
-8  :  0.00390625000000000  :  8.67361737988404e-19
-7  :  0.00781250000000000  :  1.73472347597681e-18
-6  :  0.0156250000000000  :  3.46944695195361e-18
-5  :  0.0312500000000000  :  6.93889390390723e-18
-4  :  0.0625000000000000  :  1.38777878078145e-17
-3  :  0.125000000000000  :  2.77555756156289e-17
-2  :  0.250000000000000  :  5.55111512312578e-17
-1  :  0.500000000000000  :  1.11022302462516e-16
0  :  1.00000000000000  :  2.22044604925031e-16
1  :  2.00000000000000  :  4.44089209850063e-16
2  :  4.00000000000000  :  8.88178419700125e-16
3  :  8.00000000000000  :  1.77635683940025e-15
4  :  16.0000000000000  :  3.55271367880050e-15
5  :  32.0000000000000  :  7.10542735760100e-15
6  :  64.0000000000000  :  1.42108547152020e-14
7  :  128.000000000000  :  2.84217094304040e-14
8  :  256.000000000000  :  5.68434188608080e-14
9  :  512.000000000000  :  1.13686837721616e-13
10  :  1024.00000000000  :  2.27373675443232e-13
-10  :  0.000976562500000000  :  2.16840434497101e-19
-9  :  0.00195312500000000  :  4.33680868994202e-19
-8  :  0.00390625000000000  :  8.67361737988404e-19
-7  :  0.00781250000000000  :  1.73472347597681e-18
-6  :  0.0156250000000000  :  3.46944695195361e-18
-5  :  0.0312500000000000  :  6.93889390390723e-18
-4  :  0.0625000000000000  :  1.38777878078145e-17
-3  :  0.125000000000000  :  2.77555756156289e-17
-2  :  0.250000000000000  :  5.55111512312578e-17
-1  :  0.500000000000000  :  1.11022302462516e-16
0  :  1.00000000000000  :  2.22044604925031e-16
1  :  2.00000000000000  :  4.44089209850063e-16
2  :  4.00000000000000  :  8.88178419700125e-16
3  :  8.00000000000000  :  1.77635683940025e-15
4  :  16.0000000000000  :  3.55271367880050e-15
5  :  32.0000000000000  :  7.10542735760100e-15
6  :  64.0000000000000  :  1.42108547152020e-14
7  :  128.000000000000  :  2.84217094304040e-14
8  :  256.000000000000  :  5.68434188608080e-14
9  :  512.000000000000  :  1.13686837721616e-13
10  :  1024.00000000000  :  2.27373675443232e-13
    • ako je  $x = 2^k$,  onda je  $\mathrm{ulp}\,(x) = \epsilon_{\mathrm{m}}\!\cdot 2^k$
       
-10  :  0.00097656250000000000000000  :  1.6155871338926321774832e-27
-9  :  0.0019531250000000000000000  :  3.2311742677852643549664e-27
-8  :  0.0039062500000000000000000  :  6.4623485355705287099329e-27
-7  :  0.0078125000000000000000000  :  1.2924697071141057419866e-26
-6  :  0.015625000000000000000000  :  2.5849394142282114839732e-26
-5  :  0.031250000000000000000000  :  5.1698788284564229679463e-26
-4  :  0.062500000000000000000000  :  1.0339757656912845935893e-25
-3  :  0.12500000000000000000000  :  2.0679515313825691871785e-25
-2  :  0.25000000000000000000000  :  4.1359030627651383743570e-25
-1  :  0.50000000000000000000000  :  8.2718061255302767487141e-25
0  :  1.0000000000000000000000  :  1.6543612251060553497428e-24
1  :  2.0000000000000000000000  :  3.3087224502121106994856e-24
2  :  4.0000000000000000000000  :  6.6174449004242213989713e-24
3  :  8.0000000000000000000000  :  1.3234889800848442797943e-23
4  :  16.000000000000000000000  :  2.6469779601696885595885e-23
5  :  32.000000000000000000000  :  5.2939559203393771191770e-23
6  :  64.000000000000000000000  :  1.0587911840678754238354e-22
7  :  128.00000000000000000000  :  2.1175823681357508476708e-22
8  :  256.00000000000000000000  :  4.2351647362715016953416e-22
9  :  512.00000000000000000000  :  8.4703294725430033906832e-22
10  :  1024.0000000000000000000  :  1.6940658945086006781366e-21
-10  :  0.00097656250000000000000000  :  1.6155871338926321774832e-27
-9  :  0.0019531250000000000000000  :  3.2311742677852643549664e-27
-8  :  0.0039062500000000000000000  :  6.4623485355705287099329e-27
-7  :  0.0078125000000000000000000  :  1.2924697071141057419866e-26
-6  :  0.015625000000000000000000  :  2.5849394142282114839732e-26
-5  :  0.031250000000000000000000  :  5.1698788284564229679463e-26
-4  :  0.062500000000000000000000  :  1.0339757656912845935893e-25
-3  :  0.12500000000000000000000  :  2.0679515313825691871785e-25
-2  :  0.25000000000000000000000  :  4.1359030627651383743570e-25
-1  :  0.50000000000000000000000  :  8.2718061255302767487141e-25
0  :  1.0000000000000000000000  :  1.6543612251060553497428e-24
1  :  2.0000000000000000000000  :  3.3087224502121106994856e-24
2  :  4.0000000000000000000000  :  6.6174449004242213989713e-24
3  :  8.0000000000000000000000  :  1.3234889800848442797943e-23
4  :  16.000000000000000000000  :  2.6469779601696885595885e-23
5  :  32.000000000000000000000  :  5.2939559203393771191770e-23
6  :  64.000000000000000000000  :  1.0587911840678754238354e-22
7  :  128.00000000000000000000  :  2.1175823681357508476708e-22
8  :  256.00000000000000000000  :  4.2351647362715016953416e-22
9  :  512.00000000000000000000  :  8.4703294725430033906832e-22
10  :  1024.0000000000000000000  :  1.6940658945086006781366e-21
       
70  :  1.1805916207174113034240e21  :  0.0019531250000000000000000
71  :  2.3611832414348226068480e21  :  0.0039062500000000000000000
72  :  4.7223664828696452136960e21  :  0.0078125000000000000000000
73  :  9.4447329657392904273920e21  :  0.015625000000000000000000
74  :  1.8889465931478580854784e22  :  0.031250000000000000000000
75  :  3.7778931862957161709568e22  :  0.062500000000000000000000
76  :  7.5557863725914323419136e22  :  0.12500000000000000000000
77  :  1.5111572745182864683827e23  :  0.25000000000000000000000
78  :  3.0223145490365729367654e23  :  0.50000000000000000000000
79  :  6.0446290980731458735309e23  :  1.0000000000000000000000
80  :  1.2089258196146291747062e24  :  2.0000000000000000000000
70  :  1.1805916207174113034240e21  :  0.0019531250000000000000000
71  :  2.3611832414348226068480e21  :  0.0039062500000000000000000
72  :  4.7223664828696452136960e21  :  0.0078125000000000000000000
73  :  9.4447329657392904273920e21  :  0.015625000000000000000000
74  :  1.8889465931478580854784e22  :  0.031250000000000000000000
75  :  3.7778931862957161709568e22  :  0.062500000000000000000000
76  :  7.5557863725914323419136e22  :  0.12500000000000000000000
77  :  1.5111572745182864683827e23  :  0.25000000000000000000000
78  :  3.0223145490365729367654e23  :  0.50000000000000000000000
79  :  6.0446290980731458735309e23  :  1.0000000000000000000000
80  :  1.2089258196146291747062e24  :  2.0000000000000000000000
       
50  :  1.12589990684262e15  :  0.250000000000000
51  :  2.25179981368525e15  :  0.500000000000000
52  :  4.50359962737050e15  :  1.00000000000000
53  :  9.00719925474099e15  :  2.00000000000000
54  :  1.80143985094820e16  :  4.00000000000000
55  :  3.60287970189640e16  :  8.00000000000000
56  :  7.20575940379279e16  :  16.0000000000000
57  :  1.44115188075856e17  :  32.0000000000000
58  :  2.88230376151712e17  :  64.0000000000000
59  :  5.76460752303423e17  :  128.000000000000
60  :  1.15292150460685e18  :  256.000000000000
61  :  2.30584300921369e18  :  512.000000000000
62  :  4.61168601842739e18  :  1024.00000000000
63  :  9.22337203685478e18  :  2048.00000000000
64  :  1.84467440737096e19  :  4096.00000000000
65  :  3.68934881474191e19  :  8192.00000000000
66  :  7.37869762948382e19  :  16384.0000000000
67  :  1.47573952589676e20  :  32768.0000000000
68  :  2.95147905179353e20  :  65536.0000000000
69  :  5.90295810358706e20  :  131072.000000000
70  :  1.18059162071741e21  :  262144.000000000
50  :  1.12589990684262e15  :  0.250000000000000
51  :  2.25179981368525e15  :  0.500000000000000
52  :  4.50359962737050e15  :  1.00000000000000
53  :  9.00719925474099e15  :  2.00000000000000
54  :  1.80143985094820e16  :  4.00000000000000
55  :  3.60287970189640e16  :  8.00000000000000
56  :  7.20575940379279e16  :  16.0000000000000
57  :  1.44115188075856e17  :  32.0000000000000
58  :  2.88230376151712e17  :  64.0000000000000
59  :  5.76460752303423e17  :  128.000000000000
60  :  1.15292150460685e18  :  256.000000000000
61  :  2.30584300921369e18  :  512.000000000000
62  :  4.61168601842739e18  :  1024.00000000000
63  :  9.22337203685478e18  :  2048.00000000000
64  :  1.84467440737096e19  :  4096.00000000000
65  :  3.68934881474191e19  :  8192.00000000000
66  :  7.37869762948382e19  :  16384.0000000000
67  :  1.47573952589676e20  :  32768.0000000000
68  :  2.95147905179353e20  :  65536.0000000000
69  :  5.90295810358706e20  :  131072.000000000
70  :  1.18059162071741e21  :  262144.000000000
       
0  :  1.00  :  0.000122
1  :  2.00  :  0.000244
2  :  4.00  :  0.000488
3  :  8.00  :  0.000977
4  :  16.0  :  0.00195
5  :  32.0  :  0.00391
6  :  64.0  :  0.00781
7  :  128.  :  0.0156
8  :  256.  :  0.0312
9  :  512.  :  0.0625
10  :  1020.  :  0.125
0  :  1.00  :  0.000122
1  :  2.00  :  0.000244
2  :  4.00  :  0.000488
3  :  8.00  :  0.000977
4  :  16.0  :  0.00195
5  :  32.0  :  0.00391
6  :  64.0  :  0.00781
7  :  128.  :  0.0156
8  :  256.  :  0.0312
9  :  512.  :  0.0625
10  :  1020.  :  0.125
  • ULP za brojeve  $x,\, x+dx,\, x+2\,dx, ... ,\, x+(n-1)\,dx$:
       
       
0  :  1.00000000000000  :  2.22044604925031e-16
1  :  1.10000000000000  :  2.22044604925031e-16
2  :  1.20000000000000  :  2.22044604925031e-16
3  :  1.30000000000000  :  2.22044604925031e-16
4  :  1.40000000000000  :  2.22044604925031e-16
5  :  1.50000000000000  :  2.22044604925031e-16
6  :  1.60000000000000  :  2.22044604925031e-16
7  :  1.70000000000000  :  2.22044604925031e-16
8  :  1.80000000000000  :  2.22044604925031e-16
9  :  1.90000000000000  :  2.22044604925031e-16
10  :  2.00000000000000  :  4.44089209850063e-16
0  :  1.00000000000000  :  2.22044604925031e-16
1  :  1.10000000000000  :  2.22044604925031e-16
2  :  1.20000000000000  :  2.22044604925031e-16
3  :  1.30000000000000  :  2.22044604925031e-16
4  :  1.40000000000000  :  2.22044604925031e-16
5  :  1.50000000000000  :  2.22044604925031e-16
6  :  1.60000000000000  :  2.22044604925031e-16
7  :  1.70000000000000  :  2.22044604925031e-16
8  :  1.80000000000000  :  2.22044604925031e-16
9  :  1.90000000000000  :  2.22044604925031e-16
10  :  2.00000000000000  :  4.44089209850063e-16
       
0  :  1.00000000000000  :  2.22044604925031e-16
1  :  2.00000000000000  :  4.44089209850063e-16
2  :  3.00000000000000  :  4.44089209850063e-16
3  :  4.00000000000000  :  8.88178419700125e-16
4  :  5.00000000000000  :  8.88178419700125e-16
5  :  6.00000000000000  :  8.88178419700125e-16
6  :  7.00000000000000  :  8.88178419700125e-16
7  :  8.00000000000000  :  1.77635683940025e-15
8  :  9.00000000000000  :  1.77635683940025e-15
9  :  10.0000000000000  :  1.77635683940025e-15
10  :  11.0000000000000  :  1.77635683940025e-15
11  :  12.0000000000000  :  1.77635683940025e-15
12  :  13.0000000000000  :  1.77635683940025e-15
13  :  14.0000000000000  :  1.77635683940025e-15
14  :  15.0000000000000  :  1.77635683940025e-15
0  :  1.00000000000000  :  2.22044604925031e-16
1  :  2.00000000000000  :  4.44089209850063e-16
2  :  3.00000000000000  :  4.44089209850063e-16
3  :  4.00000000000000  :  8.88178419700125e-16
4  :  5.00000000000000  :  8.88178419700125e-16
5  :  6.00000000000000  :  8.88178419700125e-16
6  :  7.00000000000000  :  8.88178419700125e-16
7  :  8.00000000000000  :  1.77635683940025e-15
8  :  9.00000000000000  :  1.77635683940025e-15
9  :  10.0000000000000  :  1.77635683940025e-15
10  :  11.0000000000000  :  1.77635683940025e-15
11  :  12.0000000000000  :  1.77635683940025e-15
12  :  13.0000000000000  :  1.77635683940025e-15
13  :  14.0000000000000  :  1.77635683940025e-15
14  :  15.0000000000000  :  1.77635683940025e-15
    • ako je  $x = m\cdot 2^k$,  gdje je $m$ normalizirana mantisa, onda je  $\mathrm{ulp}\,(x) = \epsilon_{\mathrm{m}}\!\cdot 2^k$
       
0  :  2.0000000000000000000000  :  3.3087224502121106994856e-24
1  :  2.1000000000000000000000  :  3.3087224502121106994856e-24
2  :  2.2000000000000000000000  :  3.3087224502121106994856e-24
3  :  2.3000000000000000000000  :  3.3087224502121106994856e-24
4  :  2.4000000000000000000000  :  3.3087224502121106994856e-24
5  :  2.5000000000000000000000  :  3.3087224502121106994856e-24
6  :  2.6000000000000000000000  :  3.3087224502121106994856e-24
7  :  2.7000000000000000000000  :  3.3087224502121106994856e-24
8  :  2.8000000000000000000000  :  3.3087224502121106994856e-24
9  :  2.9000000000000000000000  :  3.3087224502121106994856e-24
10  :  3.0000000000000000000000  :  3.3087224502121106994856e-24
11  :  3.1000000000000000000000  :  3.3087224502121106994856e-24
12  :  3.2000000000000000000000  :  3.3087224502121106994856e-24
13  :  3.3000000000000000000000  :  3.3087224502121106994856e-24
14  :  3.4000000000000000000000  :  3.3087224502121106994856e-24
15  :  3.5000000000000000000000  :  3.3087224502121106994856e-24
16  :  3.6000000000000000000000  :  3.3087224502121106994856e-24
17  :  3.7000000000000000000000  :  3.3087224502121106994856e-24
18  :  3.8000000000000000000000  :  3.3087224502121106994856e-24
19  :  3.9000000000000000000000  :  3.3087224502121106994856e-24
20  :  4.0000000000000000000000  :  3.3087224502121106994856e-24
21  :  4.1000000000000000000000  :  6.6174449004242213989713e-24
0  :  2.0000000000000000000000  :  3.3087224502121106994856e-24
1  :  2.1000000000000000000000  :  3.3087224502121106994856e-24
2  :  2.2000000000000000000000  :  3.3087224502121106994856e-24
3  :  2.3000000000000000000000  :  3.3087224502121106994856e-24
4  :  2.4000000000000000000000  :  3.3087224502121106994856e-24
5  :  2.5000000000000000000000  :  3.3087224502121106994856e-24
6  :  2.6000000000000000000000  :  3.3087224502121106994856e-24
7  :  2.7000000000000000000000  :  3.3087224502121106994856e-24
8  :  2.8000000000000000000000  :  3.3087224502121106994856e-24
9  :  2.9000000000000000000000  :  3.3087224502121106994856e-24
10  :  3.0000000000000000000000  :  3.3087224502121106994856e-24
11  :  3.1000000000000000000000  :  3.3087224502121106994856e-24
12  :  3.2000000000000000000000  :  3.3087224502121106994856e-24
13  :  3.3000000000000000000000  :  3.3087224502121106994856e-24
14  :  3.4000000000000000000000  :  3.3087224502121106994856e-24
15  :  3.5000000000000000000000  :  3.3087224502121106994856e-24
16  :  3.6000000000000000000000  :  3.3087224502121106994856e-24
17  :  3.7000000000000000000000  :  3.3087224502121106994856e-24
18  :  3.8000000000000000000000  :  3.3087224502121106994856e-24
19  :  3.9000000000000000000000  :  3.3087224502121106994856e-24
20  :  4.0000000000000000000000  :  3.3087224502121106994856e-24
21  :  4.1000000000000000000000  :  6.6174449004242213989713e-24

 

zbrajanje „realnih” brojeva nije asocijativno:

       
       
False
False
       
False
False
       
1.00000000000000
1.0000000000000002
1.00000000000000
1.0000000000000002
       
True
True
       
1.00000000000000
1.0000000000000000
1.00000000000000
1.0000000000000000
       
True
1.00000000000000
True
1.00000000000000
       
False
1.00000000000000
False
1.00000000000000

 

zbrajanje brojeva tipa  RealField(14)

 

$3 \,+\, 2\;=\; (11000000000000)_2 \times 2^{-12} \,+\, (10000000000000)_2 \times 2^{-12}\;:$

 

$\phantom{+}\;\:(\phantom{1}11000000000000\;)_2 \times 2^{-12}$

$+\;\:(\phantom{1}10000000000000\;)_2 \times 2^{-12}$

$=\kern0.1625ex\:(101000000000000\:)_2 \times 2^{-12}$

$=\kern0.1625ex\:(\phantom{1}10100000000000\;)_2 \times 2^{-11}$       $\ldots$  normalizacija

 

 $3 \,+\, \dfrac{3}{4} \;=\; (11000000000000)_2 \times 2^{-12} \,+\, (11000000000000)_2 \times 2^{-14}\;:$

 

$\phantom{+}\;\:(\;11000000000000\;)_2 \times 2^{-12}$

$+\;\:(\;00110000000000\;)_2 \times 2^{-12}$       $\ldots$  pomicanje mantise $-12 - (-14) = 2$ mjesta udesno

$=\kern0.1625ex\:(\;11110000000000\;)_2 \times 2^{-12}$

 

$1 \, +\, \dfrac{1}{2}\,\mathrm{ulp} (1) \;=\; (10000000000000)_2 \times 2^{-13} \,+\, (10000000000000)_2 \times 2^{-27}\;:$

 

$\phantom{+}\;\:(\;10000000000000\phantom{\Big|1}\;)_2 \times 2^{-13}$

$+\;\:(\;00000000000000\Big|1\;)_2 \times 2^{-13}$       $\ldots$  pomicanje mantise $-13 - (-27) = 14$ mjesta udesno

$=\kern0.1625ex\:(\;10000000000000\Big|1\;)_2 \times 2^{-13}$

$\approx\kern0.1625ex\:(\;10000000000000\phantom{\Big|1}\;)_2 \times 2^{-13}$

 

$ \dfrac{1}{2}\,\mathrm{ulp} (1)\, +\, \dfrac{1}{2}\,\mathrm{ulp} (1) \;=\; (10000000000000)_2 \times 2^{-27} \,+\, (10000000000000)_2 \times 2^{-27}\;:$

 

$\phantom{+}\;\:(\phantom{1}10000000000000\;)_2 \times 2^{-27}$

$+\;\:(\phantom{1}10000000000000\;)_2 \times 2^{-27}$

$=\kern0.1625ex\:(100000000000000\:)_2 \times 2^{-27}$

$=\kern0.1625ex\:(\phantom{1}10000000000000\;)_2 \times 2^{-26}$      

 

$1 \, +\, \mathrm{ulp} (1) \;=\; (10000000000000)_2 \times 2^{-13} \,+\, (10000000000000)_2 \times 2^{-26}\;:$

 

$\phantom{+}\;\:(\;11000000000000\;)_2 \times 2^{-13}$

$+\;\:(\;00000000000001\;)_2 \times 2^{-13}$       $\ldots$  pomicanje mantise $-13 - (-26) = 13$ mjesta udesno

$=\kern0.1625ex\:(\;10000000000001\;)_2 \times 2^{-13}$ 

   

 
 
zaokruživanja (roundingRND)
  • prema najbližem, to nearestN  (podrazumijeva se):
       
(0.333, 0.667, -0.333, -0.667)
(0.333, 0.667, -0.333, -0.667)
  • naniže (prema $-\infty$), down, D:
       
(0.333, 0.666, -0.334, -0.667)
(0.333, 0.666, -0.334, -0.667)
  • naviše (prema $+\infty$), up, U:
       
(0.334, 0.667, -0.333, -0.666)
(0.334, 0.667, -0.333, -0.666)
  • prema nuli, towards zero, Z
       
(0.333, 0.666, -0.333, -0.666)
(0.333, 0.666, -0.333, -0.666)
  • od nule, away from zero, A
       
(0.334, 0.667, -0.334, -0.667)
(0.334, 0.667, -0.334, -0.667)

 

zbrajanja i zaokruživanja:

       
(True, True)
(True, True)
       
(True, False)
(True, False)
       
(False, True)
(False, True)
       
(True, True)
(True, True)
       
(False, False)
(False, False)

 

(apsolutna) greška zaokruživanja:

  • $|\bar{x} \,-\, x| \:<\: \mathrm{ulp}\,(\bar{x})$  za D, U, Z, A
  • $|\bar{x} \,-\, x| \:<\: \dfrac{1}{2}\,\mathrm{ulp}\,(\bar{x})$  za N

 

„intervalna” aritmetika:

       
(3.14159265358979, 2.71828182845904, 0.650623412682596)
(3.14159265358979, 2.71828182845904, 0.650623412682596)
       
(3.14159265358980, 2.71828182845905, 0.650623412682597)
(3.14159265358980, 2.71828182845905, 0.650623412682597)

... realni broj $\,\sqrt{\pi - r}\,$ leži u intervalu između „realnih” brojeva $s_d$ i $s_u$

 

ispitivanje jednakosti „realnih” brojeva

       
1.00000000000000
1.00000000000000
       
False
False
       
^C
Traceback (click to the left of this block for traceback)
...
__SAGE__
^C
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_3.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cyA9IDAuCndoaWxlIChzICE9IDEuKSA6CiAgICBzICs9IDAuMQpz"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpQnoHQZ/___code___.py", line 5, in <module>
    s += _sage_const_0p1 
  File "src/cysignals/signals.pyx", line 320, in cysignals.signals.python_check_interrupt
KeyboardInterrupt
__SAGE__
       
2.64211950131177e6
2.64211950131177e6
       
'0.10000000000000001'
'0.20000000000000001'
'0.30000000000000004'
'0.40000000000000002'
'0.50000000000000000'
'0.59999999999999998'
'0.69999999999999996'
'0.79999999999999993'
'0.89999999999999991'
'0.99999999999999989'
'1.0999999999999999'
'1.2000000000000000'
'0.10000000000000001'
'0.20000000000000001'
'0.30000000000000004'
'0.40000000000000002'
'0.50000000000000000'
'0.59999999999999998'
'0.69999999999999996'
'0.79999999999999993'
'0.89999999999999991'
'0.99999999999999989'
'1.0999999999999999'
'1.2000000000000000'
  •  $\dfrac{1}{10} = 0,\!1 = (0,\!00011001100110011\ldots)_2 = (0,\!0\overline{0011})_2$
       
0.100000000000000 

0.100000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0.100000000000000 

0.10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
       
0.00011001100110011001100110011001100110011001100110011010 

0.000110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011010
0.00011001100110011001100110011001100110011001100110011010 

0.00011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011010
       
0.10000000000000001 

0.100000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
01
0.10000000000000001 

0.1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
       
0.100000000000000005551115123125782702118158340454101562500000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0.10000000000000000555111512312578270211815834045410156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
       
Traceback (click to the left of this block for traceback)
...
TypeError: cannot approximate to a precision of 1325 bits, use at most 53 bits
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_87.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TiAoYTUzLCAxMzI1KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpqZQ98Y/___code___.py", line 3, in <module>
    exec compile(u'N (a53, _sage_const_1325 )
  File "", line 1, in <module>
    
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/misc/functional.py", line 1419, in numerical_approx
    return n(prec, algorithm=algorithm)
  File "sage/structure/element.pyx", line 850, in sage.structure.element.Element.numerical_approx (build/cythonized/sage/structure/element.c:7829)
  File "sage/arith/numerical_approx.pyx", line 65, in sage.arith.numerical_approx.numerical_approx_generic (build/cythonized/sage/arith/numerical_approx.c:2666)
TypeError: cannot approximate to a precision of 1325 bits, use at most 53 bits

   

       

                                
                            

                                
       

                                
                            

                                

za inverznu bi matricu trebalo vrijediti  $\mathbf{A}\,\mathbf{A}^{\!-1} = \mathbf{A}^{\!-1}\mathbf{A} = \mathbf{I}$, ali...

       
False
False
       
False
False
       
False
False

... naime, kako „realna” aritmetika na računalu nije matematička realna aritmetika beskonačne točnosti, komponente matrice $\mathbf{A}\,\mathbf{A}^{\!-1}$ koje bi trebale biti nule, nisu nule:

       

                                
                            

                                

... štoviše, nisu ni sve „jedinice” jedinice, iako su ispisane kao jedinice:

       
1

4503599627370497/4503599627370496
1
9007199254740991/9007199254740992
9007199254740991/9007199254740992
4503599627370495/4503599627370496
1

4503599627370497/4503599627370496
1
9007199254740991/9007199254740992
9007199254740991/9007199254740992
4503599627370495/4503599627370496
       
1.0000000000000002
1.0000000000000000
0.99999999999999989
0.99999999999999989
0.99999999999999978
1.0000000000000002
1.0000000000000000
0.99999999999999989
0.99999999999999989
0.99999999999999978

neki (ali nikako svi) ispravni načini ispitivanja „jednakosti”:

       
1.49011611938477e-8
1.49011611938477e-8
       
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
       
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
       
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]

... ili, varijacija na temu: 

       
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
       
{(0, 0): 2.22044604925031e-16,
 (0, 1): -2.77555756156289e-17,
 (0, 2): 0.000000000000000,
 (0, 3): -2.77555756156289e-17,
 (0, 4): -2.77555756156289e-17,
 (1, 0): -5.55111512312578e-17,
 (1, 1): 0.000000000000000,
 (1, 2): -1.11022302462516e-16,
 (1, 3): -5.55111512312578e-17,
 (1, 4): 0.000000000000000,
 (2, 0): 6.93889390390723e-18,
 (2, 1): -8.32667268468867e-17,
 (2, 2): -1.11022302462516e-16,
 (2, 3): -2.77555756156289e-17,
 (2, 4): 0.000000000000000,
 (3, 0): -2.08166817117217e-17,
 (3, 1): 8.32667268468867e-17,
 (3, 2): 2.77555756156289e-17,
 (3, 3): -1.11022302462516e-16,
 (3, 4): 0.000000000000000,
 (4, 0): -2.77555756156289e-17,
 (4, 1): 0.000000000000000,
 (4, 2): 0.000000000000000,
 (4, 3): -1.11022302462516e-16,
 (4, 4): -2.22044604925031e-16}
{(0, 0): 2.22044604925031e-16,
 (0, 1): -2.77555756156289e-17,
 (0, 2): 0.000000000000000,
 (0, 3): -2.77555756156289e-17,
 (0, 4): -2.77555756156289e-17,
 (1, 0): -5.55111512312578e-17,
 (1, 1): 0.000000000000000,
 (1, 2): -1.11022302462516e-16,
 (1, 3): -5.55111512312578e-17,
 (1, 4): 0.000000000000000,
 (2, 0): 6.93889390390723e-18,
 (2, 1): -8.32667268468867e-17,
 (2, 2): -1.11022302462516e-16,
 (2, 3): -2.77555756156289e-17,
 (2, 4): 0.000000000000000,
 (3, 0): -2.08166817117217e-17,
 (3, 1): 8.32667268468867e-17,
 (3, 2): 2.77555756156289e-17,
 (3, 3): -1.11022302462516e-16,
 (3, 4): 0.000000000000000,
 (4, 0): -2.77555756156289e-17,
 (4, 1): 0.000000000000000,
 (4, 2): 0.000000000000000,
 (4, 3): -1.11022302462516e-16,
 (4, 4): -2.22044604925031e-16}
       
25
25
       
True
True
       
{}
{}
       
0
0
       
True
True

... ili: 

       
True
True
       
True
True

... ili, varijacije:

       
True
True
       
True
True
       
True
True

 

infinity & NaN (Not a Number)

       
+infinity
+infinity
       
Traceback (click to the left of this block for traceback)
...
ZeroDivisionError: rational division by zero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_112.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("MS8w"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmp3fMu04/___code___.py", line 3, in <module>
    exec compile(u'_sage_const_1 /_sage_const_0 
  File "", line 1, in <module>
    
  File "sage/rings/integer.pyx", line 2047, in sage.rings.integer.Integer.__div__ (build/cythonized/sage/rings/integer.c:14042)
ZeroDivisionError: rational division by zero
       
-infinity
-infinity
       
-infinity
-infinity
       
-Infinity
-Infinity
       
+Infinity
+Infinity
       

                                
                            

                                
       
The Infinity Ring
Real Field with 53 bits of precision
The Infinity Ring
Real Field with 53 bits of precision
       
Real Field with 53 bits of precision
Symbolic Ring
Real Field with 53 bits of precision
Symbolic Ring
       
True
True
       
True
True
       
+Infinity
+Infinity
       
+infinity
+infinity
       
+Infinity
+Infinity
       
+Infinity
+Infinity
       
+Infinity
+Infinity
       
+Infinity
+Infinity
       
+infinity
+infinity
       
Traceback (click to the left of this block for traceback)
...
TypeError: unsupported operand parent(s) for ^: 'The Infinity Ring' and 'The
Infinity Ring'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_129.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Ml5vbw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpPRg_2E/___code___.py", line 3, in <module>
    exec compile(u'_sage_const_2 **oo
  File "", line 1, in <module>
    
  File "sage/rings/integer.pyx", line 2213, in sage.rings.integer.Integer.__pow__ (build/cythonized/sage/rings/integer.c:14884)
  File "sage/structure/coerce.pyx", line 1163, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:9859)
  File "sage/structure/element.pyx", line 2038, in sage.structure.element.Element.__pow__ (build/cythonized/sage/structure/element.c:14037)
  File "sage/structure/element.pyx", line 2079, in sage.structure.element.Element._pow_ (build/cythonized/sage/structure/element.c:14381)
TypeError: unsupported operand parent(s) for ^: 'The Infinity Ring' and 'The Infinity Ring'
       
+infinity
+infinity
       
NaN
NaN
       
Traceback (click to the left of this block for traceback)
...
sage.rings.infinity.SignError: cannot add infinity to minus infinity
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_132.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("b28gLSBvbw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpHCRCdg/___code___.py", line 2, in <module>
    exec compile(u'oo - oo
  File "", line 1, in <module>
    
  File "sage/structure/element.pyx", line 1359, in sage.structure.element.Element.__sub__ (build/cythonized/sage/structure/element.c:11339)
  File "sage/structure/element.pyx", line 2371, in sage.structure.element.ModuleElement._sub_ (build/cythonized/sage/structure/element.c:15388)
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/rings/infinity.py", line 429, in _sub_
    raise SignError("cannot add infinity to minus infinity")
sage.rings.infinity.SignError: cannot add infinity to minus infinity
       
NaN
NaN
       
NaN
NaN
       
Traceback (click to the left of this block for traceback)
...
sage.rings.infinity.SignError: cannot multiply infinity by zero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_135.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("MCAqIG9v"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpJKBbmc/___code___.py", line 3, in <module>
    exec compile(u'_sage_const_0  * oo
  File "", line 1, in <module>
    
  File "sage/rings/integer.pyx", line 1989, in sage.rings.integer.Integer.__mul__ (build/cythonized/sage/rings/integer.c:13725)
  File "sage/structure/coerce.pyx", line 1163, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:9859)
  File "sage/structure/element.pyx", line 1517, in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:11977)
  File "sage/structure/element.pyx", line 2548, in sage.structure.element.RingElement._mul_ (build/cythonized/sage/structure/element.c:17481)
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/rings/infinity.py", line 1369, in _mul_
    raise SignError("cannot multiply infinity by zero")
sage.rings.infinity.SignError: cannot multiply infinity by zero
       
NaN
NaN
       
Traceback (click to the left of this block for traceback)
...
sage.rings.infinity.SignError: cannot multiply infinity by zero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_137.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("b28gLyBvbw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmp8XKd5C/___code___.py", line 2, in <module>
    exec compile(u'oo / oo
  File "", line 1, in <module>
    
  File "sage/structure/element.pyx", line 1647, in sage.structure.element.Element.__div__ (build/cythonized/sage/structure/element.c:12537)
  File "sage/structure/element.pyx", line 2649, in sage.structure.element.RingElement._div_ (build/cythonized/sage/structure/element.c:18126)
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/rings/infinity.py", line 481, in _div_
    return self * ~other
  File "sage/structure/element.pyx", line 1519, in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12012)
  File "sage/structure/coerce.pyx", line 1163, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:9859)
  File "sage/structure/element.pyx", line 1517, in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:11977)
  File "sage/structure/element.pyx", line 2548, in sage.structure.element.RingElement._mul_ (build/cythonized/sage/structure/element.c:17481)
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/rings/infinity.py", line 455, in _mul_
    raise SignError("cannot multiply infinity by zero")
sage.rings.infinity.SignError: cannot multiply infinity by zero
       
NaN
NaN
       
True
True
       
False
False
       
False
False
       
False
False
       
True
True
       
True
True
       
False
False
       
True
True
       
False
False
       
False
False
       
False
False
       
False
False

   

       
       
       
0 -8.99999999999999 -1.89188589083065
1 74.2610504415619 1.99848639858029
2 -49414.0501674566 -1.99999999651880
3 1.41943459326446e13 2.00000000000000
4 -infinity NaN
5 NaN NaN + NaN*I
6 NaN + NaN*I NaN + NaN*I
7 NaN + NaN*I NaN + NaN*I
8 NaN + NaN*I NaN + NaN*I
9 NaN + NaN*I NaN + NaN*I
NaN + NaN*I
0 -8.99999999999999 -1.89188589083065
1 74.2610504415619 1.99848639858029
2 -49414.0501674566 -1.99999999651880
3 1.41943459326446e13 2.00000000000000
4 -infinity NaN
5 NaN NaN + NaN*I
6 NaN + NaN*I NaN + NaN*I
7 NaN + NaN*I NaN + NaN*I
8 NaN + NaN*I NaN + NaN*I
9 NaN + NaN*I NaN + NaN*I
NaN + NaN*I
       
       
0 -8.99999999999999 -1.89188589083065
1 74.2610504415619 1.99848639858029
2 -49414.0501674566 -1.99999999651880
3 1.41943459326446e13 2.00000000000000
4 -infinity NaN
-infinity
0 -8.99999999999999 -1.89188589083065
1 74.2610504415619 1.99848639858029
2 -49414.0501674566 -1.99999999651880
3 1.41943459326446e13 2.00000000000000
4 -infinity NaN
-infinity

 

... i još dvije sitnice (ili pitanje dosljednosti): 

       
1.00000000000000*I
1.00000000000000*I
       
Traceback (click to the left of this block for traceback)
...
ValueError: negative number -1.00000000000000 does not have a square root in the
real field
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_150.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c3FydCAoLTEuLCBleHRlbmQgPSBGYWxzZSk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpXavP9e/___code___.py", line 3, in <module>
    exec compile(u'sqrt (-_sage_const_1p , extend = False)
  File "", line 1, in <module>
    
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/functions/other.py", line 870, in sqrt
    return x.sqrt(*args, **kwds)
  File "sage/rings/real_mpfr.pyx", line 4129, in sage.rings.real_mpfr.RealNumber.sqrt (build/cythonized/sage/rings/real_mpfr.c:26558)
ValueError: negative number -1.00000000000000 does not have a square root in the real field
       
3.14159265358979*I
3.14159265358979*I
       
Traceback (click to the left of this block for traceback)
...
TypeError: __call__() got an unexpected keyword argument 'extend'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_152.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bG9nICgxLiwgZXh0ZW5kID0gRmFsc2Up"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpPLp2_c/___code___.py", line 3, in <module>
    exec compile(u'log (_sage_const_1p , extend = False)
  File "", line 1, in <module>
    
  File "/opt/SageMath/local/lib/python2.7/site-packages/sage/functions/log.py", line 436, in log
    return ln(args[0], **kwds)
  File "sage/symbolic/function.pyx", line 897, in sage.symbolic.function.BuiltinFunction.__call__ (build/cythonized/sage/symbolic/function.cpp:10405)
TypeError: __call__() got an unexpected keyword argument 'extend'