Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 2740)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 2741)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-16 23:04:17 $
+ *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -99,4 +99,12 @@
             #NAME1, #NAME2); \
     return(RVAL); \
+}
+
+#define PS_FLOAT_CHECK_RANGE(NAME, LOWER, UPPER, RVAL) \
+if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
+    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
+            "Error: %s, %f, is out of range.  Must be between %f and %f.", \
+            #NAME, NAME, LOWER, UPPER); \
+    return RVAL; \
 }
 
Index: /trunk/psLib/src/dataManip/psFunctions.c
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.c	(revision 2740)
+++ /trunk/psLib/src/dataManip/psFunctions.c	(revision 2741)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-15 23:35:34 $
+ *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -306,6 +306,9 @@
 // XXX: You can do this without having to psAlloc() vector d.
 // XXX: How does the mask vector effect Crenshaw's formula?
+// XXX: We assume that x is scaled between -1.0 and 1.0;
 static float chebPolynomial1DEval(float x, const psPolynomial1D* myPoly)
 {
+    //    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
+    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
     psVector *d;
     psS32 n;
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 2740)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 2741)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-16 23:04:17 $
+ *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1049,4 +1049,7 @@
         PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         PS_VECTOR_CONVERT_F32_TO_F64_STATIC(x, x64, x64Static);
+        if (myPoly->type == PS_POLYNOMIAL_CHEB) {
+            p_psNormalizeVectorRangeF64(x64, -1.0, 1.0);
+        }
     }
     PS_VECTOR_CHECK_SIZE_EQUAL(x64, y64, NULL);
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 2740)
+++ /trunk/psLib/src/math/psConstants.h	(revision 2741)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-16 23:04:17 $
+ *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -99,4 +99,12 @@
             #NAME1, #NAME2); \
     return(RVAL); \
+}
+
+#define PS_FLOAT_CHECK_RANGE(NAME, LOWER, UPPER, RVAL) \
+if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
+    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
+            "Error: %s, %f, is out of range.  Must be between %f and %f.", \
+            #NAME, NAME, LOWER, UPPER); \
+    return RVAL; \
 }
 
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 2740)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 2741)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-16 23:04:17 $
+ *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1049,4 +1049,7 @@
         PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         PS_VECTOR_CONVERT_F32_TO_F64_STATIC(x, x64, x64Static);
+        if (myPoly->type == PS_POLYNOMIAL_CHEB) {
+            p_psNormalizeVectorRangeF64(x64, -1.0, 1.0);
+        }
     }
     PS_VECTOR_CHECK_SIZE_EQUAL(x64, y64, NULL);
Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 2740)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 2741)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-15 23:35:34 $
+ *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -306,6 +306,9 @@
 // XXX: You can do this without having to psAlloc() vector d.
 // XXX: How does the mask vector effect Crenshaw's formula?
+// XXX: We assume that x is scaled between -1.0 and 1.0;
 static float chebPolynomial1DEval(float x, const psPolynomial1D* myPoly)
 {
+    //    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
+    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
     psVector *d;
     psS32 n;
Index: /trunk/psLib/src/math/psSpline.c
===================================================================
--- /trunk/psLib/src/math/psSpline.c	(revision 2740)
+++ /trunk/psLib/src/math/psSpline.c	(revision 2741)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-15 23:35:34 $
+ *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-17 00:18:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -306,6 +306,9 @@
 // XXX: You can do this without having to psAlloc() vector d.
 // XXX: How does the mask vector effect Crenshaw's formula?
+// XXX: We assume that x is scaled between -1.0 and 1.0;
 static float chebPolynomial1DEval(float x, const psPolynomial1D* myPoly)
 {
+    //    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
+    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
     psVector *d;
     psS32 n;
