Dirichlet Approximation Calculator

Observed nearest numerator rational search denominator1…Qminabsoluteerror, earliest denominator ties; Dirichlet theorem not certified for irrational actual represented float from finite search, no infinite quantifier. Explicit bounded resource/branch and actual observations or independently verified parameters; no unproved infinite assertion certified.

Description

A finite rational-approximation search compares nearby fractions within a chosen denominator budget.

A finite rational-approximation search compares nearby fractions within a chosen denominator budget.1

This tool returns the closest observed witness without proving irrationality or an infinite approximation theorem.

When to use Dirichlet Approximation Calculator

Use this tool to obtain the closest observed witness without proving irrationality or an infinite approximation theorem.

How to use Dirichlet Approximation Calculator and how it works

  1. Prepare actualFiniteReal, actualMaximumDenominator, with the units, conventions and assumptions below.
  2. Enter the required fields and run Dirichlet Approximation Calculator.
  3. Read result.numerator, result.denominator, result.absoluteError using the output definitions below.
  4. Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
Input fieldMeaningValue typeRequirement
actualFiniteRealReal target x with absolute value at most 100000000.numberRequired; finite; other constraints below
actualMaximumDenominatorInteger denominator budget Q from 1 to 10000.numberRequired; finite; other constraints below

Require finite x with absolute value at most 100,000,000 and an integer denominator cap Q from 1 to 10,000. Examine q=1 through Q, choose p=Math.round(x*q), and keep the candidate with strictly smaller absolute error. Ties keep the first denominator examined; fractions are not reduced, and Math.round uses its own signed-half convention. Return numerator, denominator and absolute error for this bounded search.

p_q=Math.round(x*q); minimize abs(x-p_q/q) over q=1..Q

Apply the input ordering, units and branch conditions stated above.

Output fieldMeaningValue type
resultObject containing the calculated or selected fields below.object
result.numeratorInteger numerator selected by the bounded denominator search.number
result.denominatorPositive selected denominator; fractions are not automatically reduced.number
result.absoluteErrorAbsolute floating-point difference between x and the selected rational value.number
json
{
  "input": {
    "actualFiniteReal": 0.3,
    "actualMaximumDenominator": 10
  },
  "output": {
    "result": {
      "numerator": 3,
      "denominator": 10,
      "absoluteError": 0
    }
  }
}

Limitations and assumptions

The calculation uses the supplied observations and model inputs. It does not collect measurements, select a reference population or coefficient, or establish that the model applies to the actual case. The stated branch conditions and output units remain part of the result.

All fields require explicit values. Unexpected fields, wrong types, nonfinite numbers and sparse arrays are rejected. Alignment, bounds and supported-token rules are explained above; extremely large inputs or nonfinite results can also fail. Input errors differ from successful false comparisons, unavailable-domain flags and empty match lists.

Alternative or Complementary methods

Use Composite Density Approximation for a complementary operation: A complement of the prime-density heuristic is an asymptotic illustration rather than a measured composite fraction.

Use Chebotarev Density Calculator for a complementary operation: A Chebotarev class-density calculation depends on an independently certified finite Galois-extension context.

References

  1. Dirichlet Approximation Calculator — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies