<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>SuperLU: SRC/dlamch.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>SRC/dlamch.c File Reference</h1>Determines double precision machine parameters. <a href="#_details">More...</a>
<p>
<code>#include <stdio.h></code><br>
<code>#include "<a class="el" href="slu__Cnames_8h-source.html">slu_Cnames.h</a>"</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#ca1e6c3771fa0306e1dad2b11d22a8e5">TRUE_</a> (1)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#d4986ecbba005b963f63a85f7c8c281d">FALSE_</a> (0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#3aa069ac3980707dae1e0530f50d59e4">abs</a>(x) ((x) >= 0 ? (x) : -(x))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#c6afabdc09a49a433ee19d8a9486056d">min</a>(a, b) ((a) <= (b) ? (a) : (b))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#ffe776513b24d84b39af8ab0930fef7f">max</a>(a, b) ((a) >= (b) ? (a) : (b))</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#8f8bef103c45d87276d6508164f5883c">dlamch_</a> (char *cmach)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#eaa4a6b78a27d38535ca1a7dc010c92e">dlamc1_</a> (int *beta, int *t, int *rnd, int *ieee1)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#a05275111d3110333608138f59f3f8c3">dlamc2_</a> (int *beta, int *t, int *rnd, double *eps, int *emin, double *rmin, int *emax, double *rmax)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#35cd4981c9a7d3c46226a75f68720dad">dlamc3_</a> (double *a, double *b)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#141c735fa5fb73f28150470ee91da0f9">dlamc4_</a> (int *emin, double *start, int *base)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#0309c617fb0124d2d3ca73dfbdda9fa9">dlamc5_</a> (int *beta, int *p, int *emin, int *ieee, int *emax, double *rmax)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="dlamch_8c.html#9537f19743fcaaac6231895afa9f9e4d">pow_di</a> (double *ap, int *bp)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<pre>
-- LAPACK auxiliary routine (version 2.0) --
Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
Courant Institute, Argonne National Lab, and Rice University
October 31, 1992
</pre> <hr><h2>Define Documentation</h2>
<a class="anchor" name="3aa069ac3980707dae1e0530f50d59e4"></a><!-- doxytag: member="dlamch.c::abs" ref="3aa069ac3980707dae1e0530f50d59e4" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define abs </td>
<td>(</td>
<td class="paramtype">x </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> ((x) >= 0 ? (x) : -(x))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="d4986ecbba005b963f63a85f7c8c281d"></a><!-- doxytag: member="dlamch.c::FALSE_" ref="d4986ecbba005b963f63a85f7c8c281d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define FALSE_ (0) </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="ffe776513b24d84b39af8ab0930fef7f"></a><!-- doxytag: member="dlamch.c::max" ref="ffe776513b24d84b39af8ab0930fef7f" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define max </td>
<td>(</td>
<td class="paramtype">a, <tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">b </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> ((a) >= (b) ? (a) : (b))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="c6afabdc09a49a433ee19d8a9486056d"></a><!-- doxytag: member="dlamch.c::min" ref="c6afabdc09a49a433ee19d8a9486056d" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define min </td>
<td>(</td>
<td class="paramtype">a, <tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">b </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> ((a) <= (b) ? (a) : (b))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="ca1e6c3771fa0306e1dad2b11d22a8e5"></a><!-- doxytag: member="dlamch.c::TRUE_" ref="ca1e6c3771fa0306e1dad2b11d22a8e5" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TRUE_ (1) </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="eaa4a6b78a27d38535ca1a7dc010c92e"></a><!-- doxytag: member="dlamch.c::dlamc1_" ref="eaa4a6b78a27d38535ca1a7dc010c92e" args="(int *beta, int *t, int *rnd, int *ieee1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int dlamc1_ </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>beta</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>rnd</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>ieee1</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<pre>
Purpose
=======</pre><p>
<pre> DLAMC1 determines the machine parameters given by BETA, T, RND, and
IEEE1.</pre><p>
<pre> Arguments
=========</pre><p>
<pre> BETA (output) INT
The base of the machine.</pre><p>
<pre> T (output) INT
The number of ( BETA ) digits in the mantissa.</pre><p>
<pre> RND (output) INT
Specifies whether proper rounding ( RND = .TRUE. ) or
chopping ( RND = .FALSE. ) occurs in addition. This may not</pre><p>
<pre> be a reliable guide to the way in which the machine performs</pre><p>
<pre> its arithmetic.</pre><p>
<pre> IEEE1 (output) INT
Specifies whether rounding appears to be done in the IEEE
'round to nearest' style.</pre><p>
<pre> Further Details
===============</pre><p>
<pre> The routine is based on the routine ENVRON by Malcolm and
incorporates suggestions by Gentleman and Marovich. See</pre><p>
<pre> Malcolm M. A. (1972) Algorithms to reveal properties of
floating-point arithmetic. Comms. of the ACM, 15, 949-951.</pre><p>
<pre> Gentleman W. M. and Marovich S. B. (1974) More on algorithms
that reveal properties of floating point arithmetic units.
Comms. of the ACM, 17, 276-277.</pre><p>
<pre> =====================================================================
</pre>
</div>
</div><p>
<a class="anchor" name="a05275111d3110333608138f59f3f8c3"></a><!-- doxytag: member="dlamch.c::dlamc2_" ref="a05275111d3110333608138f59f3f8c3" args="(int *beta, int *t, int *rnd, double *eps, int *emin, double *rmin, int *emax, double *rmax)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int dlamc2_ </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>beta</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>rnd</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>eps</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>emin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>rmin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>emax</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>rmax</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<pre>
Purpose
=======</pre><p>
<pre> DLAMC2 determines the machine parameters specified in its argument
list.</pre><p>
<pre> Arguments
=========</pre><p>
<pre> BETA (output) INT
The base of the machine.</pre><p>
<pre> T (output) INT
The number of ( BETA ) digits in the mantissa.</pre><p>
<pre> RND (output) INT
Specifies whether proper rounding ( RND = .TRUE. ) or
chopping ( RND = .FALSE. ) occurs in addition. This may not</pre><p>
<pre> be a reliable guide to the way in which the machine performs</pre><p>
<pre> its arithmetic.</pre><p>
<pre> EPS (output) DOUBLE PRECISION
The smallest positive number such that</pre><p>
<pre> fl( 1.0 - EPS ) .LT. 1.0,</pre><p>
<pre> where fl denotes the computed value.</pre><p>
<pre> EMIN (output) INT
The minimum exponent before (gradual) underflow occurs.</pre><p>
<pre> RMIN (output) DOUBLE PRECISION
The smallest normalized number for the machine, given by
BASE**( EMIN - 1 ), where BASE is the floating point value</pre><p>
<pre> of BETA.</pre><p>
<pre> EMAX (output) INT
The maximum exponent before overflow occurs.</pre><p>
<pre> RMAX (output) DOUBLE PRECISION
The largest positive number for the machine, given by
BASE**EMAX * ( 1 - EPS ), where BASE is the floating point</pre><p>
<pre> value of BETA.</pre><p>
<pre> Further Details
===============</pre><p>
<pre> The computation of EPS is based on a routine PARANOIA by
W. Kahan of the University of California at Berkeley.</pre><p>
<pre> =====================================================================
</pre>
</div>
</div><p>
<a class="anchor" name="35cd4981c9a7d3c46226a75f68720dad"></a><!-- doxytag: member="dlamch.c::dlamc3_" ref="35cd4981c9a7d3c46226a75f68720dad" args="(double *a, double *b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double dlamc3_ </td>
<td>(</td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>a</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>b</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<pre>
Purpose
=======</pre><p>
<pre> DLAMC3 is intended to force A and B to be stored prior to doing</pre><p>
<pre> the addition of A and B , for use in situations where optimizers</pre><p>
<pre> might hold one of these in a register.</pre><p>
<pre> Arguments
=========</pre><p>
<pre> A, B (input) DOUBLE PRECISION
The values A and B.</pre><p>
<pre> =====================================================================
</pre>
</div>
</div><p>
<a class="anchor" name="141c735fa5fb73f28150470ee91da0f9"></a><!-- doxytag: member="dlamch.c::dlamc4_" ref="141c735fa5fb73f28150470ee91da0f9" args="(int *emin, double *start, int *base)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int dlamc4_ </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>emin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>start</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>base</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<pre>
Purpose
=======</pre><p>
<pre> DLAMC4 is a service routine for DLAMC2.</pre><p>
<pre> Arguments
=========</pre><p>
<pre> EMIN (output) EMIN
The minimum exponent before (gradual) underflow, computed by</pre><p>
<pre> setting A = START and dividing by BASE until the previous A
can not be recovered.</pre><p>
<pre> START (input) DOUBLE PRECISION
The starting point for determining EMIN.</pre><p>
<pre> BASE (input) INT
The base of the machine.</pre><p>
<pre> =====================================================================
</pre>
</div>
</div><p>
<a class="anchor" name="0309c617fb0124d2d3ca73dfbdda9fa9"></a><!-- doxytag: member="dlamch.c::dlamc5_" ref="0309c617fb0124d2d3ca73dfbdda9fa9" args="(int *beta, int *p, int *emin, int *ieee, int *emax, double *rmax)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int dlamc5_ </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>beta</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>p</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>emin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>ieee</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>emax</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>rmax</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<pre>
Purpose
=======</pre><p>
<pre> DLAMC5 attempts to compute RMAX, the largest machine floating-point
number, without overflow. It assumes that EMAX + <a class="el" href="slamch_8c.html#3aa069ac3980707dae1e0530f50d59e4">abs(EMIN)</a> sum
approximately to a power of 2. It will fail on machines where this
assumption does not hold, for example, the Cyber 205 (EMIN = -28625,</pre><p>
<pre> EMAX = 28718). It will also fail if the value supplied for EMIN is
too large (i.e. too close to zero), probably with overflow.</pre><p>
<pre> Arguments
=========</pre><p>
<pre> BETA (input) INT
The base of floating-point arithmetic.</pre><p>
<pre> P (input) INT
The number of base BETA digits in the mantissa of a
floating-point value.</pre><p>
<pre> EMIN (input) INT
The minimum exponent before (gradual) underflow.</pre><p>
<pre> IEEE (input) INT
A int flag specifying whether or not the arithmetic
system is thought to comply with the IEEE standard.</pre><p>
<pre> EMAX (output) INT
The largest exponent before overflow</pre><p>
<pre> RMAX (output) DOUBLE PRECISION
The largest machine floating-point number.</pre><p>
<pre> =====================================================================</pre><p>
<pre> First compute LEXP and UEXP, two powers of 2 that bound
<a class="el" href="slamch_8c.html#3aa069ac3980707dae1e0530f50d59e4">abs(EMIN)</a>. We then assume that EMAX + <a class="el" href="slamch_8c.html#3aa069ac3980707dae1e0530f50d59e4">abs(EMIN)</a> will sum
approximately to the bound that is closest to <a class="el" href="slamch_8c.html#3aa069ac3980707dae1e0530f50d59e4">abs(EMIN)</a>.
(EMAX is the exponent of the required number RMAX).
</pre>
</div>
</div><p>
<a class="anchor" name="8f8bef103c45d87276d6508164f5883c"></a><!-- doxytag: member="dlamch.c::dlamch_" ref="8f8bef103c45d87276d6508164f5883c" args="(char *cmach)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double dlamch_ </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>cmach</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<pre>
Purpose
=======</pre><p>
<pre> DLAMCH determines double precision machine parameters.</pre><p>
<pre> Arguments
=========</pre><p>
<pre> CMACH (input) CHARACTER*1
Specifies the value to be returned by DLAMCH:
= 'E' or 'e', DLAMCH := eps
= 'S' or 's , DLAMCH := sfmin
= 'B' or 'b', DLAMCH := base
= 'P' or 'p', DLAMCH := eps*base
= 'N' or 'n', DLAMCH := t
= 'R' or 'r', DLAMCH := rnd
= 'M' or 'm', DLAMCH := emin
= 'U' or 'u', DLAMCH := rmin
= 'L' or 'l', DLAMCH := emax
= 'O' or 'o', DLAMCH := rmax</pre><p>
<pre> where</pre><p>
<pre> eps = relative machine precision
sfmin = safe minimum, such that 1/sfmin does not overflow
base = base of the machine
prec = eps*base
t = number of (base) digits in the mantissa
rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
emin = minimum exponent before (gradual) underflow
rmin = underflow threshold - base**(emin-1)
emax = largest exponent before overflow
rmax = overflow threshold - (base**emax)*(1-eps)</pre><p>
<pre> =====================================================================
</pre>
</div>
</div><p>
<a class="anchor" name="9537f19743fcaaac6231895afa9f9e4d"></a><!-- doxytag: member="dlamch.c::pow_di" ref="9537f19743fcaaac6231895afa9f9e4d" args="(double *ap, int *bp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double pow_di </td>
<td>(</td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>ap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>bp</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 22 10:23:47 2010 for SuperLU by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>