{"id":23187991,"url":"https://github.com/stillwater-sc/universal","last_synced_at":"2026-04-02T20:44:43.157Z","repository":{"id":37493087,"uuid":"89959055","full_name":"stillwater-sc/universal","owner":"stillwater-sc","description":"Large collection of number systems providing custom arithmetic for mixed-precision algorithm development and optimization for AI, Machine Learning, Computer Vision, Signal Processing, CAE, EDA, control, optimization, estimation, and approximation.","archived":false,"fork":false,"pushed_at":"2026-01-26T00:08:54.000Z","size":138553,"stargazers_count":483,"open_issues_count":37,"forks_count":68,"subscribers_count":27,"default_branch":"main","last_synced_at":"2026-01-26T10:45:23.405Z","etag":null,"topics":["arbitrary-precision","arbitrary-precision-arithmetic","arbitrary-precision-floats","arbitrary-precision-integers","arithmetic","artificial-intelligence","c-plus-plus","digital-signal-processing","embedded-systems","fixed-point-arithmetic","floating-point-arithmetic","half-precision","integer-arithmetic","interval-arithmetic","octa-precision","posit-arithmetic","quad-precision","quarter-precision","rational-arithmetic"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stillwater-sc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["stillwater-sc"],"open_collective":"universal-number-library"}},"created_at":"2017-05-01T20:13:06.000Z","updated_at":"2026-01-25T23:29:27.000Z","dependencies_parsed_at":"2024-03-15T18:47:00.172Z","dependency_job_id":"124dcb78-0fac-46ab-8f35-edeb52e101a2","html_url":"https://github.com/stillwater-sc/universal","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/stillwater-sc/universal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stillwater-sc%2Funiversal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stillwater-sc%2Funiversal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stillwater-sc%2Funiversal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stillwater-sc%2Funiversal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stillwater-sc","download_url":"https://codeload.github.com/stillwater-sc/universal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stillwater-sc%2Funiversal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28805345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T05:43:52.625Z","status":"ssl_error","status_checked_at":"2026-01-27T05:43:48.957Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arbitrary-precision","arbitrary-precision-arithmetic","arbitrary-precision-floats","arbitrary-precision-integers","arithmetic","artificial-intelligence","c-plus-plus","digital-signal-processing","embedded-systems","fixed-point-arithmetic","floating-point-arithmetic","half-precision","integer-arithmetic","interval-arithmetic","octa-precision","posit-arithmetic","quad-precision","quarter-precision","rational-arithmetic"],"created_at":"2024-12-18T11:11:43.955Z","updated_at":"2026-04-02T20:44:43.141Z","avatar_url":"https://github.com/stillwater-sc.png","language":"C++","readme":"# Universal: a header-only C++ template library of custom arithmetic plug-in types\n\n\n| **System** | **Status** | **More information** |\n|------------|------------|----------------------|\n| [Codacy Code Quality](https://app.codacy.com/gh/stillwater-sc/universal/dashboard) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/25452f0319d34bc2a553cd1857d7dfae)](https://app.codacy.com/gh/stillwater-sc/universal?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=stillwater-sc/universal\u0026utm_campaign=Badge_Grade_Dashboard) | Code Quality Assessment |\n| [FOSSA Status](https://app.fossa.com/projects/git%2Bgithub.com%2Fstillwater-sc%2Funiversal) | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fstillwater-sc%2Funiversal.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fstillwater-sc%2Funiversal?ref=badge_shield) | Open-source license dependency scanner |\n| [GitHub Actions](https://github.com/stillwater-sc/universal/actions) | [![Build Status](https://github.com/stillwater-sc/universal/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/stillwater-sc/universal) | Latest Linux/MacOS/Windows builds and regression tests |\n| [Development Branch](https://github.com/stillwater-sc/universal/actions) | ![Development Branch Status](https://github.com/stillwater-sc/universal/actions/workflows/cmake.yml/badge.svg?branch=v3.88) | Development Branch |\n| [Regression Status](https://github.com/stillwater-sc/universal/actions) | ![Regression Status](https://github.com/stillwater-sc/universal/actions/workflows/cmake.yml/badge.svg?event=push) | Regression Status |\n| [Code Coverage](https://coveralls.io) | [![Coverage Status](https://coveralls.io/repos/github/stillwater-sc/universal/badge.svg?branch=main)](https://coveralls.io/github/stillwater-sc/universal?branch=main) | Code coverage scanner |\n| [Docker Pulls](https://hub.docker.com/r/stillwater/universal) | [![Docker Pulls](https://img.shields.io/docker/pulls/stillwater/universal.svg)](https://hub.docker.com/r/stillwater/universal) | Container pulls |\n| [Awesome C++](https://github.com/fffaraz/awesome-cpp) | [![Awesome Cpp](https://awesome.re/mentioned-badge.svg)](https://github.com/fffaraz/awesome-cpp#math) | Awesome C++ Libraries |\n| [JOSS Markdown](https://joss.theoj.org) | [![status](https://joss.theoj.org/papers/932fdfc2735a85422e4431f27ebfc0d0/status.svg)](https://joss.theoj.org/papers/932fdfc2735a85422e4431f27ebfc0d0)  | Journal of Open-Source Software paper |\n| [Zenodo](https://zenodo.org/record/7735084) | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7735084.svg)](https://doi.org/10.5281/zenodo.7735084) | Zenodo DOI Badge |\n-------------------------------\n\n\nThe goal of the Universal Numbers Library is to offer alternatives to native integer and floating-point for mixed-precision algorithm development and optimization. Tailoring the arithmetic types to the application's precision and dynamic range enables a new level of application performance and energy efficiency, particularly valuable for embedded applications that need autonomy through intelligent behavior.\n\nDeep Learning algorithms in particular provide a core application vertical where alternative formats and precisions, such as half-precision floating-point and bfloat16, yield speed-ups of two to three orders of magnitude, making rapid innovation in AI possible.\n\nThe Universal Library is a ready-to-use header-only library that provides a plug-in replacement for native types and offers a low-friction environment to explore alternatives to IEEE-754 floating-point in AI, DSP, HPC, and HFT algorithms.\n\nThe basic use pattern is as simple as:\n\n```code\n// bring in the parameterized type of interest, in this case\n// a fixed-sized, arbitrary configuration classic floating-point\n#include \u003cuniversal/number/cfloat/cfloat.hpp\u003e\n\n// define your computational kernel parameterized by arithmitic type\ntemplate\u003ctypename Real\u003e\nReal MyKernel(const Real\u0026 a, const Real\u0026 b) {\n    return a * b;  // replace this with your kernel computation\n}\n\nconstexpr double pi = 3.14159265358979323846;\n\nint main() {\n    // if desired, create an application type alias to avoid errors\n    using Real = sw::universal::half; // half-precision IEEE-754 floating-point  \n\n    Real a = sqrt(2);\n    Real b = pi;\n    // finally, call your kernel with your desired arithmetic type\n    std::cout \u003c\u003c \"Result: \" \u003c\u003c MyKernel(a, b) \u003c\u003c std::endl;  \n}\n```\n\nThe library contains fast implementations of special IEEE-754 formats that do not have universal hardware implementations across x86, ARM, POWER, RISC-V, and GPUs. Special formats such as quarter precision, `quarter`, half-precision, `half`, and quad precision, `quad`, are provided, as well as vendor-specific extensions, such as NVIDIA `TensorFloat`, Google's Brain Float, `bfloat16`, or TI DSP fixed-points, `fixpnt`. In addition to these often-used specializations, *Universal* supports static and elastic integers, decimals, fixed-points, rationals, linear floats, tapered floats, logarithmic, interval and adaptive-precision integers, rationals, and floats. There are example number system skeletons to get you started quickly if you desire to add your own.\n\n## Communication channels\n\n* [GitHub Issue](https://github.com/stillwater-sc/universal/issues): bug reports,\n  feature requests, etc.\n* [Forum](https://groups.google.com/u/1/g/unum-computing): discussion of alternatives to IEEE-754 for computational science.\n* [Slack](https://fptalks.slack.com): online chats, discussions,\n  and collaboration with other users, researchers and developers.\n\n## Citation\n\nPlease cite [our work](https://joss.theoj.org/papers/10.21105/joss.05072) if you use *Universal*.\n\nResearch results using *Universal* arithmetic types are also available:\n1. [Reproducibility](https://arxiv.org/abs/2012.11011)\n2. [Iterative Refinement](https://arxiv.org/abs/2408.13400)\n\nLorenz System ODE solver using low-precision posits:\n![visual-studio-project](docs/img/Lorenz-system.png)\n\n## Bibtex records\n```bib\n@article{Quinlan:2024,\n    author     = {James Quinlan, E. Theodore L. Omtzigt},\n    title      = {Iterative Refinement with Low-Precision Posits},\n    journal    = {arXiv:2408.13400},\n    year       = {2024},\n}\n\n@article{omtzigt2023universal,\n  title={Universal Numbers Library: Multi-format Variable Precision Arithmetic Library},\n  author={Omtzigt, E Theodore L and Quinlan, James},\n  journal={Journal of Open Source Software},\n  volume={8},\n  number={83},\n  pages={5072},\n  year={2023}\n}\n\n@inproceedings{Omtzigt:2022,\n  title        = {Universal: Reliable, Reproducible, and Energy-Efficient Numerics},\n  author       = {E. Theodore L. Omtzigt and James Quinlan},\n  booktitle    = {Conference on Next Generation Arithmetic},\n  pages        = {100--116},\n  year         = {2022},\n  organization = {Springer}\n}\n\n@article{Omtzigt2020,\n    author     = {E. Theodore L. Omtzigt and Peter Gottschling and Mark Seligman and William Zorn},\n    title      = {{Universal Numbers Library}: design and implementation of a high-performance reproducible number systems library},\n    journal    = {arXiv:2012.11011},\n    year       = {2020},\n}\n```\n\n## Talks and Presentations\n\nThe following presentations describe *Universal* and the number systems it contained as of the time of publication.\n\nSlides of a presentation at [FPTalks'21](https://fpbench.org/talks/fptalks21.html)\n\n[Presentation: Application-Driven Custom Number Systems](https://drive.google.com/file/d/1fPvJ5kjjNKY9TiVCBX8xwb5czGNd87Dr/view)\n\nSlides of the presentation at [CoNGA'22](https://link.springer.com/book/10.1007/978-3-031-09779-9)\n\n[Presentation: Universal: Reliable, Reproducible, and Energy-Efficient Numerics](docs/presentations/conga22-universal-arithmetic-library.pdf)\n\nA quick description of the structure of the number system parameterization can be found [here](docs/number-system-type-parameterization.md).\n\n## Quick start\n\nFollow the local workflow notes in [how-to-run-sanitizers.md](how-to-run-sanitizers.md).\n\nIf you just want to experiment with Universal without cloning and building the source code, there is a Docker container with compilers, cmake, and the library pre-installed:\n\n```text\n\u003e docker pull stillwater/universal\n\u003e docker run -it --rm stillwater/universal bash\nstillwater@container:~$ ieee 1.5\nstillwater@container:~$ cat \u003e hello.cpp \u003c\u003c 'EOF'\n#include \u003cuniversal/number/posit/posit.hpp\u003e\n#include \u003ciostream\u003e\nint main() {\n    sw::universal::posit\u003c16,2\u003e p = 1.5;\n    std::cout \u003c\u003c p \u003c\u003c '\\n';\n}\nEOF\nstillwater@container:~$ g++ -std=c++20 -I/usr/local/include/sw -o hello hello.cpp \u0026\u0026 ./hello\n```\n\n[Here](docs/command-line-tools.md) is a quick reference of what the command line tools have to offer.\n\n### VS Code Dev Container\n\nFor a full development environment with both GCC and Clang, install [Docker](https://www.docker.com/) and the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) VS Code extension, then open the repository and select **Reopen in Container**. CMake presets (`gcc-debug`, `clang-release`, etc.) are available in the CMake Tools preset selector.\n\n## How to build\n\nIf you do want to work with the code, the universal numbers software library is built using cmake version v4.2.1.\nInstall the latest [cmake](https://cmake.org/download).\nThere are interactive installers for MacOS and Windows.\nFor Linux, a portable approach downloads the shell archive and installs it at /usr/local:\n\n```text\n\u003e wget https://github.com/Kitware/CMake/releases/download/v4.2.1/cmake-4.2.1-Linux-x86_64.sh\n\u003e sudo sh cmake-4.2.1-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir\n```\n\nFor Ubuntu, snap will install the latest cmake, and would be the preferred method:\n\n```text\n\u003e sudo snap install cmake --classic\n```\n\nThe Universal Library is a pure C++ template library without any further dependencies, \neven for the regression test suites to enable hassle-free installation and use.\n\nClone the GitHub repo, and you are ready to build the different components of the Universal library.  \nThe library contains tools for using integers, decimals, fixed-points, floats, posits, valids, and logarithmic\nnumber systems. It includes educational programs that showcase simple use cases to familiarize yourself with\ndifferent number systems and application examples to highlight the use of other number systems to gain performance\nor numerical accuracy. Finally, each number system offers its own verification suite. \n\nThe easiest way to become familiar with all the options in the build process is to fire up the CMake GUI (or ccmake if you are on a headless server). The CMake output will summarize which options have been set.  \nThe output will look something like this:\n\n```text\n$ git clone https://github.com/stillwater-sc/universal\n$ cd universal\n$ mkdir build\n$ cd build\n$ cmake ..\n\n _____  _____  ____  _____  _____  ____   ____  ________  _______     ______        _       _____\n|_   _||_   _||_   \\|_   _||_   _||_  _| |_  _||_   __  ||_   __ \\  .' ____ \\      / \\     |_   _|   \n  | |    | |    |   \\ | |    | |    \\ \\   / /    | |_ \\_|  | |__) | | (___ \\_|    / _ \\      | |     \n  | '    ' |    | |\\ \\| |    | |     \\ \\ / /     |  _| _   |  __ /   _.____`.    / ___ \\     | |   _ \n   \\ \\__/ /    _| |_\\   |_  _| |_     \\ ' /     _| |__/ | _| |  \\ \\_| \\____) | _/ /   \\ \\_  _| |__/ |\n    `.__.'    |_____|\\____||_____|     \\_/     |________||____| |___|\\______.'|____| |____||________|\n\n-- C++20 has been enabled by default\n-- UNIVERSAL_BUILD_REGRESSION_SANITY   ON\n-- UNIVERSAL_BUILD_REGRESSION_LEVEL_1  ON\n-- \n-- PROJECT_NAME                = universal\n-- PROJECT_NAME_NOSPACES       = universal\n-- PROJECT_SOURCE_DIR          = /home/stillwater/dev/stillwater/clones/universal\n-- PROJECT_VERSION             = 3.88.1.2a532d61\n-- CMAKE_C_COMPILER            = /usr/bin/cc\n-- CMAKE_CXX_COMPILER          = /usr/bin/c++\n-- CMAKE_CURRENT_SOURCE_DIR    = /home/stillwater/dev/stillwater/clones/universal\n-- CMAKE_CURRENT_BINARY_DIR    = /home/stillwater/dev/stillwater/clones/universal/build\n-- GIT_COMMIT_HASH             = 2a532d61\n-- GIT_BRANCH                  = main\n-- include_install_dir         = include\n-- include_install_dir_full    = include/universal\n-- config_install_dir          = share/universal\n-- include_install_dir_postfix = universal\n-- Removing complex environment experiment in the Playground\n-- Removing concurrency experiment in the Playground\n-- Ignoring complex tests for application/performance\n-- Found clang-format: /usr/bin/clang-format-18\n--   Version: Ubuntu clang-format version 18.1.3 (1ubuntu1)\n--   Files to format: 1482\n-- Found clang-tidy: /usr/bin/clang-tidy-18\n--   Version: Ubuntu LLVM version 18.1.3\n  Optimized build.\n--   Header files for analysis: 738\n--   Sample test files for analysis: 79\n-- \n-- Clang-tidy targets configured:\n--   make tidy-check         - Run clang-tidy on headers (read-only)\n--   make tidy-check-samples - Run clang-tidy on sample test files\n--   make tidy-fix           - Apply clang-tidy fixes to headers\n--   make tidy-info          - Show detailed configuration\n--   Script: /home/stillwater/dev/stillwater/clones/universal/build/run-clang-tidy.sh\n-- \n-- ******************* Universal Arithmetic Library Configuration Summary *******************\n-- General:\n--   Version                          :   3.88.1.2a532d61\n--   System                           :   Linux\n--   C++ Language Requirement         :   C++20\n--   C compiler                       :   /usr/bin/cc\n--   Release C flags                  :   -O3 -DNDEBUG -Wall -Wpedantic -Wno-narrowing -Wno-deprecated\n--   Debug C flags                    :   -g -Wall -Wpedantic -Wno-narrowing -Wno-deprecated\n--   C++ compiler                     :   /usr/bin/c++\n--   Release CXX flags                :   -O3 -DNDEBUG   -Wall -Wpedantic -Wno-narrowing -Wno-deprecated -Wall -Wpedantic -Wno-narrowing -Wno-deprecated\n--   Debug CXX flags                  :   -g   -Wall -Wpedantic -Wno-narrowing -Wno-deprecated -Wall -Wpedantic -Wno-narrowing -Wno-deprecated\n--   Build type                       :   Release\n-- \n--   UNIVERSAL_BUILD_ALL                        :   OFF\n--   UNIVERSAL_BUILD_CI                         :   OFF\n-- \n--   UNIVERSAL_BUILD_DEMONSTRATION              :   ON\n--   UNIVERSAL_BUILD_NUMBERS                    :   OFF\n--   UNIVERSAL_BUILD_NUMBER_CASCADES            :   OFF\n--   UNIVERSAL_BUILD_NUMERICS                   :   OFF\n--   UNIVERSAL_BUILD_BENCHMARKS                 :   OFF\n--   UNIVERSAL_BUILD_MIXEDPRECISION_SDK         :   OFF\n--   UNIVERSAL_BUILD_COMPLEX                    :   OFF\n--   UNIVERSAL_BUILD_CONCURRENCY                :   OFF\n-- \n--   UNIVERSAL_BUILD_TOOLS_CMD_LINE             :   ON\n--   UNIVERSAL_BUILD_TOOLS_UTILS                :   ON\n--   UNIVERSAL_BUILD_TOOLS_CLOSURE              :   OFF\n--   UNIVERSAL_BUILD_EDUCATION                  :   ON\n--   UNIVERSAL_BUILD_APPLICATIONS               :   ON\n--   UNIVERSAL_BUILD_PLAYGROUND                 :   ON\n-- \n--   UNIVERSAL_BUILD_NUMBER_INTERNALS           :   OFF\n--   UNIVERSAL_BUILD_NUMBER_NATIVE_TYPES        :   OFF\n--   UNIVERSAL_BUILD_NUMBER_ELASTICS            :   OFF\n--   UNIVERSAL_BUILD_NUMBER_STATICS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_CONVERSIONS         :   OFF\n-- \n--   UNIVERSAL_BUILD_NUMBER_EINTEGERS           :   OFF\n--   UNIVERSAL_BUILD_NUMBER_EDECIMALS           :   OFF\n--   UNIVERSAL_BUILD_NUMBER_ERATIONALS          :   OFF\n--   UNIVERSAL_BUILD_NUMBER_EFLOATS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_EREALS              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_ELREALS             :   OFF\n-- \n--   UNIVERSAL_BUILD_NUMBER_INTEGERS            :   OFF\n--   UNIVERSAL_BUILD_NUMBER_DECIMALS            :   OFF\n--   UNIVERSAL_BUILD_NUMBER_RATIONALS           :   OFF\n--   UNIVERSAL_BUILD_NUMBER_FIXPNTS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_BFLOATS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_CFLOATS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_DFLOATS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_DOUBLE_DOUBLE       :   OFF\n--   UNIVERSAL_BUILD_NUMBER_TRIPLE_DOUBLE       :   OFF\n--   UNIVERSAL_BUILD_NUMBER_QUAD_DOUBLE         :   OFF\n--   UNIVERSAL_BUILD_NUMBER_DD_CASCADE          :   OFF\n--   UNIVERSAL_BUILD_NUMBER_TD_CASCADE          :   OFF\n--   UNIVERSAL_BUILD_NUMBER_QD_CASCADE          :   OFF\n--   UNIVERSAL_BUILD_NUMBER_AREALS              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_UNUM1S              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_UNUM2S              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_POSITS              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_POSITOS             :   OFF\n--   UNIVERSAL_BUILD_NUMBER_VALIDS              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_TAKUMS              :   OFF\n--   UNIVERSAL_BUILD_NUMBER_LNS                 :   OFF\n--   UNIVERSAL_BUILD_NUMBER_DBNS                :   OFF\n--   UNIVERSAL_BUILD_NUMBER_SORNS               :   OFF\n-- \n--   UNIVERSAL_BUILD_TYPE_HIERARCHY             :   OFF\n-- \n--   UNIVERSAL_BUILD_NUMERIC_FUNCTIONS          :   OFF\n--   UNIVERSAL_BUILD_NUMERIC_QUIRES             :   OFF\n--   UNIVERSAL_BUILD_NUMERIC_CHALLENGES         :   OFF\n--   UNIVERSAL_BUILD_NUMERIC_UTILS              :   OFF\n--   UNIVERSAL_BUILD_NUMERIC_FPBENCH            :   OFF\n-- \n--   UNIVERSAL_BUILD_BENCHMARK_ERROR            :   OFF\n--   UNIVERSAL_BUILD_BENCHMARK_ACCURACY         :   OFF\n--   UNIVERSAL_BUILD_BENCHMARK_REPRODUCIBILITY  :   OFF\n--   UNIVERSAL_BUILD_BENCHMARK_PERFORMANCE      :   OFF\n--   UNIVERSAL_BUILD_BENCHMARK_ENERGY           :   OFF\n-- \n--   UNIVERSAL_BUILD_MIXEDPRECISION_ROOTS       :   OFF\n--   UNIVERSAL_BUILD_MIXEDPRECISION_APPROXIMATE :   OFF\n--   UNIVERSAL_BUILD_MIXEDPRECISION_INTEGRATE   :   OFF\n--   UNIVERSAL_BUILD_MIXEDPRECISION_INTERPOLATE :   OFF\n--   UNIVERSAL_BUILD_MIXEDPRECISION_OPTIMIZE    :   OFF\n--   UNIVERSAL_BUILD_MIXEDPRECISION_TENSOR      :   OFF\n-- \n--   UNIVERSAL_BUILD_LINEAR_ALGEBRA_BLAS        :   OFF\n--   UNIVERSAL_BUILD_LINEAR_ALGEBRA_VMATH       :   OFF\n--   UNIVERSAL_BUILD_LINEAR_ALGEBRA_DATA        :   OFF\n-- \n-- \n--   UNIVERSAL_BUILD_C_API_PURE_LIB             :   OFF\n--   UNIVERSAL_BUILD_C_API_SHIM_LIB             :   OFF\n--   UNIVERSAL_BUILD_C_API_LIB_PIC              :   OFF\n--   UNIVERSAL_BUILD_DOCS                       :   OFF\n-- \n-- Regression Testing Level:\n--   UNIVERSAL_BUILD_REGRESSION_SANITY          :   ON\n-- \n-- Compiler Configuration:\n--   Verbose build messages           :   NO\n-- \n-- Dependencies:\n--   SSE3                             :   NO\n--   AVX                              :   NO\n--   AVX2                             :   NO\n-- \n-- Utilities:\n--   Serializer                       :   NO\n-- \n-- Install:\n--   Install path                     :   /usr/local\n-- \n\n _____  _____  ____  _____  _____  ____   ____  ________  _______     ______        _       _____\n|_   _||_   _||_   \\|_   _||_   _||_  _| |_  _||_   __  ||_   __ \\  .' ____ \\      / \\     |_   _|   \n  | |    | |    |   \\ | |    | |    \\ \\   / /    | |_ \\_|  | |__) | | (___ \\_|    / _ \\      | |     \n  | '    ' |    | |\\ \\| |    | |     \\ \\ / /     |  _| _   |  __ /   _.____`.    / ___ \\     | |   _ \n   \\ \\__/ /    _| |_\\   |_  _| |_     \\ ' /     _| |__/ | _| |  \\ \\_| \\____) | _/ /   \\ \\_  _| |__/ |\n    `.__.'    |_____|\\____||_____|     \\_/     |________||____| |___|\\______.'|____| |____||________|\n\n-- Configuring done (0.1s)\n-- Generating done (0.1s)\n-- Build files have been written to: /home/stillwater/dev/stillwater/clones/universal/build\n```\n\nAs you can see in the cmake output there are many build targets. Each build target is designed to provide\nfocus and fast build turnarounds when working with different number systems. Each number system has its\nown build target allowing fast and efficient regression testing.\n\nThe default build configuration is to build the DEMONSTRATION set, which contain the CMD_LINE_TOOLS, UTILS,\nEDUCATION, APPLICATIONS, and PLAYGROUND.\n\nThe build options are enabled/disabled as follows:\n\n```text\n\u003e cmake -DUNIVERSAL_BUILD_EDUCATION=OFF -DUNIVERSAL_BUILD_NUMBER_POSITS=ON ..\n```\n\nAfter building, issue the command _make test_ to run the complete test suite of all the enabled components, \nas a regression capability when you are modifying the source code. This will take touch all the corners of the code.\n\n```text\n\u003e git clone https://github.com/stillwater-sc/universal\n\u003e cd universal\n\u003e mkdir build\n\u003e cd build\n\u003e cmake ..\n\u003e make -j \"$(nproc)\"\n\u003e make test\n```\n\nFor Windows and Visual Studio, there are `CMakePredefinedTargets` that accomplish the same tasks:\n\n```text\n    - ALL_BUILD will compile all the projects\n    - INSTALL   will install the Universal library\n    - RUN_TESTS will run all tests\n```\n\nHere is the layout of all the projects contained in V3.68 of Universal:\n\n![visual-studio-project](docs/img/visual-studio-project.png)\n\nIn the *Applications* section, you will find application examples to demonstrate the use of Universal \narithmetic types to accomplish different numerical goals, such as reproducibility, accuracy, performance,\nor precision. These examples are great starting points for your own application requirements.\n\n![example-applications](docs/img/example-applications.png)\n\n## How to develop and extend *Universal*\n\nThe *Universal* library contains hundreds of example programs to demonstrate the use of the arithmetic types and the enable new developers to get up to speed. In each number system type's regression suite there is an `api/api.cpp` that chronicles all the invokation and use cases to provide an executable example of how to use the type. In general, the api section of the regression tests has code examples how to use the different library components, such as manipulators, attributes, number traits, exceptions, and special cases. \n\nIn the `education` build target (BUILD_EDUCATION), there are individual test programs that demonstrate how to use the different types.\n\nThe `docs` directory contains the descriptions of the [command line tools](docs/command-line-tools.md), a [tutorial](docs/number-system-type-parameterization.md) explaining the parameterization design of the arithmetic types in *Universal*, several conference presentations, [FPTalks](docs/presentations/fptalks-custom-number-systems.pdf) and [CoNGA22](docs/presentations/conga22-universal-arithmetic-library.pdf), describing the arithmetic types. The `docs` directory also contains ready-to-use value tables and dynamic range comparisons of many key small arithmetic types of interest in AI and DSP applications.\n\nEach number system comes with a complete regression suite to verify the functionality of assignment, conversion, arithmetic, logic, exceptions, number traits, and special cases. These regression suites are run for each PR or push to the version branch. *Universal* uses standard GitHub Actions for this, so add your branch to the workflow cmake yaml to trigger CI for your own branch.\n\nThe easiest way to get started is to pick up and copy the directory structure under `ROOT/include/universal/number/skeleton_1param` or `ROOT/include/universal/number/skeleton_2params`. They are configured to get you all the constituent pieces of a number system *Universal*-style.\n\n# Installation and usage\n\nAfter cloning the library, building and testing it in your environment, you can install it via:\n\n```text\n\u003e cd universal/build\n\u003e cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/your/installation/path\n\u003e cmake --build . --config Release --target install -- -j $(nproc)\n```\n\nor manually via the Makefile target in the build directory:\n\n```text\n\u003e make -j $(nproc) install\n```\n\nThe default install directory is `/usr/local` under Linux.  There is also an _uninstall_ command:\n\n```text\n\u003e make uninstall\n```\n\nIf you want to use the number systems provided by Universal in your own project, \nyou can use the following CMakeLists.txt structure:\n\n```code\nproject(\"my-numerical-experiment\")\n\nfind_package(UNIVERSAL CONFIG REQUIRED)\n\nadd_executable(${PROJECT_NAME} src/mymain.cpp)\nset_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)\ntarget_link_libraries(${PROJECT_NAME} universal::universal)\n```\n\n## Controlling the build to include different components\n\nThe default build configuration will build the command line tools, a playground, educational and \napplication examples. If you want to build the full regression suite across all the number systems, \nuse the following cmake command:\n\n```text\ncmake -DUNIVERSAL_BUILD_ALL=ON ..\n```\n\nFor performance, the build configuration can enable specific x86 instruction sets (SSE/AVX/AVX2). \nFor example, if your processor supports the AVX2 instruction set, you can build the test suites \nand educational examples with the AVX2 flag turned on. This typically yields a 20% performance boost.\n\n```text\ncmake -DUNIVERSAL_BUILD_ALL=on -DUSE_AVX2=ON ..\n```\n\nThe library builds a set of useful command utilities to inspect native IEEE float/double/long double \ntypes, as well as the custom number systems provided by Universal. Assuming you have build and \ninstalled the library, the inspection commands available are:\n\n```text\n    ieee           -- show the components of the full set of IEEE floating point values\n    quarter        -- show the components and traits of a quarter precision floating-point value (FP8)\n    half           -- show the components and traits of a half precision IEEE-754 value (FP16)\n    single         -- show the components and traits of a single precision IEEE-754 value (FP32)\n    double         -- show the components and traits of a double precision IEEE-754 value (FP64)\n    longdouble     -- show the components and traits of a native long double IEEE-754 value\n    quad           -- show the components and traits of a quad precision IEEE-754 value (FP128)\n\n    signedint      -- show the components and traits of a signed integer value\n    unsignedint    -- show the components and traits of an unsigned integer value\n    fixpnt         -- show the components and traits of a fixed-point value\n    posit          -- show the components and traits of a posit value\n    lns            -- show the components and traits of a logarithmic number system value\n\n    float2posit    -- show the conversion process of a Real value to a posit\n\n    propenv        -- show the properties of the execution (==compiler) environment that built the library\n    propp          -- show numerical properties of a posit environment including the associated quire\n    propq          -- show numerical properties of a quire\n```\n\nFor example:\n\n```text\n$ ieee 1.234567890123456789012\ncompiler              : 7.5.0\nfloat precision       : 23 bits\ndouble precision      : 52 bits\nlong double precision : 63 bits\n\nDecimal representations\ninput value:             1.23456789012\n      float:                1.23456788\n     double:        1.2345678901199999\nlong double:    1.23456789011999999999\n\nHex representations\ninput value:             1.23456789012\n      float:                1.23456788    hex: 0.7f.1e0652\n     double:        1.2345678901199999    hex: 0.3ff.3c0ca428c1d2b\nlong double:    1.23456789011999999999    hex: 0.3fff.1e06521460e95b9a\n\nBinary representations:\n      float:                1.23456788    bin: 0.01111111.00111100000011001010010\n     double:        1.2345678901199999    bin: 0.01111111111.0011110000001100101001000010100011000001110100101011\nlong double:    1.23456789011999999999    bin: 0.011111111111111.001111000000110010100100001010001100000111010010101101110011010\n\nNative triple representations (sign, scale, fraction):\n      float:                1.23456788    triple: (+,0,00111100000011001010010)\n     double:        1.2345678901199999    triple: (+,0,0011110000001100101001000010100011000001110100101011)\nlong double:    1.23456789011999999999    triple: (+,0,001111000000110010100100001010001100000111010010101101110011010)\n\nUniversal triple representation (sign, scale, fraction):\ninput value:             1.23456789012\n      float:                1.23456788    triple: (+,0,00111100000011001010010)\n     double:        1.2345678901199999    triple: (+,0,0011110000001100101001000010100011000001110100101011)\nlong double:    1.23456789011999999999    triple: (+,0,001111000000110010100100001010001100000111010010101101110011010)\n      exact: TBD\n```\n\nThis _ieee_ command is very handy to quickly determine how your development environment represents (truncates) a specific value. \n\nThe specific commands _single_, _double_, and _longdouble_ focus on float, double, and long double representations respectively.\n\nThere is also a command _posit_ to help you visualize and compare the posit component fields for a given value, for example:\n\n```text\n$ posit 1.234567890123456789012\nposit\u003c 8,0\u003e = s0 r10 e f01000 qNE v1.25\nposit\u003c 8,1\u003e = s0 r10 e0 f0100 qNE v1.25\nposit\u003c 8,2\u003e = s0 r10 e00 f010 qNE v1.25\nposit\u003c 8,3\u003e = s0 r10 e000 f01 qNE v1.25\nposit\u003c16,1\u003e = s0 r10 e0 f001111000001 qNE v1.234619140625\nposit\u003c16,2\u003e = s0 r10 e00 f00111100000 qNE v1.234375\nposit\u003c16,3\u003e = s0 r10 e000 f0011110000 qNE v1.234375\nposit\u003c32,1\u003e = s0 r10 e0 f0011110000001100101001000011 qNE v1.2345678918063641\nposit\u003c32,2\u003e = s0 r10 e00 f001111000000110010100100001 qNE v1.2345678880810738\nposit\u003c32,3\u003e = s0 r10 e000 f00111100000011001010010001 qNE v1.2345678955316544\nposit\u003c48,1\u003e = s0 r10 e0 f00111100000011001010010000101000110001011010 qNE v1.2345678901234578\nposit\u003c48,2\u003e = s0 r10 e00 f0011110000001100101001000010100011000101101 qNE v1.2345678901234578\nposit\u003c48,3\u003e = s0 r10 e000 f001111000000110010100100001010001100010110 qNE v1.2345678901233441\nposit\u003c64,1\u003e = s0 r10 e0 f001111000000110010100100001010001100010110011111101100000000 qNE v1.2345678901234567\nposit\u003c64,2\u003e = s0 r10 e00 f00111100000011001010010000101000110001011001111110110000000 qNE v1.2345678901234567\nposit\u003c64,3\u003e = s0 r10 e000 f0011110000001100101001000010100011000101100111111011000000 qNE v1.2345678901234567\n```\n\nThe fields are prefixed by their first characters, for example, \"posit\u003c16,2\u003e = s0 r10 e00 f00111100000 qNE v1.234375\"\n\n-   sign     field = s0, indicating a positive number\n-   regime   field = r10, indicates the first positive regime, named regime 0\n-   exponent field = e00, indicates two bits of exponent, both 0\n-   fraction field = f00111100000, a full set of fraction bits\n\nThe field values are followed by a quadrant descriptor and a value representation in decimal:\n\n-   qNE            = North-East Quadrant, representing a number in the range \"[1, maxpos]\"\n-   v1.234375      = the value representation of the posit projection\n\n\nThe positive regime for a posit shows a very specific structure, as can be seen in the image blow:\n![regime structure](docs/img/positive_regimes.png)\n\n## Leveraging the *Universal* library in your own mixed-precision algorithm research\n\nTo bootstrap any new mixed-precision algorithm development and optimization project quickly and robustly, there is a github template repo available that will set up a complete working development environment with dependent libraries, development containers, VS Code integration, and a Github CI workflow. The template repo can be found at [mpadao-template](https://github.com/stillwater-sc/mpadao-template). \n\nThe template repo is the easiest way to get started with mixed-precision algorithm development using *Universal*.\n\n## Motivation\n\nModern Deep Learning AI applications are very demanding high-performance applications. Runtimes to train\nmodels are measured in terms of weeks, and target latencies for inference are 10-100msec. Standard\ndouble, and even single, precision IEEE-754 floating-point have been too expensive to use in addressing the \nperformance and power requirements of AI applications in both the cloud and the edge.\nBoth Google and Microsoft have jettisoned traditional floating-point formats for their AI cloud services \nto gain two orders of magnitude better performance. Similarly, AI applications for mobile and embedded \napplications are requantized to small integers to fit their very stringent power budgets. The AI domain\nhas been researching better number systems to address both power and performance requirements,\nbut all these efforts have worked in isolation, with results being difficult to reproduce.\n\nAI applications are only some of the applications that expose the limitations of traditional hardware. Inefficiencies in numeric storage and operations also limit cloud scale, IoT, embedded, and HPC applications. A simple change to a new number system may improve the scale and cost of these applications by orders of magnitude.\n\nWhen performance and power efficiency are the differentiating attributes for a use case, arithmetic systems that are tailored to the needs of the application are desired.\n\nIn particular, there are two concerns when using the IEEE-754 floating-point formats: \n\n-   inefficient representation of the real numbers\n-   irreproducibility in the context of concurrency\n\nMore specifically, \n\n1.   **Wasted Bit Patterns** \n    -   32-bit IEEE floating point has around eight million ways to represent NaN (Not-A-Number), while the 64-bit floating point has two quadrillion, which is approximately 2.251x10^15 to be more exact.  A NaN is an exceptional value to represent undefined or invalid results, such as the result of a division by zero.\n2.   **Mathematically Incorrect** \n    -   The format specifies two zeroes, a negative and positive zero, with different behaviors. \n    -   Loss of associative and distributive law due to rounding after each operation.  This loss of associative and distributive arithmetic behavior creates an irreproducible result of concurrent programs that use the IEEE floating point.  This is particularly problematic for embedded and control applications.\n3.   **Overflows to ± inf and underflows to 0** \n    -   Overflowing to ± inf increases the relative error by an infinite factor while underflowing to 0 loses sign information.\n4.   **Unused dynamic range** \n    -   The dynamic range of double precision floats is a whopping 2^2047, whereas most numerical software is architected to operate around 1.0.\n5.   **Complicated Circuitry** \n    -   Denormalized floating point numbers have a hidden bit of 0 instead of 1.  This creates a host of special handling requirements that complicate compliant hardware implementations.\n6.   **No Gradual Overflow and Fixed Accuracy** \n    -   If accuracy is defined as the number of significand bits, IEEE floating-point has fixed accuracy for all numbers except denormalized numbers because the number of signficand digits is fixed.  Denormalized numbers are characterized by decreased significand digits when the value approaches zero due to having a zero hidden bit.  Denormalized numbers fill the underflow gap (i.e., between zero and the least non-zero values).  The counterpart for gradual underflow is gradual overflow which does not exist in IEEE floating points.\n\nIn contrast, the _posit_ number system was designed to overcome these negatives: \n\n1.   **Economical** \n    -   No bit patterns are redundant.  There is one representation for infinity denoted as ± inf and zero.  All other bit patterns are valid distinct non-zero real numbers. ± inf serves as a replacement for NaN.\n2.   **Preserves Mathematical Properties** \n    -   There is only one representation for zero, and the encoding is symmetric around 1.0.  Associative and distributive laws are supported through deferred rounding via the quire, enabling reproducible linear algebra algorithms in any concurrency environment.\n3.   **Tapered Accuracy** \n    -   Tapered accuracy is when values with small exponents have more precision and values with large exponents have fewer digits of accuracy.  This concept was first introduced by Morris (1971) in his paper ”Tapered Floating Point: A New Floating-Point Representation”.\n4.   **Parameterized precision and dynamic range** \n    -   posits are defined by a size, _nbits_, and the number of exponent bits, _es_. This enables system designers the freedom to pick the right precision and dynamic range required for the application.  For example, we may pick 5- or 6-bit posits without any exponent bits for AI applications to improve performance.  For embedded DSP applications, such as 5G base stations, we may select a 16-bit posit with one exponent bit to improve performance per Watt.\n5.   **Simpler Circuitry** \n    -   There are only two exceptional cases, Not a Real and Zero.  No denormalized numbers, overflow, or underflow. \n\nHowever as Deep Learning has demonstrated, there are many different requirements to optimize an arithmetic and\ntailor it to the needs of the application. Universal brings all the machinery together to experiment to \nfacilitate efficient contrast and compare different arithmetic number system designs, before committing them\nto hardware.\n\n## Goals of the library\n\nThe *Universal* library started as a bit-level arithmetic reference implementation of the evolving unum Type III \n(posit and valid) standard. However, the demands for supporting number systems, such as adaptive-precision integers \nto solve large factorials, adaptive-precision floats to act as Oracles, or comparing linear and tapered floats \nprovided the opportunity to create a complete platform for numerical analysis and computational mathematics. \nWith this *Universal* platform, we enable a new direction for optimizing algorithms to take advantage of mixed-precision \ncomputation to maximize performance and minimize energy demands. Energy efficiency is going to be the\nkey differentiator for embedded intelligence applications.\n\nAs a reference library, *Universal* offers an extensive test infrastructure to validate number system \narithmetic operations, and there is a host of utilities to inspect the internal encodings and operations \nof the different number systems.\n\nThe design space for custom arithmetic is vast, and any contribution to expanding the capability of \nthe *Universal* library is encouraged. \n\n\n## Contributing to universal\n\nWe are happy to accept pull requests via GitHub. The only requirement is that the entire regression test suite passes.\n\n[![Stargazers over time](https://starchart.cc/stillwater-sc/universal.svg)](https://starchart.cc/stillwater-sc/universal)\n\n## Verification Suite\n\nTypically, the verification suite is run as part of the build directory's _make test_ command. However, it is possible to run specific test suite components, for example, to validate algorithmic changes to more complex arithmetic functions, such as square root, exponent, logarithm, and trigonometric functions.\n\nHere is an example:\n\n```text\n\u003e:~/dev/universal/build$  make posit_logarithm\n[ 50%] Building CXX object static/posit/CMakeFiles/posit_logarithm.dir/math/logarithm.cpp.o\n[100%] Linking CXX executable posit_logarithm\n[100%] Built target posit_logarithm\n\u003e:~/dev/universal/build$ static/posit/posit_logarithm\nposit logarithm function validation: results only\n               4 -\u003e log(4) =  1.3862943649292\n0110000000000000 -\u003e log(4) = 0100011000101110 (reference: 0100011000101110)   PASS\n\nposit\u003c2,0\u003e                                                   log PASS\nposit\u003c3,0\u003e                                                   log PASS\nposit\u003c3,1\u003e                                                   log PASS\nposit\u003c4,0\u003e                                                   log PASS\nposit\u003c4,1\u003e                                                   log PASS\nposit\u003c5,0\u003e                                                   log PASS\nposit\u003c5,1\u003e                                                   log PASS\nposit\u003c5,2\u003e                                                   log PASS\nposit\u003c8,4\u003e                                                   log PASS\nposit\u003c8,4\u003e                                                   log2 PASS\nposit\u003c8,4\u003e                                                   log10 PASS\nposit logarithm function validation: PASS\n```\n\n## Structure of the tree\n\nThe universal library contains a set of functional groups to organize the development and validation of \ndifferent number systems. Each number system type has a single include file that brings together\nthe arithmetic number type and all the extensions that *Universal* has standardized so that\nworking with numeric types is more productive. For example, facilities for number traits, an \narithmetic exception hierarchy, number system attributes, manipulators,\nand finally, a math library specialized for the type.\n\nThe number system types are categorized as _static_ or _elastic_. Static types are arithmetic types\nthat have a constant, that is _static_ size, and thus can be used for sharing composite data structures, \nsuch as matrices and tensors, between general-purpose CPUs and special-purpose hardware accelerators.\nElastic types are arithmetic types that can grow and shrink during computation, typically to accommodate\nerror-free, or closed computations.\n\nIn addition to the _static_ and _elastic_ classification, we also recognize that the base of the number\nsystem is a key parameter in the arithmetic and numerical traits of the type. In particular, the tree\nwill specialize in binary and decimal forms of arithmetic.\n\nHere is a complete list:\n\n### _static_ fixed-sized configurations\n\n- *universal/number/integer* - arbitrary configuration fixed-size integer\n- *universal/number/fixpnt* - arbitrary configuration fixed-size fixed-point number system\n- *universal/number/areal* - arbitrary configuration fixed-size faithful floating-point with uncertainty bit\n- *universal/number/cfloat* - arbitrary configuration fixed-size classic floating-point number system\n- *universal/number/posit* - arbitrary configuration fixed-size posit number system, a tapered floating-point\n- *universal/number/valid* - arbitrary configuration fixed-size valid number system, a tapered floating-point interval number system\n- *universal/number/unum* - arbitrary configuration unum Type 1 number system\n- *universal/number/unum2* - arbitrary configuration unum Type 2 number system\n- *universal/number/lns* - arbitrary configuration logarithmic number system with fixed-point exponent\n- *universal/number/dbns* - double base number system with integer exponents\n- *universal/number/sorn* - set of real numbers \n- *universal/number/dd* - multi-component double-double floating-point format \n- *universal/number/qd* - multi-component quad-double floating-point format \n\n### _elastic_ adaptive-precision configurations\n\n- *universal/number/decimal* - adaptive-precision decimal integer\n- *universal/number/einteger* - adaptive-precision binary integer\n- *universal/number/erational* - adaptive-precision rational number system\n- *universal/number/efloat* - multi-digit adaptive-precision floating-point\n- *universal/number/ereal* - multi-component adaptive-precision floating-point\n- *universal/number/elreal* - multi-component exact lazy floating-point\n\n### super-accumulator facilities\n\n- *universal/number/quire* - arbitrary configuration fixed-size super accumulator number system (add/sub/abs/sqrt)\n- *universal/number/float* - contains the implementation of the IEEE floating point augmentations for reproducible computation\n\nAnd each of these functionality groups has an associated test suite located in \".../universal/tests/...\"\n\n\n## Background information\n\nUniversal numbers, unums for short, express real numbers and ranges of real numbers. There are two modes of operation, selectable by the programmer, _posit_ mode and _valid_ mode.\n\nIn _posit_ mode, a unum behaves like a floating-point number of fixed size, rounding to the nearest expressible value if the result of a calculation is not expressible exactly.\nA posit offers more accuracy and a wider dynamic range than floats with the same number of bits.\n\nIn _valid_ mode, a unum represents a range of real numbers and can be used to bound answers rigorously, much as interval arithmetic does.\n\nPosit configurations have a specific relationship to one another. When expanding a posit, the new value falls 'between' the old values of the smaller posit. The new value is the arithmetic mean of the two numbers if the expanding bit is a fraction bit, and it is the geometric mean of the two numbers if the expanding bit is a regime or exponent bit. \nThis [page](docs/PositRefinementViz.md) shows a visualization of the expansion of _posit\u003c2,0\u003e_ to _posit\u003c7,1\u003e_:\n\n## Documentation\n\nThe [docs](docs/README.md) directory contains design documents and tutorials for the _Universal_ library types.\nThe published documentation site is at https://stillwater-sc.github.io/universal/.\nFor local build/test/sanitize/coverage workflows, see [how-to-run-sanitizers.md](how-to-run-sanitizers.md).\n\n\n## Public Domain and community resources\n\nThe unum format is a public domain specification and a collection of web resources to manage information and discussions using unums.\n\n[Posit Hub](https://posithub.org)\n\n[Unum-computing Google Group](https://groups.google.com/forum/#!forum/unum-computing)\n\n\n\n\n\n## Projects that leverage posits\n\n[Matrix Template Library](http://simunova.com/#en-mtl4-index-html)\n\nThe Matrix Template Library incorporates modern C++ programming techniques to provide an easy and intuitive interface to users while enabling optimal performance. The natural mathematical notation in MTL4 empowers all engineers and scientists to implement their algorithms and models in minimal time. All technical aspects are encapsulated in the library. Think of it as MATLAB for applications.\n\n[G+SMO](http://gs.jku.at/gismo) \n\nG+Smo (Geometry + Simulation Modules, pronounced \"gismo\") is a new open-source C++ library that brings together mathematical tools for geometric design and numerical simulation. It is developed mainly by researchers and PhD students. It implements the relatively new paradigm of isogeometric analysis, which suggests the use of a unified framework in the design and analysis pipeline. G+Smo is an object-oriented, cross-platform, template C++ library and follows the generic programming principle, with a focus on both efficiency and ease of use. The library is partitioned into smaller entities, called modules. Examples of available modules include the dimension-independent NURBS module, the data fitting and solid segmentation module, the PDE discretization module and the adaptive spline module, based on hierarchical splines of arbitrary dimension and polynomial degree. \n\n[FEniCS](https://fenicsproject.org/)\n\nFEniCS is a popular open-source (LGPLv3) computing platform for solving partial differential equations (PDEs). FEniCS enables users to quickly translate scientific models into efficient finite element code. With the high-level Python and C++ interfaces to FEniCS, it is easy to get started, but FEniCS offers also powerful capabilities for more experienced programmers. FEniCS runs on a multitude of platforms ranging from laptops to high-performance clusters.\n\n\n[ODEINT-v2](http://headmyshoulder.github.io/odeint-v2/)\n\nOdeint is a modern C++ library for numerically solving Ordinary Differential Equations. It is developed in a generic way using Template Metaprogramming which leads to extraordinary high flexibility at top performance. The numerical algorithms are implemented independently of the underlying arithmetics. This results in an incredible applicability of the library, especially in non-standard environments. For example, odeint supports matrix types, arbitrary precision arithmetics and even can be easily run on CUDA GPUs.\n\nSeveral AI and Deep Learning libraries are being reengineered to enable the use of posits for both training and inference. They will be announced as they are released.\n\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fstillwater-sc%2Funiversal.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fstillwater-sc%2Funiversal?ref=badge_large)\n","funding_links":["https://github.com/sponsors/stillwater-sc","https://opencollective.com/universal-number-library"],"categories":["Math","进程间通信","Mathematics"],"sub_categories":["数学"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstillwater-sc%2Funiversal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstillwater-sc%2Funiversal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstillwater-sc%2Funiversal/lists"}