On 2014/06/03 16:51:30, Raymond Toy wrote:
On 2014/06/03 07:01:45, Yang wrote:
> https://codereview.chromium.org/303753002/diff/40001/src/math.js
> File src/math.js (right):
>
> https://codereview.chromium.org/303753002/diff/40001/src/math.js#newcode262
> src/math.js:262: }
> On 2014/06/02 17:26:11, Raymond Toy wrote:
> > As you mentioned via email, you've removed the 3rd iteration. This is
really
> > needed if you want to be able to reduce multiples of pi/2 accurately.
>
> That's true. However, the reduction step is not exposed as a library
function.
> From what I have seen, the third step seems to only affect y1. With a y0
really
> close to y1, it does not change the result of sine or cosine. This is also
why
I
> was asking for a test case where removing this third step would make a
> difference.

I don't understand what you mean by "y0 really close to y1".  What are you
saying?


tan(Math.PI*45/2) requires the 3rd iteration. ieee754_rem_pio2 returns
[45, -9.790984586812941e-16, -6.820314736619894e-32]

If you ignore the y1 result, we have
kernel_tan(-9.790984586812941e-16, 0e0, -1) -> 1021347742030824.2

If you include the y1 result:
kernel_tan(-9.790984586812941e-16,-6.820314736619894e-32, -1) ->
1021347742030824.1

I somehow didn't type what I thought. I meant to say: if y0 is really close to 0, there does not seem to be any point to invest in the third loop. (I am aware
that omitting y1 changes the result in some cases. I'm not arguing this).

So in the example here, if I omit the third iteration, I get
[45, -9.790984586812941e-16, -6.820199415561299e-32]

y0 is the same, y1 differs slightly, but the end result is still
1021347742030824.1.


https://codereview.chromium.org/303753002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to