Hyperbolic Equation

hyperbolic_equation(first_constant, second_constant, precision=4)

Generates a hyperbolic function to provide evaluations at variable inputs

Parameters
  • first_constant (int or float) – Coefficient of the reciprocal variable of the resultant hyperbolic function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001)

  • second_constant (int or float) – Coefficient of the constant term of the resultant hyperbolic function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001)

  • precision (int, default=4) – Maximum number of digits that can appear after the decimal place of the resultant roots

Raises
  • TypeError – First two arguments must be integers or floats

  • ValueError – Last argument must be a positive integer

Returns

evaluation – Function for evaluating a hyperbolic equation when passed any integer or float argument; if zero inputted as argument, it will be converted to a small, non-zero decimal value (e.g., 0.0001)

Return type

func

Notes

  • Standard form of a hyperbolic function: \(f(x) = a\cdot{\frac{1}{x}} + b\)

  • Rational Functions

Examples

Import hyperbolic_equation function from regressions library
>>> from regressions.analyses.equations.hyperbolic import hyperbolic_equation
Create a hyperbolic function with coefficients 2 and 3, then evaluate it at 10
>>> evaluation_first = hyperbolic_equation(2, 3)
>>> print(evaluation_first(10))
3.2
Create a hyperbolic function with coefficients -2 and 3, then evaluate it at 10
>>> evaluation_second = hyperbolic_equation(-2, 3)
>>> print(evaluation_second(10))
2.8
Create a hyperbolic function with all inputs set to 0, then evaluate it at 10
>>> evaluation_zero = hyperbolic_equation(0, 0)
>>> print(evaluation_zero(10))
0.0001