Exponential Roots¶
- exponential_roots(first_constant, second_constant, precision=4)¶
Calculates the roots of an exponential function
- Parameters
first_constant (int or float) – Constant multiple of the original exponential function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001)
second_constant (int or float) – Base rate of variable of the original exponential 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
roots – List of the x-coordinates of all of the x-intercepts of the original function; if the function never crosses the x-axis, then it will return a list of None
- Return type
list of float
See also
exponential_equation(),exponential_derivatives(),exponential_integral(),exponential_model()Notes
Standard form of a exponential function: \(f(x) = a\cdot{b^x}\)
Exponential formula: \(x = \varnothing\)
Examples
- Import exponential_roots function from regressions library
>>> from regressions.analyses.roots.exponential import exponential_roots
- Calculate the roots of an exponential function with coefficients 2 and 3
>>> roots_first = exponential_roots(2, 3) >>> print(roots_first) [None]
- Calculate the roots of an exponential function with coefficients -2 and 3
>>> roots_second = exponential_roots(-2, 3) >>> print(roots_second) [None]
- Calculate the roots of an exponential function with all inputs set to 0
>>> roots_zeroes = exponential_roots(0, 0) >>> print(roots_zeroes) [None]