From 4321934be544bc2888c6799fd6b50d8188a3d832 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Tue, 8 Oct 2019 17:27:35 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1730

---
 magick/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/magick/segment.c b/magick/segment.c
index 8f03c22ef..46fae277f 100644
--- a/magick/segment.c
+++ b/magick/segment.c
@@ -1696,7 +1696,7 @@ static MagickRealType OptimalTau(const ssize_t *histogram,const double max_tau,
   average_tau=0.0;
   for (i=0; i < number_nodes; i++)
     average_tau+=list[i]->tau;
-  average_tau/=(MagickRealType) number_nodes;
+  average_tau*=PerceptibleReciprocal((MagickRealType) number_nodes);
   /*
     Relinquish resources.
   */
