• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 machine epsilon of the HP Prime
11-03-2016, 10:53 PM
Post: #1
 cdeaglejr Junior Member Posts: 39 Joined: Mar 2016 Reputation: 0
machine epsilon of the HP Prime
Here's a short program that calculates the machine epsilon of the HP Prime calculator. The square root of the machine epsilon is often used for the convergence criterion for iterative algorithms such as root finders, numerical integrators, etc.

EXPORT meps()

// machine epsilon of the HP Prime

// epsilon is that number when added to one
// is still one according to the calculator

///////////////////////////////////////////

BEGIN

LOCAL x;

x := 1.0;

WHILE ((1.0 + x) > 1.0) DO

x := x / 2.0;

END;

PRINT;

PRINT("machine epsilon = " + x);

print(" ");

print("1 + epsilon = " + (1.0 + x));

END;

Here are the results for the HP Prime. The second calculation verifies the computed value by adding it to the number one and printing the result.

machine epsilon = 3.63797880705ᴇ−12

1 + epsilon = 1
 « Next Oldest | Next Newest »

Forum Jump:

User(s) browsing this thread: 1 Guest(s)