summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/polynomial.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdimension/polynomial.c b/libdimension/polynomial.c
index 31d8309..6e8ce4e 100644
--- a/libdimension/polynomial.c
+++ b/libdimension/polynomial.c
@@ -86,6 +86,9 @@ dmnsn_bisect_root(double poly[], size_t degree, double min, double max)
double mid = 0.0, evmid;
int lastsign = -1;
+ if (max - min <= dmnsn_epsilon)
+ return min;
+
do {
mid = (min*evmax - max*evmin)/(evmax - evmin);
evmid = dmnsn_evaluate_polynomial(poly, degree, mid);