Module: BigMathR::Solver

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

Overview

A module that provides a solver for mathematical functions. It is used internally.

Class Method Summary collapse

Class Method Details

.exp(func, z, prec) ⇒ BigDecimal, Complex

This is a public API for exponential solver.

Parameters:

  • func (Symbol)

    The name of the target function. [:exp, :exp2]

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

  • (Complex)

    Complex solution

Raises:

  • (ArgumentError)

    Target function name no match found.

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.



178
179
180
181
182
# File 'ext/bigdecimal/math_r/solver.c', line 178

static VALUE
__impl_solver_exp(VALUE unused_obj, VALUE func, VALUE z, VALUE prec)
{
  return solver_exp(SYM2ID(func), z, prec);
}

.hyperb(func, z, prec) ⇒ BigDecimal, Complex

This is a public API for hyperbolic solver.

Parameters:

  • func (Symbol)

    The name of the target function. [:sinh, :cosh, :tanh, :csch, :sech, :coth]

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

  • (Complex)

    Complex solution

Raises:

  • (ArgumentError)

    Target function name no match found.

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.



730
731
732
733
734
# File 'ext/bigdecimal/math_r/solver.c', line 730

static VALUE
__impl_solver_hyperb(VALUE unused_obj, VALUE func, VALUE z, VALUE prec)
{
  return solver_hyperb(SYM2ID(func), z, prec);
}

.hyperbinv(func, z, prec) ⇒ BigDecimal, Complex

This is a public API for inverse hyperbolic solver.

Parameters:

  • func (Symbol)

    The name of the target function. [:asinh, :acosh, :atanh, :acsch, :asech, :acoth]

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

  • (Complex)

    Complex solution

Raises:

  • (ArgumentError)

    Target function name no match found.

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.



1208
1209
1210
1211
1212
# File 'ext/bigdecimal/math_r/solver.c', line 1208

static VALUE
__impl_solver_hyperbinv(VALUE unused_obj, VALUE func, VALUE z, VALUE prec)
{
  return solver_hyperbinv(SYM2ID(func), z, prec);
}

.log(func, z, prec) ⇒ BigDecimal, Complex

This is a public API for logarithmic solver.

Parameters:

  • func (Symbol)

    The name of the target function. [:log, :log1p, :log2, :log10]

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

  • (Complex)

    Complex solution

Raises:

  • (ArgumentError)

    Target function name no match found.

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.



280
281
282
283
284
# File 'ext/bigdecimal/math_r/solver.c', line 280

static VALUE
__impl_solver_log(VALUE unused_obj, VALUE func, VALUE z, VALUE prec)
{
  return solver_log(SYM2ID(func), z, prec);
}

.trig(func, z, prec) ⇒ BigDecimal, Complex

This is a public API for trigonometric solver.

Parameters:

  • func (Symbol)

    The name of the target function. [:sin, :cos, :tan, :csc, :sec, :cot]

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

  • (Complex)

    Complex solution

Raises:

  • (ArgumentError)

    Target function name no match found.

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.



513
514
515
516
517
# File 'ext/bigdecimal/math_r/solver.c', line 513

static VALUE
__impl_solver_trig(VALUE unused_obj, VALUE func, VALUE z, VALUE prec)
{
  return solver_trig(SYM2ID(func), z, prec);
}

.triginv(func, z, prec) ⇒ BigDecimal, Complex

This is a public API for inverse trigonometric solver.

Parameters:

  • func (Symbol)

    The name of the target function. [:asin, :acos, :atan, :acsc, :asec, :acot]

  • z (Numeric)

    Numerical argument

  • prec (Integer)

    Arbitrary precision

Returns:

  • (BigDecimal)

    Real solution

  • (Complex)

    Complex solution

Raises:

  • (ArgumentError)

    Target function name no match found.

  • (ArgumentError)

    Occurs when prec is not a positive integer.

  • (TypeError)

    Occurs when z is not a numeric class.



941
942
943
944
945
# File 'ext/bigdecimal/math_r/solver.c', line 941

static VALUE
__impl_solver_triginv(VALUE unused_obj, VALUE func, VALUE z, VALUE prec)
{
  return solver_triginv(SYM2ID(func), z, prec);
}