René's URL Explorer Experiment


Title: Fast math discussion needs more nuance · Issue #275 · algorithmica-org/algorithmica · GitHub

Open Graph Title: Fast math discussion needs more nuance · Issue #275 · algorithmica-org/algorithmica

X Title: Fast math discussion needs more nuance · Issue #275 · algorithmica-org/algorithmica

Description: First of all, congratulations for writing the most accurate micro-optimization textbook I have read so far. There are, however, still a couple of important shortcomings that prevent me from recommending to my computational scientist comm...

Open Graph Description: First of all, congratulations for writing the most accurate micro-optimization textbook I have read so far. There are, however, still a couple of important shortcomings that prevent me from recomme...

X Description: First of all, congratulations for writing the most accurate micro-optimization textbook I have read so far. There are, however, still a couple of important shortcomings that prevent me from recomme...

Opengraph URL: https://github.com/algorithmica-org/algorithmica/issues/275

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fast math discussion needs more nuance","articleBody":"First of all, congratulations for writing the most accurate micro-optimization textbook I have read so far.\r\n\r\nThere are, however, still a couple of important shortcomings that prevent me from recommending to my computational scientist community right now. One of them is your discussion of fast-math, which present it as an unilateral win that costs just a few bits of precision. This description lacks the level of nuance that this topic deserves, as explained in https://simonbyrne.github.io/notes/fastmath/ .\r\n\r\nA good discussion of fast-math should cover the following points:\r\n\r\n- fast-math turns many important parts of the IEEE-754 specification into undefined behavior (basically every special number: -0, NaN, +/-inf... is assumed not to be received as input or emitted as output at runtime). As a result, it makes it dangerously easy to write programs that invoke undefined behavior, when all they seem to do is to perform basic FP operations. This can, in turn, result in arbitrary badness like all UB does.\r\n- fast-math makes the floating-point output of a program depend on hardware, compilers and even on compiler versions. While exact reproducibility is a very costly property to enforce on modern hardware, it is also makes programs a lot easier to test. A program that uses fast-math in production should have tests that assert the correctness of results using more mathematically general, and thus more complex properties.\r\n- While fast-math only costs a few bits of precision when performing small amounts of simple arithmetic, it can and will break fancier numerical algorithms, such as transcendental functions and statistics packages, not just in your code but in third-party libraries that you use. This is important because many common math manipulations in the set of reals (e.g. polynomial evaluations, ratios of small numbers...) are numerically unstable when performed in the set of floating-point numbers, and getting them to produce even one bit of correctness there requires special precautions. These precautions are exactly the kind of seemingly unnecessary complex code that fast-maths optimizes out.\r\n\r\nBecause of these points, I find it safer only use fast-math as a guide to manual optimization during development, rather than as a production binary feature, and would encourage you to advise the same in your book:\r\n\r\n- Periodically turn on fast-math.\r\n- Locate any resulting program speedup using a profiler.\r\n- Study the assembler before and after to see what fast-math did.\r\n- Make sure this transformation is valid for your algorithm (ideally, you would have tests for that).\r\n- If so, apply the corresponding transformation to the C code so that you get the same benefit without fast-math.\r\n- Turn off fast-math once it does not make any meaningful difference anymore.","author":{"url":"https://github.com/HadrienG2","@type":"Person","name":"HadrienG2"},"datePublished":"2024-03-23T18:38:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/275/algorithmica/issues/275"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4139faa6-79d8-f60b-67d2-dcee2a1f7c70
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9322:3583FC:54055F:75393C:697CE0BC
html-safe-nonce6d984b91f01a8dd2d91676158ee5b2ae7998806e34f6985d81af641adcdcc5c1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzIyOjM1ODNGQzo1NDA1NUY6NzUzOTNDOjY5N0NFMEJDIiwidmlzaXRvcl9pZCI6IjgwMjY1MjQxOTQwODQ1NDQ3MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacdcdd8eea4ecbfd76c279e00c6ff866dba13b863799439365f434a61a4096ec33
hovercard-subject-tagissue:2203998384
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/algorithmica-org/algorithmica/275/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ad3e3aded9616fe8399098ca9701aa3b98b194b5f2be7d774108521a4b63925f/algorithmica-org/algorithmica/issues/275
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ad3e3aded9616fe8399098ca9701aa3b98b194b5f2be7d774108521a4b63925f/algorithmica-org/algorithmica/issues/275
og:image:altFirst of all, congratulations for writing the most accurate micro-optimization textbook I have read so far. There are, however, still a couple of important shortcomings that prevent me from recomme...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameHadrienG2
hostnamegithub.com
expected-hostnamegithub.com
None5f20df5019a7f846ce01350c443b1b5209bcc8b08d1ff80f92fdef440a0c7c89
turbo-cache-controlno-preview
go-importgithub.com/algorithmica-org/algorithmica git https://github.com/algorithmica-org/algorithmica.git
octolytics-dimension-user_id51334463
octolytics-dimension-user_loginalgorithmica-org
octolytics-dimension-repository_id333536823
octolytics-dimension-repository_nwoalgorithmica-org/algorithmica
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id333536823
octolytics-dimension-repository_network_root_nwoalgorithmica-org/algorithmica
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0f08fae6208283a46e6e5febf9878b9cdddfaa23
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues/275#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Falgorithmica-org%2Falgorithmica%2Fissues%2F275
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Falgorithmica-org%2Falgorithmica%2Fissues%2F275
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=algorithmica-org%2Falgorithmica
Reloadhttps://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues/275
Reloadhttps://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues/275
Reloadhttps://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues/275
algorithmica-org https://patch-diff.githubusercontent.com/algorithmica-org
algorithmicahttps://patch-diff.githubusercontent.com/algorithmica-org/algorithmica
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Falgorithmica-org%2Falgorithmica
Fork 465 https://patch-diff.githubusercontent.com/login?return_to=%2Falgorithmica-org%2Falgorithmica
Star 4.6k https://patch-diff.githubusercontent.com/login?return_to=%2Falgorithmica-org%2Falgorithmica
Code https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica
Issues 38 https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues
Pull requests 142 https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/pulls
Actions https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/actions
Projects 0 https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/projects
Security 0 https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/security
Insights https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/pulse
Code https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica
Issues https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues
Pull requests https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/pulls
Actions https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/actions
Projects https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/projects
Security https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/security
Insights https://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/algorithmica-org/algorithmica/issues/275
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/algorithmica-org/algorithmica/issues/275
Fast math discussion needs more nuancehttps://patch-diff.githubusercontent.com/algorithmica-org/algorithmica/issues/275#top
https://github.com/HadrienG2
https://github.com/HadrienG2
HadrienG2https://github.com/HadrienG2
on Mar 23, 2024https://github.com/algorithmica-org/algorithmica/issues/275#issue-2203998384
https://simonbyrne.github.io/notes/fastmath/https://simonbyrne.github.io/notes/fastmath/
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.