diff --git a/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/Polynomial.java b/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/Polynomial.java index 7e00dd83a9..ea8db7c3ff 100644 --- a/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/Polynomial.java +++ b/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/Polynomial.java @@ -195,7 +195,7 @@ private Expiry findExpiryNearRoot(Predicate expires) { // Do a binary search to find the exact transition time while (end.longerThan(start.plus(EPSILON))) { - Duration midpoint = start.plus(end).dividedBy(2); + Duration midpoint = start.plus(end.minus(start).dividedBy(2)); if (expires.test(midpoint)) { end = midpoint; } else {