ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
df1b2cum.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <df1b2fun.h>
00012 
00017 df1b2variable inv_cumd_exponential(const df1b2variable& y)
00018 {
00019   if (value(y)<=0.5)
00020     return log(2.0*y);
00021   else
00022     return log(2.0*(1-y));
00023 }
00024 
00029 df1b2variable cumd_exponential(const df1b2variable& x)
00030 {
00031   if (value(x)<=0.0)
00032     return 0.5*exp(x);
00033   else
00034     return 1.0-0.5*exp(-x);
00035 }