Highly Optimized Mathematical Functions for the Itanium Processor

Size: px
Start display at page:

Download "Highly Optimized Mathematical Functions for the Itanium Processor"

Transcription

1 Highly Optimized Mathematical Functions for the Itanium Processor! Speaker: Shane Story! Software Engineer! CSL Numerics Group! Corporation Copyright Copyright Corporation.

2 Agenda! Itanium Processor Math Functionality Overview! Sample Algorithms! Performance! Accuracy and Testing! Open Source Website Copyright Copyright Corporation.

3 Overview Itanium Processor Math Functionality! Target Key Math Library Functions in C++ and Fortran Compiler exp: e x cos: cosine(x), log: ln(x) ) sin: sine(x) log10: log 10 (x) tan: tangent(x), pow(x,y): x y atan2(y,x): arctangent(y/x)! Open Source Website! Support Instructions for IA-32 Binaries f2xm1, fyl2x, fsin, fcos, fptan, fpatan (Paper: 1999 Computer Arithmetic Conference) Copyright Copyright Corporation.

4 Overview Software Math Functionality Exponential exp, exp10, exp2, log, log10, log2, cbrt, pow Trigonometric sin, cos, tan, asin, acos, atan, atan2 Hyperbolic sinh, cosh, tanh, asinh, acosh, atanh Others floor, ceil, modf, scalb, rem, j0, erf,,! Exponential! Trigonometric! Hyperbolic! Others Optimized Assembler / C Coded Copyright Copyright Corporation.

5 Overview Supported Precisions! Float / Real*4 (32-bit Floating-Point) expf, logf, sinf, powf,! Double / Real*8 (64-bit Floating-Point) exp, log, sin, pow,! Extended / Real*10 (80-bit Floating-Point) expl, logl, sinl, powl, Copyright Copyright Corporation.

6 Overview Itanium Processor Floating-Point Formats! IEEE 754 Floating-Point Formats sign exponent significand! (±1) 2 biased-exp sign exponent significand! Float (32-bits) (1-bit 8-bits 23-bits)! Double (64-bits) (1-bit 11-bits 52-bits)! Extended (80-bits) (1-bit 15-bits 64-bits)! Internal (82-bits) (1-bit 17-bits 64-bits) Copyright Copyright Corporation.

7 Overview Supporting Standards and Error Support! C99 (C Numerics Standard) Special Values: log(-1), exp(50,000) Unique classes: QNaN, ± Inf! Linux or Windows* Errno: : EDOM or ERANGE Matherr: : User takes Control! IEEE Floating-Point Exception Flags * Other brands and names are the property of their respective owners Copyright Copyright Corporation.

8 Overview Key Messages! Provide a Full Math Library Solution! Targeting All Important Functions Supporting Important Precisions Flexible Error Handling Mechanism What algorithms were used? Copyright Copyright Corporation.

9 Sample Algorithms Algorithmic Characteristics!Table-Based Argument Reduction Table-Lookup Polynomial Approximation Reconstruction Copyright Copyright Corporation.

10 Sample Algorithms Simple Table-Based Example (1)! exp(x) e x e! Reduction! exp(x) e x e N ln! Table-Lookup Copyright Copyright Corporation. Table-part + Reduced argument N = rint( ( 4x / ln(2) ) and r = x N ln(2)/4 x N ln(2)/4 + r ln(2)/4(2)/4 + r + r = 2 N/4 N/4 e r Based on (2 1/4 ) N and here 4092 N (10-byte Values) Load Approximation to 2 N/4

11 Sample Algorithms Simple Table-Based Example (2)! exp(x) e x = e N ln! Polynomial Approximation e r = 1 + r + r 2 /2 + r 3 /6 + + r 10 /10! Coefficients in tables or created on-the-fly! Reconstruction ln(2)/4(2)/4 + r + r = 2 N/4 N/4 e r e Table-part 2 N/4 e r 1 + r + r 2 /2 + r 3 /6 + + r 10 /10! exp(x) 2 N/4 e r Rounding Error Rnd.. Error & Trunc.. Error Rounding Error Copyright Copyright Corporation.

12 Sample Algorithms Itanium Processor Attributes(1)! Parallelism 2 FP Units, 2 Integer Units, 2 Memory Units! Internal Register File Format 64-Bit Significand Widest Range Exponent (17-Bits)! Four Floating-Point Status Registers User: s0 Internal: s1 and possibly s2 or s3 Copyright Copyright Corporation.

13 Sample Algorithms Itanium Processor Attributes(2)! FMA instruction: Result = A B + C Simple Method How Many Cycles? P(x) = A 0 + A 1 x +A 2 x 2 +A 3 x 3 Horner s Method A 0 + x ( A 1 + x ( A 2 + x A 3 ) ) ) 15 Cycles Cycle 0 Z 2 = A 2 + A 3 x Cycle 0 Z 1 =A 0 + A 1 x Cycle 1 Z 3 = x 2 Cycle 6 P(x) = Z 1 + Z 2 Z 3 Cycle 11 Result Copyright Copyright Corporation.

