High-precision numerical calculation
z = 0.51404189589007076139762973957688candidate = 5*pi^2/96A typical use case: a numerical integral or algebraic manipulation returns a decimal and the recognizer proposes a compact form.
Method notes
The calculator reverses the usual numerical workflow. Instead of entering a formula and obtaining a number, one enters a numerical target, a list of independent targets, or a table of x,y observations—and searches for short calculator programs that reproduce the selected data.
Use the tool the way one uses a numerical experiment: record the input, the assumptions, the search parameters, and the candidate expression. The result is not a proof.
The opening wizard selects one numerical target, a batch of independent targets, or one function fitted to x,y observations.
Use values produced by calculations or measurements. Give dz per numerical target or dy per function observation when the data are approximate.
K bounds the length of the RPN button sequence. Each additional step increases the search space roughly by the calculator alphabet size.
A returned expression is a numerical lead. Recompute at higher precision or prove the identity from the original mathematical problem.
The search space is defined by a standard scientific RPN calculator. Button sequences are encoded as integer codes, then evaluated one after another. The original browser version describes this as a virtual calculator whose buttons are pressed sequentially by CPUs rather than randomly by people.
K always counts RPN tokens; it is not a constant count, operation count, or thread count. For an active alphabet with T terminals, U unary functions, and B binary operators, the implementation counts stack-valid programs exactly. A valid structure with t terminal, u unary, and b binary positions contributes T^t U^u B^b candidates. Parallel CPU workers and WebGPU divide this same set without changing K or its cardinality.
For cross-calculator reporting, the fixed-width information cost is I_K = K log2(T+U+B) bits. Dataset size is separate again: a batch or fitted function evaluates each candidate against every target or observation. The calculator now reports all of these quantities before the search starts.
The wizard fixes the input contract, available terminals, engine call, and result report before a search starts. The selected calculator buttons define the constants, unary functions, and binary operators in every mode.
| Mode | Input | Terminals | Execution | Report |
|---|---|---|---|---|
| One constant | z and global dz | selected constants; x disabled | one CPU/WASM or GPU search | ranked candidates |
| Multiple constants | one z[,dz] per row | selected constants; x disabled | shared CPU batch or verified GPU searches | one best result per target_id |
| Function f(x) | one x,y[,dy] per row | x enabled; constants optional | one CPU/WASM or GPU fit search | formula and weighted MSE |
Enter at least two rows as zor z, dz. CPU/WASM enumerates each expression once and compares its value with every unfinished target. The report preserves the input-row identity and retains a separately verified best expression for every target.
In Identify f(x) mode, enter one row per observation as x, yor x, y, dy. Every candidate must contain x and is evaluated against every row. CPU/WASM uses double precision; GPU candidates are screened in FP32 and then recomputed on the CPU before they are reported.
Candidate formulas should be judged by both numerical accuracy and complexity. Long formulas can fit many decimal inputs by accident.
| Symbol | Meaning |
|---|---|
| z | target numerical value |
| Delta z | absolute uncertainty of the input value |
| delta z | relative uncertainty Delta z / z |
| K | length of the RPN code being searched |
| T, U, B | counts of terminals, unary functions, and binary operators in the active calculator |
| I_K | fixed-width description length K log2(T+U+B), used to compare calculator alphabets |
| RPN | reverse Polish notation button sequence |
| CR | compression-style ranking signal balancing error and length |
| x, y | input and observed output for univariate function recognition |
| target_id | stable input-row identifier in a multiple-constant report |
| dy | optional non-negative uncertainty used to scale a function residual |
| MSE | mean squared residual; with dy, mean of ((f(x)-y)/dy)^2 |
These examples are checks for numerical work and teaching: each one shows what was entered, what candidate was found, and what still has to be verified.
z = 0.51404189589007076139762973957688candidate = 5*pi^2/96A typical use case: a numerical integral or algebraic manipulation returns a decimal and the recognizer proposes a compact form.
z = 0.22222222222candidate = 2/9Useful for teaching why decimal representations can hide very simple exact values.
z = 0.846153846153846candidate = tanh(log(sqrt(12))) = 11/13An example of an identity that is not obvious from the decimal representation and can become a problem for students.
z = 2026candidate = 1 + (9*5)^2Integer and date-like inputs are not scientific evidence by themselves, but they are useful demonstrations of the search space.
Constant recognition is exploratory. A very close numerical match can still be meaningless if the expression is too long, if the input precision is overstated, or if the expression has no connection with the original problem.
If the tool contributes to a publication, cite the repository or deployed version and include the search parameters needed to reproduce the candidate.
The stopping and compression criteria follow Andrzej Odrzywolek, Criteria for the numerical constant recognition.
Constant Recognition, A. Odrzywolek and K. Sroka. Inverse RPN calculator for numerical constant recognition. https://github.com/Klaudiusz321/ConstantRecognition1