HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jeremybarnes
cephes
C2020–2026
jeremybarnes / cephes

cephes

Mirror of the Cephes C source for reference

2Distinct people
3Mentions
0Explicit recommenders
105GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Mirror of the Cephes C source for reference

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 2:19:09 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year3 dated mentions

Observed mentions: 2020-10-15 17:37:34 UTC to 2026-03-16 20:30:52 UTC.

0122020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

2 sources
> In what way do you think a sin function is computed? In some way vaguely like this: https://github.com/jeremybarnes/cephes/blob/master/cmath/sin... > I think it is stored like sintable[deg]. The degree is index. I can think of a few reasons why this is a bad idea. 1. Why would you use degrees? Pretty much everybody uses and wants radians. 2. What are you going to do about fractional degrees? Some sort of interpretation, right? 3. There's only so much cache available, are you willing to spend multiple kilobytes of it every time you want to calculate a sine? If you're imagining doing this in hardware, there are only so many transistors available, are you willing to spend that many thousands of them? 4. If you're keeping a sine table, why not keep one half the size, and then add a cosine table of equal size. That way you can use double
Read the rest
and sum angle formulae to get the original range back and pick up cosine along the way. Reflection formulae let you cut it down even further. There's a certain train of thought that leads from (2). a. I'm going to be interpreting values anyway b. How few support points can I get away with? c. Are there better choices than evenly spaced points? d. Wait, do I want to limit myself to polynomials? Following it you get answers "b: just a handful" and "c: oh yeah!" and "d: you can if you want but you don't have to". Then if you do a bunch of thinking you end up with something very much like what everybody else in these two threads have been talking about.
In Even faster asin() was staring right at me
> The polynomial/rational approximation mentioned by you is valid only for a small range of the possible input arguments I was assuming that as part of the table stakes of the conversation. Let's look at something basic and traditional like Cephes: https://github.com/jeremybarnes/cephes/blob/master/cmath/sin... We start of with a range reduction to [0, pi/4] (presumably this would be [0, 1/8] in cycles), and then the polynomial happens. If cycles really were that better, why isn't this implemented as starting with a conversion to cycles, then removal of the interval part, and then a division by 8, followed by whatever the appropriate polynomial/rational function is? > adding or subtracting Pi or its submultiples cannot be done exactly. I was also assuming that we've been talking about floating point this whole time.
In The most famous transcendental numbers

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.