Exemple #1
0
 public static Fad Min(Fad lhs, Fad rhs)
 {
     return(new Fad(Math.Min(lhs.Value, rhs.Value), lhs.Value < rhs.Value ? lhs.Derivative : rhs.Derivative));
 }
Exemple #2
0
 public static Fad Tan(Fad x)
 {
     return(new Fad(Math.Tan(x.Value), 1.0 + Math.Tan(x.Value) * Math.Tan(x.Value)));
 }
Exemple #3
0
 public static Fad Sqrt(Fad x)
 {
     return(new Fad(Math.Sqrt(x.Value), 0.5 * x.Derivative / Math.Sqrt(x.Value)));
 }
Exemple #4
0
 public static Fad Log(Fad x)
 {
     return(new Fad(Math.Log(x.Value), x.Derivative / x.Value));
 }
Exemple #5
0
 public static Fad Cos(Fad x)
 {
     return(new Fad(Math.Cos(x.Value), Math.Sin(x.Value) * x.Derivative));
 }
Exemple #6
0
 public static Fad Exp(Fad x)
 {
     return(new Fad(Math.Exp(x.Value), Math.Exp(x.Value) * x.Derivative));
 }