Changeset 17155
- Timestamp:
- 07/23/19 20:15:32 (5 years ago)
- Location:
- stable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 17125
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/DerivativeCalculator.cs
r17103 r17155 179 179 var u = (ISymbolicExpressionTreeNode)branch.GetSubtree(0).Clone(); 180 180 return Div(fxp, Square(Cosine(u))); 181 } 182 if (branch.Symbol is HyperbolicTangent) { 183 // tanh(f(x))' = f(x)'sech²(f(x)) = f(x)'(1 - tanh²(f(x))) 184 var fxp = Derive(branch.GetSubtree(0), variableName); 185 var tanh = (ISymbolicExpressionTreeNode)branch.Clone(); 186 return Product(fxp, Subtract(CreateConstant(1.0), Square(tanh))); 181 187 } 182 188 throw new NotSupportedException(string.Format("Symbol {0} is not supported.", branch.Symbol)); -
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Tests merged: 17125
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/DeriveTest.cs
r17102 r17155 68 68 69 69 Assert.AreEqual("('a' * 'b' * 'c')", Derive("a*b*c*d", "d")); 70 Assert.AreEqual("('a' / ('b' * 'c' * SQR('d') * (-1)))", Derive("a/b/c/d", "d")); 70 Assert.AreEqual("('a' / ('b' * 'c' * SQR('d') * (-1)))", Derive("a/b/c/d", "d")); 71 72 Assert.AreEqual("('x' * ((SQR(TANH(SQR('x'))) * (-1)) + 1) * 2)", Derive("tanh(sqr(x))", "x")); // (2*'x'*(1 - SQR(TANH(SQR('x')))) 71 73 72 74 {
Note: See TracChangeset
for help on using the changeset viewer.