Add cheat sheet to documentation#750
Conversation
Quick-reference page covering the full v1 API: types, constructors, string parsing, ExactReal/NG flag, accessors, decorations, arithmetic, powers, boolean functions, set operations, bisection, display options, configuration, piecewise functions, and common gotchas. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
OlivierHnt
left a comment
There was a problem hiding this comment.
Great idea, thanks for taking the initiative!
| | Function | IEEE 1788? | Domain | Notes | | ||
| |----------|:----------:|--------|-------| | ||
| | [`pown`](@ref)`(x, n)` | Yes | full real line | exact for integer powers | | ||
| | [`pow`](@ref)`(x, y)` | Yes | positive reals | standard power | |
There was a problem hiding this comment.
This is a bit more tricky actually:
julia> pow(interval(-1, 1), 2)
[0.0, 1.0]_trv
julia> pown(interval(-1, 1), 2)
[0.0, 1.0]_com
julia> interval(-1, 1) ^ 2
[0.0, 1.0]_com
julia> fastpow(interval(-1, 1), 2)
[0.0, 1.0]_trvThere was a problem hiding this comment.
IIRC, the behaviour of pow, pown are dictated by the standard. The fast version follow the same guidelines.
For ^, we are trying to do something "more convenient": the functions calls pown or pow depending on the exponent.
| ### Standard functions | ||
|
|
||
| `sqrt`, `cbrt`, `exp`, `exp2`, `exp10`, `expm1`, `log`, `log2`, `log10`, `log1p`, | ||
| `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `sinh`, `cosh`, `tanh`, etc. |
There was a problem hiding this comment.
We should probably make this list exhaustive? I mean removing "etc."
| (Interval{Float64}[Interval{Float64}(0.0, 0.5, com, true), Interval{Float64}(0.0, 1.0, com, true)], Interval{Float64}[Interval{Float64}(0.5, 1.0, com, true), Interval{Float64}(0.0, 1.0, com, true)]) | ||
| ``` | ||
|
|
||
| ## Display Options |
There was a problem hiding this comment.
This should probably put before, since it is used above.
|
|
||
| Usage: `IntervalArithmetic.configure(numtype=BigFloat, power=:slow)` | ||
|
|
||
| ## The `@interval` Macro |
There was a problem hiding this comment.
Maybe this should be next to the constructors; we should also add something about @exact
|
Looks like the documentation is failing to build. |
|
@dpsanders did you want to discuss some of the feedback I sent? |
Summary
docs/src/manual/cheatsheet.md) covering the full v1 API as a quick referenceThe cheat sheet covers: type hierarchy, constructors, string parsing, ExactReal/NG flag, accessors, decorations, arithmetic, powers, boolean functions, set operations, bisection, display options, configuration, piecewise functions, and common gotchas.
All examples use
jldoctestblocks for verification during docs builds.Test plan
julia docs/make.jl🤖 Generated with Claude Code