---
layout: post
author: Pascal Cuoq
date: 2011-09-19 13:35 +0200
categories: donut facetious-colleagues
format: xhtml
title: "Penultimate donut post: the function compute() is safe"
summary: 
---
{% raw %}
<h2>Do two jobs, and do them well</h2> 
<p>In the previous post, I used the command:</p> 
<pre>$ cat log? | grep \N " | sort | uniq 
</pre> 
<p>This may be an inefficient way to get a list of unique lines containing "N ". The command <code>sort</code> does not know that it is sending its results to <code>uniq</code>  so it has to keep all duplicates in memory  or at least keep a count for each of them. 
As pointed out by my colleague Benjamin Monate  you can make <code>sort</code>'s job easier by telling it directly that you are only interested in unique lines. The option is <code>sort -u</code>. This can only make <code>sort</code>'s job simpler  even if it has an optimization for dealing with duplicate lines efficiently.</p> 
<h2>Update on the donut verification</h2> 
<p>The computations for the remaining difficult 5% of the search space are now finished. I was hoping not to have to do a third pass  so I split each side of the examined subcube in 4. In other words  I divided each subcube in 4⁴ or 256 subsubcubes. A little birdie told me that splitting each side in two wouldn't be sufficient. That birdie had been wrong before  but this time  it was absolutely sure— it got the tip straight from the subcube's mouth.</p> 
<p>I have kept the entire logs for this second pass  since I didn't know yet whether I would need the additional information they contain. I would have needed them if a third pass had been necessary  but it won't be. It is now official: function <code>compute()</code> is safe for all arguments between -3.25 and 3.25.</p> 
<p>Now I must write the concluding post quickly  because the full logs are taking 85GB on our computations server.</p>
 <h2>Do two jobs, and do them well</h2> 
<p>In the previous post, I used the command:</p> 
<pre>$ cat log? | grep \N " | sort | uniq 
</pre> 
<p>This may be an inefficient way to get a list of unique lines containing "N ". The command <code>sort</code> does not know that it is sending its results to <code>uniq</code>  so it has to keep all duplicates in memory  or at least keep a count for each of them. 
As pointed out by my colleague Benjamin Monate  you can make <code>sort</code>'s job easier by telling it directly that you are only interested in unique lines. The option is <code>sort -u</code>. This can only make <code>sort</code>'s job simpler  even if it has an optimization for dealing with duplicate lines efficiently.</p> 
<h2>Update on the donut verification</h2> 
<p>The computations for the remaining difficult 5% of the search space are now finished. I was hoping not to have to do a third pass  so I split each side of the examined subcube in 4. In other words  I divided each subcube in 4⁴ or 256 subsubcubes. A little birdie told me that splitting each side in two wouldn't be sufficient. That birdie had been wrong before  but this time  it was absolutely sure— it got the tip straight from the subcube's mouth.</p> 
<p>I have kept the entire logs for this second pass  since I didn't know yet whether I would need the additional information they contain. I would have needed them if a third pass had been necessary  but it won't be. It is now official: function <code>compute()</code> is safe for all arguments between -3.25 and 3.25.</p> 
<p>Now I must write the concluding post quickly  because the full logs are taking 85GB on our computations server.</p>
{% endraw %}