<p>In <a href="https://github.com/mlpack/mlpack/pull/684#discussion_r66666544">src/mlpack/tests/test_tools.hpp</a>:</p>
<pre style='color:#555'>&gt; @@ -35,4 +34,9 @@
&gt;  
&gt;  #endif
&gt;  
&gt; +// Require the approximation L to be within a relative error of E respect to the
&gt; +// actual value R.
&gt; +#define REQUIRE_RELATIVE_ERR( L, R, E ) \
&gt; +    BOOST_REQUIRE_LE( abs((R) - (L)), (E) * (R))
</pre>
<p>It's up to you (or, at least, I don't have a strong opinion).  The only issue with adding <code>REQUIRE_RELATIVE_ERR</code> is that it should be clearly documented, because another developer might expect something a little different out of a relative error condition.  Personally, I might consider using <code>BOOST_REQUIRE_CLOSE</code> with tolerance epsilon for KNN and with tolerance epsilon(1 + epsilon) for KFN (I think I did those calculations right) in order to avoid adding a new macro, but like I said, either way is fine, as long as the new macro is well-documented.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/684/files/07879a2cc79b35b10d7fae687d6e27ad90a9f2d7#r66666544">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFGIoKHvelQZC540zdtIv4RiGt9wEks5qKbcrgaJpZM4IvhJu">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFPqkfawgpfQuTjHLaMydymDNmqF6ks5qKbcrgaJpZM4IvhJu.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/684/files/07879a2cc79b35b10d7fae687d6e27ad90a9f2d7#r66666544"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>