title: How to increase precision of std::sin function on iOS
body: <p>I have a cross-platform application, which is an audio application and therefore uses sine waves a lot, and the <code>std::sin()</code> and other goniometric functions. </p>
  
  <p>I noticed that particularly on the iOS platform, the precision of the <code>std::sin()</code> is extremely poor. I wrote the following test:</p>
  
  <pre><code>void TestSineZeroCrossings()
  {
     const static float kTwoPi = 6.28318530718f;
     const static float epsilon = 1e-5f;
  
     for (int ii = 0; ii &lt; 10000; ++ii)
     {
         const float difference = std::abs(std::sin(kTwoPi * static_cast&lt;float&gt;(ii)));
         if (difference &gt;  epsilon)
            printf("Zero crossing fail, difference: %f\n", difference);
     }
  }
  </code></pre>
  
  <p>On Windows and MaxOSX this passes (i.e. no print-outs), but on iOS this fails on pretty much every iteration. In fact, only with an <code>epsilon &gt; 0.004f</code> does it succeed. That results in clearly audible noise in my application. </p>
  
  <p>Is there a way to tell the compiler to use a better implementation that's not as lossy?</p>