Module: BigMathR::EulerF

Defined in:
ext/bigdecimal/math_r/euler_f.c,
ext/bigdecimal/math_r/math_r.c

Overview

A module that provides using Euler’s formula. It is used internally.
By using this formula for complex analysis, it can be applied to differential equations and Fourier transforms.

Synopsis

The function names defined are the same as those in the C/C++ standard.

  • Exponential function: :cexp

  • Base-2 (Binary) exponent: :cexp2

  • Sine: :sin :csin

  • Cosine: :cos :ccos

  • Tangent: :tan :ctan

  • Hyperbolic sine: :sinh :csinh

  • Hyperbolic cosine: :cosh :ccosh

  • Hyperbolic tangent: :tanh :ctanh

Follow, those reciprocals of not defined in C/C++ standard.

  • Cosecant: :csc :ccsc

  • Secant: :sec :csec

  • Cotangent: :cot :ccot

  • Hyperbolic cosecant: :csch :ccsch

  • Hyperbolic secant: :sech :csech

  • Hyperbolic cotangent: :coth :ccoth

Reference

Kiso kara hatten made Sankaku kansuu (Japanese) - Michimasa Kobayashi (Beret Shuppan)

Class Method Summary collapse

Class Method Details

.ccos(z, prec) ⇒ Complex

Computes complex cosine of z.

Examples:

BigMathR::EulerF.ccos(1+1i, 20)
#=> (0.83373002513114904889e0-0.9888977057628650964e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



198
199
200
201
202
# File 'ext/bigdecimal/math_r/euler_f.c', line 198

static VALUE
__impl_eulerf_ccos(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ccos_branch(z, prec, ccos_eulerf);
}

.ccosh(z, prec) ⇒ Complex

Computes complex hyperbolic cosine of z.

Examples:

BigMathR::EulerF.ccosh(1+1i, 20)
#=> (0.83373002513114904889e0+0.9888977057628650964e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



426
427
428
429
430
# File 'ext/bigdecimal/math_r/euler_f.c', line 426

static VALUE
__impl_eulerf_ccosh(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ccosh_branch(z, prec, ccosh_eulerf);
}

.ccot(z, prec) ⇒ Complex

Computes complex cotangent of z.

Examples:

BigMathR::EulerF.ccot(1+1i, 20)
#=> (0.21762156185440268135e0-0.86801414289592494862e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



274
275
276
277
278
# File 'ext/bigdecimal/math_r/euler_f.c', line 274

static VALUE
__impl_eulerf_ccot(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ccot_branch(z, prec, ccot_eulerf);
}

.ccoth(z, prec) ⇒ Complex

Computes complex hyperbolic cotangent of z.

Examples:

BigMathR::EulerF.ccoth(1+1i, 20)
#=> (0.86801414289592494862e0-0.21762156185440268135e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



502
503
504
505
506
# File 'ext/bigdecimal/math_r/euler_f.c', line 502

static VALUE
__impl_eulerf_ccoth(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ccoth_branch(z, prec, ccoth_eulerf);
}

.ccsc(z, prec) ⇒ Complex

Computes complex cosecant of z.

Examples:

BigMathR::EulerF.ccsc(1+1i, 20)
#=> (0.62151801717042842124e0-0.30393100162842645035e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



236
237
238
239
240
# File 'ext/bigdecimal/math_r/euler_f.c', line 236

static VALUE
__impl_eulerf_ccsc(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ccsc_branch(z, prec, ccsc_eulerf);
}

.ccsch(z, prec) ⇒ Complex

Computes complex hyperbolic cosecant of z.

Examples:

BigMathR::EulerF.ccsch(1+1i, 20)
#=> (0.30393100162842645035e0-0.62151801717042842124e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



464
465
466
467
468
# File 'ext/bigdecimal/math_r/euler_f.c', line 464

static VALUE
__impl_eulerf_ccsch(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ccsch_branch(z, prec, ccsch_eulerf);
}

.cexp(z, prec) ⇒ Complex

Computes complex exponential function of z.

Examples:

BigMathR::EulerF.cexp(1+1i, 20)
#=> (0.14686939399158851572e1+0.22873552871788423912e1i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



26
27
28
29
30
# File 'ext/bigdecimal/math_r/euler_f.c', line 26

static VALUE
__impl_eulerf_cexp(VALUE unused_obj, VALUE z, VALUE prec)
{
	return cexp_branch(z, prec, cexp_eulerf);
}

.cexp2(z, prec) ⇒ Complex

Computes complex binary exponent of z.

Examples:

