Research

PI Was Set to 3.1415: Claude Reviewed His 2013 Math Internship Code and Cut a Simulation's Drift 750 Times

  • Level Advanced
  • Setup1–3 hrs (estimated)
  • Evidence Strong evidence
  • CostNot stated in source
  • No-codeNo
ClaudeSource-linked

What they did

In 2013, as a math intern, he wrote C code for a shallow-water equations scheme. This week he pointed Claude at the repo for a review. It found PI defined as 3.1415, which made a lake that should stay still slowly move; fixing it cut the drift 750 times. It also found an error norm multiplied by dx that hid errors by a factor of 50, and a sign typo in one of the paper's integrals. A better quadrature rule fixed the remaining drift and made the run 20 times faster.

How it went

Hidden numeric bugs found, with drift cut 750 times and the run made 20 times faster.

Worth knowing

  • Hacker News post by MathLab (Oct 23, 2026 Denver time): Claude reviewed his 2013 C code and found PI=3.1415 (fixing it cut drift 750x), an error norm that hid errors 50x, and a sign typo in the paper; a tanh-sinh rule made it 20x faster.
  • Have the agent prove each fix with a test case; 'it found a bug' isn't enough for research code.

Prompt

Cleaned version rewritten from the source — not a direct quote.

Review this scientific code ([repo]) against the method in [paper]. Check constants, units, numerical integration and error measures. Check that the code's equations match the paper, and flag where the paper itself may be wrong. For each finding, give a test that shows the effect before and after the fix. Don't change the code until I approve.

Recommended

Try it in Grok Bot

Grok Bot can run a review like this through a coding agent and summarize the findings.

  1. Copy the prompt (button below).
  2. Open Grok Bot chat and paste it. Replace any [bracketed] placeholders.
  3. Connect the listed tools (as needed) as connectors when Grok Bot asks.
  4. If the task repeats, ask: "Make this a daily routine."

Alternatives: the same prompt works in Claude, ChatGPT Agent, OpenClaw.

Set it up

Stack: Claude + code repo

  1. Read the original source for full context.
  2. Connect the tools your agent needs.
  3. Paste the prompt and replace [bracketed] placeholders.
  4. Run once manually and check the output before scheduling it.

Generic suggested steps, not from the source.

Evidence

Hacker News post by MathLab (Oct 23, 2026 Denver time): Claude reviewed his 2013 C code and found PI=3.1415 (fixing it cut drift 750x), an error norm that hid errors 50x, and a sign typo in the paper; a tanh-sinh rule made it 20x faster. Have the agent prove each fix with a test case; 'it found a bug' isn't enough for research code

Source: HN · 2026-10-23 · Verified by us: not yet · Report broken or outdated

Related use cases

ResearchReddit

Schedule Reddit, email and Search Console digests

Isolated cron jobs scan Reddit, check inboxes, and pull Google Search Console data, then send summaries to Telegram.

  • Level Beginner
  • Setup~20 min per job (source)
  • Evidence Strong evidence
OpenClawSource-linkedBeginner-friendly
ResearchX · 2026-10

Scrape X bookmarks into a Notion database every few hours

Bookmarks pile up and get forgotten. Jeston Lu built a Grok Bot that scrapes saved X posts every 6 hours and auto-categorizes them into a Notion database so the archive stays searchable.

  • Level Intermediate
  • Setup1–3 hrs*
  • Evidence Strong evidence
Grok BotSource-linked
MoneyWeb · 2026-02

Check a hospital bill against what Medicare would pay

A writer gave Claude the coded hospital claim (UB-04) for his late brother-in-law's $195,628 ER bill and asked it to build a spreadsheet of Medicare rates per code. Claude flagged bundled items billed separately, a bypass charge for a procedure that never happened, and a ventilation charge Medicare does not allow.

  • Level Intermediate
  • Setup1–3 hrs*
  • Evidence Strong evidence
ClaudeSource-linked