+ All Categories
Home > Documents > unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten...

unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten...

Date post: 09-Oct-2019
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
24
Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums floats doubles Thomas Risse Institut für Informatik & Automation, IIA Fakultät E-Technik & Informatik Hochschule Bremen City University of Applied Sciences 13. Workshop – Mathematik in ingenieurwissenschaftlichen Studiengängen 16. September 2016 @ HS OS – Campus Lingen
Transcript
Page 1: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

unums

floats sub doubles

Thomas Risse

Institut fuumlr Informatik amp Automation IIAFakultaumlt E-Technik amp Informatik

Hochschule BremenCity University of Applied Sciences

13 Workshop ndash Mathematik iningenieurwissenschaftlichen Studiengaumlngen

16 September 2016 HS OS ndash Campus Lingen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Agenda

1 Einfuumlhrung

2 IEEE 754 Abnormitaumlten

3 Intervall-Arithmetik

4 Unums ndash Universal Numbers

5 Arithmetik mit Unums

6 Computational Science mit UBoxes

7 Ende der Debatte

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einfuumlhrunguumlberall Gleitpunktzahlen minus10 00 01 10 e asymp 271828π asymp 314159 10 middot 102 Planck1 h asymp 6626 middot 10minus34 J sγ = (667408plusmn 000031) middot 10minus11 m3

kgmiddots2 oder Avogadro2

Konstante NA asymp 6022140857(74) middot 1023 molminus1 cp [1]

IEEE 754 von 1985 [10] nachgebessert 2008 [11]standardisiert Darstellung von und Arithmetik mitGleitpunktzahlen sa [4] [2]

Einige rationale Zahlen q isin Q koumlnnen dargestellt werden als

q = Vorzeichen (normalisierte)Mantisse middot 2Exponent

Die Mantisse wird normalisiert um Mehrdeutigkeiten wie05 middot 2 = 1 = 32 middot 2minus5 zu vermeiden

Die Anzahl der bits der Mantisse bestimmt die Genauigkeitdiejenige der bits des Exponenten SkalierungrsquoWertebereichrsquo

1Max Planck (1858-1947) www-historymcsst-andrewsacukBiographiesPlanckhtml

2Amedeo Avogadro (1776-1856) httpsenwikipediaorgwikiAmedeo_Avogadro

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten I

IEEE 754 stellt Q 3 110 = 01 = 000011(2) nicht exakt dar

rArr Darstellungsfehlerradicradicmiddot middot middotradic

2 = 2nradic2=1 sinπ=1224646799147353e-16

997 minus

977 minus

27=minus 9992007221626409e-16 etc etc

rArr Rundungsfehler

Mit zB 2bit Mantissen und reichlich bits fuumlr den Exponentengilt 1 = 10(2) middot 20 1

4 = 10(2) middot 2minus2 so daszlig(1 + 1

4) = (10(2) middot 20 + 001(2) middot 20) = 1 und

((1 + 1

4) +14

)= 1 6= 15 = (1 + 1

2) = (1 + (1

4 + 14))

MATLAB (minus10 and 16 + 10 and 16) + 1 = 1 ltgt 0 = minus10 and 16 + (10 and 16 + 1)

rArr Assoziativitaumlt nicht garantiert

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten II

1976 auf einer CRAY-1 a middot b 6= b middot a [7]

rArr 1976 fake Kommutativitaumlt garantiert

2016 auf jeder IEEE 754 hardwarebull schlecht konditionierte lineare Gleichungssysteme wie zB

025510582x + 052746197y = 079981812080143857x + 165707065y = 251270273

mit

(xy

)=

(minus1

2

)stattasymp

(0

13

)bull C JAVA float s=00 for (int i=0 ilt10e+09 i++) s+=10

MATLAB s = single(0) for i=110^9 s = single(s+1) endliefern s = 16 777 216 statt s = 1 000 000 000bull harmonische Reihe limNrarrinfin

(sumNi=1

1i

)ltinfin

bull x12 = minusbplusmnradic

b2minus4ac2a = 2c

minusb∓radic

b2minus4acloumlst ax2+bx+c = 0

vgl 1CP10 in wwwweblearnhs-bremenderisseMAIdocsheathpdf

