ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mfexpcon.cpp
Go to the documentation of this file.
1 /*
2 \file Robust exponential functions for constant scalar objects.
3 
4 Author: David Fournier
5 Copyright (c) 2008-2015 Regents of the University of California
6 */
7 #include <fvar.hpp>
8 
22 double mfexp(double x, double b)
23 {
24  if (x > b)
25  {
26  return exp(b)*(1.+2.*(x-b))/(1.+x-b);
27  }
28  else if (x < -b)
29  {
30  return exp(-b)*(1.-x-b)/(1.+2.*(-x-b));
31  }
32  return exp(x);
33 }
47 double mfexp(double x)
48 {
49  double b = 60;
50  return mfexp(x, b);
51 }
52 
#define x
d3_array mfexp(const d3_array &m)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr7.cpp:10
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Definition: d3arr2a.cpp:28