Approximating sin(x) to 5 ULP with Chebyshev polynomials
Notice that your program could use a fold [1].  Not sure it would be much more efficient, but that would give it a more functional-programming style, which is arguably more elegant.<p>I wrote it in Perl 6 for instance:<p><pre><code>    sub wallace-sin($x) {
        constant pi_major =  3.1415927e0;
        constant pi_minor = -0.00000008742278e0;
        my $x2 = $x²;
        ($x - pi_major - pi_minor) *
        ($x + pi_major + pi_minor) * $x *
        reduce * * $x2 + *,
            0.00000000013291342e0,
           -0.000000023317787e0,
            0.0000025222919e0,
           -0.00017350505e0,
            0.0066208798e0,
           -0.10132118e0;
    }

</code></pre>
1. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fold_(higher-order_function)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fold_(higher-order_function%...</a>