Skip to content

Instantly share code, notes, and snippets.

View chemoelectric's full-sized avatar

Barry Schwartz chemoelectric

View GitHub Profile
@chemoelectric
chemoelectric / fine_struct_const.mac
Created October 21, 2026 19:58
First-Principles Unified Field Theory Fine-Structure Constant (alpha)
/* =========================================================================
First-Principles Unified Field Theory Fine-Structure Constant (alpha)
Free of SI Units -- Evaluated via Exact Definite Integrals
========================================================================= */
/* Set precision for big-float display */
fpprec : 32$
/* 1. Primary Conformal Phase Action (Definite Polynomial Integral) */
alpha_0_inv : integrate(12*x^2 + 2*x + 1, x, 0, %pi);
@chemoelectric
chemoelectric / proton_electron_mass_ratio.mac
Created October 21, 2026 19:46
Proton-to-Electron Mass Ratio via 3 Interlinked Toroidal Fluxes
/* =========================================================================
Proton-to-Electron Mass Ratio via 3 Interlinked Toroidal Fluxes
Accounting for Elliptic Deformation from Helical Winding and Spin
========================================================================= */
/* 1. Fine-Structure Constant from Toroidal Conformal Phase & Field Reaction */
alpha_0_inv : 4 * %pi^3 + %pi^2 + %pi$
alpha_inv : alpha_0_inv - 1 / (24 * alpha_0_inv)$
alpha : 1 / alpha_inv$
@chemoelectric
chemoelectric / bernstein_root_finder.adb
Created August 22, 2026 23:44
Real root isolation without shenanigans, by de Casteljau’s algorithm, with refinement of the root by the ITP algorithm
pragma ada_2022;
with ada.text_io;
with ada.float_text_io;
with ada.numerics.generic_elementary_functions;
-- complete demonstration of recursive bernstein
-- real root isolation algorithm in floating point (ada 2022).
-- author: frédéric blondin custer.
@chemoelectric
chemoelectric / primality_test.d
Created August 22, 2026 22:01
A primality test program combining multiple techniques
/*********************************************************************
* Deterministic Iris Primality Inference Engine Module
*
* Implements the combined Vernier Phase Trajectory (Miller-Rabin)
* and Lucas-Frobenius Cl(2,0) Bivector Rotor (Baillie-PSW) test with
* Montgomery domain aperture reduction for deterministic primality
* verification without integer factorization.
*
* Precision selected at compile time via gdc (GNU D) version flags:
* -fversion=LIMB_32 (32-bit integer precision)
@chemoelectric
chemoelectric / wave_queens_8.adb
Created August 22, 2026 08:15
Discrete 8-queens wave action potential relaxation engine. Finds a solution to the 8-queens puzzle by phase-locking.
pragma ada_2022;
with ada.text_io;
with ada.integer_text_io;
with ada.float_text_io;
with ada.numerics.generic_elementary_functions;
-- discrete 8-queens wave action potential relaxation engine.
-- author: frédéric blondin custer.
procedure wave_queens_8 is
@chemoelectric
chemoelectric / grassmann_queens_8.adb
Last active August 22, 2026 08:06
Discrete 8-queens Grassmann exterior wave annihilation engine. Simultaneously computes all 92 solutions to the 8-queens problem. (This may also be viewed as a bit-twiddling algorithm.)
pragma ada_2022;
with ada.text_io;
with ada.integer_text_io;
-- discrete 8-queens grassmann exterior wave annihilation engine.
-- computes the complete ensemble of 92 solutions simultaneously.
-- author: frédéric blondin custer.
procedure grassmann_queens_8 is
@chemoelectric
chemoelectric / gist:817e70db66dd4ae75b37fbe90c725a65
Created May 8, 2026 10:51
Integer radix trees in generic C
/*
The hiha programming language
Copyright © 2026 Barry Schwartz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@chemoelectric
chemoelectric / chem_unique_id.m4
Created April 15, 2026 20:46
Autoconf m4 code to find shell code that produces a unique identifier without spaces
# Copyright (C) 2025 Barry Schwartz
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# serial 2
# chem_unique_id([CHEM_UNIQUE_ID([VAR])
@chemoelectric
chemoelectric / n-queens
Created March 22, 2026 01:47
n-queens solution in R⁷RS Scheme using circular lists extensively, so it cannot be translated to R⁶RS. Thus showing R⁶RS is the more retrograde standard.
#!/usr/bin/env scheme-r7rs
(import (scheme base)
(scheme list)
(scheme write)
(scheme process-context))
;;; Generate solutions to the n-queens problem.
;;;
;;; This implementation is based *very* closely on a Fortran solution
;;; by Barry Schwartz, and in turn *extremely* loosely on the public
@chemoelectric
chemoelectric / eprb_simulation.adb
Last active August 21, 2023 22:21
Ada simulation of an EPR-B experiment, showing that the correlations are due to polarization, not ‘entanglement’ or ‘non-locality’
--********************************************************************
-- This is free and unencumbered software released into the public domain.
-- Anyone is free to copy, modify, publish, use, compile, sell, or
-- distribute this software, either in source code form or as a compiled
-- binary, for any purpose, commercial or non-commercial, and by any
-- means.
-- In jurisdictions that recognize copyright laws, the author or authors
-- of this software dedicate any and all copyright interest in the