예제 #1
0
 public override Term AggregateConstants()
 {
     Arg = Arg.AggregateConstants();
     Mid = Mid.AggregateConstants();
     if (Arg is Constant && Mid is Constant)
     {
         double e = Math.Exp(Steepness * (-(Arg as Constant).Value + (Mid as Constant).Value));
         if (Double.IsPositiveInfinity(e))
         {
             return(Term.Epsilon);
             //Console.WriteLine("FUCKUP {0}",e);
         }
         else
         {
             e = 1.0 / (1.0 + e);
         }
         if (e < Term.Epsilon)
         {
             return(Term.Epsilon);
         }
         else
         {
             return(e);
         }
     }
     else
     {
         return(this);
     }
 }