在 2022-06-28 05:38, Martin Storsjö 写道:
Instead of calculating the reciprocal of x upfront and doing the
repeated multiplication with that, calculate the reciprocal of
the result at the end instead.

As a special case, for cases where this algorithm overflows
(where the result would be a subnormal), fall back to the previous
algorithm.

Instead of spending upfront complexity on trying to decide between
these two algorithms, just try to detect whether this happened
afterwards (which should be quite cheap) and redo the calculation
if that happened - with the assumption that this is the uncommon
case (subnormals generally can be considered more expensive).

This fixes https://github.com/msys2/MINGW-packages/issues/11733.

Signed-off-by: Martin Storsjö <[email protected]>
---



Thanks; the approach looks correct to me. I would also like to hear about the 
OP's opinion.

Sorry for not having too much time working on this. I have been busy for a couple of weeks; hardly had any free time other than catching up on some sleep.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to