Skip to content

Conversation

@Abhi210
Copy link
Contributor

@Abhi210 Abhi210 commented Oct 22, 2025

Replaced the expression computing the final result in loghelper with an fma() call:

result = fma(func(2.0), (double)e, func(x));

This change reduces rounding error and improves the ULP distribution of math.log for very large integer inputs.

@tim-one
Copy link
Member

tim-one commented Oct 22, 2025

Please add your name to Misc/ACKS.

@Abhi210 Abhi210 force-pushed the gh-140443-fused-multiply branch from de6ba0d to 33acf47 Compare October 22, 2025 18:00
@Abhi210 Abhi210 force-pushed the gh-140443-fused-multiply branch from 33acf47 to 760614c Compare October 22, 2025 18:11
…ery large integers

Replaced the expression computing the final result in loghelper with an
fma() call:

    result = fma(func(2.0), (double)e, func(x));

This change reduces rounding error and improves the ULP distribution of
math.log10() for very large integer inputs.
@Abhi210 Abhi210 force-pushed the gh-140443-fused-multiply branch from 760614c to f05b4b2 Compare October 23, 2025 03:34
@python-cla-bot
Copy link

python-cla-bot bot commented Oct 23, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link
Member

@tim-one tim-one left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a joy! Thank you for your efforts and patience. It's amazing how much "busy work" there is to make a 1-line change 🤣, eh?

It all looks good to me. I'll merge it tomorrow. Perhaps @StanFromIreland knows more than me about what kind of markup decorations are wanted in NEWS entries. I can never remember that stuff ☹️.

@Abhi210
Copy link
Contributor Author

Abhi210 commented Oct 23, 2025

Thank you, @tim-one and @StanFromIreland, for your guidance throughout this PR (and thank you for pointing out my mistakes.) I’ve learned a great deal from your feedback and reviews.

@tim-one tim-one linked an issue Oct 23, 2025 that may be closed by this pull request
@tim-one tim-one merged commit f0291c3 into python:main Oct 23, 2025
45 checks passed
@Abhi210 Abhi210 deleted the gh-140443-fused-multiply branch October 24, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use fused multiply add to improve logarithms of bigints

4 participants