Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/26/12 14:17:10 (12 years ago)
Author:
gkronber
Message:

#1810 added a unit test to check the evaluation of newly added special functions and fixed a bugs in the interpreters.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r7708 r8123  
    837837    public static double Psi(double x) {
    838838      if (double.IsNaN(x)) return double.NaN;
    839       else if (x.IsAlmost(0.0)) return double.NaN;
    840       else if ((Math.Floor(x) - x).IsAlmost(0.0)) return double.NaN;
     839      else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
    841840      return alglib.psi(x);
    842841    }
     
    865864      double shi, chi;
    866865      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
    867       return chi;
     866      return shi;
    868867    }
    869868
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r7708 r8123  
    198198      { typeof(Norm), OpCodes.Norm},
    199199      { typeof(Erf), OpCodes.Erf},
    200       { typeof(Bessel), OpCodes.Bessel}     
     200      { typeof(Bessel), OpCodes.Bessel}
    201201    };
    202202
     
    370370            var x = Evaluate(dataset, ref row, state);
    371371            if (double.IsNaN(x)) return double.NaN;
    372             else if (x.IsAlmost(0.0)) return double.NaN;
    373             else if ((Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
     372            else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
    374373            return alglib.psi(x);
    375374          }
Note: See TracChangeset for help on using the changeset viewer.