Indian Institute of Technology Jodhpur
Scientific Computations
Lab Sheet 1
2025-26, Semester I Instructor: Dr. Gaurav Bhatnagar
Task 1: Error Metrics Calculator
Write a program to compute absolute, relative, and percentage errors.
• Input: True value and approximate value
• Output:
o Absolute Error
o Relative Error
o Percentage Error
Task 2: Chopping and Rounding
Write a program to:
• Truncate a given number to n decimal places
• Round a given number to n decimal places
• Compare the original, truncated, and rounded values, and compute their respective errors.
Task 3: Truncation Error
Write a program to approximate a function using the first 4 terms of its Taylor series at ܽ = ݔ
• Input:
o A continuously differentiable function (Your method should work for exponential, sine and
cosine functions)
o Value of ܽ
• Output:
o the error between the approximate and actual value
Task 4: Error Propagation
Write a program to provide the total error propagate due to arithmetic operations.
• Input:
o Two numbers and error associated with them
o Airthmatic operation to be used for error propagation
• Output:
o Total propagated error
Task 5: Floating-Point Representation
Write a program to convert a number into floating point representation.
Submission Guidelines:
Submit your code of Tasks 2 and 3 at [Link]
Also, include the following information at the top of the submitted file as a comment: your name, roll
number, and instructions on how to run the program, if any.