BigMathR::EulerF.cexp2(1+1i, 20)
#=> (0.15384778027279442532e1+0.12779225526272696023e1i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



46
47
48
49
50
# File 'ext/bigdecimal/math_r/euler_f.c', line 46

static VALUE
__impl_eulerf_cexp2(VALUE unused_obj, VALUE z, VALUE prec)
{
	return cexp2_branch(z, prec, cexp2_eulerf);
}

.cos(x, prec) ⇒ Complex

Computes cosine of x.

Examples:

BigMathR::EulerF.cos(1, 20)
#=> 0.5403023058681397174e0

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



84
85
86
87
88
# File 'ext/bigdecimal/math_r/euler_f.c', line 84

static VALUE
__impl_eulerf_cos(VALUE unused_obj, VALUE x, VALUE prec)
{
	return cos_branch(x, prec, cos_eulerf);
}

.cosh(x, prec) ⇒ BigDecimal

Computes hyperbolic cosine of x.

Examples:

BigMathR::EulerF.cosh(1, 20)
#=> 0.15430806348152437785e1

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



312
313
314
315
316
# File 'ext/bigdecimal/math_r/euler_f.c', line 312

static VALUE
__impl_eulerf_cosh(VALUE unused_obj, VALUE x, VALUE prec)
{
	return cosh_branch(x, prec, cosh_eulerf);
}

.cot(x, prec) ⇒ Complex

Computes cotangent of x.

Examples:

BigMathR::EulerF.cot(1, 20)
#=> 0.64209261593433070301e0

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



160
161
162
163
164
# File 'ext/bigdecimal/math_r/euler_f.c', line 160

static VALUE
__impl_eulerf_cot(VALUE unused_obj, VALUE x, VALUE prec)
{
	return cot_branch(x, prec, cot_eulerf);
}

.coth(x, prec) ⇒ BigDecimal

Computes hyperbolic cotangent of x.

Examples:

BigMathR::EulerF.coth(1, 20)
#=> 0.13130352854993313036e1

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



388
389
390
391
392
# File 'ext/bigdecimal/math_r/euler_f.c', line 388

static VALUE
__impl_eulerf_coth(VALUE unused_obj, VALUE x, VALUE prec)
{
	return coth_branch(x, prec, coth_eulerf);
}

.csc(x, prec) ⇒ Complex

Computes cosecant of x.

Examples:

BigMathR::EulerF.csc(1, 20)
#=> 0.11883951057781212163e1

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



122
123
124
125
126
# File 'ext/bigdecimal/math_r/euler_f.c', line 122

static VALUE
__impl_eulerf_csc(VALUE unused_obj, VALUE x, VALUE prec)
{
	return csc_branch(x, prec, csc_eulerf);
}

.csch(x, prec) ⇒ BigDecimal

Computes hyperbolic cosecant of x.

Examples:

BigMathR::EulerF.csch(1, 20)
#=> 0.85091812823932154512e0

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



350
351
352
353
354
# File 'ext/bigdecimal/math_r/euler_f.c', line 350

static VALUE
__impl_eulerf_csch(VALUE unused_obj, VALUE x, VALUE prec)
{
	return csch_branch(x, prec, csch_eulerf);
}

.csec(z, prec) ⇒ Complex

Computes complex secant of z.

Examples:

BigMathR::EulerF.csec(1+1i, 20)
#=> (0.4983370305551867852e0+0.59108384172104504804e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



255
256
257
258
259
# File 'ext/bigdecimal/math_r/euler_f.c', line 255

static VALUE
__impl_eulerf_csec(VALUE unused_obj, VALUE z, VALUE prec)
{
	return csec_branch(z, prec, csec_eulerf);
}

.csech(z, prec) ⇒ Complex

Computes complex hyperbolic secant of z.

Examples:

BigMathR::EulerF.csech(1+1i, 20)
#=> (0.4983370305551867852e0-0.59108384172104504804e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



483
484
485
486
487
# File 'ext/bigdecimal/math_r/euler_f.c', line 483

static VALUE
__impl_eulerf_csech(VALUE unused_obj, VALUE z, VALUE prec)
{
	return csech_branch(z, prec, csech_eulerf);
}

.csin(z, prec) ⇒ Complex

Computes complex sine of z.

Examples:

BigMathR::EulerF.csin(1+1i, 20)
#=> (0.12984575814159772948e1+0.63496391478473610827e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



179
180
181
182
183
# File 'ext/bigdecimal/math_r/euler_f.c', line 179

