Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs417-lecture-examples
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Kennedy
cs417-lecture-examples
Commits
3e9c7fe1
Commit
3e9c7fe1
authored
4 years ago
by
Thomas Kennedy
Browse files
Options
Downloads
Patches
Plain Diff
Document Alex Launi's merge request in README
parent
a5f7a151
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FPvsArbitraryPrecision/FP-ErrorEstimate-C++/README.md
+47
-0
47 additions, 0 deletions
FPvsArbitraryPrecision/FP-ErrorEstimate-C++/README.md
with
47 additions
and
0 deletions
FPvsArbitraryPrecision/FP-ErrorEstimate-C++/R
eadMe
.md
→
FPvsArbitraryPrecision/FP-ErrorEstimate-C++/R
EADME
.md
+
47
−
0
View file @
3e9c7fe1
...
...
@@ -73,3 +73,50 @@ output *simliar* to
will be displayed. Note that the precision estimates will vary by
architecture/system.
---
# Merge Requests
This section documents contributions made by students via merge requests.
## Replace naïve float128 abs implementation with something closer to Rust implementation
**Author**
: Alex Launi
**Date**
: 2020-05-21
#### Goal
Remove bottleneck caused by conditional negation implementation of float128 abs.
#### Results
Note: these were run on a 2019 MacBook Pro using a 2.4 GHz 8-Core Intel Core i9.
| Version | Time (1x10^9) |
| --- | --------------: |
| Orig (-O0) | 326s |
| Mine (-O0) | __179s__ |
| Orig (-O3) | 92s |
| Mine (-O3) | __60s__ |
#### Possible Improvement
Rust uses MPFR on the backend. I dug into the MPFR source, and this is close to
the implementation used. The primary difference is the use of a
`MPFR_SET_SIGN`
macro. Boost has a copysign(const T& x, const T& y) which copies the sign from
y to x. Something like
```
C++
inline
float128 abs(float 128 x)
{
const float128 p = 1.0Q;
return copysign(x, p);
}
```
should work, but I was unable to get any use of copysign to compile. I settled
on the approach used in this merge request. I think the results speak well.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment