SlideShare a Scribd company logo
1 of 17
NUMERICAL
METHODS
NAME – PAYEL DALAL
ROLL NO –
14400120030
STREAM – CSE
SUBJECT –
NUMERICAL METHODS
SUBJECT CODE –
OEC-IT601A
Presentation title 2
TOPIC:-
 APPROXIMATION IN NUMERICAL
COMPUTATION
 Truncation and rounding errors
 Fixed and floating point arithmetic
 Propagation of errors
APPROXIMATION IN
NUMERICAL
COMPUTATION
4
 Error Definitions:
 True error (Et ): the difference between the true value and
the approximation.
 Absolute error (|Et |): the absolute difference between the
true value and the approximation.
 True fractional relative error: the true error divided by
the true value.
 Relative error (et): the true fractional relative error
expressed as a percentage.
• True fractional relative error = (true value – approximation)/true value
• Et = True value – approximation
• et= true fractional relative error * 100%
5
 We don’t know the true value, so we can’t calculate
the true error - approximate the error
 Relative approximate error – an approximation of
the error relative to the approximation itself
o Relative Approximate Error:
ea =
Approximate error
Approximation
*100%
o Iterative Approach:
ea =
Current Approximation – Previous Approximation
Current Approximation
6
 For iterative approximations, continue to iterate
until the relative approximate error magnitude is
less than a specified stopping criterion
 For accuracy to at least n significant figures set the
stopping criterion to
o Stopping Criterion:
|ea | = es
es = (0.5*10(2-n))%
7
 ROUND-OFF ERROR:
Roundoff errors arise because digital computers cannot represent some quantities
exactly.
There are two major facets of roundoff errors involved in numerical calculations:
• Digital computers have size and precision limits on their
ability to represent numbers.
• Certain numerical manipulations are highly sensitive to
roundoff errors.
Errors
Truncation Errors Round-off Errors
8
 Base-10 computer with a 5 bit word
S1d1.d2*10S0d0
 2 -5= 0.03125  3.1 x 10 -2
 roundoff error =
(0.03125-0.031)/0.03125 = 0.008 = 0.8%
 Because of the limited number of bits for significand and exponent,
Roundoff errors is occur.
π= 3.141593for 16-bit word computer
π= 3.14159265358979 for 32-bit word computer
 Although adding significand digits can improve the approximation, such
quantities will always have some roundoff error when stored in a computer
9
 Truncation errors are those that result from using an approximation in place of an
exact mathematical procedure.
 Example 1: approximation to a derivative using a finite-difference equation:
~
 Example 2: The Taylor Series
 TRUNCATION ERROR:
=
dv v v(ti+1) – v(ti)
dt t ti+1 - ti
=
f(x)= f(x0)+ f' (x0)+ f'' (x0) + ….. + f(n) (x0) + Rn
x – x0
1!
(x – x0)2 (x – x0)n
n!
2!
10
o The Taylor Series:
11
 In general, the nth order Taylor series expansion will be exact for an nth order polynomial.
 In other cases, the remainder term Rn is of the order of h n+1, meaning:
o Truncation Error:
• The more terms are used, the smaller the error, and
• The smaller the spacing, the smaller the error for a given number of terms.
 The total numerical error is the summation of the
truncation and roundoff errors.
 The truncation error generally increases as the
step size increases, while the roundoff error
decreases as the step size increases - this leads to a
point of diminishing returns for step size.
o Total Numerical Error:
12
Figure: Parts of fixed-point representation
 Sign bit:- The fixed-point number representation in binary uses a sign bit. The
negative number has a sign bit 1, while a positive number has a bit 0.
 Integral Part:- The integral part in fixed-point numbers is of different lengths at
different places. It depends on the register's size; for an 8-bit register, the
integral part is 4 bits.
 Fractional part:- The Fractional part is of different lengths at different places. It
depends on the registers; for an 8-bit register, the fractional part is 3 bits.
There are three parts of the fixed-point number representation: Sign bit, Integral
part, and Fractional part.
 Fixed Point Representation:
13
Register Sign Bit Integer Part Fraction Part
8-bit register 1 bit 4 bits 3 bits
16-bit register 1 bit 9 bits 6 bits
32-bit register 1 bit 15 bits 9 bits
Size of Sign Bit, Integer Part, and Fractional Part for different registers are displayed
below:
Now that we have learned about fixed-point number representation, let's see how to represent
it.
The number considered is 4.5
Step 1: We will convert the number 4.5 to binary form. 4.5 = 100.1
Step 2: Represent the binary number in fixed-point notation with the following format.
Figure: Fixed Point Notation of 4.5
o How to write numbers in Fixed-point notation:
14
 Floating Point Representation:
A floating-point representation has three parts: Sign bit, Exponent Part, and Mantissa.
Figure: Parts of floating-point representation
 Sign bit:- The floating-point numbers in binary uses a sign bit. A negative
number has a sign bit 1, while a positive number has a sign bit 0. The sign of
any number depends on mantissa, not on exponent.
 Mantissa Part:- The mantissa part is of different lengths at different places. It
depends on registers like for a 16-bit register, and mantissa part is of 8 bits.
 Exponent Part:- It is the power of the number. It depends on the size of the
register. For example, in the 16-bit register, the exponent part is of 7 bits.
15
The number considered is 53.5
Step 1: We will convert the number 53.5 to binary form. 53.5 =
110101.1
Step 2: Normalize the number ( base is 2) = (1.101011) * 25.
Step 2: Represent the binary number in floating-point notation with the
following format.
Figure: Floating Point Notation of 53.5
o How to write numbers in Floating-point notation:
16
 Error Propagation:
 Let x refer to the floating point representation of the real number x.
 Since computer has fixed word length, there is a difference between x and x (round-off
error)
and we would like to estimate the error in the calculation of f(x):
f(xfl) = |f(x) - f(xfl)|
f(x) - f(xfl) = f'(xfl)(x - xfl)
f(xfl) = f'(xfl) * x
Result: If f'(x) and x are known, then we can estimate the error using this formula
~
• Both x and f(x) are unknown.
• If x, is close to x, then we can use first order Taylor expansion and compute:
~
THANK YOU

More Related Content

Similar to Neumerical Methods.pptx

FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...Arti Parab Academics
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdfmiftah88
 
Data representation
Data representationData representation
Data representationManish Kumar
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptxssusera6fdd5
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16John Todora
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental Aman anand kumar
 
Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mpMSc CST
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 
Error detection and correction codes
Error detection and correction codesError detection and correction codes
Error detection and correction codesGargiKhanna1
 
Computer Oraganizaation.pptx
Computer Oraganizaation.pptxComputer Oraganizaation.pptx
Computer Oraganizaation.pptxbmangesh
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...ARVIND PANDE
 
data representation
 data representation data representation
data representationHaroon_007
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentIJERD Editor
 
Lec 02 data representation part 2
Lec 02 data representation part 2Lec 02 data representation part 2
Lec 02 data representation part 2Abdul Khan
 
Chapter iii: Number System
Chapter iii: Number SystemChapter iii: Number System
Chapter iii: Number Systemkclove
 

Similar to Neumerical Methods.pptx (20)

FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdf
 
Data representation
Data representationData representation
Data representation
 
datareprersentation 1.pptx
datareprersentation 1.pptxdatareprersentation 1.pptx
datareprersentation 1.pptx
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptx
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16
 
Module 2_Data representations.pdf
Module 2_Data representations.pdfModule 2_Data representations.pdf
Module 2_Data representations.pdf
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental
 
Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mp
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Number System
Number SystemNumber System
Number System
 
Error detection and correction codes
Error detection and correction codesError detection and correction codes
Error detection and correction codes
 
Computer Oraganizaation.pptx
Computer Oraganizaation.pptxComputer Oraganizaation.pptx
Computer Oraganizaation.pptx
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
 
data representation
 data representation data representation
data representation
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
Lec 02 data representation part 2
Lec 02 data representation part 2Lec 02 data representation part 2
Lec 02 data representation part 2
 
Chapter iii: Number System
Chapter iii: Number SystemChapter iii: Number System
Chapter iii: Number System
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

Neumerical Methods.pptx

  • 1. NUMERICAL METHODS NAME – PAYEL DALAL ROLL NO – 14400120030 STREAM – CSE SUBJECT – NUMERICAL METHODS SUBJECT CODE – OEC-IT601A
  • 2. Presentation title 2 TOPIC:-  APPROXIMATION IN NUMERICAL COMPUTATION  Truncation and rounding errors  Fixed and floating point arithmetic  Propagation of errors
  • 4. 4  Error Definitions:  True error (Et ): the difference between the true value and the approximation.  Absolute error (|Et |): the absolute difference between the true value and the approximation.  True fractional relative error: the true error divided by the true value.  Relative error (et): the true fractional relative error expressed as a percentage. • True fractional relative error = (true value – approximation)/true value • Et = True value – approximation • et= true fractional relative error * 100%
  • 5. 5  We don’t know the true value, so we can’t calculate the true error - approximate the error  Relative approximate error – an approximation of the error relative to the approximation itself o Relative Approximate Error: ea = Approximate error Approximation *100% o Iterative Approach: ea = Current Approximation – Previous Approximation Current Approximation
  • 6. 6  For iterative approximations, continue to iterate until the relative approximate error magnitude is less than a specified stopping criterion  For accuracy to at least n significant figures set the stopping criterion to o Stopping Criterion: |ea | = es es = (0.5*10(2-n))%
  • 7. 7  ROUND-OFF ERROR: Roundoff errors arise because digital computers cannot represent some quantities exactly. There are two major facets of roundoff errors involved in numerical calculations: • Digital computers have size and precision limits on their ability to represent numbers. • Certain numerical manipulations are highly sensitive to roundoff errors. Errors Truncation Errors Round-off Errors
  • 8. 8  Base-10 computer with a 5 bit word S1d1.d2*10S0d0  2 -5= 0.03125  3.1 x 10 -2  roundoff error = (0.03125-0.031)/0.03125 = 0.008 = 0.8%  Because of the limited number of bits for significand and exponent, Roundoff errors is occur. π= 3.141593for 16-bit word computer π= 3.14159265358979 for 32-bit word computer  Although adding significand digits can improve the approximation, such quantities will always have some roundoff error when stored in a computer
  • 9. 9  Truncation errors are those that result from using an approximation in place of an exact mathematical procedure.  Example 1: approximation to a derivative using a finite-difference equation: ~  Example 2: The Taylor Series  TRUNCATION ERROR: = dv v v(ti+1) – v(ti) dt t ti+1 - ti = f(x)= f(x0)+ f' (x0)+ f'' (x0) + ….. + f(n) (x0) + Rn x – x0 1! (x – x0)2 (x – x0)n n! 2!
  • 10. 10 o The Taylor Series:
  • 11. 11  In general, the nth order Taylor series expansion will be exact for an nth order polynomial.  In other cases, the remainder term Rn is of the order of h n+1, meaning: o Truncation Error: • The more terms are used, the smaller the error, and • The smaller the spacing, the smaller the error for a given number of terms.  The total numerical error is the summation of the truncation and roundoff errors.  The truncation error generally increases as the step size increases, while the roundoff error decreases as the step size increases - this leads to a point of diminishing returns for step size. o Total Numerical Error:
  • 12. 12 Figure: Parts of fixed-point representation  Sign bit:- The fixed-point number representation in binary uses a sign bit. The negative number has a sign bit 1, while a positive number has a bit 0.  Integral Part:- The integral part in fixed-point numbers is of different lengths at different places. It depends on the register's size; for an 8-bit register, the integral part is 4 bits.  Fractional part:- The Fractional part is of different lengths at different places. It depends on the registers; for an 8-bit register, the fractional part is 3 bits. There are three parts of the fixed-point number representation: Sign bit, Integral part, and Fractional part.  Fixed Point Representation:
  • 13. 13 Register Sign Bit Integer Part Fraction Part 8-bit register 1 bit 4 bits 3 bits 16-bit register 1 bit 9 bits 6 bits 32-bit register 1 bit 15 bits 9 bits Size of Sign Bit, Integer Part, and Fractional Part for different registers are displayed below: Now that we have learned about fixed-point number representation, let's see how to represent it. The number considered is 4.5 Step 1: We will convert the number 4.5 to binary form. 4.5 = 100.1 Step 2: Represent the binary number in fixed-point notation with the following format. Figure: Fixed Point Notation of 4.5 o How to write numbers in Fixed-point notation:
  • 14. 14  Floating Point Representation: A floating-point representation has three parts: Sign bit, Exponent Part, and Mantissa. Figure: Parts of floating-point representation  Sign bit:- The floating-point numbers in binary uses a sign bit. A negative number has a sign bit 1, while a positive number has a sign bit 0. The sign of any number depends on mantissa, not on exponent.  Mantissa Part:- The mantissa part is of different lengths at different places. It depends on registers like for a 16-bit register, and mantissa part is of 8 bits.  Exponent Part:- It is the power of the number. It depends on the size of the register. For example, in the 16-bit register, the exponent part is of 7 bits.
  • 15. 15 The number considered is 53.5 Step 1: We will convert the number 53.5 to binary form. 53.5 = 110101.1 Step 2: Normalize the number ( base is 2) = (1.101011) * 25. Step 2: Represent the binary number in floating-point notation with the following format. Figure: Floating Point Notation of 53.5 o How to write numbers in Floating-point notation:
  • 16. 16  Error Propagation:  Let x refer to the floating point representation of the real number x.  Since computer has fixed word length, there is a difference between x and x (round-off error) and we would like to estimate the error in the calculation of f(x): f(xfl) = |f(x) - f(xfl)| f(x) - f(xfl) = f'(xfl)(x - xfl) f(xfl) = f'(xfl) * x Result: If f'(x) and x are known, then we can estimate the error using this formula ~ • Both x and f(x) are unknown. • If x, is close to x, then we can use first order Taylor expansion and compute: ~