Skip to content

Uncertain quantities and error propagation for the Julia language

Notifications You must be signed in to change notification settings

rephorm/Uncertain.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Uncertain.jl

Handle error propogation in Julia

NB: See Caveats below!

Example Usage

julia> load("uncertain.jl")
julia> import Uncertain.UncertainNumber

julia> a = UncertainNumber(1.0, 0.1)
UncertainNumber{Float64}(1.0,0.1)

julia> b = UncertainNumber(2.0, 0.2)
UncertainNumber{Float64}(2.0,0.2)

julia> 5*a
UncertainNumber{Float64}(5.0,0.5)

julia> a*2
UncertainNumber{Float64}(2.0,0.2)

julia> a*b
UncertainNumber{Float64}(2.0,0.28284271247461906)

julia> cosh(a^2 * b)
UncertainNumber{Float64}(3.7621956910836314,1.2563812996702035)

Caveats

Currently, only basic arithmetic functions (+-*/) and trig/hypertrig functions are supported. Feel free to implement more and send a pull request.

Correlations are currently ignored, so, e.g. a+a gives a smaller uncertainty than 2*a.

The ^ operator is also currently incorrect. It looks like it is being induced from * instead of using the one defined in the module.

About

Uncertain quantities and error propagation for the Julia language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages