@Override public Tensor toTensor() { if (content.length != 1) throw new IllegalArgumentException("Wrong scalar function node."); Tensor arg = content[0].toTensor(); switch (function.toLowerCase()) { case "sin": return Tensors.sin(arg); case "cos": return Tensors.cos(arg); case "tan": return Tensors.tan(arg); case "cot": return Tensors.cot(arg); case "arcsin": return Tensors.arcsin(arg); case "arccos": return Tensors.arccos(arg); case "arctan": return Tensors.arctan(arg); case "arccot": return Tensors.arccot(arg); case "log": return Tensors.log(arg); case "exp": return Tensors.exp(arg); } throw new IllegalStateException("Unknown scalar function \"" + function + "\"."); }
differentiate1(tensor.get(0), rule, transformations)), multiplyAndRenameConflictingDummies(tensor, log(tensor.get(0)), differentiateWithRenaming(tensor.get(1), rule, transformations))); temp = applyTransformations(temp, transformations);