/* dcbrt.f -- translated by f2c (version 19980913). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static doublereal c_b2 = .33333333333333331; /* $Procedure DCBRT ( Double precision cube root ) */ doublereal dcbrt_(doublereal *x) { /* System generated locals */ doublereal ret_val, d__1, d__2; /* Builtin functions */ double pow_dd(doublereal *, doublereal *), d_sign(doublereal *, doublereal *); /* $ Abstract */ /* Return the cube root of a double precision number. */ /* $ Copyright */ /* Copyright (1995), California Institute of Technology. */ /* U.S. Government sponsorship acknowledged. */ /* $ Required_Reading */ /* None. */ /* $ Keywords */ /* MATH, ROOT */ /* $ Declarations */ /* $ Brief_I/O */ /* VARIABLE I/O DESCRIPTION */ /* -------- --- -------------------------------------------------- */ /* X I Number whose cube root is desired. */ /* $ Detailed_Input */ /* X may be any double precision value. */ /* $ Detailed_Output */ /* DCBRT is the cube root of the input value. */ /* $ Parameters */ /* None. */ /* $ Particulars */ /* DCBRT calculates the cube root of the input value by using the */ /* exponentiation operator to raise the input value to the 1/3 */ /* power. This operation, however, is performed on the absolute */ /* value of the input variable, and then the sign of the input */ /* is transferred to the output value. */ /* All values of the input variable X should be acceptible to the */ /* DCBRT. */ /* $ Examples */ /* The following table gives sample values of the variable X and */ /* DCBRT(X) */ /* X DCBRT(X) */ /* -------------------------------------------------------------- */ /* 0.0D0 0.0D0 */ /* 8.0D0 2.0D0 */ /* -1.0D3 -1.0D1 */ /* $ Restrictions */ /* None */ /* $ Exceptions */ /* Error free. */ /* $ Files */ /* None */ /* $ Author_and_Institution */ /* W.M. Owen (JPL) */ /* $ Literature_References */ /* None */ /* $ Version */ /* - SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) */ /* Comment section for permuted index source lines was added */ /* following the header. */ /* - SPICELIB Version 1.0.0, 31-JAN-1990 (WMO) */ /* -& */ /* $ Index_Entries */ /* d.p. cube root */ /* -& */ d__2 = abs(*x); d__1 = pow_dd(&d__2, &c_b2); ret_val = d_sign(&d__1, x); return ret_val; } /* dcbrt_ */