ForHosting KIT · Developer Utilities

Function iteration calculator

The function iteration calculator repeatedly applies the same real-valued expression to a starting number and returns every point in the resulting orbit.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter an expression in x, choose x_0, and specify how many iterations to perform. The result includes the initial value, each successive output, and the final value. It is useful for studying recurrence relations, fixed points, cycles, convergence, divergence, and the first steps of simple dynamical systems without calculating each substitution by hand.

Enter the function and starting value

Write the rule as an expression in x, such as x^2 - 1, cos(x), or 0.5*x + 3. The calculator supports parentheses, decimal and scientific-notation numbers, the operators +, -, *, /, and ^, and the constants pi and e. Supported one-argument functions include abs, sqrt, sin, cos, tan, exp, ln, log, floor, ceil, and round. Multiplication must be explicit, so write 2*x rather than 2x. Next, provide a finite real starting value. This is x_0, the first member of the orbit, not the result of the first application. Finally, choose an iteration count from zero through one thousand. A count of zero is meaningful: it returns the starting point alone and can help confirm that the input has been interpreted correctly. Expressions are parsed as mathematics rather than executed as code, so names, syntax, and operations outside the documented grammar are rejected with a clear input error.

Read the orbit in the correct order

If the entered rule is f and the starting value is x_0, the calculator computes x_1 = f(x_0), then x_2 = f(x_1), and continues until x_n. The orbit array therefore contains n + 1 values: the starting value at index zero followed by one value for each requested application. The final_value field repeats the last member for convenient use in scripts, while iterations records how many applications were actually requested. This distinction prevents a common off-by-one mistake. For example, requesting three iterations does not return three total points; it returns x_0, x_1, x_2, and x_3. Values are normalized to fifteen significant digits to reduce distracting binary floating-point tails while retaining useful precision. That normalization does not turn numerical iteration into symbolic algebra, and rounding can influence extremely sensitive systems after many steps. Treat long chaotic orbits as numerical approximations, especially when nearby starting values separate rapidly.

Interpret convergence, cycles, and failures

Successive values often reveal the qualitative behavior of a recurrence. When later entries settle near one number, that number may be an attracting fixed point: substituting it into the function produces approximately the same value. Alternation between a small set of repeating values suggests a cycle, while steadily increasing magnitudes may indicate divergence. A finite list cannot prove any of those behaviors by itself, but it provides evidence and a practical starting point for analysis. Compare orbits from several nearby initial values when investigating stability. The calculator stops with an input error if an operation produces Infinity or NaN, as can happen after division by zero, a square root of a negative number, or logarithm of an invalid value. That error identifies the iteration where the real-valued orbit ceased to exist. The fixed limits on expression length and iteration count also keep browser and API execution predictable. No network request, randomness, clock, or hidden state affects the calculation, so identical valid input produces identical output.

Explore a recurrence relation

Generate x_0 through x_n for a rule such as x^2 - 1 without repeating substitutions manually.

Look for fixed-point convergence

Inspect whether successive outputs settle near a value that is unchanged by another application.

Compare nearby starting values

Run the same nonlinear function from close initial conditions and compare how their numerical orbits develop.

Does the orbit include the starting value?

Yes. The first entry is x_0, followed by one output for every requested iteration.

Which expression syntax is supported?

Use x, numbers, pi, e, parentheses, +, -, *, /, ^, and the documented one-argument functions. Multiplication must be written explicitly.

What happens if an iteration is undefined?

The calculation stops and returns an invalid-input error naming the iteration that produced a non-finite value.

Why can a chaotic orbit differ from a theoretical exact result?

This is numerical floating-point iteration. Small rounding differences can grow rapidly in sensitive dynamical systems.

How much does an API calculation cost?

Each API request costs $0.002. The same deterministic calculator is also available in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/function-iteration

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/function-iteration \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"function":"x^2 - 1","start":1.5,"iterations":4}'
{
  "function": "x^2 - 1",
  "start": 1.5,
  "iterations": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.function_iteration",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_iterations1000
max_expression_chars500
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →