Révision 254 pobysoPythonSage/src/sageSLZ/sageSLZ.sage
sageSLZ.sage (revision 254) | ||
---|---|---|
1523 | 1523 |
if debug: |
1524 | 1524 |
print 'ff:', ff, "- Domain:", scaledLowerBoundSa, \ |
1525 | 1525 |
scaledUpperBoundSa |
1526 |
## If both bounds are negative, swap them. |
|
1527 |
if lowerBoundSa < 0 and upperBoundSa < 0: |
|
1528 |
scaledLowerBoundSa, scaledUpperBoundSa = \ |
|
1529 |
scaledUpperBoundSa,scaledLowerBoundSa |
|
1526 | 1530 |
# |
1527 | 1531 |
# Scalling the image -> [1,2[. |
1528 | 1532 |
flbSa = ff(scaledLowerBoundSa).n(prec=floatingPointPrecSa) |
... | ... | |
1591 | 1595 |
else: |
1592 | 1596 |
lb = lb + newIntervalWidth |
1593 | 1597 |
lbBinade = slz_compute_binade(lb) |
1598 |
#print "sfbfb: lower bound:", lb.str(truncate=False) |
|
1599 |
#print "sfbfb: upper bound:", ub.str(truncate=False) |
|
1600 |
## At this point, both bounds belond to the same binade. |
|
1594 | 1601 |
## Image binade. |
1595 | 1602 |
if lb == ub: |
1596 | 1603 |
return (lb, ub) |
1597 | 1604 |
lbImg = func(lb) |
1598 | 1605 |
ubImg = func(ub) |
1599 |
funcIsInc = (ubImg >= lbImg)
|
|
1606 |
funcIsInc = ((ubImg - lbImg) >= 0)
|
|
1600 | 1607 |
lbImgBinade = slz_compute_binade(lbImg) |
1601 | 1608 |
ubImgBinade = slz_compute_binade(ubImg) |
1602 | 1609 |
while lbImgBinade != ubImgBinade: |
Formats disponibles : Unified diff