/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:06 */
/*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */
#include <math.h>
#include "fcrt.h"
#include "dlnrel.h"
#include <stdlib.h>
		/* PARAMETER translations */
#define	BOT	(.70710678118654752440e0 - 1.0e0)
#define	P0	0.7504094990777122217455611007e2
#define	P1	(-0.1345669115050430235318253537e3)
#define	P2	0.741371921324860251277933647e2
#define	P3	(-0.1277249755012330819984385e2)
#define	P4	0.3327108381087686938144e00
#define	Q0	0.3752047495388561108727775374e2
#define	Q1	(-0.7979028073715004879439951583e2)
#define	Q2	0.561612613211825729205856036e2
#define	Q3	(-0.1450868091858082685362325e2)
#define	TOP	(1.4142135623730950488e0 - 1.0e0)
		/* end of PARAMETER translations */
 
double /*FUNCTION*/ dlnrel(
double x)
{
	double dlnrel_v, z, zsq;
 
	/* Copyright (c) 1996 California Institute of Technology, Pasadena, CA.
	 * ALL RIGHTS RESERVED.
	 * Based on Government Sponsored Research NAS7-03001.
	 *>>   1994-10-20 DLNREL Krogh  Changes to use M77CON
	 *>>   1990-11-27 DLNREL WV Snyder Initial Code.
	 *
	 *     Compute LOG(1+X).
	 *
	 *     This procedure uses approximation 2707 from Hart, et. al. when
	 *     1/sqrt(2) < 1+x < sqrt(2), and otherwise uses the Fortran
	 *     intrinsic logarithm routine.
	 *
	 *--D replaces "?": ?LNREL */
	/*     parameter (Q4 = +1.0                                 D00 ) */
 
	if (x < BOT || x > TOP)
	{
		dlnrel_v = log( x + 1.0e0 );
	}
	else
	{
		z = x/(x + 2.0e0);
		zsq = z*z;
		dlnrel_v = z*((((P4*zsq + P3)*zsq + P2)*zsq + P1)*zsq + P0)/
		 ((((zsq + Q3)*zsq + Q2)*zsq + Q1)*zsq + Q0);
	}
	return( dlnrel_v );
} /* end of function */