summaryrefslogtreecommitdiff
path: root/libc/utils/mathtools
AgeCommit message (Collapse)Author
2025-01-23[libc][NFC] Strip all training whitespace and missing newlines (#124163)Joseph Huber
2024-08-19[libc][NFC] Add sollya script to compute worst case range reduction. (#104803)lntue
2024-02-23[libc][NFC] Remove all trailing spaces from libc (#82831)Joseph Huber
Summary: There are a lot of random training spaces on various lines. This patch just got rid of all of them with `sed 's/\ \+$//g'.
2023-09-21[libc] Fix Off By One Errors In Printf Long Double (#66957)michaelrj-google
Two major off-by-one errors are fixed in this patch. The first is in float_to_string.h with length_for_num, which wasn't accounting for the implicit leading bit when calculating the length of a number, causing a missing digit on 80 bit float max. The other off-by-one is the ryu_long_double_constants.h (a.k.a the Mega Table) not having any entries for the last POW10_OFFSET in POW10_SPLIT. This was also found on 80 bit float max. Finally, the integer calculation mode was using a slightly too short integer, again on 80 bit float max, not accounting for the mantissa width. All of these are fixed in this patch.
2023-06-08[libc] add options to printf decimal floatsMichael Jones
This patch adds three options for printf decimal long doubles, and these can also apply to doubles. 1. Use a giant table which is fast and accurate, but takes up ~5MB). 2. Use dyadic floats for approximations, which only gives ~50 digits of accuracy but is very fast. 3. Use large integers for approximations, which is accurate but very slow. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D150399
2023-05-25[NFC][Py Reformat] Reformat python files in the rest of the dirsTobias Hieta
This is an ongoing series of commits that are reformatting our Python code. This catches the last of the python files to reformat. Since they where so few I bunched them together. Reformatting is done with `black`. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Reviewed By: jhenderson, #libc, Mordante, sivachandra Differential Revision: https://reviews.llvm.org/D150784
2021-10-04[libc][NFC] Add supporting class for atof implementationMichael Jones
This change adds the High Precision Decimal described here: https://nigeltao.github.io/blog/2020/parse-number-f64-simple.html It will be used for the atof implementation later, but is complete and tested now. The code is inspired by the golang implmentation of the HPD class, which can be found here: https://github.com/golang/go/blob/release-branch.go1.16/src/strconv/decimal.go Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D110454
2021-06-10[libc] Add implementation of expm1f.Tue Ly
Use expm1f(x) = exp(x) - 1 for |x| > ln(2). For |x| <= ln(2), divide it into 3 subintervals: [-ln2, -1/8], [-1/8, 1/8], [1/8, ln2] and use a degree-6 polynomial approximation generated by Sollya's fpminmax for each interval. Errors < 1.5 ULPs when we use fma to evaluate the polynomials. Differential Revision: https://reviews.llvm.org/D101134