-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add API docs #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add API docs #49
Conversation
Based on numpy/numpy-user-dtypes#256 Co-authored-by: swayaminsync <hawkempire007@gmail.com>
SwayamInSync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structure looks good to me, added following reviews to correct some values, suggested some notes and a bit format fixing
| The smallest positive normal (normalized, mantissa has a leading 1 bit) quad-precision value. | ||
| :value: :math:`2^{-16382} \cdot (1 - 2^{-112})` or approximately :math:`3.36 \cdot 10^{-4932}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :value: :math:`2^{-16382} \cdot (1 - 2^{-112})` or approximately :math:`3.36 \cdot 10^{-4932}` | |
| :value: :math:`2^{-16382}` or approximately :math:`3.36 \cdot 10^{-4932}` |
No multiplier is needed here, what you wrote earlier was the "Largest Subnormal Value" (We don't need to document that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took this from https://sleef.org/quad.xhtml for SLEEF_QUAD_MIN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe they made error as well, IEEE does not define it like this https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format
you can confirm this from code too,
import numpy as np
from numpy_quaddtype import QuadPrecision, QuadPrecDType
info = np.finfo(QuadPrecDType())
two = QuadPrecision(2)
smallest_normal_theoretical = two ** QuadPrecision(-16382)
print("Are they equal?", info.smallest_normal == smallest_normal_theoretical) # True
sleef_formula = (two ** QuadPrecision(-16382)) * (QuadPrecision(1) - two ** QuadPrecision(-112))
print("Are they equal?", info.smallest_normal == sleef_formula) # FalseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll also recommend to run this code on Mac as well :) (I'll run later as I get access to my machine)
My current machine supports __float128 so maybe because of aliasing I am getting true results as per standard.
If they made mistake in their implementation then it'll get caught
| @@ -1,8 +1,108 @@ | |||
| ```{include} ../README.md | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of information present in README is missing here, like source installation, TSan build, documentation build, etc.
So ideally we should add those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can maybe selectively copy the sections from there to here
Co-authored-by: Swayam <hawkempire007@gmail.com>
|
|
||
| | Function | Description | | ||
| |----------|-------------| | ||
| | `np.dot` | Dot product | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | `np.dot` | Dot product | |
We do not support dot function
Supersedes numpy/numpy-user-dtypes#256