static VALUE
__impl_eulerf_csin(VALUE unused_obj, VALUE z, VALUE prec)
{
	return csin_branch(z, prec, csin_eulerf);
}

.csinh(z, prec) ⇒ Complex

Computes complex hyperbolic sine of z.

Examples:

BigMathR::EulerF.csinh(1+1i, 20)
#=> (0.63496391478473610827e0+0.12984575814159772948e1i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



407
408
409
410
411
# File 'ext/bigdecimal/math_r/euler_f.c', line 407

static VALUE
__impl_eulerf_csinh(VALUE unused_obj, VALUE z, VALUE prec)
{
	return csinh_branch(z, prec, csinh_eulerf);
}

.ctan(z, prec) ⇒ Complex

Computes complex tangent of z.

Examples:

BigMathR::EulerF.ctan(1+1i, 20)
#=> (0.27175258531951171652e0+0.10839233273386945435e1i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



217
218
219
220
221
# File 'ext/bigdecimal/math_r/euler_f.c', line 217

static VALUE
__impl_eulerf_ctan(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ctan_branch(z, prec, ctan_eulerf);
}

.ctanh(z, prec) ⇒ Complex

Computes complex hyperbolic tangent of z.

Examples:

BigMathR::EulerF.ctanh(1+1i, 20)
#=> (0.10839233273386945435e1+0.27175258531951171652e0i)

Parameters:

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.

Since:

  • 0.1.0



445
446
447
448
449
# File 'ext/bigdecimal/math_r/euler_f.c', line 445

static VALUE
__impl_eulerf_ctanh(VALUE unused_obj, VALUE z, VALUE prec)
{
	return ctanh_branch(z, prec, ctanh_eulerf);
}

.sec(x, prec) ⇒ Complex

Computes secant of x.

Examples:

BigMathR::EulerF.sec(1, 20)
#=> 0.18508157176809256179e1

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



141
142
143
144
145
# File 'ext/bigdecimal/math_r/euler_f.c', line 141

static VALUE
__impl_eulerf_sec(VALUE unused_obj, VALUE x, VALUE prec)
{
	return sec_branch(x, prec, sec_eulerf);
}

.sech(x, prec) ⇒ BigDecimal

Computes hyperbolic secant of x.

Examples:

BigMathR::EulerF.sech(1, 20)
#=> 0.64805427366388539957e0

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



369
370
371
372
373
# File 'ext/bigdecimal/math_r/euler_f.c', line 369

static VALUE
__impl_eulerf_sech(VALUE unused_obj, VALUE x, VALUE prec)
{
	return sech_branch(x, prec, sech_eulerf);
}

.sin(x, prec) ⇒ Complex

Computes sine of x.

Examples:

BigMathR::EulerF.sin(1, 20)
#=> 0.84147098480789650665e0

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



65
66
67
68
69
# File 'ext/bigdecimal/math_r/euler_f.c', line 65

static VALUE
__impl_eulerf_sin(VALUE unused_obj, VALUE x, VALUE prec)
{
	return sin_branch(x, prec, sin_eulerf);
}

.sinh(x, prec) ⇒ BigDecimal

Computes hyperbolic sine of x.

Examples:

BigMathR::EulerF.sinh(1, 20)
#=> 0.11752011936438014569e1

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



293
294
295
296
297
# File 'ext/bigdecimal/math_r/euler_f.c', line 293

static VALUE
__impl_eulerf_sinh(VALUE unused_obj, VALUE x, VALUE prec)
{
	return sinh_branch(x, prec, sinh_eulerf);
}

.tan(x, prec) ⇒ Complex

Computes tangent of x.

Examples:

BigMathR::EulerF.tan(1, 20)
#=> 0.15574077246549022305e1

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



103
104
105
106
107
# File 'ext/bigdecimal/math_r/euler_f.c', line 103

static VALUE
__impl_eulerf_tan(VALUE unused_obj, VALUE x, VALUE prec)
{
	return tan_branch(x, prec, tan_eulerf);
}

.tanh(x, prec) ⇒ BigDecimal

Computes hyperbolic tangent of x.

Examples:

BigMathR::EulerF.tanh(1, 20)
#=> 0.76159415595576488813e0

Parameters:

  • x (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

Raises:

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when x is not a numeric class.

Since:

  • 0.1.0



331
332
333
334
335
# File 'ext/bigdecimal/math_r/euler_f.c', line 331

static VALUE
__impl_eulerf_tanh(VALUE unused_obj, VALUE x, VALUE prec)
{
	return tanh_branch(x, prec, tanh_eulerf);
}