14 Sample Algorithms Itanium Processor Double-Precision Log Example (1)! Consider log(x) ln(x), and the original! x = 2 N 1.f 1 f 2 f52 (Double-Precision)! ln(2 N 1.f 1 f 2 f 52 ) = N ln(2) + ln(1. (1.f 1 f 2 f 52! Taylor Series: ln(1 + z) = z z 2 /2 + z 3 /3 - for z 1 and z 1 52 ) Copyright Copyright Corporation.

15 Sample Algorithms Double-Precision Log Example (2)! ln(x) = ln( ( frcpa(x) x / frcpa(x) ) = ln ( frcpa(x) x) ln ( frcpa(x) )! frcpa(x) = 2 N frcpa(1.f 1 f 2 f 8 ), where (1.f 1 f 2 f 52 ) is significand of the original x! ln(frcpa(x)) = NlnN ln(2) ln(frcpa(1.f 1 f 2 f 3 f 4 f 5 f 6 f 7 f 8 )) Copyright Copyright Corporation.

16 Sample Algorithms Core log Approximation Piece 1: 1 ln(frcpa frcpa(x)x) Argument Reduction & Polynomial Approximation Piece 2: N ln(2) Miscellaneous Piece 3: 3 ln(frcpa frcpa(1.f 1 f 2 f 3 f 4 f 5 f 6 f 7 f 8 )) Table-Lookup ln(x) Piece 1 + Piece 2 + Piece 3 Copyright Copyright Corporation. Reconstruction

17 Sample Algorithms Log: Piece 1 (Reduction & Poly) Copyright Copyright Corporation. ln(x) = ln(frcpa(x)x) + NlnN ln(2) ln(frcpa(1.f 1 f 2 f 8 )) // Cycle 1: Compute reciprocal approximation to x: (1/x) frcpa.s0 inv_approx, p6 = f1, x // Cycle 8: frcpa(x) * x 1 yields z 2-8 fms.s1 z = inv_approx, x, 1 // Cycle 13: Compute z * z fma.s1 z_sqr = z, z, 0 // Cycle 14: 6 th degree polynomial evaluation in parallel fma.s1 P_lo1 = A3, z, A2 : fma.s1 P_lo2 = A5, z, A4 // Cycle 18: Calculate = z 3 and P hi (z) = z + A1 * z 2 fma.s1 z_cubed = z_sqr sqr, z, f0 : fma.s1 P_hi = z_sqr sqr, A1, z // Cycle 19: Construct P lo (z) fma.s1 P_lo = P_lo2, z_sqr sqr, P_lo1 // Cycle 24: ln(frcpa frcpa(x)x) P hi (z) + z 3 * P lo (z) Cycle 29 fma.s1 ln_approx = P_lo, z_cubed, P_hi

18 Sample Algorithms Log: Piece 2 (Miscellaneous) ln(x) = ln(frcpa(x)x) + Nln(2) ln(frcpa(1.f 1 f 2 f 8 )) // Cycle 3: Get exponent of x getf.exp N_Sbias = x // Cycle 5: Remove sign bit and N_Bias = N_Sbias Sbias, 0x1FFFF // Cycle 6: Remove exponent bias sub N_float = N_Bias, 0xFFFF // Cycle 8: Place exponent in general purpose register setf.sig sig N = N_float // Cycle 17: Make N a floating-point value fcvt.xf N = N Cycle 22 Copyright Copyright Corporation.

19 Sample Algorithms Log: Piece 3 (Table-Lookup) ln(x) = ln(frcpa(x)x) + NlnN ln(2) ln(frcpa(1.f 1 f 2 f 8 )) // Cycle 1: Normalize x fnorm x_norm = x // Cycle 9: Extract significand ox x_norm getf.sig signif_x = x_norm // Cycle 11: Remove the explicit bit shl signif_x = signif_x, 1 // Cycle 12: Isolate fraction bits f1, f2,,f8,f8 shr index = signif_x, 56 // Cycle 13: Calculate address of table entry shladd address = index, 4, Table_Base // Cycle 14: Load ln(frcpa frcpa(1.f 1 f... f 2 52 )) ldfe Table_part = [address] Cycle 23 Copyright Copyright Corporation.

20 Sample Algorithms Reconstruction for Log ln(x) = ln(frcpa(x)x) + NlnN ln(2) ln(frcpa(1.f 1 f 2 f 8 )) Miscellaneous Table-Lookup Cycle 23: Table = N ln(2) ln(frcpa(1.f 1 f 2 f )) 8 Argument Reduction & Polynomial Approximation Cycle 29: Result = ln( frcpa(x)x ) + Table log(x) complete in Cycle 34 Copyright Copyright Corporation.

21 Sample Algorithms Key Message! Novel Algorithms Yield High-Performance Functions! How good is the overall performance? Copyright Copyright Corporation.

22 Performance Single-Precision Functions tanf powf Cycles 60 sqrtf floorf Copyright 2001 Corporation. logf expf asinf acosf sinf cosf atanf floorf logf expf asinffunction acosf sinf cosf atanf tanf powf

23 Performance Double-Precision Functions Cycles floor Copyright 2001 Corporation. log exp tan pow 60 sqrt asin acos atan sin 50 cos floor log exp atan Function sin cos asin acos tan pow

24 Performance Extended-Precision Functions powl Cycles logl sinl cosl tanl atanl expl acosl asinl 50 sqrtl 0 floorl Copyright 2001 Corporation. Function floorl asinl acosl expl logl sinl cosl tanl atanl powl

25 Performance Key Message! Optimal Minimum Latency Performance Obtained! How good is the accuracy? Copyright Copyright Corporation.

26 Testing and Accuracy Units in the Last Place (Ulps)! Goal: Ulp Error(Computed Function) <.55 ulps! Distance Between f computed (x) & f exact (x) f(x) computed = (±1)( 2 k 1.f 1 f 2 f f 51 f ! Ulp Error = f exact f computed (2 where 1 2 -k f exact < 2, k is base-2 exponent of f exact Copyright Copyright Corporation. (2 k 52 ), k 52 ),

27 Testing and Accuracy Accuracy: Example! f(x) computed = f(x) computed! f(x) exact = ulps! f(x) exact = ulps Copyright Copyright Corporation.

28 Testing and Accuracy Math Library Test Suite GUI Copyright Copyright Corporation.

29 Testing and Accuracy Ulp Chart for log(x) Copyright Copyright Corporation.

30 Testing and Accuracy Key Message! High Accuracy is Essential! Accuracy Balance Performance Where can we find these functions? Copyright Copyright Corporation.

31 Open Source Website opensource/numericsnumerics Copyright Copyright Corporation.

32 Summary! Provide a Full Math Library Solution!! Novel Algorithms Yield High-Performance Functions!! Optimal Minimum Latency Performance Obtained!! High Accuracy is Essential!! Sources are Available! Copyright Copyright Corporation.

33 Implementers & Designers! Marius Cornea! John Harrison! Cristina Iordache! Ted Kubaska! Bob Norin! Ping Tak Peter Tang! Eugeny Gvozdev! Vladimir Lunev Copyright Copyright Corporation.

34 Call to Action! Use the provided math functions from the C++ and Fortran Compiler! Download the source code from intel.com/software/.com/software/opensource/numericsnumerics Copyright Copyright Corporation.

35

Arithmetic and Logic Blocks

Arithmetic and Logic Blocks Arithmetic and Logic Blocks The Addition Block The block performs addition and subtractions on its inputs. This block can add or subtract scalar, vector, or matrix inputs. We can specify the operation

More information

The Cygnus C Math Library

The Cygnus C Math Library The Cygnus C Math Library libm 1.4 December 1995 Steve Chamberlain Roland Pesch Cygnus Support Cygnus Support sac@cygnus.com pesch@cygnus.com Copyright c 1992, 1993 Cygnus Support libm includes software

More information

The Red Hat newlib C Math Library

The Red Hat newlib C Math Library The Red Hat newlib C Math Library libm 1.11.0 July 2002 Steve Chamberlain Roland Pesch Red Hat Support Jeff Johnston Red Hat Support sac@cygnus.com pesch@cygnus.com jjohnstn@redhat.com Copyright c 1992,

More information

The Red Hat newlib C Math Library

The Red Hat newlib C Math Library The Red Hat newlib C Math Library libm 1.17.0 December 2008 Steve Chamberlain Roland Pesch Red Hat Support Jeff Johnston Red Hat Support sac@cygnus.com pesch@cygnus.com jjohnstn@redhat.com Copyright c

More information

Built-in Types of Data

Built-in Types of Data Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),

More information

This course provides a more detailed look at the SH2A s FPU core with an emphasis on its use and control in the compilers

This course provides a more detailed look at the SH2A s FPU core with an emphasis on its use and control in the compilers Course Introduction Purpose: This course provides a more detailed look at the SH2A s FPU core with an emphasis on its use and control in the compilers Objectives: Review of Floating point numbers Overview

More information

Outline. Introduction Intel Vector Math Library (VML) o Features and performance VML in Finance Useful links

Outline. Introduction Intel Vector Math Library (VML) o Features and performance VML in Finance Useful links Outline Introduction Intel Vector Math Library (VML) o Features and performance VML in Finance Useful links 2 Introduction VML is one component of Intel MKL Support HPC applications: o o Scientific & engineering

More information

S III. Case Study: TI Calculator Numerics

S III. Case Study: TI Calculator Numerics Introduction S III. Case Study: TI Calculator Numerics Texas Instruments started a research project in 1965 to design a pocket calculator. The first pocket calculators appeared in the early 1970 from the

More information

ECET 264 C Programming Language with Applications

ECET 264 C Programming Language with Applications ECET 264 C Programming Language with Applications Lecture 10 C Standard Library Functions Paul I. Lin Professor of Electrical & Computer Engineering Technology http://www.etcs.ipfw.edu/~lin Lecture 10

More information

Matlab Workshop I. Niloufer Mackey and Lixin Shen

Matlab Workshop I. Niloufer Mackey and Lixin Shen Matlab Workshop I Niloufer Mackey and Lixin Shen Western Michigan University/ Syracuse University Email: nil.mackey@wmich.edu, lshen03@syr.edu@wmich.edu p.1/13 What is Matlab? Matlab is a commercial Matrix

More information

Script started on Thu 25 Aug :00:40 PM CDT

Script started on Thu 25 Aug :00:40 PM CDT Script started on Thu 25 Aug 2016 02:00:40 PM CDT < M A T L A B (R) > Copyright 1984-2014 The MathWorks, Inc. R2014a (8.3.0.532) 64-bit (glnxa64) February 11, 2014 To get started, type one of these: helpwin,

More information

Simultaneous floating-point sine and cosine for VLIW integer processors

Simultaneous floating-point sine and cosine for VLIW integer processors Simultaneous floating-point sine and cosine for VLIW integer processors Jingyan Jourdan-Lu Computer Arithmetic group ARIC INRIA and ENS Lyon, France Compilation Expertise Center STMicroelectronics Grenoble,

More information

A. Matrix-wise and element-wise operations

A. Matrix-wise and element-wise operations USC GSBME MATLAB CLASS Reviewing previous session Second session A. Matrix-wise and element-wise operations A.1. Matrix-wise operations So far we learned how to define variables and how to extract data

More information

GRAPH 4.4. Megha K. Raman APRIL 22, 2015

GRAPH 4.4. Megha K. Raman APRIL 22, 2015 GRAPH 4.4 By Megha K. Raman APRIL 22, 2015 1. Preface... 4 2. Introduction:... 4 3. Plotting a function... 5 Sample funtions:... 9 List of Functions:... 10 Constants:... 10 Operators:... 11 Functions:...

More information

LAB 1 General MATLAB Information 1

LAB 1 General MATLAB Information 1 LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by

More information

Computing Fundamentals

Computing Fundamentals Computing Fundamentals Salvatore Filippone salvatore.filippone@uniroma2.it 2012 2013 (salvatore.filippone@uniroma2.it) Computing Fundamentals 2012 2013 1 / 18 Octave basics Octave/Matlab: f p r i n t f

More information

RETURN VALUE The acos() function returns the arc cosine in radians and the value is mathematically defined to be between 0 and PI (inclusive).

RETURN VALUE The acos() function returns the arc cosine in radians and the value is mathematically defined to be between 0 and PI (inclusive). ACOS(3) Linux Programmer s Manual ACOS(3) acos, acosf, acosl arc cosine function double acos(double x); float acosf(float x); long double acosl(long double x); The acos() function calculates the arc cosine

More information

Python. Olmo Zavala R. Python Exercises. Center of Atmospheric Sciences, UNAM. August 24, 2016

Python. Olmo Zavala R. Python Exercises. Center of Atmospheric Sciences, UNAM. August 24, 2016 Exercises Center of Atmospheric Sciences, UNAM August 24, 2016 NAND Make function that computes the NAND. It should receive two booleans and return one more boolean. logical operators A and B, A or B,

More information

Correct Rounding of Mathematical Functions

Correct Rounding of Mathematical Functions Correct Rounding of Mathematical Functions Vincent LEFÈVRE Arénaire, INRIA Grenoble Rhône-Alpes / LIP, ENS-Lyon SIESTE, 2010-03-23 Outline Introduction: Floating-Point Arithmetic Relation with Programming

More information

Taipei Embedded Outreach OpenCL DSP Profile Proposals

Taipei Embedded Outreach OpenCL DSP Profile Proposals Copyright 2018 The Khronos Group Inc. Page 1 Taipei Embedded Outreach OpenCL DSP Profile Proposals Prof. Jenq-Kuen Lee, NTHU Taipei, January 2018 Copyright 2018 The Khronos Group Inc. Page 2 Outline Speaker

More information

The Red Hat newlib C Math Library

The Red Hat newlib C Math Library The Red Hat newlib C Math Library libm 2.1.0 December 2013 Steve Chamberlain Roland Pesch Red Hat Support Jeff Johnston Red Hat Support sac@cygnus.com pesch@cygnus.com jjohnstn@redhat.com Copyright c 1992,

More information

Introduction to GNU-Octave

Introduction to GNU-Octave Introduction to GNU-Octave Dr. K.R. Chowdhary, Professor & Campus Director, JIETCOE JIET College of Engineering Email: kr.chowdhary@jietjodhpur.ac.in Web-Page: http://www.krchowdhary.com July 11, 2016

More information

Introduction to MATLAB

Introduction to MATLAB Outlines September 9, 2004 Outlines Part I: Review of Previous Lecture Part II: Part III: Writing MATLAB Functions Review of Previous Lecture Outlines Part I: Review of Previous Lecture Part II: Part III:

More information

Introduction to Scientific and Engineering Computing, BIL108E. Karaman

Introduction to Scientific and Engineering Computing, BIL108E. Karaman USING MATLAB INTRODUCTION TO SCIENTIFIC & ENGINEERING COMPUTING BIL 108E, CRN24023 To start from Windows, Double click the Matlab icon. To start from UNIX, Dr. S. Gökhan type matlab at the shell prompt.

More information

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below.

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below. What is MATLAB? MATLAB (short for MATrix LABoratory) is a language for technical computing, developed by The Mathworks, Inc. (A matrix is a rectangular array or table of usually numerical values.) MATLAB

More information

Data Parallel Execution Model

Data Parallel Execution Model CS/EE 217 GPU Architecture and Parallel Programming Lecture 3: Kernel-Based Data Parallel Execution Model David Kirk/NVIDIA and Wen-mei Hwu, 2007-2013 Objective To understand the organization and scheduling

More information

Mentor Graphics Predefined Packages

Mentor Graphics Predefined Packages Mentor Graphics Predefined Packages Mentor Graphics has created packages that define various types and subprograms that make it possible to write and simulate a VHDL model within the Mentor Graphics environment.

More information

Package Brobdingnag. R topics documented: March 19, 2018

Package Brobdingnag. R topics documented: March 19, 2018 Type Package Title Very Large Numbers in R Version 1.2-5 Date 2018-03-19 Author Depends R (>= 2.13.0), methods Package Brobdingnag March 19, 2018 Maintainer Handles very large

More information

Function I/O. Function Input and Output. Input through actual parameters. Output through return value. Input/Output through side effects

Function I/O. Function Input and Output. Input through actual parameters. Output through return value. Input/Output through side effects Function Input and Output Input through actual parameters Output through return value Only one value can be returned Input/Output through side effects printf scanf 2 tj Function Input and Output int main(void){

More information

General MATLAB Information 1

General MATLAB Information 1 Introduction to MATLAB General MATLAB Information 1 Once you initiate the MATLAB software, you will see the MATLAB logo appear and then the MATLAB prompt >>. The prompt >> indicates that MATLAB is awaiting

More information

Fixed point algorithmic math package user s guide By David Bishop

Fixed point algorithmic math package user s guide By David Bishop Fixed point algorithmic math package user s guide By David Bishop (dbishop@vhdl.org) The fixed point matrix math package was designed to be a synthesizable matrix math package. Because this package allows

More information

Computer Science 121. Scientific Computing Winter 2016 Chapter 3 Simple Types: Numbers, Text, Booleans

Computer Science 121. Scientific Computing Winter 2016 Chapter 3 Simple Types: Numbers, Text, Booleans Computer Science 121 Scientific Computing Winter 2016 Chapter 3 Simple Types: Numbers, Text, Booleans 3.1 The Organization of Computer Memory Computers store information as bits : sequences of zeros and

More information

CSE 591: GPU Programming. Programmer Interface. Klaus Mueller. Computer Science Department Stony Brook University

CSE 591: GPU Programming. Programmer Interface. Klaus Mueller. Computer Science Department Stony Brook University CSE 591: GPU Programming Programmer Interface Klaus Mueller Computer Science Department Stony Brook University Compute Levels Encodes the hardware capability of a GPU card newer cards have higher compute

More information

Introduction to MATLAB

Introduction to MATLAB Outlines January 30, 2008 Outlines Part I: Part II: Writing MATLAB Functions Starting MATLAB Exiting MATLAB Getting Help Command Window Workspace Command History Current Directory Selector Real Values

More information

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754 Floating Point Puzzles Topics Lecture 3B Floating Point IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties For each of the following C expressions, either: Argue that

More information

Data Representation Floating Point

Data Representation Floating Point Data Representation Floating Point CSCI 2400 / ECE 3217: Computer Architecture Instructor: David Ferry Slides adapted from Bryant & O Hallaron s slides via Jason Fritts Today: Floating Point Background:

More information

Chap 6 Function Define a function, which can reuse a piece of code, just with a few different values.

Chap 6 Function Define a function, which can reuse a piece of code, just with a few different values. Chap 6 Function Define a function, which can reuse a piece of code, just with a few different values. def tax(bill): """Adds 8% tax to a restaurant bill.""" bill *= 1.08 print "With tax: %f" % bill return

More information

Systems I. Floating Point. Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties

Systems I. Floating Point. Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Systems I Floating Point Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties IEEE Floating Point IEEE Standard 754 Established in 1985 as uniform standard for

More information

Graphing Calculator Tutorial

Graphing Calculator Tutorial Graphing Calculator Tutorial This tutorial is designed as an interactive activity. The best way to learn the calculator functions will be to work the examples on your own calculator as you read the tutorial.

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 11: Floating Point & Floating Point Addition Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Last time: Single Precision Format

More information

Floating Point January 24, 2008

Floating Point January 24, 2008 15-213 The course that gives CMU its Zip! Floating Point January 24, 2008 Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties class04.ppt 15-213, S 08 Floating

More information

Function I/O. Last Updated 10/30/18

Function I/O. Last Updated 10/30/18 Last Updated 10/30/18 Program Structure Includes Function Declarations void main(void){ foo = fun1(a, b); fun2(2, c); if(fun1(c, d)) { } } Function 1 Definition Function 2 Definition 2 tj Function Input

More information

Programming for Engineers in Python. Recitation 2

Programming for Engineers in Python. Recitation 2 Programming for Engineers in Python Recitation 2 Plan Range For loop While loop Lists Modules Operations Arithmetic Operations: + plus - minus * multiply / divide (int / float) % modulo (remainder) **

More information

POLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers

POLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers POLYMATH VERSION 4.1 Provides System Printing from Windows 3.X, 95, 98 and NT USER-FRIENDLY NUMERICAL ANALYSIS PROGRAMS - SIMULTANEOUS DIFFERENTIAL EQUATIONS - SIMULTANEOUS ALGEBRAIC EQUATIONS - SIMULTANEOUS

More information

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754

Floating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754 Floating Point Puzzles Topics Lecture 3B Floating Point IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties For each of the following C expressions, either: Argue that

More information

Single row numeric functions

Single row numeric functions Single row numeric functions Oracle provides a lot of standard numeric functions for single rows. Here is a list of all the single row numeric functions (in version 10.2). Function Description ABS(n) ABS

More information

INSIDE MACINTOSH. Addison-Wesley Publishing Company

INSIDE MACINTOSH. Addison-Wesley Publishing Company apple INSIDE MACINTOSH PowerPC Numerics Addison-Wesley Publishing Company Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo

More information

Chapter 2 Float Point Arithmetic. Real Numbers in Decimal Notation. Real Numbers in Decimal Notation

Chapter 2 Float Point Arithmetic. Real Numbers in Decimal Notation. Real Numbers in Decimal Notation Chapter 2 Float Point Arithmetic Topics IEEE Floating Point Standard Fractional Binary Numbers Rounding Floating Point Operations Mathematical properties Real Numbers in Decimal Notation Representation

More information

System Programming CISC 360. Floating Point September 16, 2008

System Programming CISC 360. Floating Point September 16, 2008 System Programming CISC 360 Floating Point September 16, 2008 Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Powerpoint Lecture Notes for Computer Systems:

More information

Lecture 1: What is MATLAB?

Lecture 1: What is MATLAB? Lecture 1: What is MATLAB? Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 1. MATLAB MATLAB (MATrix LABoratory) is a numerical

More information

IEEE Working Group P1788: A Standard for Interval Arithmetic

IEEE Working Group P1788: A Standard for Interval Arithmetic IEEE Working Group P1788: A Standard for Interval Arithmetic Nathalie Revol INRIA - LIP (UMR 5668 CNRS - ENS Lyon - INRIA - UCBL) Université de Lyon based on a talk given for an EVA-Flo meeting, September

More information

SPIR-V Extended Instructions for GLSL

SPIR-V Extended Instructions for GLSL SPIR-V Etended Instructions for GLSL John Kessenich, Google Version 1.00, Revision 7 August 8, 2018 SPIR-V Etended Instructions for GLSL Copyright 2014-2018 The Khronos Group Inc. All Rights Reserved.

More information

An Elementary Transcendental Function Core Library for Reconfigurable Computing. Robin Bruce, Dr Malachy Devlin, Prof Stephen Marshall

An Elementary Transcendental Function Core Library for Reconfigurable Computing. Robin Bruce, Dr Malachy Devlin, Prof Stephen Marshall An Elementary Transcendental Function Core Library for Reconfigurable Computing Robin Bruce, Dr Malachy Devlin, Prof Stephen Marshall Introduction Project: Implement Floating-Point Math Functions on FPGAs

More information

Computational Physics

Computational Physics Computational Physics Python Programming Basics Prof. Paul Eugenio Department of Physics Florida State University Jan 17, 2019 http://hadron.physics.fsu.edu/~eugenio/comphy/ Announcements Exercise 0 due

More information

GPU Floating Point Features

GPU Floating Point Features CSE 591: GPU Programming Floating Point Considerations Klaus Mueller Computer Science Department Stony Brook University Objective To understand the fundamentals of floating-point representation To know

More information

Formal Verification of a Floating-Point Elementary Function

Formal Verification of a Floating-Point Elementary Function Introduction Coq & Flocq Coq.Interval Gappa Conclusion Formal Verification of a Floating-Point Elementary Function Inria Saclay Île-de-France & LRI, Université Paris Sud, CNRS 2015-06-25 Introduction Coq

More information

Subprograms. FORTRAN 77 Chapter 5. Subprograms. Subprograms. Subprograms. Function Subprograms 1/5/2014. Satish Chandra.

Subprograms. FORTRAN 77 Chapter 5. Subprograms. Subprograms. Subprograms. Function Subprograms 1/5/2014. Satish Chandra. FORTRAN 77 Chapter 5 Satish Chandra satish0402@gmail.com When a programs is more than a few hundred lines long, it gets hard to follow. Fortran codes that solve real research problems often have tens of

More information

Macro Programming Reference Guide. Copyright 2005 Scott Martinez

Macro Programming Reference Guide. Copyright 2005 Scott Martinez Macro Programming Reference Guide Copyright 2005 Scott Martinez Section 1. Section 2. Section 3. Section 4. Section 5. Section 6. Section 7. What is macro programming What are Variables What are Expressions

More information

Floating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers.

Floating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers. class04.ppt 15-213 The course that gives CMU its Zip! Topics Floating Point Jan 22, 2004 IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Floating Point Puzzles For

More information

Introduction to Programming and 4Algorithms Abstract Types. Uwe R. Zimmer - The Australian National University

Introduction to Programming and 4Algorithms Abstract Types. Uwe R. Zimmer - The Australian National University Introduction to Programming and 4Algorithms 2015 Uwe R. Zimmer - The Australian National University [ Thompson2011 ] Thompson, Simon Haskell - The craft of functional programming Addison Wesley, third

More information

Outline of High-Speed Quad-Precision Arithmetic Package ASLQUAD

Outline of High-Speed Quad-Precision Arithmetic Package ASLQUAD Outline of High-Speed Quad-Precision Arithmetic Package ASLQUAD OGATA Ryusei, KUBO Yoshiyuki, TAKEI Toshifumi Abstract The ASLQUAD high-speed quad-precision arithmetic package reduces numerical errors

More information

Giving credit where credit is due

Giving credit where credit is due CSCE 230J Computer Organization Floating Point Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due Most of slides for this lecture are based

More information

Lecture 14. Daily Puzzle. Math in C. Rearrange the letters of eleven plus two to make this mathematical statement true. Eleven plus two =?

Lecture 14. Daily Puzzle. Math in C. Rearrange the letters of eleven plus two to make this mathematical statement true. Eleven plus two =? Lecture 14 Math in C Daily Puzzle Rearrange the letters of eleven plus two to make this mathematical statement true. Eleven plus two =? Daily Puzzle SOLUTION Eleven plus two = twelve plus one Announcements

More information

Giving credit where credit is due

Giving credit where credit is due JDEP 284H Foundations of Computer Systems Floating Point Dr. Steve Goddard goddard@cse.unl.edu Giving credit where credit is due Most of slides for this lecture are based on slides created by Drs. Bryant

More information

Floating Point Numbers

Floating Point Numbers Floating Point Numbers Computer Systems Organization (Spring 2016) CSCI-UA 201, Section 2 Instructor: Joanna Klukowska Slides adapted from Randal E. Bryant and David R. O Hallaron (CMU) Mohamed Zahran

More information

Floating Point Numbers

Floating Point Numbers Floating Point Numbers Computer Systems Organization (Spring 2016) CSCI-UA 201, Section 2 Fractions in Binary Instructor: Joanna Klukowska Slides adapted from Randal E. Bryant and David R. O Hallaron (CMU)

More information

Intel Math Kernel Library ( Intel MKL )

Intel Math Kernel Library ( Intel MKL ) Intel Math Kernel Library ( Intel MKL ) Part of Intel Parallel Studio XE Composer Edition December 2014 Copyright 2014, Intel Corporation. All rights reserved. *Other brands and names are the property

More information

Consider this m file that creates a file that you can load data into called rain.txt

Consider this m file that creates a file that you can load data into called rain.txt SAVING AND IMPORTING DATA FROM A DATA FILES AND PROCESSING AS A ONE DIMENSIONAL ARRAY If we save data in a file sequentially than we can call it back sequentially into a row vector. Consider this m file

More information

6-1 (Function). (Function) !*+!"#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x

6-1 (Function). (Function) !*+!#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x (Function) -1.1 Math Library Function!"#! $%&!'(#) preprocessor directive #include !*+!"#!, Function Description Example sqrt(x) square root of x sqrt(900.0) is 30.0 sqrt(9.0) is 3.0 exp(x) log(x)

More information

1001ICT Introduction To Programming Lecture Notes

1001ICT Introduction To Programming Lecture Notes 1001ICT Introduction To Programming Lecture Notes School of Information and Communication Technology Griffith University Semester 1, 2015 1 M Environment console M.1 Purpose This environment supports programming

More information

Numerical Modelling in Fortran: day 2. Paul Tackley, 2017

Numerical Modelling in Fortran: day 2. Paul Tackley, 2017 Numerical Modelling in Fortran: day 2 Paul Tackley, 2017 Goals for today Review main points in online materials you read for homework http://www.cs.mtu.edu/%7eshene/courses/cs201/notes/intro.html More

More information

CUDA Toolkit 5.0 Performance Report. January 2013

CUDA Toolkit 5.0 Performance Report. January 2013 CUDA Toolkit 5.0 Performance Report January 2013 CUDA Math Libraries High performance math routines for your applications: cufft Fast Fourier Transforms Library cublas Complete BLAS Library cusparse Sparse

More information

CS-201 Introduction to Programming with Java

CS-201 Introduction to Programming with Java CS-201 Introduction to Programming with Java California State University, Los Angeles Computer Science Department Lecture V: Mathematical Functions, Characters, and Strings Introduction How would you estimate

More information

Data Representation Floating Point

Data Representation Floating Point Data Representation Floating Point CSCI 2400 / ECE 3217: Computer Architecture Instructor: David Ferry Slides adapted from Bryant & O Hallaron s slides via Jason Fritts Today: Floating Point Background:

More information

Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !

Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. ! Floating point Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties Next time! The machine model Chris Riesbeck, Fall 2011 Checkpoint IEEE Floating point Floating

More information

Computer Organization: A Programmer's Perspective

Computer Organization: A Programmer's Perspective A Programmer's Perspective Representing Numbers Gal A. Kaminka galk@cs.biu.ac.il Fractional Binary Numbers 2 i 2 i 1 4 2 1 b i b i 1 b 2 b 1 b 0. b 1 b 2 b 3 b j 1/2 1/4 1/8 Representation Bits to right

More information

Julia Calculator ( Introduction)

Julia Calculator ( Introduction) Julia Calculator ( Introduction) Julia can replicate the basics of a calculator with the standard notations. Binary operators Symbol Example Addition + 2+2 = 4 Substraction 2*3 = 6 Multify * 3*3 = 9 Division

More information

DM550/DM857 Introduction to Programming. Peter Schneider-Kamp

DM550/DM857 Introduction to Programming. Peter Schneider-Kamp DM550/DM857 Introduction to Programming Peter Schneider-Kamp petersk@imada.sdu.dk http://imada.sdu.dk/~petersk/dm550/ http://imada.sdu.dk/~petersk/dm857/ Operator Precedence expressions are evaluated left-to-right

More information

Numerical computing. How computers store real numbers and the problems that result

Numerical computing. How computers store real numbers and the problems that result Numerical computing How computers store real numbers and the problems that result The scientific method Theory: Mathematical equations provide a description or model Experiment Inference from data Test

More information

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS 1 6 3 Matlab 3.1 Fundamentals Matlab. The name Matlab stands for matrix laboratory. Main principle. Matlab works with rectangular

More information

2.0. C/C++ Compiler and Library. Manual for ADSP-21xxx DSPs. Third Revision, September, Part Number

2.0. C/C++ Compiler and Library. Manual for ADSP-21xxx DSPs. Third Revision, September, Part Number 2.0 C/C++ Compiler and Library Manual for ADSP-21xxx DSPs Third Revision, September, 2001 Analog Devices, Inc. Digital Signal Processor Division One Technology Way Norwood, Mass. 02062-9106 Part Number

More information

C++, How to Program. Spring 2016 CISC1600 Yanjun Li 1

C++, How to Program. Spring 2016 CISC1600 Yanjun Li 1 Chapter 6 Function C++, How to Program Deitel & Deitel Spring 2016 CISC1600 Yanjun Li 1 Function A function is a collection of statements that performs a specific task - a single, well-defined task. Divide

More information

CUDA MATH API. v6.5 August API Reference Manual

CUDA MATH API. v6.5 August API Reference Manual CUDA MATH API v65 August 2014 API Reference Manual TABLE OF CONTENTS Chapter 1 1 11 Mathematical Functions 1 12 Single Precision Mathematical Functions 1 acosf 2 acoshf 2 asinf 2 asinhf3 atan2f 3 atanf

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: September 18, 2017 at 12:48 CS429 Slideset 4: 1 Topics of this Slideset

More information

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers Chapter 03: Computer Arithmetic Lesson 09: Arithmetic using floating point numbers Objective To understand arithmetic operations in case of floating point numbers 2 Multiplication of Floating Point Numbers

More information

Statistical Data Analysis: Python Tutorial

Statistical Data Analysis: Python Tutorial 1 October 4, 2017 Statistical Data Analysis: Python Tutorial Dr A. J. Bevan, Contents 1 Getting started 1 2 Basic calculations 2 3 More advanced calculations 4 4 Data sets 5 4.1 CSV file input.............................................

More information

A General Introduction to Matlab

A General Introduction to Matlab Master Degree Course in ELECTRONICS ENGINEERING http://www.dii.unimore.it/~lbiagiotti/systemscontroltheory.html A General Introduction to Matlab e-mail: luigi.biagiotti@unimore.it http://www.dii.unimore.it/~lbiagiotti

More information

Introduction to GPGPUs and to CUDA programming model: CUDA Libraries

Introduction to GPGPUs and to CUDA programming model: CUDA Libraries Introduction to GPGPUs and to CUDA programming model: CUDA Libraries www.cineca.it Marzia Rivi m.rivi@cineca.it NVIDIA CUDA Libraries http://developer.nvidia.com/technologies/libraries CUDA Toolkit includes

More information

The Expressions plugin PRINTED MANUAL

The Expressions plugin PRINTED MANUAL The Expressions plugin PRINTED MANUAL Expressions plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying,

More information

CUDA Toolkit 4.0 Performance Report. June, 2011

CUDA Toolkit 4.0 Performance Report. June, 2011 CUDA Toolkit 4. Performance Report June, 211 CUDA Math Libraries High performance math routines for your applications: cufft Fast Fourier Transforms Library cublas Complete BLAS Library cusparse Sparse

More information

Object-Based Programming. Programming with Objects

Object-Based Programming. Programming with Objects ITEC1620 Object-Based Programming g Lecture 8 Programming with Objects Review Sequence, Branching, Looping Primitive datatypes Mathematical operations Four-function calculator Scientific calculator Don

More information

Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition. Carnegie Mellon

Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition. Carnegie Mellon Carnegie Mellon Floating Point 15-213/18-213/14-513/15-513: Introduction to Computer Systems 4 th Lecture, Sept. 6, 2018 Today: Floating Point Background: Fractional binary numbers IEEE floating point

More information

Chapter 1 MATLAB Preliminaries

Chapter 1 MATLAB Preliminaries Chapter 1 MATLAB Preliminaries 1.1 INTRODUCTION MATLAB (Matrix Laboratory) is a high-level technical computing environment developed by The Mathworks, Inc. for mathematical, scientific, and engineering

More information

Floating Point. CSE 238/2038/2138: Systems Programming. Instructor: Fatma CORUT ERGİN. Slides adapted from Bryant & O Hallaron s slides

Floating Point. CSE 238/2038/2138: Systems Programming. Instructor: Fatma CORUT ERGİN. Slides adapted from Bryant & O Hallaron s slides Floating Point CSE 238/2038/2138: Systems Programming Instructor: Fatma CORUT ERGİN Slides adapted from Bryant & O Hallaron s slides Today: Floating Point Background: Fractional binary numbers IEEE floating

More information

Advanced features of the Calculate signal tool

Advanced features of the Calculate signal tool Advanced features of the Calculate signal tool Case study: how to us the advanced features of the Calculate signal tool? 1 The calculate signal tool The calculate signal tool is one of the most useful

More information

ArcGIS Enterprise Building Raster Analytics Workflows. Mike Muller, Jie Zhang

ArcGIS Enterprise Building Raster Analytics Workflows. Mike Muller, Jie Zhang ArcGIS Enterprise Building Raster Analytics Workflows Mike Muller, Jie Zhang Introduction and Context Raster Analytics What is Raster Analytics? The ArcGIS way to create and execute spatial analysis models

More information

IEEE Standard for Floating-Point Arithmetic: 754

IEEE Standard for Floating-Point Arithmetic: 754 IEEE Standard for Floating-Point Arithmetic: 754 G.E. Antoniou G.E. Antoniou () IEEE Standard for Floating-Point Arithmetic: 754 1 / 34 Floating Point Standard: IEEE 754 1985/2008 Established in 1985 (2008)

More information

Efficient implementation of elementary functions in the medium-precision range

Efficient implementation of elementary functions in the medium-precision range Efficient implementation of elementary functions in the medium-precision range Fredrik Johansson (LFANT, INRIA Bordeaux) 22nd IEEE Symposium on Computer Arithmetic (ARITH 22), Lyon, France, June 2015 1

More information

CT 229 Java Syntax Continued

CT 229 Java Syntax Continued CT 229 Java Syntax Continued 06/10/2006 CT229 Lab Assignments Due Date for current lab assignment : Oct 8 th Before submission make sure that the name of each.java file matches the name given in the assignment

More information

Foundations of Computer Systems

Foundations of Computer Systems 18-600 Foundations of Computer Systems Lecture 4: Floating Point Required Reading Assignment: Chapter 2 of CS:APP (3 rd edition) by Randy Bryant & Dave O Hallaron Assignments for This Week: Lab 1 18-600

More information