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 GeneralFunctionclassForm()Returns this representation of factorial in the form of a composition of other raw classesdoubleevaluate(Map<String,Double> variableValues)Evaluates aGeneralFunctionat a point denoted by aMapGeneralFunctiongetDerivative(String varID)Returns the derivative of aGeneralFunctionwith respect to a variable.UnitaryFunctiongetInstance(GeneralFunction function)Returns a new instance of thisUnitaryFunctionlongoperate(int input)Performs the operation of this functionMethods inherited from class UnitaryFunction
clone, compareSelf, equalsFunction, hashCode, iterator, newInstanceOf, simplify, simplifyFOC, simplifyInternal, simplifyInverse, substituteAll, toOutputFunctionMethods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Constructor Details
-
Method Details
-
classForm
Description copied from class:FactorialReturns this representation of factorial in the form of a composition of other raw classes -
getInstance
Description copied from class:UnitaryFunctionReturns a new instance of thisUnitaryFunction- Specified by:
getInstancein classUnitaryFunction- Parameters:
function- theGeneralFunctionto be operated on- Returns:
- a new instance of this
UnitaryFunction
-
getDerivative
Description copied from interface:DifferentiableReturns the derivative of aGeneralFunctionwith respect to a variable. Should not be used in general;GeneralFunction.getSimplifiedDerivative(java.lang.String)is strongly preferred.- Specified by:
getDerivativein interfaceDifferentiable- Overrides:
getDerivativein 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:EvaluableEvaluates aGeneralFunctionat a point denoted by aMap- Specified by:
evaluatein interfaceEvaluable- Overrides:
evaluatein classIntegerUnitaryFunction- Parameters:
variableValues- the values of the variables in theGeneralFunctionat the point- Returns:
- the value of the
GeneralFunctionat the point
-
operate
public long operate(int input)Description copied from class:IntegerUnitaryFunctionPerforms the operation of this function- Specified by:
operatein classIntegerUnitaryFunction- Parameters:
input- the value to be operated on- Returns:
- the result of the operation
-