Révision 86
| pobysoPythonSage/src/sageSLZ/sageSLZ.sage (revision 86) | ||
|---|---|---|
| 47 | 47 |
#print "Current upper bound:", currentUpperBoundSa |
| 48 | 48 |
sollya_lib_clear_obj(currentRangeSo) |
| 49 | 49 |
sollya_lib_clear_obj(polySo) |
| 50 |
if currentUpperBoundSa <= currentLowerBoundSa: |
|
| 51 |
sollya_lib_clear_obj(absoluteErrorTypeSo) |
|
| 52 |
print "Can't find an interval." |
|
| 53 |
print "Use either or both a higher polynomial degree or a higher", |
|
| 54 |
print "internal precision." |
|
| 55 |
print "Aborting!" |
|
| 56 |
return (None, None, None, None) |
|
| 50 | 57 |
currentRangeSo = pobyso_bounds_to_range_sa_so(currentLowerBoundSa, |
| 51 | 58 |
currentUpperBoundSa) |
| 52 |
#print "New interval:", |
|
| 53 |
#pobyso_autoprint(currentRangeSo) |
|
| 59 |
# print "New interval:",
|
|
| 60 |
# pobyso_autoprint(currentRangeSo)
|
|
| 54 | 61 |
(polySo, intervalCenterSo, maxErrorSo) = \ |
| 55 | 62 |
pobyso_taylor_expansion_no_change_var_so_so(functionSo, degreeSo, |
| 56 | 63 |
currentRangeSo, |
| ... | ... | |
| 119 | 126 |
# Create a polynomial over the rationals. |
| 120 | 127 |
polynomialRing = QQ[str(polyOfFloat.variables()[0])] |
| 121 | 128 |
return(polynomialRing(polyOfFloat)) |
| 122 |
# End slz_float_poly_of_float_to_rat_poly_of_rat |
|
| 129 |
# End slz_float_poly_of_float_to_rat_poly_of_rat.
|
|
| 123 | 130 |
|
| 124 | 131 |
def slz_get_intervals_and_polynomials(functionSa, degreeSa, |
| 125 | 132 |
lowerBoundSa, |
| ... | ... | |
| 169 | 176 |
slz_compute_polynomial_and_interval(functionSo, degreeSo, |
| 170 | 177 |
scaledLowerBoundSa, scaledUpperBoundSa, |
| 171 | 178 |
approxPrecSa, internalSollyaPrecSa) |
| 179 |
if polySo is None: |
|
| 180 |
print "Aborting" |
|
| 181 |
return None |
|
| 172 | 182 |
# Change variable stuff |
| 173 | 183 |
changeVarExpressionSo = sollya_lib_build_function_sub( |
| 174 | 184 |
sollya_lib_build_function_free_variable(), |
Formats disponibles : Unified diff