root / www / HPL_dlamch.html
Historique | Voir | Annoter | Télécharger (3,39 ko)
1 |
<HTML>
|
---|---|
2 |
<HEAD>
|
3 |
<TITLE>HPL_dlamch HPL 2.0 Library Functions September 10, 2008</TITLE> |
4 |
</HEAD>
|
5 |
|
6 |
<BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099" |
7 |
ALINK = "#ffff00"> |
8 |
|
9 |
<H1>Name</H1> |
10 |
<B>HPL_dlamch</B> determines machine-specific arithmetic constants. |
11 |
|
12 |
<H1>Synopsis</H1> |
13 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
14 |
<CODE>double</CODE> |
15 |
<CODE>HPL_dlamch(</CODE> |
16 |
<CODE>const HPL_T_MACH</CODE> |
17 |
<CODE>CMACH</CODE> |
18 |
<CODE>);</CODE> |
19 |
|
20 |
<H1>Description</H1> |
21 |
<B>HPL_dlamch</B> |
22 |
determines machine-specific arithmetic constants such as |
23 |
the relative machine precision (eps), the safe minimum (sfmin) such |
24 |
that 1 / sfmin does not overflow, the base of the machine (base), the |
25 |
precision (prec), the number of (base) digits in the mantissa (t), |
26 |
whether rounding occurs in addition (rnd=1.0 and 0.0 otherwise), the |
27 |
minimum exponent before (gradual) underflow (emin), the underflow |
28 |
threshold (rmin) base**(emin-1), the largest exponent before overflow |
29 |
(emax), the overflow threshold (rmax) (base**emax)*(1-eps). |
30 |
|
31 |
<H1>Arguments</H1> |
32 |
<PRE>
|
33 |
CMACH (local input) const HPL_T_MACH |
34 |
Specifies the value to be returned by HPL_dlamch |
35 |
= HPL_MACH_EPS, HPL_dlamch := eps (default) |
36 |
= HPL_MACH_SFMIN, HPL_dlamch := sfmin |
37 |
= HPL_MACH_BASE, HPL_dlamch := base |
38 |
= HPL_MACH_PREC, HPL_dlamch := eps*base |
39 |
= HPL_MACH_MLEN, HPL_dlamch := t |
40 |
= HPL_MACH_RND, HPL_dlamch := rnd |
41 |
= HPL_MACH_EMIN, HPL_dlamch := emin |
42 |
= HPL_MACH_RMIN, HPL_dlamch := rmin |
43 |
= HPL_MACH_EMAX, HPL_dlamch := emax |
44 |
= HPL_MACH_RMAX, HPL_dlamch := rmax |
45 |
|
46 |
where |
47 |
|
48 |
eps = relative machine precision, |
49 |
sfmin = safe minimum, |
50 |
base = base of the machine, |
51 |
prec = eps*base, |
52 |
t = number of digits in the mantissa, |
53 |
rnd = 1.0 if rounding occurs in addition, |
54 |
emin = minimum exponent before underflow, |
55 |
rmin = underflow threshold, |
56 |
emax = largest exponent before overflow, |
57 |
rmax = overflow threshold. |
58 |
</PRE>
|
59 |
|
60 |
<H1>Example</H1> |
61 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
62 |
<PRE>
|
63 |
int main(int argc, char *argv[]) |
64 |
{ |
65 |
double eps; |
66 |
eps = HPL_dlamch( HPL_MACH_EPS ); |
67 |
printf("eps=%18.8e\n", eps); |
68 |
exit(0); return(0); |
69 |
} |
70 |
</PRE>
|
71 |
|
72 |
<H1>References</H1> |
73 |
This function has been manually translated from the Fortran 77 LAPACK |
74 |
auxiliary function dlamch.f (version 2.0 -- 1992), that was itself |
75 |
based on the function ENVRON by Malcolm and incorporated suggestions |
76 |
by Gentleman and Marovich. See |
77 |
|
78 |
Malcolm M. A., Algorithms to reveal properties of floating-point |
79 |
arithmetic., Comms. of the ACM, 15, 949-951 (1972). |
80 |
|
81 |
Gentleman W. M. and Marovich S. B., More on algorithms that reveal |
82 |
properties of floating point arithmetic units., Comms. of the ACM, |
83 |
17, 276-277 (1974). |
84 |
|
85 |
</BODY>
|
86 |
</HTML>
|