 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] hfarray --> Maple float
| [MUG] hfarray --> Maple float |
|
Author: Dr George Corliss
Posted: Mon, 05 Aug 2002 09:03:55 -0500
|
>> From: "Dr. George Corliss" "George.Corliss"
Question: Does Maple do hfarray --> 100 digit
number without rounding?
I am using Maple to check results of a C program
that I know is sensitive to rounding errors.
In pseudocode, the C program:
double x, y;
x = something I construct;
y = f(x); for some function f
write AS BINARY x, y;
In the Maple program, I want something like
Digits := 100;
fd := open (fileName, READ, BINARY);
x := hfarray(1..1);
y := hfarray(1..1);
x := readbytes(fd, x); # Binary read
y := readbytes(fd, y); # Binary read
z := f(x); # Some function f
# Compare y and z
# Expect abs(y - z) / z to be about 10^(-16)
What I WANT is that in Maple, the binary number
x is exactly representable in its hardware floating
point form. Before the function f is evaluated
in Maple's 100 digit arithmetic, I want x to be
converted to the exact 100 digit value of the
binary x. Then I am evaluating f at the exact
argument for f as used by my C program, and z is
the correct value (to nearly 100 digits) of f(x).
I could imagine Maple doing the hfarray --> 100 digit
number exactly.
I could imagine that Maple might take the binary
value, convert it to about 16-18 decimal digits
(possibly committing a rounding error), then
append 82-84 zeros to get a 100 digit number with
rounding errors in about the 16th place.
Does anyone know which (or something else) it is?
How can I tell for certain?
Thanks.
--
Dr. George F. Corliss
Electrical and Computer Engineering
Haggerty Engineering 296
Marquette University
P.O. Box 1881
Milwaukee, WI 53201-1881 USA
"George.Corliss"
Office: 414-288-6599; Dept: 288-6820; Fax: 288-5579
|
[View Complete Thread]
Previous by date: [MUG] Re: Solving equations with radicals, Rafael Espericueta
Next by date: [MUG] Maple 7 under Linux: memory trouble, Jerome BENOIT
Previous thread: [MUG] Bug in print(), Helmut Kahovec
Next thread: [MUG] Maple 7 under Linux: memory trouble, Jerome BENOIT
|
|
|