(In Sezialfaumlllen lassen sich Rundungsfehler algorithmischminimieren [13])

rArr no exception thrown no intelligent error handling

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten IIIf (x) = (x minus 1)n bzw g(x) =

sumnk=0

(nk

)(minus1)nminusk xk

095 096 097 098 099 1 101 102 103 104 105

minus1

minus05

0

05

1

x 10minus13

x

45 x2 minus 10 x minus 120 x3 + 210 x4 minus 252 x5 ++ 1

f = (xminus1)n mit n=10g = expand(f)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 2: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Agenda

1 Einfuumlhrung

2 IEEE 754 Abnormitaumlten

3 Intervall-Arithmetik

4 Unums ndash Universal Numbers

5 Arithmetik mit Unums

6 Computational Science mit UBoxes

7 Ende der Debatte

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einfuumlhrunguumlberall Gleitpunktzahlen minus10 00 01 10 e asymp 271828π asymp 314159 10 middot 102 Planck1 h asymp 6626 middot 10minus34 J sγ = (667408plusmn 000031) middot 10minus11 m3

kgmiddots2 oder Avogadro2

Konstante NA asymp 6022140857(74) middot 1023 molminus1 cp [1]

IEEE 754 von 1985 [10] nachgebessert 2008 [11]standardisiert Darstellung von und Arithmetik mitGleitpunktzahlen sa [4] [2]

Einige rationale Zahlen q isin Q koumlnnen dargestellt werden als

q = Vorzeichen (normalisierte)Mantisse middot 2Exponent

Die Mantisse wird normalisiert um Mehrdeutigkeiten wie05 middot 2 = 1 = 32 middot 2minus5 zu vermeiden

Die Anzahl der bits der Mantisse bestimmt die Genauigkeitdiejenige der bits des Exponenten SkalierungrsquoWertebereichrsquo

1Max Planck (1858-1947) www-historymcsst-andrewsacukBiographiesPlanckhtml

2Amedeo Avogadro (1776-1856) httpsenwikipediaorgwikiAmedeo_Avogadro

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten I

IEEE 754 stellt Q 3 110 = 01 = 000011(2) nicht exakt dar

rArr Darstellungsfehlerradicradicmiddot middot middotradic

2 = 2nradic2=1 sinπ=1224646799147353e-16

997 minus

977 minus

27=minus 9992007221626409e-16 etc etc

rArr Rundungsfehler

Mit zB 2bit Mantissen und reichlich bits fuumlr den Exponentengilt 1 = 10(2) middot 20 1

4 = 10(2) middot 2minus2 so daszlig(1 + 1

4) = (10(2) middot 20 + 001(2) middot 20) = 1 und

((1 + 1

4) +14

)= 1 6= 15 = (1 + 1

2) = (1 + (1

4 + 14))

MATLAB (minus10 and 16 + 10 and 16) + 1 = 1 ltgt 0 = minus10 and 16 + (10 and 16 + 1)

rArr Assoziativitaumlt nicht garantiert

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten II

1976 auf einer CRAY-1 a middot b 6= b middot a [7]

rArr 1976 fake Kommutativitaumlt garantiert

2016 auf jeder IEEE 754 hardwarebull schlecht konditionierte lineare Gleichungssysteme wie zB

025510582x + 052746197y = 079981812080143857x + 165707065y = 251270273

mit

(xy

)=

(minus1

2

)stattasymp

(0

13

)bull C JAVA float s=00 for (int i=0 ilt10e+09 i++) s+=10

MATLAB s = single(0) for i=110^9 s = single(s+1) endliefern s = 16 777 216 statt s = 1 000 000 000bull harmonische Reihe limNrarrinfin

(sumNi=1

1i

)ltinfin

bull x12 = minusbplusmnradic

b2minus4ac2a = 2c

minusb∓radic

b2minus4acloumlst ax2+bx+c = 0

vgl 1CP10 in wwwweblearnhs-bremenderisseMAIdocsheathpdf

(In Sezialfaumlllen lassen sich Rundungsfehler algorithmischminimieren [13])

rArr no exception thrown no intelligent error handling

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten IIIf (x) = (x minus 1)n bzw g(x) =

sumnk=0

(nk

)(minus1)nminusk xk

095 096 097 098 099 1 101 102 103 104 105

