jmath.universal package

Submodules

jmath.universal.hyperbolic module

Hyperbolic functions.

jmath.universal.hyperbolic.acosh(value)

Computes the inverse hyberbolic cosine of a value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to compute the inverse hyberbolic cosine of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.hyperbolic.asinh(value)

Computes the inverse hyberbolic sine of a value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to compute the inverse hyberbolic sine of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.hyperbolic.atanh(value)

Computes the inverse hyberbolic tangent of a value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to compute the inverse hyberbolic tangent of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.hyperbolic.cosh(value)

Computes the hyberbolic cosine of a value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to compute the hyberbolic cosine of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.hyperbolic.sinh(value)

Computes the hyberbolic sine of a value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to compute the hyberbolic sine of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.hyperbolic.tanh(value)

Computes the hyberbolic tangent of a value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to compute the hyberbolic tangent of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.logarithms module

Logarithmic Functions

jmath.universal.logarithms.ln(value)

Calculates the natural logarithm of a number.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The value to compute the natural logarithm of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.logarithms.log(value, base=2.718281828459045)

Calculates logarithm of a number.

Parameters
Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.logarithms.log10(value)

Calculates the log base 10 of a number.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to calculate the log base 10 of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.logarithms.log2(value)

Calculates the log base 2 of a number.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The number to calculate the log base 2 of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.natural module

Natural functions associated with Euler’s constant e.

Notes

log is from logarithms.py

jmath.universal.natural.exp(value)

Calculates the exponential (e^x) of a number.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – The value to calculate the exponential of.

Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.tools module

Provides tools for creating universal functions.

jmath.universal.tools.generic_function(func, input, *args, derivative=None)

Applies a function with generic cases for special objects.

Parameters
Return type

Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]

jmath.universal.trigonometry module

Trigonometric Functions

jmath.universal.trigonometry.acos(value)

Computes the inverse cosine of the value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – Value to compute the inverse cosine of.

Returns

Radians

Return type

Unit

jmath.universal.trigonometry.asin(value)

Computes the inverse sine of the value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – Value to compute the inverse sine of.

Returns

Radians

Return type

Unit

jmath.universal.trigonometry.atan(value)

Computes the inverse tangent of the value.

Parameters

value (Union[float, int, jmath.uncertainties.Uncertainty, jmath.units.units.Unit, jmath.autodiff.Variable, jmath.autodiff.Function]) – Value to compute the inverse tangent of.

Returns

Radians

Return type

Unit

jmath.universal.trigonometry.cos(value)

Computes the cosine of the value.

Parameters

value – Value (in radians) to compute the cosine of

jmath.universal.trigonometry.sin(value)

Computes the sine of the value.

Parameters

value – Value (in radians) to compute the sine of.

jmath.universal.trigonometry.tan(value)

Computes the tangent of the value.

Parameters

value – Value (in radians) to compute the tangent of

Module contents

Standard maths functions that are also compatible with jmath structures.