Constant Recognition logoJagiellonian University crestInverse RPN calculator for numerical experiments

Constant Recognition

A browser version of a constant-recognition experiment: enter a numerical result and search whether a short sequence of scientific calculator operations can reproduce it.

example session
z = 0.51404189589007076139762973957688K max = 8candidate = 5*pi^2/96status = numerical lead
Problem
inverse calculation
Expression model
36-button RPN
Search order
increasing code length K
Implementation
C / WASM / WebGPU

Problem

The usual calculator problem is reversed.

Normally one enters a formula and obtains a number. Here the input is a number, and the program enumerates formulas that could have produced it. This is useful when a computation returns a decimal value and the next question is whether it has a compact analytic form.

  1. 1A virtual scientific RPN calculator defines the alphabet of operations.
  2. 2Integer codes enumerate button sequences in a fixed order.
  3. 3Each code is evaluated numerically and compared with the target value z.
  4. 4The search proceeds by increasing code length K, so short formulas appear first.

Examples

Numerical values should be treated as hypotheses, not answers.

A match is a candidate identity. It becomes mathematics only after independent verification: higher precision, symbolic manipulation, or a derivation from the original problem.

Input valueCandidate expressionUse in practice
0.514041895890070761397629739576885*pi^2/96recognition of a numerical result from a high-precision calculation
-0.0833333333333-1/12simple rational value hidden by decimal notation
11/13tanh(log(sqrt(12)))example of a non-obvious identity useful in teaching

Cost of search

Increasing K is expensive.

The original single-threaded browser version notes that each step in code length increases the search time by roughly a factor of 36. The parallel and WebGPU versions are attempts to make larger searches more practical, not a reason to ignore the combinatorial growth.

What the web version is for

  • Checking numerical results from calculations or simulations.
  • Preparing examples for teaching elementary functions.
  • Comparing exact-looking formulas before doing a proof.
  • Exploring the behavior of brute-force symbolic search.
Run calculator