math4610

Routine Name: double_machine_epsilon

Author: David Merkley

Language: Python

Description/Purpose: THis routine calculates the size of the machine epsilon for double precision numbers.

Input: N/A

Output: machine error double precision

Implementation/Code:

    def double_machine_epsilon():
        x = 1
        E = .5
        i = 1
        while i <= 100:
            xapprox = x + E
            error = abs(x - xapprox)
            if error == 0:
                break
            E = E/2
            print(i, error)
            i += 1