Index: pobysoPythonSage/src/pobyso.py
===================================================================
--- pobysoPythonSage/src/pobyso.py	(revision 165)
+++ pobysoPythonSage/src/pobyso.py	(revision 166)
@@ -788,7 +788,7 @@
     if not weightSa is None:
         weightAsStringSa = weightSa._assume_str().replace('_SAGE_VAR_', '')
         weightSo = pobyso_parse_string_sa_so(weightAsStringSa)
-        if pobyso_is_error(weightSo):
+        if pobyso_is_error_so_sa(weightSo):
             sollya_lib_clear_obj(functionSo)
             sollya_lib_clear_obj(rangeSo)
             sollya_lib_clear_obj(approxErrorSo)   
@@ -834,7 +834,7 @@
     if neededPrecisionSa > currentPrecSa:
         currentPrecSo = pobyso_get_prec_so()
         pobyso_set_prec_sa_so(neededPrecisionSa)
-    print "Guessing degree..."
+    #print "Guessing degree..."
     # weightSo and degreeBoundsSo are optional arguments.
     # As declared, sollya_lib_guessdegree must take 5 arguments.
     if weightSo is None:
@@ -846,7 +846,7 @@
     else:
         degreeRangeSo =  sollya_lib_guessdegree(functionSo, rangeSo, errorSo, \
                                                 weightSo, degreeBoundSo, None)
-    print "Degree guess done."
+    #print "...degree guess done."
     # Restore internal precision, if applicable.
     if neededPrecisionSa > currentPrecSa:
         pobyso_set_prec_so_so(currentPrecSo)
Index: pobysoPythonSage/src/sageSLZ/sageSLZ.sage
===================================================================
--- pobysoPythonSage/src/sageSLZ/sageSLZ.sage	(revision 165)
+++ pobysoPythonSage/src/sageSLZ/sageSLZ.sage	(revision 166)
@@ -476,8 +476,11 @@
       output polynomial ; this error <= approxPrecSaS.
     
     """
+    ## Superficial argument check.
+    if lowerBoundSa > upperBoundSa:
+        return None
     RRR = lowerBoundSa.parent()
-    intervalShrinkConstFactorSa = RRR('0.5')
+    intervalShrinkConstFactorSa = RRR('0.8')
     absoluteErrorTypeSo = pobyso_absolute_so_so()
     currentRangeSo = pobyso_bounds_to_range_sa_so(lowerBoundSa, upperBoundSa)
     currentUpperBoundSa = upperBoundSa
@@ -491,7 +494,7 @@
                                                     absoluteErrorTypeSo)
     maxErrorSa = pobyso_get_constant_as_rn_with_rf_so_sa(maxErrorSo)
     while maxErrorSa > approxPrecSa:
-        #print "++Approximation error:", maxErrorSa
+        print "++Approximation error:", maxErrorSa
         sollya_lib_clear_obj(polySo)
         sollya_lib_clear_obj(intervalCenterSo)
         sollya_lib_clear_obj(maxErrorSo)
@@ -691,7 +694,7 @@
     # Scalling the domain -> [1,2[.
     boundsIntervalRifSa = RealIntervalField(floatingPointPrecSa)
     domainBoundsIntervalSa = boundsIntervalRifSa(lowerBoundSa, upperBoundSa)
-    (domainScalingExpressionSa, invDomainScalingExpressionSa) = \
+    (invDomainScalingExpressionSa, domainScalingExpressionSa) = \
         slz_interval_scaling_expression(domainBoundsIntervalSa, x)
     if debug:
         print "domainScalingExpression for argument :", \
@@ -718,7 +721,7 @@
     if debug:
         print 'ff:', ff, '- Image:', flbSa, fubSa, imageBinadeBottomSa
     imageBoundsIntervalSa = boundsIntervalRifSa(flbSa, fubSa)
-    (imageScalingExpressionSa, invImageScalingExpressionSa) = \
+    (invImageScalingExpressionSa,imageScalingExpressionSa) = \
         slz_interval_scaling_expression(imageBoundsIntervalSa, x)
     if debug:
         print "imageScalingExpression for argument :", \
@@ -779,7 +782,12 @@
                                             lowerBoundSa,                     \
                                             upperBoundSa,                     \
                                             floatingPointPrecSa)
-    #
+    # In case bounds were in the negative real one may need to
+    # switch scaled bounds.
+    if scaledLowerBoundSa > scaledUpperBoundSa:
+        scaledLowerBoundSa, scaledUpperBoundSa = \
+            scaledUpperBoundSa, scaledLowerBoundSa
+        #print "Switching!"
     print "Approximation precision: ", RR(approxPrecSa)
     # Prepare the arguments for the Taylor expansion computation with Sollya.
     functionSo = \
@@ -788,10 +796,12 @@
     scaledBoundsSo = pobyso_bounds_to_range_sa_so(scaledLowerBoundSa, 
                                                   scaledUpperBoundSa)
     # Compute the first Taylor expansion.
+    print "Computing first Taylor expansion..."
     (polySo, boundsSo, intervalCenterSo, maxErrorSo) = \
         slz_compute_polynomial_and_interval(functionSo, degreeSo,
                                         scaledLowerBoundSa, scaledUpperBoundSa,
                                         approxPrecSa, internalSollyaPrecSa)
+    print "...done."
     if polySo is None:
         print "slz_get_intervals_and_polynomials: Aborting and returning None!"
         if precChangedSa:
@@ -805,7 +815,7 @@
                                               upperBoundSa.parent().precision()))
     boundsSa = pobyso_range_to_interval_so_sa(boundsSo, realIntervalField)
     errorSa = pobyso_get_constant_as_rn_with_rf_so_sa(maxErrorSo)
-    print "First approximation error:", errorSa.n(digits=50)
+    print "First approximation error:", errorSa.n(digits=10)
     # If the error and interval are OK a the first try, just return.
     if boundsSa.endpoints()[1] >= scaledUpperBoundSa:
         # Change variable stuff in Sollya x -> x0-x.
@@ -905,7 +915,7 @@
 def slz_interval_scaling_expression(boundsInterval, expVar):
     """
     Compute the scaling expression to map an interval that spans at most