minus1

minus05

0

05

1

x 10minus13

x

45 x2 minus 10 x minus 120 x3 + 210 x4 minus 252 x5 ++ 1

f = (xminus1)n mit n=10g = expand(f)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 3: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einfuumlhrunguumlberall Gleitpunktzahlen minus10 00 01 10 e asymp 271828π asymp 314159 10 middot 102 Planck1 h asymp 6626 middot 10minus34 J sγ = (667408plusmn 000031) middot 10minus11 m3

kgmiddots2 oder Avogadro2

Konstante NA asymp 6022140857(74) middot 1023 molminus1 cp [1]

IEEE 754 von 1985 [10] nachgebessert 2008 [11]standardisiert Darstellung von und Arithmetik mitGleitpunktzahlen sa [4] [2]

Einige rationale Zahlen q isin Q koumlnnen dargestellt werden als

q = Vorzeichen (normalisierte)Mantisse middot 2Exponent

Die Mantisse wird normalisiert um Mehrdeutigkeiten wie05 middot 2 = 1 = 32 middot 2minus5 zu vermeiden

Die Anzahl der bits der Mantisse bestimmt die Genauigkeitdiejenige der bits des Exponenten SkalierungrsquoWertebereichrsquo

1Max Planck (1858-1947) www-historymcsst-andrewsacukBiographiesPlanckhtml

2Amedeo Avogadro (1776-1856) httpsenwikipediaorgwikiAmedeo_Avogadro

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten I

IEEE 754 stellt Q 3 110 = 01 = 000011(2) nicht exakt dar

rArr Darstellungsfehlerradicradicmiddot middot middotradic

2 = 2nradic2=1 sinπ=1224646799147353e-16

997 minus

977 minus

27=minus 9992007221626409e-16 etc etc

rArr Rundungsfehler

Mit zB 2bit Mantissen und reichlich bits fuumlr den Exponentengilt 1 = 10(2) middot 20 1

4 = 10(2) middot 2minus2 so daszlig(1 + 1

4) = (10(2) middot 20 + 001(2) middot 20) = 1 und

((1 + 1

4) +14

)= 1 6= 15 = (1 + 1

2) = (1 + (1

4 + 14))

MATLAB (minus10 and 16 + 10 and 16) + 1 = 1 ltgt 0 = minus10 and 16 + (10 and 16 + 1)

rArr Assoziativitaumlt nicht garantiert

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten II

1976 auf einer CRAY-1 a middot b 6= b middot a [7]

rArr 1976 fake Kommutativitaumlt garantiert

2016 auf jeder IEEE 754 hardwarebull schlecht konditionierte lineare Gleichungssysteme wie zB

025510582x + 052746197y = 079981812080143857x + 165707065y = 251270273

mit

(xy

)=

(minus1

2

)stattasymp

(0

13

)bull C JAVA float s=00 for (int i=0 ilt10e+09 i++) s+=10

MATLAB s = single(0) for i=110^9 s = single(s+1) endliefern s = 16 777 216 statt s = 1 000 000 000bull harmonische Reihe limNrarrinfin

(sumNi=1

1i

)ltinfin

bull x12 = minusbplusmnradic

b2minus4ac2a = 2c

minusb∓radic

b2minus4acloumlst ax2+bx+c = 0

vgl 1CP10 in wwwweblearnhs-bremenderisseMAIdocsheathpdf

(In Sezialfaumlllen lassen sich Rundungsfehler algorithmischminimieren [13])

rArr no exception thrown no intelligent error handling

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten IIIf (x) = (x minus 1)n bzw g(x) =

sumnk=0

(nk

)(minus1)nminusk xk

095 096 097 098 099 1 101 102 103 104 105

minus1

minus05

0

05

1

x 10minus13

x

45 x2 minus 10 x minus 120 x3 + 210 x4 minus 252 x5 ++ 1

f = (xminus1)n mit n=10g = expand(f)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 4: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten I

IEEE 754 stellt Q 3 110 = 01 = 000011(2) nicht exakt dar

rArr Darstellungsfehlerradicradicmiddot middot middotradic

2 = 2nradic2=1 sinπ=1224646799147353e-16

997 minus

977 minus

27=minus 9992007221626409e-16 etc etc

rArr Rundungsfehler

Mit zB 2bit Mantissen und reichlich bits fuumlr den Exponentengilt 1 = 10(2) middot 20 1

4 = 10(2) middot 2minus2 so daszlig(1 + 1

4) = (10(2) middot 20 + 001(2) middot 20) = 1 und

((1 + 1

4) +14

)= 1 6= 15 = (1 + 1

2) = (1 + (1

4 + 14))

MATLAB (minus10 and 16 + 10 and 16) + 1 = 1 ltgt 0 = minus10 and 16 + (10 and 16 + 1)

rArr Assoziativitaumlt nicht garantiert

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten II

1976 auf einer CRAY-1 a middot b 6= b middot a [7]

rArr 1976 fake Kommutativitaumlt garantiert

2016 auf jeder IEEE 754 hardwarebull schlecht konditionierte lineare Gleichungssysteme wie zB

025510582x + 052746197y = 079981812080143857x + 165707065y = 251270273

mit

(xy

)=

(minus1

2

)stattasymp

(0

13

)bull C JAVA float s=00 for (int i=0 ilt10e+09 i++) s+=10

MATLAB s = single(0) for i=110^9 s = single(s+1) endliefern s = 16 777 216 statt s = 1 000 000 000bull harmonische Reihe limNrarrinfin

(sumNi=1

1i

)ltinfin

bull x12 = minusbplusmnradic

b2minus4ac2a = 2c

minusb∓radic

b2minus4acloumlst ax2+bx+c = 0

vgl 1CP10 in wwwweblearnhs-bremenderisseMAIdocsheathpdf

(In Sezialfaumlllen lassen sich Rundungsfehler algorithmischminimieren [13])

rArr no exception thrown no intelligent error handling

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten IIIf (x) = (x minus 1)n bzw g(x) =

sumnk=0

(nk

)(minus1)nminusk xk

095 096 097 098 099 1 101 102 103 104 105

minus1

minus05

0

05

1

x 10minus13

x

45 x2 minus 10 x minus 120 x3 + 210 x4 minus 252 x5 ++ 1

f = (xminus1)n mit n=10g = expand(f)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 5: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten II

1976 auf einer CRAY-1 a middot b 6= b middot a [7]

rArr 1976 fake Kommutativitaumlt garantiert

2016 auf jeder IEEE 754 hardwarebull schlecht konditionierte lineare Gleichungssysteme wie zB

025510582x + 052746197y = 079981812080143857x + 165707065y = 251270273

mit

(xy

)=

(minus1

2

)stattasymp

(0

13

)bull C JAVA float s=00 for (int i=0 ilt10e+09 i++) s+=10

MATLAB s = single(0) for i=110^9 s = single(s+1) endliefern s = 16 777 216 statt s = 1 000 000 000bull harmonische Reihe limNrarrinfin

(sumNi=1

1i

)ltinfin

bull x12 = minusbplusmnradic

b2minus4ac2a = 2c

minusb∓radic

b2minus4acloumlst ax2+bx+c = 0

vgl 1CP10 in wwwweblearnhs-bremenderisseMAIdocsheathpdf

(In Sezialfaumlllen lassen sich Rundungsfehler algorithmischminimieren [13])

rArr no exception thrown no intelligent error handling

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten IIIf (x) = (x minus 1)n bzw g(x) =

sumnk=0

(nk

)(minus1)nminusk xk

095 096 097 098 099 1 101 102 103 104 105

minus1

minus05

0

05

1

x 10minus13

x

45 x2 minus 10 x minus 120 x3 + 210 x4 minus 252 x5 ++ 1

f = (xminus1)n mit n=10g = expand(f)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 6: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754 Abnormitaumlten IIIf (x) = (x minus 1)n bzw g(x) =

sumnk=0

(nk

)(minus1)nminusk xk

095 096 097 098 099 1 101 102 103 104 105

minus1

minus05

0

05

1

x 10minus13

x

45 x2 minus 10 x minus 120 x3 + 210 x4 minus 252 x5 ++ 1

f = (xminus1)n mit n=10g = expand(f)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 7: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten IVDefiniere

(ui)

iisinNodurch ui+2 = 111minus 1130

ui+1+ 3000

ui ui+1mit

