Module: BigMathR::Hyperb
- Defined in:
- ext/bigdecimal/math_r/hyperb.c,
ext/bigdecimal/math_r/math_r.c
Overview
A module that provides a hyperbolic functions.
It is used internally.
It handle the real number solutions.
The algorithm is implemented according to the references,
when |x| < 3 computes to series expansion, otherwise computes by exponent identity.
Synopsis
The function names defined are the same as those in the C/C++ standard.
- Hyperbolic Sine:
:sinh - Hyperbolic Cosine:
:cosh - Hyperbolic Tangent:
:tanh
Follow, those reciprocals of not defined in C/C++ standard.
- Hyperbolic Cosecant: +:csch+
- Hyperbolic Secant: +:sech+
- Hyperbolic Cotangent: +:coth+
Reference:: C-gengo ni yoru hyoujun alkgorithm jiten (Japanese) - Hasruhiko Okumura (Gijutsu hyouron-sha)
Class Method Summary collapse
-
.cosh(x, prec) ⇒ BigDecimal
Computes hyperbolic cosine of
x. -
.coth(x, prec) ⇒ BigDecimal
Computes hyperbolic cotangent of
x. -
.csch(x, prec) ⇒ BigDecimal
Computes hyperbolic cosecant of
x. -
.sech(x, prec) ⇒ BigDecimal
Computes hyperbolic secant of
x. -
.tanh(x, prec) ⇒ BigDecimal
Computes hyperbolic tangent of
x.
Class Method Details
.cosh(x, prec) ⇒ BigDecimal
Computes hyperbolic cosine of x.
50 51 52 53 54 |
# File 'ext/bigdecimal/math_r/hyperb.c', line 50
static VALUE
__impl_hyperb_cosh(VALUE unused_obj, VALUE x, VALUE prec)
{
return cosh_branch(x, prec, cosh_formula);
}
|
.coth(x, prec) ⇒ BigDecimal
Computes hyperbolic cotangent of x.
134 135 136 137 138 |
# File 'ext/bigdecimal/math_r/hyperb.c', line 134
static VALUE
__impl_hyperb_coth(VALUE unused_obj, VALUE x, VALUE prec)
{
return coth_branch(x, prec, coth_formula);
}
|
.csch(x, prec) ⇒ BigDecimal
Computes hyperbolic cosecant of x.
92 93 94 95 96 |
# File 'ext/bigdecimal/math_r/hyperb.c', line 92
static VALUE
__impl_hyperb_csch(VALUE unused_obj, VALUE x, VALUE prec)
{
return csch_branch(x, prec, csch_formula);
}
|
.sech(x, prec) ⇒ BigDecimal
Computes hyperbolic secant of x.
113 114 115 116 117 |
# File 'ext/bigdecimal/math_r/hyperb.c', line 113
static VALUE
__impl_hyperb_sech(VALUE unused_obj, VALUE x, VALUE prec)
{
return sech_branch(x, prec, sech_formula);
}
|
.tanh(x, prec) ⇒ BigDecimal
Computes hyperbolic tangent of x.
71 72 73 74 75 |
# File 'ext/bigdecimal/math_r/hyperb.c', line 71
static VALUE
__impl_hyperb_tanh(VALUE unused_obj, VALUE x, VALUE prec)
{
return tanh_branch(x, prec, tanh_formula);
}
|