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 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 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

3 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
I'm not going to argue Python politics with you, but suffice it to say that only a few communities have had such a bad major version upgrade experience. Here are some off the top of my head for comparison, from roughest to smoothest: * Perl 5 to Perl 6: So disastrous that they rolled back and Perl 6 is now known as Raku * PHP5 to PHP7: Burn my eyes out, please! But of course PHP has unique user pressures, and a monoculture helps a lot * Python 2.4 to Python 2.7: Done in several stages, including deprecation of syntax, rolling out of new keywords, introduction of backwards-compatible objects and classes, and improvements to various semantic corner cases * Haskell 98 to Haskell 2010: GHC dominated the ecosystem and now Haskell 98 is only known for being associated with Hugs, which knows nothing newer * C++03 and earlier to C++11: Failed to
Read the rest
deprecate enough stuff, but did successfully establish a permanent 3yr release cadence * C99 to C11: Aside from the whole Microsoft deal, this was perfect; unfortunately Microsoft's platforms are common in the wild Now consider how many Python 3 features ended up backported to Python 2 [0] and how divisive the upgrade needed to be in the end. On readability, you'll just have to trust me that when Python gets to millions of lines of code per application, the organization of modules into packages becomes obligatory; the module-to-module barrier isn't expressive enough to support all of the readable syntax that people want to use for composing objects. If you want a FORTRAN example, look at Cephes [1], a C library partially ported from FORTRAN. The readability is terrible, the factoring is terrible, and it cannot be improved because FORTRAN lacked the abstractive power necessary for higher-order factoring, and so does C. Compare and contrast with Numpy [2], a popular numeric library for Python which is implemented in (punchline!) FORTRAN and C. [0] https://docs.python.org/2/whatsnew/2.7.html#python-3-1-featu... [1] https://github.com/jeremybarnes/cephes [2] https://github.com/numpy/numpy
In How do we tell truths that might hurt? (1975)

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.