uo = 2 und u1 = minus4 hat Fixpunkte (6 6 6) und 100(1 1 1)

55

6

65

55

6

x

Kahanrsquos sequence ui+2 = 111minus1130ui+1+3000uiui+1

yx

y

contour plot of f = (xy)111minus1130y+3000(xy)

55 6 65

55

56

57

58

59

6

61

62

63

64

65

numericsymbolic

numericsymbolic

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 8: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Kahan-Abnormitaumlten Vbull Evaluiere H(x) = E(Q2(x)) mit E(0) = 1 und

E(x) = exminus1x und Q(x) = |x minus

radicx2 + 1| minus 1

x+radic

x2+1fuumlr

x = (15 16 17 9999) MATLAB liefert (0 0 0 0) statt(1 1 1 1) weil Q(x) equiv 0

bull Minimiere 180 log |3(1minus x) + 1|+ x2 + 1 fuumlr x isin [08 2]

08 1 12 14 16 18 2

15

2

25

3

35

4

45

5

x

180 log(abs(3 (1minusx)+1))+x2+1

13 131 132 133 134 135 136255

26

265

27

275

28

Kahanrsquos Smooth Surprise

bull Gilt 5960464477539062578 = 476837158203125exakt s

httpssageinformatikhs-bremendehomepub189

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 9: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Rump-Abnormitaumlten VI

bull Fuumlr (xo yo) = (77617 33096) evaluiere f (x y) =33375y6 + x2(11x2y2 minus y6 minus 121y4 minus 2) + 55y8 + x

2y MATLAB liefert f (xo yo) = minus1180591620717411e+21statt minus082739605994682136 wie zB der 2D-Schnittg(x) = f (x yo

xox) nahelegt

7761677617

7761777618

77618

x 104

33095

33096

33096

33097

33097

x 104

minus1

0

1

x 1033

x

Rumprsquos Royal Pain

y

77616 77616 77616 77617 77617 77617 77617 77617 77618 77618 77618

x 104

minus4

minus3

minus2

minus1

0

1

2

3

4x 10

22

x

33375 (c x)6++1(2 c)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 10: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

IEEE 754

IEEE 754 2008 Standard [12]fuumlr Gleitpunkt-Zahlen Q 3 q = s mantissa 2exponent

(mit Vorzeichen bit s) vornehmlich

float s 8bit exponent 24bit mantissaalso wegen 1 hidden bit insgesamt 4 bytes

double s 11bit exponent 53bit mantissaalso wegen 1 hidden bit insgesamt 8 bytes

wobei floats = single precision sub single extended subdouble = double precision sub double extended

IEEE floats und doubles verbinden angeblich GenauigkeitDarstellungsbereich und effizienter Arithmetik mit angemessenen(optimalen) Speicher- (Bandbreite) und Energie-Anforderungen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 11: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Maumlngel von IEEE 754

bull Darstellungsfehlerbull plusmninfin ersetzt betragsmaumlszligig groszlige endliche Zahlenbull 0 ersetzt betragsmaumlszligig kleine Zahlenbull akzeptiere etwa 00001100110011(2) an Stelle von 1

10

bull RundungsfehlerrArr keine AssoziativitaumltDistributivitaumlt

bull handling plusmninfin (Mantisse = 0 und alle Exponenten bits 1)

bull handling lots of NaN (Mantisse 6= 0 alle Exponenten bits 1)

bull underflowoverflow nur im processor status word

bull Potential fuumlr Parallelisierung wird nicht ausgeschoumlpft

bull IEEE 754 ist nicht strikt (zB subnormals optional)verschiedene Ergebnisse auf verschiedener hardwareJAVA [15] FMA EDP SUN [7]

bull ineffiziente Nutzung des Speichersbull hohe Anforderungen an Speicher und Interfacebull hoher Energie-Bedarf fuumlr den Daten-Transfer

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 12: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Intervall-ArithmetikIntervall-Arithmetik wie beispielsweisex isin [a b] y isin [c d ]rArr x + y isin [a + c b + d ](mit geeigneter Rundung) hat nur Nachteile

bull Numerik- amp Programmier-Expertise unverzichtbarbull mindestens doppelter Speicher- und Rechen-Bedarfbull Speicher-Verschwendung x isin [a b] (entweder viele

identische bits falls |aminus b| 1 oder unsinnigeGenauigkeit sonst)

