MCPcopy Create free account
hub / github.com/Aghajari/MathParser / derivative

Method derivative

MathParser/src/com/aghajari/math/Functions.java:222–231  ·  view source on GitHub ↗
(MathParser parser, String variableName, String exp, double x)

Source from the content-addressed store, hash-verified

220 }
221
222 public static double derivative(MathParser parser, String variableName, String exp, double x) throws MathParserException {
223 if (!Utils.isIdentifier(variableName))
224 throw new MathInvalidParameterException("derivative(): invalid variable name (" + variableName + ")");
225
226 MathParser newParser = parser.clone();
227 newParser.setRoundEnabled(false);
228 newParser.addVariable(variableName, 0, 0);
229 MathParser.MathVariable variable = newParser.getVariable(variableName);
230 return Derivative.getDerivative(new FunctionWrapper(newParser, exp, variable), x);
231 }
232
233 public static double intg(MathParser parser, String variableName, String exp, double lowerLimit, double upperLimit) throws MathParserException {
234 return integral(parser, variableName, exp, lowerLimit, upperLimit, 20);

Callers

nothing calls this directly

Calls 6

isIdentifierMethod · 0.95
setRoundEnabledMethod · 0.95
addVariableMethod · 0.95
getVariableMethod · 0.95
getDerivativeMethod · 0.95
cloneMethod · 0.80

Tested by

no test coverage detected