René's URL Explorer Experiment


Title: bpo-41513: Improve order of adding fractional values. Improve variable names. by rhettinger · Pull Request #22368 · python/cpython · GitHub

Open Graph Title: bpo-41513: Improve order of adding fractional values. Improve variable names. by rhettinger · Pull Request #22368 · python/cpython

X Title: bpo-41513: Improve order of adding fractional values. Improve variable names. by rhettinger · Pull Request #22368 · python/cpython

Description: Improve the variable names and optimize the order that the fractional components are added together. Gives a slight improvement in speed and a minor improvement in accuracy. Baseline timing: $ pytime -s 'from math import pi, hypot, e, tau' 'hypot(pi, e)' 5000000 loops, best of 11: 83.6 nsec per loop $ pytime -s 'from math import pi, hypot, e, tau' 'hypot(pi, e, tau)' 5000000 loops, best of 11: 89.1 nsec per loop $ pytime -s 'from math import pi, hypot, e, tau' 'hypot(pi, e, tau, e)' 5000000 loops, best of 11: 98.4 nsec per loop Timing with PR: $ pytime -s 'from math import pi, hypot, e, tau' 'hypot(pi, e)' 5000000 loops, best of 11: 83.1 nsec per loop $ pytime -s 'from math import pi, hypot, e, tau' 'hypot(pi, e, tau)' 5000000 loops, best of 11: 89.1 nsec per loop $ pytime -s 'from math import pi, hypot, e, tau' 'hypot(pi, e, tau, e)' 5000000 loops, best of 11: 96 nsec per loop Accuracy tests. n is the number of dimensions followed by the weighted average number of correct bits (higher is better). The list contains counts for number of bits of error (lower counts are better). hypot12 is the baseline and hypot15 is the new code: n=2 108.94 hypot12 [(104, 465), (105, 9650), (106, 74210), (107, 177328), (108, 220778) n=2 109.12 hypot15 [(104, 76), (105, 6170), (106, 65987), (107, 163375), (108, 206841) n=3 108.48 hypot12 [(103, 8), (104, 486), (105, 13420), (106, 93712), (107, 229769), (108, 243386) n=3 108.72 hypot15 [(104, 102), (105, 7086), (106, 82426), (107, 208486), (108, 230416) n=5 108.17 hypot12 [(103, 11), (104, 1353), (105, 18261), (106, 123382), (107, 253589), (108, 250362) n=5 108.40 hypot15 [(104, 174), (105, 10427), (106, 108216), (107, 232246), (108, 243693) n=10 107.97 hypot12 [(103, 33), (104, 3417), (105, 33754), (106, 150365), (107, 261133), (108, 237118) n=10 108.18 hypot15 [(103, 5), (104, 653), (105, 24797), (106, 132075), (107, 243443), (108, 238205) n=20 107.92 hypot12 [(102, 1), (103, 193), (104, 3811), (105, 39405), (106, 153847), (107, 263381), (108, 234462) n=20 108.10 hypot15 [(103, 59), (104, 2030), (105, 29794), (106, 136819), (107, 247027), (108, 238805) n=50 107.69 hypot12 [(103, 57), (104, 4987), (105, 53502), (106, 188830), (107, 275831), (108, 217911) n=50 107.80 hypot15 [(103, 97), (104, 4406), (105, 47363), (106, 175900), (107, 265514), (108, 223802) n=100 107.29 hypot12 [(103, 397), (104, 14872), (105, 101681), (106, 240449), (107, 264715), (108, 178790) n=100 107.33 hypot15 [(103, 615), (104, 18598), (105, 100409), (106, 228175), (107, 258464), (108, 183213) n=200 106.62 hypot12 [(102, 19), (103, 4065), (104, 55179), (105, 204706), (106, 282193), (107, 210798), (108, 119011) n=200 106.60 hypot15 [(102, 31), (103, 5541), (104, 59552), (105, 205935), (106, 278179), (107, 208483), (108, 118478) n=1000 104.68 hypot12 [(100, 102), (101, 5593), (102, 57169), (103, 184363), (104, 276279), (105, 218668), (106, 126077) n=1000 104.64 hypot15 [(100, 119), (101, 5805), (102, 60339), (103, 193004), (104, 276688), (105, 213714), (106, 122384) # Case for very large n but with fewer trials: n=10000 100.49 hypot12 [(96, 62), (97, 1261), (98, 8502), (99, 20909), (100, 25938), (101, 19875), (102, 11594) n=10000 100.48 hypot15 [(96, 61), (97, 1271), (98, 8530), (99, 20922), (100, 26032), (101, 19856), (102, 11562) n=50000 97.72 hypot12 [(93, 5), (94, 521), (95, 5593), (96, 18338), (97, 26766), (98, 22070), (99, 12926) n=50000 97.72 hypot15 [(93, 5), (94, 531), (95, 5582), (96, 18319), (97, 26805), (98, 22049), (99, 12970) https://bugs.python.org/issue41513

Open Graph Description: Improve the variable names and optimize the order that the fractional components are added together. Gives a slight improvement in speed and a minor improvement in accuracy. Baseline timing: $ pyt...

X Description: Improve the variable names and optimize the order that the fractional components are added together. Gives a slight improvement in speed and a minor improvement in accuracy. Baseline timing: $ pyt...

Opengraph URL: https://github.com/python/cpython/pull/22368

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a3e5fbed-c536-4971-a07a-56308ec294a6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id86E8:CC59B:1CE35D:283996:696A63D6
html-safe-nonce1f164d1ccfc9f8d851b68b72566f3f894694dd919d43e24be658e81548ddd293
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkU4OkNDNTlCOjFDRTM1RDoyODM5OTY6Njk2QTYzRDYiLCJ2aXNpdG9yX2lkIjoiMTYyMzQ4ODY2NzQ2OTg5ODcxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc43c01b56df6f259d89bd73aa18ccec73161e23a9835aa643620fa32b5a5b172
hovercard-subject-tagpull_request:491295143
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/22368/files
twitter:imagehttps://avatars.githubusercontent.com/u/1623689?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1623689?s=400&v=4
og:image:altImprove the variable names and optimize the order that the fractional components are added together. Gives a slight improvement in speed and a minor improvement in accuracy. Baseline timing: $ pyt...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9b7735a184970dd9333b2cbe036c8f3c0a9108c64aaa93827c5a64fc70993392
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release87cbd411c2982752221b5751d583a515b23bf5fa
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/22368/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F22368%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F22368%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/22368/files
Reloadhttps://github.com/python/cpython/pull/22368/files
Reloadhttps://github.com/python/cpython/pull/22368/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/22368/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/22368/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
rhettingerhttps://github.com/rhettinger
python:masterhttps://github.com/python/cpython/tree/master
rhettinger:hypot_frac_orderhttps://github.com/rhettinger/cpython/tree/hypot_frac_order
Conversation 1 https://github.com/python/cpython/pull/22368
Commits 1 https://github.com/python/cpython/pull/22368/commits
Checks 0 https://github.com/python/cpython/pull/22368/checks
Files changed https://github.com/python/cpython/pull/22368/files
Please reload this pagehttps://github.com/python/cpython/pull/22368/files
bpo-41513: Improve order of adding fractional values. Improve variable names. https://github.com/python/cpython/pull/22368/files#top
Show all changes 1 commit https://github.com/python/cpython/pull/22368/files
7148a38 Improve order of adding fractional values. Improve variable names. rhettinger Sep 21, 2020 https://github.com/python/cpython/pull/22368/commits/7148a38f948f3c6a1af855601e51862f1bd81eac
Clear filters https://github.com/python/cpython/pull/22368/files
Please reload this pagehttps://github.com/python/cpython/pull/22368/files
Please reload this pagehttps://github.com/python/cpython/pull/22368/files
Modules/mathmodule.chttps://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
View file https://github.com/rhettinger/cpython/blob/7148a38f948f3c6a1af855601e51862f1bd81eac/Modules/mathmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/22368/{{ revealButtonHref }}
https://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
https://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
https://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
https://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
https://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
https://github.com/python/cpython/pull/22368/files#diff-5b1186dfcc44670529aa53cb728a1c005f58f38324c24787a49f22cec36841c7
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.