-    a single binade to [1, 2) and the inverse expression as well.
+    a single binade into [1, 2) and the inverse expression as well.
     If the interval spans more than one binade, result is wrong since
     scaling is only based on the lower bound.
     Not very sure that the transformation makes sense for negative numbers.
@@ -981,7 +991,7 @@
     if boundsInterval.endpoints()[0] > 0:
         return((2^(-lbBinade) * expVar),(2^(lbBinade) * expVar))
     else:
-        return((-(2^(-lbBinade+1)) * expVar),(-(2^(lbBinade-1)) * expVar))
+        return((-(2^(-ubBinade)) * expVar),(-(2^(ubBinade)) * expVar))
 """
     # Code sent to attic. Should be the base for a 
     # "slz_interval_translate_expression" rather than scale.
Index: pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage
===================================================================
--- pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage	(revision 165)
+++ pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage	(revision 166)
@@ -1,4 +1,5 @@
-load(str('/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageMatrixOperations.sage'))
+load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageMatrixOperations.sage")
+#load(str('/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageMatrixOperations.sage'))
 print "sagePolynomialOperations loading..."
 def spo_add_polynomial_coeffs_to_matrix_row(poly, 
                                             knownMonomials, 
Index: pobysoPythonSage/src/testPobyso.sage
===================================================================
--- pobysoPythonSage/src/testPobyso.sage	(revision 165)
+++ pobysoPythonSage/src/testPobyso.sage	(revision 166)
@@ -292,17 +292,18 @@
                                                intervalCenterSo, 
                                                errorTypeSo)
         sollya_lib_clear_obj(taylorformSo)
+
     wrapped = test_pobyso_wrapper(test, 
                                   functionSo, 
                                   degreeSo, 
                                   intervalCenterSo, 
                                   errorTypeSo)
     timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
-    sollya_lib_clear_obj(functionSo,None)
-    sollya_lib_clear_obj(degreeSo,None)
-    sollya_lib_clear_obj(rangeSo,None)
-    sollya_lib_clear_obj(intervalCenterSo,None)
-    sollya_lib_clear_obj(errorTypeSo,None)
+    sollya_lib_clear_obj(functionSo, None)
+    sollya_lib_clear_obj(degreeSo, None)
+    sollya_lib_clear_obj(rangeSo, None)
+    sollya_lib_clear_obj(intervalCenterSo, None)
+    sollya_lib_clear_obj(errorTypeSo, None)
     return timing
 # End   test_pobyso_taylor_so_so_2
  
