Files
obitools4/autodoc/docmd/pkg/obistats/algo.md
T
Eric Coissac 8c7017a99d ⬆️ version bump to v4.5
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5"
- Update version.txt from 4.29 → .30
(automated by Makefile)
2026-04-13 13:34:53 +02:00

21 lines
1.3 KiB
Markdown

# `obistats` Package — Semantic Overview
The `obistats` package provides lightweight, general-purpose numerical utilities in Go. It includes:
- **Basic arithmetic helpers**:
- `maxint`, `minint`: return the maximum/minimum of two integers.
- `sumint(xs []int) int`: computes the sum over a slice of integers.
- **Root-finding via bisection**:
- `bisect(...)`: numerically finds a root of a real-valued function within `[low, high]`, using the classical bisection method. Returns `(root, success)`.
- Requires `f(low)` and `f(high)` to have opposite signs; panics otherwise.
- **Boolean bisection**:
- `bisectBool(...)`: locates the transition point where a boolean function flips (e.g., threshold detection). Returns adjacent points `(x1, x2)` straddling the change. Panics if `f(low) == f(high)`.
- **Series summation**:
- `series(...)`: computes the infinite sum ∑ₙ₌₀^∞ f(n) by iterating until convergence (i.e., `y == yp` within floating-point precision).
- *Note*: Fast but may suffer from rounding errors for slowly converging or oscillating series.
All functions are designed for performance and simplicity, with no external dependencies beyond `fmt` (for error messages). The package is a stripped-down copy of internal utilities, likely used in performance-critical or statistical computations.