bull unnoumltig pessimistische Intervalle (zB (a b) sub [a b])bull Intervalle wie zB (minusinfin b) sub [minusinfin b] sind nicht

darstellbarbull Annahme unabhaumlngiger Operanden impliziert unsinnig

groszlige Intervalle (zB x minus x isin [aminus b b minus a] oderxx isin [ a

b ba ] fuumlr x isin [a b] und a gt 0)

bull Intervall-Arithmetik ist nicht algebraisch abgeschlossen(zB 1

x isin [minusinfininfin] fuumlr x isin [a b] mit a lt 0 lt b obwohlx 6isin ( 1

a 1b ))

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 13: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Unum ndash Universal Numbers

Unums [7] seien in zwei Schritten eingefuumlhrt1 Schritt fixed format mit es bits fuumlr den biased Exponentenfs bits fuumlr die Mantisse=Fraction mit einem hidden bit (0 fallsexponent = all zero und 1 sonst) und dem ubit

s es bit exponent fs bit fraction ubit

ubit == 0 lArrrArr Zahl wird exakt dargestelltubit == 1 lArrrArr das Unum stellt das offene Intervall zwischenZahl und dem naumlchsten exakten Unum dar kein Runden

ZB sei es=2 und fs=1 Dann00010 = 1

2 00011 = (12 1) 00100 = 1 und 2

3 isin (12 1) ist besser

als rsquoLuumlgenrsquo wie 23 = 1

2 or 23 = 1

ZB 01110 = +infin 11110 = minusinfin01100 = 4 = maxreal 11100 = minus4 = ndashmaxreal01101 = (4infin) = almostinfin 11101 = (minusinfinminus4) = almostminusinfin01111 = quiet NaN 11101 = (4infin) = signaling NaN

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 14: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Vorteile

bull kein Runden wg ubit exakt oder Interval

bull kein underflow stattdessen Intervale(0 smallestsubnormal) bzw (minussmallestsubnormal 0)

bull kein overflow stattdessen Intervale(maxrealinfin) bzw (minusinfinminusmaxreal)

bull nur genau zwei NaN quiet und signaling

2 Schritt floats mit variabler exponent- und fraction-Laumlnge

bull Formate mit variablen Laumlngen sind gaumlngig zB stringsmessages images memory segments files etc

bull in IEEE 754 sind fs und es absolut willkuumlrlich

bull Um auf der sicheren Seite zu sein gibtrsquos overkilldefault data type zB in MATLAB ist double

rArr Zwei zusaumltzliche Felder spezifizierendie bit Laumlngen von exponent und fraction

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 15: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

variable length unums

Def esizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr den Exponenten

Def fsizesize isin No ist die Anzahl von bits fuumlr diemaximale Anzahl von bits fuumlr die fraction

Def utag = ubit exponent size bits fraction size bitswith |utag| = 1+esizesize+fsizesize

Def maxubits = 2+esizesize+fsizesize+2esizesize + 2fsizesize

s es bit exponent fs bit fraction ubit es-1 fs-1

doppelt positiv ist

1 Speicher-Ersparnisse wiegen den zusaumltzlichenSpeicherbedarf fuumlr utags bei weitem auf

2 Der Computer (und nicht der Programmierer) kontrolliertdie Feld-Groumlszligen

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 16: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Einige (extreme) Beispiele

Def esizesize fsizesize definiert ein environment

ZB 0 0 braucht jeweils 1 + 20 + 20 + 1 = 4 bits um R mit1110 = minusinfin 1101 = (minusinfinminus2) 1100 = minus2 1011 = (minus2minus1)1010 = minus1 1001 = (minus1 0) 1000 = 0 0000 = 0 zuuumlberdecken wobei 1111 = signal NaN und 0111 = quiet NaN

ZB 3 4 kann mit maximal 1 + 23 + 24 + 1 + 3 + 4 = 33bits floats mit Exponenten mit bis zu 23 = 8 bits (wie IEEE 754single prec) und mit Mantissae mit bis zu 24 = 16 bits dar-stellen (bessere Genauigkeit als IEEE 754 half single prec)

Eg 3 5 mit max 41 bits ist besser als IEEE 754 single

Eg 9 9 erlaubt Exponenten und Mantissen mit bis zu29 = 512 bits maxubits = 1+512+512+1+9+9 = 1044 undkann integers der Groumlszligenordnung22512

= 24middot251middot10= 16(2

10)51 asymp 16(103)51= 1610153

speichern

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 17: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Arithmetik mit Unums

Unums stellen im Wechsel exakte rationale Zahlen und offenereelle Intervalle dar

Def ubounds spezifizieren reelle Intervalle durch ein(inexaktes) Unum oder zwei Unums

Daher gibt es fuumlr jede Operation zwei Tabellen zB fuumlr oplusoplus links [minusinfin (minusinfin [y (y [infin[minusinfin [minusinfin [minusinfin [minusinfin [minusinfin (NaN(minusinfin [minusinfin (minusinfin (minusinfin (minusinfin [infin[x [minusinfin (minusinfin [x+y (x+y [infin(x [minusinfin (minusinfin (x+y (x+y [infin[infin (NaN [infin [infin [infin [infin

oplus rechts minusinfin] y) y ] infin) infin]

minusinfin) minusinfin] minusinfin] minusinfin] minusinfin] NaN)x) minusinfin] x+y) x+y) infin) infin]x] minusinfin] x+y) x+y ] infin) infin]infin) minusinfin] infin) infin) infin) infin]infin] NaN) infin] infin] infin] infin]

Die beiden Faumllle rsquo(infinrsquo und rsquominusinfin)rsquo koumlnnen nicht auftretenWenn x + y gt+

ltminusmaxreal dann [x oplus [y = (maxreal(minusinfin

Wenn x + y gt+ltminusmaxreal dann x]oplus y ] = infin)

minusmaxreal)

x minus y = x + (minusy) wobei minusy im g-layer gebildet wird

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 18: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

hardware fuumlr Unums g-layer

Unums aller environments mit esizesize le 4 fsizesize le 5koumlnnen zusammen mit den fuumlnf flags

negativ NaN plusmninfin zero scndin gaumlngigen 64-bit Registern gehalten und verarbeitet werden

Fixed-size unums faster than floats bull Warlpiri ubounds are one byte but closed system for reals bull Unpacked unums pre-decode exception bits hidden bit

Circuit required for ldquoIEEE half-precision float = infinrdquo Circuit required for

ldquounum = infinrdquo (any precision)

bull kleine kompakte unums im Speicher

bull schmale Prozessor-Speicher-Schnittstelle

bull schnelle hardware keine exceptions

bull pswrarrflags (quidquid latet apparebit)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 19: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

mathlib

bull exist xy fuumlr Unum Argumente x und y Fuumlr exakte Unums xund y ist xy nicht transzendental sondern algebraisch

bull exist exp(x) log(x) table makers dilemma N 3 eπradic

163 asymp262 537 412 640 768 743999 999 999 999

bull exist trigonometrische Funktionen mit Argumenten in Gradbull exist fused operations (MAC SAXPY oder DAXPY uauml)

bull exaktes Skalarprodukt (Arithmetik in C pp161) garantiertAssoziativitaumlt die wiederum Parallelitaumlt ermoumlglicht zBa + b + c + d = (a + b) + (c + d)

bull fused product garantiert Assoziativitaumltbull fused add-multiply garantiert Distributivitaumltbull fused product-ratio zB π = 2

prodinfini=1

(2i)2

(2iminus1)(2i+1)

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 20: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Computational Science mit UboxesUboxes sind n-tupel von Unums dh Hyperquader imn-dimensionalen Loumlsungsraum

Gesucht ist die kleinste Menge an uboxes die ein Problemloumlsen

Methoden sind deklarativ ndash aumlhnlich inclusionexlusion regiongrowing lumping grid refinement etc ndash ausreichend fuumlr [7]

bull finite Integrale

bull (lineare) Gleichungen mit exakten und inexakten Koeffizienten

bull Polynom-Auswertung Nullstellen Extrema Fixpunkte

bull physikalisches Pendel v = v(ϑ) a = a(ϑ) t = t(ϑ)

bull Zwei- und Mehr-Koumlrper-Probleme

bull inverse Kinematik [8]

bull Masse-Feder-Systeme Tragwerke FFT CFD

Vorteile exakte ErgebnisseIntervalle (Daten-) Parallelitaumlt

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 21: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Ende der Debatte

bull exist Gustafsonrsquos Mathematica notebooks (open sourceloyalty free sa httpswwwcrcpresscomdownloadsK23295K23295_Downloadszip)mit vollstaumlndiger Unum Math library (in Mathematica)

bull exist Implementierungen in Python [6] Julia [3] etc sahttpsgithubcomjrmuizelpyunum and othershttpsgithubcomREX-ComputingunumjlhttpsgithubcomSFrijtersunum-dhttpsgithubcomtbreloffUnumsjl

aktueller Stand [9]

bull exist heftige Debatte zwischen Gustafson [9] und Kahan [17]

bull exist Unums 20 naumlmlich Set of Real Numbers SORN [8]

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 22: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

References

[1] Bureau International des Poids et Mesures BIPM On the possiblefuture revision of the International System of Units the SI Resolution1 of the 24th CGPM (2011) wwwbipmorgenCGPMdb241

[2] brazzy httpfloating-point-guide

[3] Simon Byrne Implementing Unums in Juliahttpjuliacomputingcomblog20160329unumshtml

[4] David Goldberg What Every Computer Scientist Should Know AboutFloating-Point Arithmetic ACM Computing Surveys March 1991docsoraclecomcdE19957-01806-3568ncg_goldberghtml

[5] John L Gustafson The End of Numerical Error http

arith22gforgeinriafrslides06-gustafsonpdf

[6] John L Gustafson An Energy-Efficient and Massively ParallelApproach to Valid Numerics wwwjohngustafsonnet

presentationsUnumArithmetic-ICRARseminarpdfhttpinsidehpccom201503slidecast-john-

gustafson-explains-energy-efficient-unum-computing

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 23: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrsquo

[7] John L Gustafson The End of Error ndash Unum Computing CRC Press2015

[8] John L Gustafson A Radical Approach to Computation with RealNumbershttpwwwjohngustafsonnetpubsRadicalApproachpdf

[9] John L Gustafson The Great Debate ndash Unum Arithmetic PositionStatement 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesGustafsonpdf

[10] IEEE 754-1985 ndash IEEE Standard for Binary Floating-Point Arithmetichttpieeexploreieeeorgservletopacpunumber=2355

[11] IEEE 754-2008 ndash IEEE Standard for Binary Floating-Point Arithmeticieeexploreieeeorgservletopacpunumber=4610933

[12] about IEEE 754 httpgrouperieeeorggroups754

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte
Page 24: unums - TitleFrame · Unum Thomas Risse IIA, Fak E & I, HSB Einführung Abnormitäten Intervall-Arithmetik Unums Unum-Arithmetik Uboxes Stand unums ˚ ˜ floats ˆ doubles Thomas

Unum

Thomas RisseIIA Fak E amp I HSB

Einfuumlhrung

Abnormitaumlten

Intervall-Arithmetik

Unums

Unum-Arithmetik

Uboxes

Stand

Referencesrdquo

[13] William Kahan Further remarks on reducing truncation errorsCommunications of the ACM 8 (1)40 January 1965

[14] William Kahan Lecture Notes on the Status of IEEE Standard 754 forBinary Floating-Point Arithmetic May 31 1996wwwcsberkeleyedusimwkahanieee754statusieee754ps

[15] William Kahan How JAVArsquos Floating-Point Hurts EveryoneEverywhere wwwcsberkeleyedusimwkahanJAVAhurtpdf

[16] William Kahan Desperately Needed Remedies for theUndebuggability of Large Floating-Point Computations in Science andEngineering wwweecsberkeleyedusimwkahanBoulderpdf

[17] William Kahan A critique of John L Gustafsonrsquos The End of Error ndashUnum Computation and his Radical Approach to Computation withReal Numbers 23rd IEEE Symposium on Computer Arithmetic 2016httparith23gforgeinriafrslidesKahanpdf

  • Einfuumlhrung
  • IEEE 754 Abnormitaumlten
  • Intervall-Arithmetik
  • Unums ndash Universal Numbers
  • Arithmetik mit Unums
  • Computational Science mit UBoxes
  • Ende der Debatte

Recommended