Package functions.unitary.integer.combo
Class SFactorial
Object
- All Implemented Interfaces:
Differentiable
,Evaluable
,Outputable
,Simplifiable
,Comparable<GeneralFunction>
,Iterable<GeneralFunction>
public class SFactorial extends Factorial
Stirling's Approximation for factorials asymptotically approaches
n!
, but it has a delta greater than one for x>=5
.
It is useful for performance (but not accuracy) of large number inputs, and for approximations of the gamma function especially on [1, 4]
.-
Field Summary
-
Constructor Summary
Constructors Constructor Description SFactorial(GeneralFunction operand)
-
Method Summary
Modifier and Type Method Description GeneralFunction
classForm()
Returns this representation of factorial in the form of a composition of other raw classesdouble
evaluate(Map<String,Double> variableValues)
Evaluates aGeneralFunction
at a point denoted by aMap
GeneralFunction
getDerivative(String varID)
Returns the derivative of aGeneralFunction
with respect to a variable.UnitaryFunction
getInstance(GeneralFunction function)
Returns a new instance of thisUnitaryFunction
long
operate(int input)
Performs the operation of this functionMethods inherited from class UnitaryFunction
clone, compareSelf, equalsFunction, hashCode, iterator, newInstanceOf, simplify, simplifyFOC, simplifyInternal, simplifyInverse, substituteAll, toOutputFunction
Methods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Constructor Details
-
Method Details
-
classForm
Description copied from class:Factorial
Returns this representation of factorial in the form of a composition of other raw classes -
getInstance
Description copied from class:UnitaryFunction
Returns a new instance of thisUnitaryFunction
- Specified by:
getInstance
in classUnitaryFunction
- Parameters:
function
- theGeneralFunction
to be operated on- Returns:
- a new instance of this
UnitaryFunction
-
getDerivative
Description copied from interface:Differentiable
Returns the derivative of aGeneralFunction
with respect to a variable. Should not be used in general;GeneralFunction.getSimplifiedDerivative(java.lang.String)
is strongly preferred.- Specified by:
getDerivative
in interfaceDifferentiable
- Overrides:
getDerivative
in classIntegerUnitaryFunction
- Parameters:
varID
- the ID of the variable that is differentiated against- Returns:
- the derivative of the function with respect to
varID
-
evaluate
public double evaluate(Map<String,Double> variableValues)Description copied from interface:Evaluable
Evaluates aGeneralFunction
at a point denoted by aMap
- Specified by:
evaluate
in interfaceEvaluable
- Overrides:
evaluate
in classIntegerUnitaryFunction
- Parameters:
variableValues
- the values of the variables in theGeneralFunction
at the point- Returns:
- the value of the
GeneralFunction
at the point
-
operate
public long operate(int input)Description copied from class:IntegerUnitaryFunction
Performs the operation of this function- Specified by:
operate
in classIntegerUnitaryFunction
- Parameters:
input
- the value to be operated on- Returns:
- the result of the operation
-