- Timestamp:
- 07/07/19 23:47:53 (5 years ago)
- Location:
- stable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 16629,16631,16646,16740,16743,16757-16758,16769,16822
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis merged: 16631,16646,16757-16758
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis/3.4 merged: 16631,16646,16757-16758
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
r17097 r17100 124 124 125 125 double min = Math.Min(Math.Min(v1, v2), Math.Min(v3, v4)); 126 double max = Math.Max(Math.M in(v1, v2), Math.Max(v3, v4));126 double max = Math.Max(Math.Max(v1, v2), Math.Max(v3, v4)); 127 127 return new Interval(min, max); 128 128 } … … 167 167 } 168 168 public static Interval Cosine(Interval a) { 169 return Interval.Sine(Interval. Subtract(a, new Interval(Math.PI / 2, Math.PI / 2)));169 return Interval.Sine(Interval.Add(a, new Interval(Math.PI / 2, Math.PI / 2))); 170 170 } 171 171 public static Interval Tangens(Interval a) { 172 172 return Interval.Divide(Interval.Sine(a), Interval.Cosine(a)); 173 } 174 public static Interval HyperbolicTangent(Interval a) { 175 return new Interval(Math.Tanh(a.LowerBound), Math.Tanh(a.UpperBound)); 173 176 } 174 177 … … 201 204 202 205 public static Interval Square(Interval a) { 203 return Power(a, new Interval(2, 2)); 204 } 205 206 public static Interval Cubic(Interval a) { 207 return Power(a, new Interval(3, 3)); 206 if (a.UpperBound <= 0) return new Interval(a.UpperBound * a.UpperBound, a.LowerBound * a.LowerBound); // interval is negative 207 else if (a.LowerBound >= 0) return new Interval(a.LowerBound * a.LowerBound, a.UpperBound * a.UpperBound); // interval is positive 208 else return new Interval(0, Math.Max(a.LowerBound*a.LowerBound, a.UpperBound*a.UpperBound)); // interval goes over zero 209 } 210 211 public static Interval Cube(Interval a) { 212 return new Interval(Math.Pow(a.LowerBound, 3), Math.Pow(a.UpperBound, 3)); 208 213 } 209 214 … … 216 221 217 222 public static Interval SquareRoot(Interval a) { 218 return Root(a, new Interval(2, 2)); 223 if (a.LowerBound < 0) return new Interval(double.NaN, double.NaN); 224 return new Interval(Math.Sqrt(a.LowerBound), Math.Sqrt(a.UpperBound)); 219 225 } 220 226 221 227 public static Interval CubicRoot(Interval a) { 222 return Root(a, new Interval(3, 3)); 228 if (a.LowerBound < 0) return new Interval(double.NaN, double.NaN); 229 return new Interval(Math.Pow(a.LowerBound, 1.0/3), Math.Pow(a.UpperBound, 1.0/3)); 223 230 } 224 231 #endregion
Note: See TracChangeset
for help on using the changeset viewer.