OSDN Git Service

Add INSTALL.
[islib/islib.git] / logit.cpp
1 //
2 // Inclusion of standard header file
3 //
4 #include <cmath>
5 #include <limits>
6 #include <stdexcept>
7
8 //
9 // Inclusion of local header file
10 //
11 #include "islibfunc.hpp"
12 #include "logit.hpp"
13
14 namespace islib
15   {
16     //
17     // Definition of function
18     //
19     double
20     logit
21       (
22         double const x
23       )
24       {
25         class local
26           {
27           public:
28             local
29               (
30                 double const x_
31               )
32               {
33                 throw_if ( std::invalid_argument ( "islib::logit: is_less_than ( x_, 0.0, std::numeric_limits < double >::epsilon () ) || is_greater_than ( x_, 1.0, std::numeric_limits < double >::epsilon () )" ), is_less_than ( x_, 0.0, std::numeric_limits < double >::epsilon () ) || is_greater_than ( x_, 1.0, std::numeric_limits < double >::epsilon () ) );
34               }
35
36             ~local
37               ()
38               throw
39                 ()
40               {
41               }
42           }
43           a_local ( x );
44
45         return std::log ( x / ( 1.0 - x ) );
46       }
47   }
48
49 //
50 // End of file
51 //