![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b DLADIV 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download DLADIV + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dladiv.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dladiv.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dladiv.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DLADIV( A, B, C, D, P, Q ) 00022 * 00023 * .. Scalar Arguments .. 00024 * DOUBLE PRECISION A, B, C, D, P, Q 00025 * .. 00026 * 00027 * 00028 *> \par Purpose: 00029 * ============= 00030 *> 00031 *> \verbatim 00032 *> 00033 *> DLADIV performs complex division in real arithmetic 00034 *> 00035 *> a + i*b 00036 *> p + i*q = --------- 00037 *> c + i*d 00038 *> 00039 *> The algorithm is due to Robert L. Smith and can be found 00040 *> in D. Knuth, The art of Computer Programming, Vol.2, p.195 00041 *> \endverbatim 00042 * 00043 * Arguments: 00044 * ========== 00045 * 00046 *> \param[in] A 00047 *> \verbatim 00048 *> A is DOUBLE PRECISION 00049 *> \endverbatim 00050 *> 00051 *> \param[in] B 00052 *> \verbatim 00053 *> B is DOUBLE PRECISION 00054 *> \endverbatim 00055 *> 00056 *> \param[in] C 00057 *> \verbatim 00058 *> C is DOUBLE PRECISION 00059 *> \endverbatim 00060 *> 00061 *> \param[in] D 00062 *> \verbatim 00063 *> D is DOUBLE PRECISION 00064 *> The scalars a, b, c, and d in the above expression. 00065 *> \endverbatim 00066 *> 00067 *> \param[out] P 00068 *> \verbatim 00069 *> P is DOUBLE PRECISION 00070 *> \endverbatim 00071 *> 00072 *> \param[out] Q 00073 *> \verbatim 00074 *> Q is DOUBLE PRECISION 00075 *> The scalars p and q in the above expression. 00076 *> \endverbatim 00077 * 00078 * Authors: 00079 * ======== 00080 * 00081 *> \author Univ. of Tennessee 00082 *> \author Univ. of California Berkeley 00083 *> \author Univ. of Colorado Denver 00084 *> \author NAG Ltd. 00085 * 00086 *> \date November 2011 00087 * 00088 *> \ingroup auxOTHERauxiliary 00089 * 00090 * ===================================================================== 00091 SUBROUTINE DLADIV( A, B, C, D, P, Q ) 00092 * 00093 * -- LAPACK auxiliary routine (version 3.4.0) -- 00094 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00095 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00096 * November 2011 00097 * 00098 * .. Scalar Arguments .. 00099 DOUBLE PRECISION A, B, C, D, P, Q 00100 * .. 00101 * 00102 * ===================================================================== 00103 * 00104 * .. Local Scalars .. 00105 DOUBLE PRECISION E, F 00106 * .. 00107 * .. Intrinsic Functions .. 00108 INTRINSIC ABS 00109 * .. 00110 * .. Executable Statements .. 00111 * 00112 IF( ABS( D ).LT.ABS( C ) ) THEN 00113 E = D / C 00114 F = C + D*E 00115 P = ( A+B*E ) / F 00116 Q = ( B-A*E ) / F 00117 ELSE 00118 E = C / D 00119 F = D + C*E 00120 P = ( B+A*E ) / F 00121 Q = ( -A+B*E ) / F 00122 END IF 00123 * 00124 RETURN 00125 * 00126 * End of DLADIV 00127 * 00128 END