Skip to content

Merge to Master for 1.91#1340

Closed
mborland wants to merge 105 commits intomasterfrom
develop
Closed

Merge to Master for 1.91#1340
mborland wants to merge 105 commits intomasterfrom
develop

Conversation

@mborland
Copy link
Member

No description provided.

justinzhu@home and others added 30 commits January 25, 2026 03:05
Convert decimal to double, use std::sqrt, convert back. Added baseline,
benchmarks, and build scripts. Updated .gitignore.
- Add decimal lookup table for 1/sqrt(x) approximation
- Implement SoftFloat-style remainder elimination
- Add safety checks to prevent inf/NaN results
- Maintain C++14 compatibility with out-of-line definitions

Performance: ~4-5x speedup over baseline implementation
Replace Padé approximation with 32-entry lookup table approach,
reducing Newton-Raphson iterations from 3-5 to 1-3 based on precision.

- Add sqrt lookup tables for [0.1, 1.0) range with interpolation
- Reduce iterations: decimal32 (1), decimal64 (2), decimal128 (3)
- Maintain existing normalization and exponent handling

Performance: Fewer divisions per sqrt call with faster convergence.

Known issues: Some precision gaps remain, particularly for decimal32.
Further optimization needed for interpolation and edge cases.
Replace Padé approximation with 1/sqrt(x) lookup table and linear
interpolation, reducing Newton iterations from 3-5 to 1-2.
Replace Padé + Newton-Raphson with decimal-native lookup table
algorithm. Uses 128-entry table with linear interpolation for
initial approximation, then remainder elimination refinement using
multiplication only (no division). Reduces iterations from 3-5 to 1-3.

Experimental: precision tuning may be needed.
Add alignment support for {fmt} and <format>
zhuguangwen and others added 27 commits February 5, 2026 17:21
Improve sqrt with SoftFloat-style lookup table and integer arithmetic
Fix C++17 check for windows platforms
Reduce sqrt128 multiply cost: mul128By64, precompute target, 128-bit sig_z²
Tuning tests cover optimize zero
Reuse `r.ptr` instead of using strlen to get return size
@mborland
Copy link
Member Author

There's conflicts from removing the package management so doing this manually

@mborland mborland closed this Feb 18, 2026
@cppalliance-bot
Copy link

An automated preview of the documentation is available at https://1340.decimal.prtest3.cppalliance.org/libs/decimal/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-02-18 15:44:02 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments