ADMB Documentation  11.1.2448
 All Classes Files Functions Variables Typedefs Friends Defines
ccumdexp.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: ccumdexp.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 
00017 double inv_cumd_exponential(double y)
00018 {
00019   if (y<=0.5)
00020     return log(2.0*y);
00021   else
00022     return log(2.0*(1-y));
00023 }
00024 
00029 double cumd_exponential(double x)
00030 {
00031   if (x<=0.0)
00032     return 0.5*exp(x);
00033   else
00034     return 1.0-0.5*exp(-x);
00035 }