# public gnufied /rb-gsl forked from romanbsd/rb-gsl

### Subversion checkout URL

You can clone with HTTPS or Subversion.

 ``` d757e5a6 » davidm ``` 2008-10-16 Initial version from rb-gsl-1.10.3.tar.gz. 1 =begin 2 = Mathematical Functions 3 Contents: 4 (1) (()) 5 (2) (()) 6 (1) (()) 7 (2) (()) 8 (3) (()) 9 (4) (()) 10 (5) (()) 11 (6) (()) 12 (7) (()) 13 (8) (()) 14 15 == Mathematical Constants 16 --- GSL::M_E 17 The base of exponentials, e 18 --- GSL::M_LOG2E 19 The base-2 logarithm of e, log_2(e) 20 --- GSL::M_LOG10E 21 The base-10 logarithm of e, log_10(e) 22 --- GSL::M_SQRT2 23 The square root of two, sqrt(2) 24 --- GSL::M_SQRT1_2 25 The square root of one-half, sqrt(1/2) 26 --- GSL::M_SQRT3 27 The square root of three, sqrt(3) 28 --- GSL::M_PI 29 The constant pi 30 --- GSL::M_PI_2 31 Pi divided by two 32 --- GSL::M_PI_4 33 Pi divided by four 34 --- GSL::M_SQRTPI 35 The square root of pi 36 --- GSL::M_2_SQRTPI 37 Two divided by the square root of pi 38 --- GSL::M_1_PI 39 The reciprocal of pi, 1/pi 40 --- GSL::M_2_PI 41 Twice the reciprocal of pi, 2/pi 42 --- GSL::M_LN10 43 The natural logarithm of ten, ln(10) 44 --- GSL::M_LN2 45 The natural logarithm of ten, ln(2) 46 --- GSL::M_LNPI 47 The natural logarithm of ten, ln(pi) 48 --- GSL::M_EULER 49 Euler's constant 50 51 == Infinities and Not-a-number 52 53 === Constants 54 --- GSL::POSINF 55 The IEEE representation of positive infinity, 56 computed from the expression +1.0/0.0. 57 --- GSL::NEGINF 58 The IEEE representation of negative infinity, 59 computed from the expression -1.0/0.0. 60 --- GSL::NAN 61 The IEEE representation of the Not-a-Number symbol, 62 computed from the ratio 0.0/0.0. 63 64 === Module functions 65 --- GSL::isnan(x) 66 This returns 1 if ((|x|)) is not-a-number. 67 --- GSL::isnan?(x) 68 This returns (({true})) if ((|x|)) is not-a-number, and (({false})) otherwise. 69 --- GSL::isinf(x) 70 This returns +1 if ((|x|)) is positive infinity, 71 -1 if ((|x|)) is negative infinity and 0 otherwise. ``` 59de1367 » ytsunesada ``` 2008-10-17 git-svn-id: http://rb-gsl.rubyforge.org/svn/trunk/rb-gsl@12 6e764f74-… 72 NOTE: In Darwin9.5.0-gcc4.0.1, this method returns 1 for -inf. ``` d757e5a6 » davidm ``` 2008-10-16 Initial version from rb-gsl-1.10.3.tar.gz. 73 --- GSL::isinf?(x) 74 This returns (({true})) if ((|x|)) is positive or negative infinity, 75 and (({false})) otherwise. 76 --- GSL::finite(x) 77 This returns 1 if ((|x|)) is a real number, 78 and 0 if it is infinite or not-a-number. 79 --- GSL::finite?(x) 80 This returns (({true})) if ((|x|)) is a real number, 81 and (({false})) if it is infinite or not-a-number. 82 83 == Elementary Functions 84 --- GSL::log1p(x) 85 This method computes the value of log(1+x) 86 in a way that is accurate for small ((|x|)). It provides an alternative 87 to the BSD math function log1p(x). 88 --- GSL::expm1(x) 89 This method computes the value of exp(x)-1 90 in a way that is accurate for small ((|x|)). It provides an alternative 91 to the BSD math function expm1(x). 92 --- GSL::hypot(x, y) 93 This method computes the value of sqrt{x^2 + y^2} in a way that 94 avoids overflow. 95 --- GSL::hypot3(x, y, z) 96 Computes the value of sqrt{x^2 + y^2 + z^2} in a way that avoids overflow. 97 --- GSL::acosh(x) 98 This method computes the value of arccosh(x). 99 --- GSL::asinh(x) 100 This method computes the value of arcsinh(x). 101 --- GSL::atanh(x) 102 This method computes the value of arctanh(x). 103 104 These methods above can take argument ((|x|)) of 105 Integer, Float, Array, Vector or Matrix. 106 107 --- GSL::ldexp(x) 108 This method computes the value of x * 2^e. 109 --- GSL::frexp(x) 110 This method splits the number ((|x|)) into its normalized fraction 111 f and exponent e, such that x = f * 2^e and 0.5 <= f < 1. 112 The method returns f and the exponent e as an array, [f, e]. 113 If ((|x|)) is zero, both f and e are set to zero. 114 115 == Small Integer Powers 116 --- GSL::pow_int(x, n) 117 This routine computes the power ((|x^n|)) for integer ((|n|)). 118 The power is computed efficiently -- for example, x^8 is computed as 119 ((x^2)^2)^2, requiring only 3 multiplications. 120 121 --- GSL::pow_2(x) 122 --- GSL::pow_3(x) 123 --- GSL::pow_4(x) 124 --- GSL::pow_5(x) 125 --- GSL::pow_6(x) 126 --- GSL::pow_7(x) 127 --- GSL::pow_8(x) 128 --- GSL::pow_9(x) 129 These methods can be used to compute small integer powers x^2, x^3, etc. 130 efficiently. 131 132 == Testing the Sign of Numbers 133 --- GSL::SIGN(x) 134 --- GSL::sign(x) 135 Return the sign of ((|x|)). 136 It is defined as ((x) >= 0 ? 1 : -1). 137 Note that with this definition the sign of zero is positive 138 (regardless of its IEEE sign bit). 139 140 == Testing for Odd and Even Numbers 141 --- GSL::is_odd(n) 142 --- GSL::IS_ODD(n) 143 Evaluate to 1 if ((|n|)) is odd and 0 if ((|n|)) is even. 144 The argument ((|n|)) must be of Fixnum type. 145 --- GSL::is_odd?(n) 146 --- GSL::IS_ODD?(n) 147 Return (({true})) if ((|n|)) is odd and (({false})) if even. 148 --- GSL::is_even(n) 149 --- GSL::IS_EVEN(n) 150 Evaluate to 1 if ((|n|)) is even and 0 if ((|n|)) is odd. 151 The argument ((|n|)) must be of Fixnum type. 152 --- GSL::is_even?(n) 153 --- GSL::IS_even?(n) 154 Return (({true})) if ((|n|)) is even and (({false})) if odd. 155 156 == Maximum and Minimum functions 157 --- GSL::max(a, b) 158 --- GSL::MAX(a, b) 159 --- GSL::min(a, b) 160 --- GSL::MIN(a, b) 161 162 == Approximate Comparison of Floating Point Numbers 163 --- GSL::fcmp(a, b, epsilon = 1e-10) 164 This method determines whether ((|x|)) and ((|y|)) are approximately equal to a 165 relative accuracy ((|epsilon|)). 166 --- GSL::equal?(a, b, epsilon = 1e-10) 167 168 == Module Constants 169 --- GSL::VERSION 170 GSL version 171 172 --- GSL::RB_GSL_VERSION 173 --- GSL::RUBY_GSL_VERSION 174 Ruby/GSL version 175 176 (()) 177 (()) 178 179 (()) 180 (()) 181 182 =end