public override double Compute(IReadOnlyDictionary <string, double> variableValues) { double arg = Arg1.Compute(variableValues); double Radian = arg * Math.PI / 180; return(1 / Math.Tan(Radian)); }
public override Expr Diff() { if (!IsConstant) { if (Arg1.IsConstant) { if (Arg1.Compute() == E) { return(new FunPow(Arg1, Arg2)); } else { return(Pow(Arg1, Arg2) * Log(Arg1)); } } else if (Arg2.IsConstant) { return(Arg2 * Pow(Arg1, Arg2 - 1)); } throw new NotImplementedException(); } else { return(new Constant(0)); } }
public override double Compute(IReadOnlyDictionary <string, double> variableValues) => Arg1.Compute(variableValues) - Arg2.Compute(variableValues);
public override double Compute(IReadOnlyDictionary <string, double> variableValues) => 1 / Math.Tanh(Arg1.Compute(variableValues));
public override double Compute(IReadOnlyDictionary <string, double> variableValues) => (Math.PI / 2 - Math.Atan(Arg1.Compute(variableValues))) * 180 / Math.PI;
public override double Compute(IReadOnlyDictionary <string, double> variableValues) { return(Arg2 == null?Math.Log(Arg1.Compute(variableValues)) : Math.Log(Arg1.Compute(variableValues), Arg2.Compute(variableValues))); }
public override double Compute(IReadOnlyDictionary <string, double> variableValues) => Math.Pow(Arg1.Compute(variableValues), Arg2.Compute(variableValues));