Skip to content

Commit 8a06f33

Browse files
committed
Document normal distribution commands
1 parent cd5070c commit 8a06f33

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ object-level facts rather than asking the scalar layer to infer geometry or topo
198198

199199
```toml
200200
[dependencies]
201-
hyperreal = "0.12.0"
201+
hyperreal = "0.13.0"
202202
```
203203

204204
With the `Simple` parser and calculator binary:
205205

206206
```toml
207207
[dependencies]
208-
hyperreal = { version = "0.12.0", features = ["simple"] }
208+
hyperreal = { version = "0.13.0", features = ["simple"] }
209209
```
210210

211211
Feature flags:
@@ -323,6 +323,18 @@ assert_eq!(value.exact_rational(), Some(Rational::fraction(7, 8).unwrap()));
323323
inverse hyperbolic functions, normal distribution helpers (`erf`, `dnorm`, `pnorm`,
324324
`qnorm`), integers, decimals, fractions, `pi`, and `e`.
325325

326+
Normal-distribution forms use the same `Real` methods as Rust callers:
327+
328+
| Form | Meaning | Domain |
329+
| --- | --- | --- |
330+
| `(erf x)` | error function | all real inputs |
331+
| `(dnorm x)` | standard normal density | finite values with `abs(x) <= 10` |
332+
| `(pnorm x)` | standard normal cumulative distribution | finite values with `abs(x) <= 10` |
333+
| `(qnorm p)` | inverse standard normal CDF | `pnorm(-10) < p < pnorm(10)` |
334+
335+
Inputs outside those supported numeric ranges return `Problem` rather than silently
336+
falling back to primitive floating point.
337+
326338
## Conversions
327339

328340
Supported conversions include:

src/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ numeric domain failures:
6565
- square root of known-negative values
6666
- logarithm of non-positive values
6767
- inverse trig / inverse hyperbolic domain failures
68+
- normal density/CDF inputs outside the supported finite approximation window
69+
- normal quantile inputs outside the supported probability window
6870
- invalid primitive float import such as `NaN` or infinity
6971

7072
Internal `expect` calls are reserved for representation invariants that should

src/computable/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Approximation kernels should:
4848
- avoid cancellation-prone forms when a stable transform is available
4949
- reuse shared constants such as `pi`, `tau`, `e`, `sqrt(2)`, `sqrt(3)`, and
5050
common logarithms
51+
- provide dedicated kernels for supported statistical functions such as `erf`,
52+
standard normal density/CDF, and standard normal quantile rather than routing
53+
through primitive floating point
5154
- keep approximation precision explicit rather than silently falling back to
5255
primitive floating point
5356

src/real/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ shape unless benchmarks show no cost.
6262
- arithmetic preserves recognizable symbolic structure where benchmarks justify
6363
it.
6464
- fallible methods return `Problem` for known domain errors.
65+
- `erf`, `dnorm`, `pnorm`, and `qnorm` expose computable standard-normal helpers;
66+
`dnorm`/`pnorm` are bounded to finite inputs with `abs(x) <= 10`, and `qnorm`
67+
is bounded to probabilities strictly between `pnorm(-10)` and `pnorm(10)`.
6568
- structural queries return conservative facts and should not force expensive
6669
approximation when representation facts are enough.
6770
- borrowed arithmetic should avoid unnecessary expression cloning.

0 commit comments

Comments
 (0)