Skip to content

Instantly share code, notes, and snippets.

View asmeurer's full-sized avatar

Aaron Meurer asmeurer

View GitHub Profile
@asmeurer
asmeurer / RISCH_ALGEBRAIC_PLAN.md
Created August 15, 2026 18:20
Plan: branch-correct algebraic integration in SymPy's Risch code, and correctness testing against the Rubi corpus

Plan: branch-correct algebraic integration, and correctness testing

against the Rubi corpus

Companion to RISCH_PLAN.md (the transcendental Risch plan) and BRONSTEIN_ERRATA.md. This file covers the experimental algebraic track on branch risch-algebraic and is written to be picked up by a fresh session.

Status: research and prototyping done, nothing implemented. Two work items are queued, in this order:

@asmeurer
asmeurer / RISCH_ALGEBRAIC_RUNS.md
Last active August 16, 2026 02:38
risch-algebraic experiment: RUBI corpus run logs (sympy risch_integrate algebraic=True)

risch-algebraic experiment: run log

Runs of sympy's risch_integrate(f, x, algebraic=True) (the experimental exp-log-tower representation of radicals, e.g. sqrt(x) as exp(log(x)/2)) over test corpora. Companion to the "Experimental track" section of the RISCH_PLAN.md gist.

Summary (as of 2026-08-11)

The experiment: represent radicals as exp-log towers, run the

@asmeurer
asmeurer / RISCH_PLAN.md
Last active August 16, 2026 17:32
Plan/status for completing the transcendental Risch algorithm in SymPy (Bronstein, Symbolic Integration I)

Plan: completing the transcendental Risch algorithm in SymPy

Scope: the transcendental algorithm from Bronstein, Symbolic Integration I (2nd ed. section numbers used throughout; the OCR'd 2nd-edition PDF is at ~/Dropbox/papers/symbolic-computation/_books/, PDF page = book page + 16). Algebraic extensions (Volume II territory) are explicitly out of scope. Line numbers originally referred to master at 89796fa512.

Status (updated 2026-08-15)

@asmeurer
asmeurer / BRONSTEIN_ERRATA.md
Last active August 16, 2026 03:00
Errata for Bronstein, Symbolic Integration I: Transcendental Functions (found while completing SymPy's Risch implementation)

Errata for Bronstein, Symbolic Integration I: Transcendental Functions

Errata found while completing SymPy's implementation of the transcendental Risch algorithm (see RISCH_PLAN.md). Each was verified by deriving the correct statement from the surrounding theory and empirically checking the algorithm's own stated contract on examples. As far as we can tell these are unreported: no official errata list survives (the archived INRIA pages for the book do not link one), and the second edition's preface does not mention them.

Using CPython 3.14.0a6
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
Resolved 10 packages in 1ms
Installed 10 packages in 11ms
+ attrs==25.3.0
+ hypothesis==6.135.29
+ iniconfig==2.1.0
+ mpmath==1.3.0
+ packaging==25.0
import sympy
import numpy as np
import argparse
import importlib.util
import os
def _get_sym_coeff(val):
"""Converts a number to a SymPy Rational or Integer."""
if isinstance(val, (float, np.floating)):
# Convert float to SymPy Rational for exact representation
@asmeurer
asmeurer / gist:1d78693c3cdfe98413b66fb838f5e386
Created December 8, 2024 08:13
qwq repeat the word 'apple' 1000 times
$ollama run qwq
>>> Repeat the word "apple" 1000 times.
Okay, so I have this task to repeat the word "apple" 1000 times. Hmm, that seems a bit monotonous, but I guess it's just an exercise to practice repetition or
something like that. Maybe it's to test my patience or something. Anyway, let's get started.
Apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple
apple apple apple apple apple
>>> That is not 1000 times.
Oh, right. I only did it about 30 times there. I need to repeat it 1000 times. That's going to take a while. Maybe I should find a more efficient way to do this.
@asmeurer
asmeurer / flycheck-ruff.el
Created November 12, 2024 22:19 — forked from abo-abo/flycheck-ruff.el
Emacs ruff flycheck config
(require 'flycheck)
;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202
(flycheck-define-checker python-ruff
"A Python syntax and style checker using the ruff utility.
To override the path to the ruff executable, set
`flycheck-python-ruff-executable'.
See URL `http://pypi.python.org/pypi/ruff'."
:command ("ruff"
"--format=text"
@asmeurer
asmeurer / gist:9ced6b7e8d5b9f6f2441ccb65d709558
Last active November 12, 2024 21:09
Claude dockur/macos
This appears to be a project that allows running macOS in a Docker container, which is quite interesting from a technical perspective. Let me break down the key components:
1. Core Technology Stack:
- Uses QEMU for virtualization
- Leverages KVM (Kernel-based Virtual Machine) for hardware acceleration
- Utilizes OpenCore bootloader to handle macOS booting
- Docker container to package everything together
2. Key Components:
@asmeurer
asmeurer / ndindex_pyinstrument1.html
Last active August 9, 2024 23:16
ndindex pyinstrument profiles
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="app"></div>
<script>var pyinstrumentHTMLRenderer=function(){"use strict";var ct=Object.defineProperty;var dt=(R,C,H)=>C in R?ct(R,C,{enumerable:!0,configurable:!0,writable:!0,value:H}):R[C]=H;var k=(R,C,H)=>(dt(R,typeof C!="symbol"?C+"":C,H),H);const R="";function C(){}function H(t){return t()}function we(){return Object.create(null)}function O(t){t.forEach(H)}function be(t){return typeof t=="function"}function K(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ie(t){return Object.keys(t).length===0}function Re(t,...e){if(t==null)return C;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function se(t,e,i){t.$$.on_destroy.push(Re(e,i))}function f(t,e){t.appendChild(e)}function X(t,e,i){t.insertBefore(e,i||null)}function N(t){t.parentNode&&t.parentNode.removeChild(t)}function _(t){return