Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
4 of 38 committers (10.5%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
math with more good bits
Basic Info
Statistics
- Stars: 165
- Watchers: 9
- Forks: 31
- Open Issues: 17
- Releases: 134
Topics
Metadata Files
README.md
DoubleFloats.jl
Math with 85+ accurate bits.
Extended precision float and complex types
- N.B.
Double64is the most performant type β
Installation
julia
pkg> add DoubleFloats
or
julia
julia> using Pkg
julia> Pkg.add("DoubleFloats")
More Performant Than Float128, BigFloat
these results are from BenchmarkTools, on one machine
There is another package, Quadmath.jl, which exports Float128 from GNU’s libquadmath. Float128s have 6 more significant bits than Double64s, and a much wider exponent range (Double64s exponents have the same range as Float64s). Big128 is BigFloat after setprecision(BigFloat, 128).
Benchmarking: vectors (v) of 1000 values and 50x50 matrices (m).
| | Double64 | Float128 | Big128 | | Double64 | Float128 | Big128 |
|:----------|:----------:|:--------:|:--------:|:-----------|:--------:|:---------:|:-------:|
|dot(v,v) | 1 | 3 | 7 | exp.(m) | 1 | 2 | 6 |
|v .+ v | 1 | 7 | 16 | m * m | 1 | 3 | 9 |
|v .* v | 1 | 12 | 25 | det(m) | 1 | 5 | 11 |
relative performance: smaller is faster, the larger number takes proportionately longer.
Examples
Double64, Double32, Double16
```julia julia> using DoubleFloats
julia> dbl64 = sqrt(Double64(2)); 1 - dbl64 * inv(dbl64) 0.0 julia> dbl32 = sqrt(Double32(2)); 1 - dbl32 * inv(dbl32) 0.0 julia> dbl16 = sqrt(Double16(2)); 1 - dbl16 * inv(dbl16) 0.0
julia> typeof(ans) === Double16
true
note: floating-point constants must be used with care,
they are evaluated as Float64 values before additional processing
julia
julia> Double64(0.2)
0.2
julia> showall(ans)
2.0000000000000001110223024625156540e-01
julia> Double64(2)/10 0.2 julia> showall(ans) 1.9999999999999999999999999999999937e-01
julia> df64"0.2" 0.2 julia> showall(ans) 1.9999999999999999999999999999999937e-01 ```
Complex functions
```julia
julia> x = ComplexDF64(sqrt(df64"2"), cbrt(df64"3")) 1.4142135623730951 + 1.4422495703074083im julia> showall(x) 1.4142135623730950488016887242096816 + 1.4422495703074083823216383107800998im
julia> y = acosh(x) 1.402873733241199 + 0.8555178360714634im
julia> x - cosh(y) 7.395570986446986e-32 + 0.0im ```
show, string, parse
```julia julia> using DoubleFloats
julia> x = sqrt(Double64(2)) / sqrt(Double64(6)) 0.5773502691896257
julia> string(x) "5.7735026918962576450914878050194151e-01"
julia> show(IOContext(Base.stdout,:compact=>false),x) 5.7735026918962576450914878050194151e-01
julia> showall(x) 0.5773502691896257645091487805019415
julia> showtyped(x) Double64(0.5773502691896257, 3.3450280739356326e-17)
julia> showtyped(parse(Double64, stringtyped(x))) Double64(0.5773502691896257, 3.3450280739356326e-17)
julia> Meta.parse(stringtyped(x)) :(Double64(0.5773502691896257, 3.3450280739356326e-17))
julia> x = ComplexDF32(sqrt(df32"2"), cbrt(df32"3")) 1.4142135 + 1.4422495im
julia> string(x) "1.414213562373094 + 1.442249570307406im"
julia> stringtyped(x) "ComplexD32(Double32(1.4142135, 2.4203233e-8), Double32(1.4422495, 3.3793125e-8))" ```
see https://juliamath.github.io/DoubleFloats.jl/stable/ for more information
Accuracy
results for f(x), x in 0..1
| function | abserr | relerr | |:--------:|:----------:|:----------:| | exp | 1.0e-31 | 1.0e-31 | | log | 1.0e-31 | 1.0e-31 | | | | | | sin | 1.0e-31 | 1.0e-31 | | cos | 1.0e-31 | 1.0e-31 | | tan | 1.0e-31 | 1.0e-31 | | | | | | asin | 1.0e-31 | 1.0e-31 | | acos | 1.0e-31 | 1.0e-31 | | atan | 1.0e-31 | 1.0e-31 | | | | | | sinh | 1.0e-31 | 1.0e-29 | | cosh | 1.0e-31 | 1.0e-31 | | tanh | 1.0e-31 | 1.0e-29 | | | | | | asinh | 1.0e-31 | 1.0e-29 | | atanh | 1.0e-31 | 1.0e-30 |
results for f(x), x in 1..2
| function | abserr | relerr | |:--------:|:----------:|:----------:| | exp | 1.0e-30 | 1.0e-31 | | log | 1.0e-31 | 1.0e-31 | | | | | | sin | 1.0e-31 | 1.0e-31 | | cos | 1.0e-31 | 1.0e-28 | | tan | 1.0e-30 | 1.0e-30 | | | | | | atan | 1.0e-31 | 1.0e-31 | | | | | | sinh | 1.0e-30 | 1.0e-31 | | cosh | 1.0e-30 | 1.0e-31 | | tanh | 1.0e-31 | 1.0e-28 | | | | | | asinh | 1.0e-31 | 1.0e-28 |
isapprox
isapproxuses this defaultrtol=eps(1.0)^(37/64).
Good Ways To Use This
In addition to simply using DoubleFloats and going from there, these two suggestions are easily managed
and will go a long way in increasing the robustness of the work and reliability in the computational results.
If your input values are Float64s, map them to Double64s and proceed with your computation. Then unmap your output values as Float64s, do additional work using those Float64s. With Float32 inputs, used Double32s similarly. Where throughput is important, and your algorithms are well-understood, this approach be used with the numerically sensitive parts of your computation only. If you are doing that, be careful to map the inputs to those parts and unmap the outputs from those parts just as described above.
Questions
Usage questions can be posted on the Julia Discourse forum. Use the topic Numerics (a "Discipline") and a put the package name, DoubleFloats, in your question ("topic").
Contributions
Contributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems.
β: If you want to get involved with moving Double32 performance forward, great. I would provide guidance. Otherwise, for most purposes you are better off using Float64 than Double32 (Float64 has more significant bits, wider exponent range, and is much faster).
Owner
- Name: Julia Math
- Login: JuliaMath
- Kind: organization
- Website: https://julialang.org
- Repositories: 53
- Profile: https://github.com/JuliaMath
Mathematics made easy in Julia
Citation (CITATION.cff)
cff-version: 1.2.0
message: If you use this software, please cite it using these metadata.
title: DoubleFloats
abstract: A high-performance type for accurate extended precision math.
authors:
- given-names: Jeffrey
family-names: Sarnoff
email: "jeffrey.sarnoff@gmail.com"
affiliation: "Julia Innovator"
orcid: "https://orcid.org/0000-0001-9159-1667"
- name: "JuliaMath"
type: software
url: "https://juliamath.github.io/DoubleFloats.jl/stable"
repository-code: "https://github.com/JuliaMath/DoubleFloats.jl"
version: 1.2.2
date-released: 2022-06-25
license: MIT
GitHub Events
Total
- Create event: 6
- Commit comment event: 6
- Release event: 3
- Issues event: 3
- Watch event: 9
- Delete event: 6
- Issue comment event: 19
- Push event: 11
- Pull request review comment event: 1
- Pull request review event: 1
- Pull request event: 7
- Fork event: 1
Last Year
- Create event: 6
- Commit comment event: 6
- Release event: 3
- Issues event: 3
- Watch event: 9
- Delete event: 6
- Issue comment event: 19
- Push event: 11
- Pull request review comment event: 1
- Pull request review event: 1
- Pull request event: 7
- Fork event: 1
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Jeffrey Sarnoff | J****f | 2,935 |
| Sascha Timme | s****e@g****m | 13 |
| Oscar Smith | o****h@g****m | 11 |
| araujoms | m****n@g****m | 9 |
| Dillon Daudert | d****t@g****m | 7 |
| Neven Sajko | s@p****m | 6 |
| David Gleich | d****h@p****u | 5 |
| dependabot[bot] | 4****] | 5 |
| t-bltg | t****g@g****m | 4 |
| Simon Byrne | s****e@g****m | 4 |
| Asbjørn Nilsen Riseth | a****h@g****m | 3 |
| Kristoffer Carlsson | k****9@g****m | 3 |
| Steven G. Johnson | s****j@m****u | 3 |
| woclass | g****t@w****n | 3 |
| yikait2 | 4****2 | 3 |
| Antoine Levitt | a****t@g****m | 2 |
| Benjamin Deonovic | b****c@g****m | 2 |
| GregPlowman | G****n | 2 |
| Hannes Uppman | h****n@g****m | 2 |
| Harmen Stoppels | h****s@g****m | 2 |
| Lilith Orion Hafner | l****r@g****m | 2 |
| Michael F. Herbst | i****o@m****m | 2 |
| Ralph A. Smith | s****a@g****m | 2 |
| Zeke | 6****t | 2 |
| klinemichael | m****l@k****m | 2 |
| Hendrik Ranocha | r****a | 2 |
| mtanneau | m****u@g****m | 1 |
| github-actions[bot] | 4****] | 1 |
| Yuping Luo | r****u@g****m | 1 |
| Viral B. Shah | V****h | 1 |
| and 8 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 76
- Total pull requests: 64
- Average time to close issues: about 2 months
- Average time to close pull requests: 27 days
- Total issue authors: 58
- Total pull request authors: 29
- Average comments per issue: 6.08
- Average comments per pull request: 2.33
- Merged pull requests: 58
- Bot issues: 0
- Bot pull requests: 7
Past Year
- Issues: 2
- Pull requests: 6
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Issue authors: 2
- Pull request authors: 4
- Average comments per issue: 3.0
- Average comments per pull request: 2.67
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- GregPlowman (4)
- saschatimme (4)
- photor (3)
- nschaeff (3)
- andreasvarga (2)
- lrnv (2)
- JeffreySarnoff (2)
- PallHaraldsson (2)
- moble (2)
- protogeezer (2)
- pearlzli (1)
- zhiyuanzhai (1)
- ericphanson (1)
- mateuszbaran (1)
- pepijndevos (1)
Pull Request Authors
- JeffreySarnoff (14)
- dependabot[bot] (10)
- araujoms (9)
- oscardssmith (4)
- ranocha (3)
- GregPlowman (3)
- dgleich (3)
- stevengj (2)
- nsajko (2)
- KristofferC (2)
- t-bltg (2)
- jondeuce (2)
- mfherbst (2)
- saschatimme (2)
- simonbyrne (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 730 total
- Total dependent packages: 24
- Total dependent repositories: 5
- Total versions: 136
juliahub.com: DoubleFloats
math with more good bits
- Documentation: https://docs.juliahub.com/General/DoubleFloats/stable/
- License: MIT
-
Latest release: 1.4.3
published 11 months ago
Rankings
Dependencies
- actions/cache v1 composite
- actions/checkout v2 composite
- codecov/codecov-action v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v3 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-invalidations v1 composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite
- actions/checkout v2 composite
- julia-actions/setup-julia latest composite