Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 8122)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 8123)
@@ -837,6 +837,5 @@
     public static double Psi(double x) {
       if (double.IsNaN(x)) return double.NaN;
-      else if (x.IsAlmost(0.0)) return double.NaN;
-      else if ((Math.Floor(x) - x).IsAlmost(0.0)) return double.NaN;
+      else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
       return alglib.psi(x);
     }
@@ -865,5 +864,5 @@
       double shi, chi;
       alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
-      return chi;
+      return shi;
     }
 
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 8122)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 8123)
@@ -198,5 +198,5 @@
       { typeof(Norm), OpCodes.Norm},
       { typeof(Erf), OpCodes.Erf},
-      { typeof(Bessel), OpCodes.Bessel}      
+      { typeof(Bessel), OpCodes.Bessel}
     };
 
@@ -370,6 +370,5 @@
             var x = Evaluate(dataset, ref row, state);
             if (double.IsNaN(x)) return double.NaN;
-            else if (x.IsAlmost(0.0)) return double.NaN;
-            else if ((Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
+            else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
             return alglib.psi(x);
           }
Index: trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs	(revision 8122)
+++ trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs	(revision 8123)
@@ -365,4 +365,73 @@
       Evaluate(interpreter, ds, "(lag -1.0 (* (lagVariable 1.0 a 1) (lagVariable 1.0 b 2)))", 1, ds.GetDoubleValue("A", 1) * ds.GetDoubleValue("B", 2));
       Evaluate(interpreter, ds, "(lag -2.0 3.0)", 1, 3.0);
+
+      {
+        // special functions
+        Action<double> checkAiry = (x) => {
+          double ai, aip, bi, bip;
+          alglib.airy(x, out ai, out aip, out bi, out bip);
+          Evaluate(interpreter, ds, "(airya " + x + ")", 0, ai);
+          Evaluate(interpreter, ds, "(airyb " + x + ")", 0, bi);
+        };
+
+        Action<double> checkBessel = (x) => {
+          Evaluate(interpreter, ds, "(bessel " + x + ")", 0, alglib.besseli0(x));
+        };
+
+        Action<double> checkSinCosIntegrals = (x) => {
+          double si, ci;
+          alglib.sinecosineintegrals(x, out si, out ci);
+          Evaluate(interpreter, ds, "(cosint " + x + ")", 0, ci);
+          Evaluate(interpreter, ds, "(sinint " + x + ")", 0, si);
+        };
+        Action<double> checkHypSinCosIntegrals = (x) => {
+          double shi, chi;
+          alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+          Evaluate(interpreter, ds, "(hypcosint " + x + ")", 0, chi);
+          Evaluate(interpreter, ds, "(hypsinint " + x + ")", 0, shi);
+        };
+        Action<double> checkFresnelSinCosIntegrals = (x) => {
+          double c = 0, s = 0;
+          alglib.fresnelintegral(x, ref c, ref s);
+          Evaluate(interpreter, ds, "(fresnelcosint " + x + ")", 0, c);
+          Evaluate(interpreter, ds, "(fresnelsinint " + x + ")", 0, s);
+        };
+        Action<double> checkNormErf = (x) => {
+          Evaluate(interpreter, ds, "(norm " + x + ")", 0, alglib.normaldistribution(x));
+          Evaluate(interpreter, ds, "(erf " + x + ")", 0, alglib.errorfunction(x));
+        };
+
+        Action<double> checkGamma = (x) => {
+          Evaluate(interpreter, ds, "(gamma " + x + ")", 0, alglib.gammafunction(x));
+        };
+        Action<double> checkPsi = (x) => {
+          try {
+            Evaluate(interpreter, ds, "(psi " + x + ")", 0, alglib.psi(x));
+          }
+          catch (alglib.alglibexception) { // ignore cases where alglib throws an exception
+          }
+        };
+        Action<double> checkDawson = (x) => {
+          Evaluate(interpreter, ds, "(dawson " + x + ")", 0, alglib.dawsonintegral(x));
+        };
+        Action<double> checkExpInt = (x) => {
+          Evaluate(interpreter, ds, "(expint " + x + ")", 0, alglib.exponentialintegralei(x));
+        };
+
+
+
+        foreach (var e in new[] { -2.0, -1.0, 0.0, 1.0, 2.0 }) {
+          checkAiry(e);
+          checkBessel(e);
+          checkSinCosIntegrals(e);
+          checkGamma(e);
+          checkExpInt(e);
+          checkDawson(e);
+          checkPsi(e);
+          checkNormErf(e);
+          checkFresnelSinCosIntegrals(e);
+          checkHypSinCosIntegrals(e);
+        }
+      }
     }
 
Index: trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionImporter.cs
===================================================================
--- trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionImporter.cs	(revision 8122)
+++ trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionImporter.cs	(revision 8123)
@@ -49,4 +49,19 @@
         {"COS", new Cosine()},
         {"TAN", new Tangent()},
+        {"AIRYA", new AiryA()},
+        {"AIRYB", new AiryB()},
+        {"BESSEL", new Bessel()},
+        {"COSINT", new CosineIntegral()},
+        {"SININT", new SineIntegral()},
+        {"HYPCOSINT", new HyperbolicCosineIntegral()},
+        {"HYPSININT", new HyperbolicSineIntegral()},
+        {"FRESNELSININT", new FresnelSineIntegral()},
+        {"FRESNELCOSINT", new FresnelCosineIntegral()},
+        {"NORM", new Norm()},
+        {"ERF", new Erf()},
+        {"GAMMA", new Gamma()},
+        {"PSI", new Psi()},
+        {"DAWSON", new Dawson()},
+        {"EXPINT", new ExponentialIntegralEi()},
         {"MEAN", new Average()},
         {"IF", new IfThenElse()},
