frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

4-bit floating point FP4

https://www.johndcook.com/blog/2026/04/17/fp4/
22•chmaynard•4h ago

Comments

chrisjj•4h ago
> Programmers were grateful for the move from 32-bit floats to 64-bit floats. It doesn’t hurt to have more precision

Someome didn't try it on GPU...

kimixa•1h ago
Even the latest CPUs have a 2:1 fp64:fp32 performance ratio - plus the effects of 2x the data size in cache and bandwidth use mean you can often get greater than a 2x difference.

If you're in a numeric heavy use case that's a massive difference. It's not some outdated "Ancient Lore" that causes languages that care about performance to default to fp32 :P

adgjlsfhk1•48m ago
> languages that care about performance to default to fp32

What do you mean by this? In C 1.0 is a double.

pixelesque•26m ago
> Even the latest CPUs have a 2:1 fp64:fp32 performance ratio

Not completely - for basic operations (and ignoring byte size for things like cache hit ratios and memory bandwidth) if you look at (say Agner Fog's optimisation PDFs of instruction latency) the basic SSE/AVX latency for basic add/sub/mult/div (yes, even divides these days), the latency between float and double is almost always the same on the most recent AMD/Intel CPUs (and normally execution ports can do both now).

Where it differs is gather/scatter and some shuffle instructions (larger size to work on), and maths routines like transcendentals - sqrt(), sin(), etc, where the backing algorithms (whether on the processor in some cases or in libm or equivalent) obviously have to do more work (often more iterations of refinement) to calculate the value to greater precision for f64.

ant6n•1h ago
> In ancient times, floating point numbers were stored in 32 bits.

I thought in ancient times, floating point numbers used to be 80 bit. They lived in a funky mini stack on the coprocessor (x87). Then one day, somebody came along and standardized those 32 and 64 bit floats we still have today.

_trampeltier•27m ago
80 bits is just in the processor. Thats why you might a little bit different result, depending how you calculated first and maybe stored something in the RAM
convolvatron•24m ago
I was going to reply that just because intel did something funny doesn't mean that it was the beginning of the story. but it turns out that the release of the 8087 predates the ratification of IEEE floats by 2 years. in addition, the primary numeric designer for the 8087 was apparently Kahan, which means that they were both part of the same design process. of course there were other formats predating both of these
indolering•17m ago
The floating point "standard" was basically codifying multiple different vendor implementations of the same idea. Hence the mess that floating point is not consistent across implementations.
burnt-resistor•39m ago
FP4 1:2:0:1 (other examples: binary32 1:8:0:23, 8087 ep 1:15:1:63)

S:E:l:M

S = sign bit present (or magnitude-only absolute value)

E = exponent bits (typically biased by 2^(E-1) - 1)

l = explicit leading integer present (almost always 0 because the leading digit is always 1 for normals, 0 for denormals, and not very useful for special values)

M = mantissa (fraction) bits

The limitations of FP4 are that it lacks infinities, [sq]NaNs, and denormals that make it very limited to special purposes only. There's no denying that it might be extremely efficient for very particular problems.

If a more even distribution were needed, a simpler fixed point format like 1:2:1 (sign:integer:fraction bits) is possible.

conaclos•32m ago
There is a relevant Wikipedia page about minifloats [0]

> The smallest possible float size that follows all IEEE principles, including normalized numbers, subnormal numbers, signed zero, signed infinity, and multiple NaN values, is a 4-bit float with 1-bit sign, 2-bit exponent, and 1-bit mantissa.

[0] https://en.wikipedia.org/wiki/Minifloat

Thoughts and feelings around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
126•cdrnsf•2h ago•70 comments

The electromechanical angle computer inside the B-52 bomber's star tracker

https://www.righto.com/2026/04/B-52-star-tracker-angle-computer.html
198•NelsonMinar•5h ago•61 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
54•gnabgib•2h ago•36 comments

Any Color You Like: NIST Scientists Create 'Any Wavelength' Lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
13•rbanffy•1h ago•0 comments

Optimizing Ruby Path Methods

https://byroot.github.io/ruby/performance/2026/04/18/faster-paths.html
11•weaksauce•1h ago•0 comments

Migrating from DigitalOcean to Hetzner

https://isayeter.com/posts/digitalocean-to-hetzner-migration/
614•yusufusta•8h ago•323 comments

State of Kdenlive

https://kdenlive.org/news/2026/state-2026/
302•f_r_d•10h ago•104 comments

Floating Point Fun on Cortex-M Processors

https://danielmangum.com/posts/floating-point-cortex-m/
17•hasheddan•1d ago•1 comments

Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

https://github.com/drasimwagan/mdv
68•drasim•6h ago•28 comments

Michael Rabin has died

https://en.wikipedia.org/wiki/Michael_O._Rabin
361•tkhattra•3d ago•76 comments

Scientists discover "cleaner ants" that groom giant ants in Arizona desert

https://www.sciencedaily.com/releases/2026/04/260414075641.htm
59•t-3•3d ago•25 comments

Sumida Aquarium Posts 2026 Penguin Relationship Chart, with Drama and Breakups

https://www.sumida-aquarium.com/special/sokanzu/en/2026/
138•Lwrless•3d ago•5 comments

PostgreSQL production incident caused by transaction ID wraparound

https://www.sqlservercentral.com/articles/i-too-have-a-production-story-a-downtime-caused-by-post...
8•tcp_handshaker•1h ago•2 comments

Opus 4.7 to 4.6 Inflation is ~45%

https://tokens.billchambers.me/leaderboard
367•anabranch•5h ago•384 comments

Show HN: AI Subroutines – Run automation scripts inside your browser tab

https://www.rtrvr.ai/blog/ai-subroutines-zero-token-deterministic-automation
15•arjunchint•1d ago•2 comments

UpCodes (YC S17) is hiring SDRs to help make construction more productive

https://up.codes/careers?utm_source=HN
1•Old_Thrashbarg•4h ago

Modern Common Lisp with FSET

https://fset.common-lisp.dev/Modern-CL/Top_html/index.html
25•larve•3d ago•0 comments

Show HN: Remoroo. trying to fix memory in long-running coding agents

https://www.remoroo.com
19•adhamghazali•4d ago•2 comments

PgQue: Zero-Bloat Postgres Queue

https://github.com/NikolayS/pgque
37•gmcabrita•5h ago•0 comments

Graphs that explain the state of AI in 2026

https://spectrum.ieee.org/state-of-ai-index-2026
51•bryanrasmussen•4h ago•34 comments

80386 Memory Pipeline

https://nand2mario.github.io/posts/2026/80386_memory_pipeline/
70•wicket•4d ago•10 comments

Fuzix OS

https://www.fuzix.org/
61•DeathArrow•6h ago•24 comments

Amiga Graphics Archive

https://amiga.lychesis.net/
221•sph•15h ago•63 comments

4-bit floating point FP4

https://www.johndcook.com/blog/2026/04/17/fp4/
22•chmaynard•4h ago•10 comments

Understanding the FFT Algorithm (2013)

https://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/
38•peter_d_sherman•3d ago•3 comments

Category Theory Illustrated – Orders

https://abuseofnotation.github.io/category-theory-illustrated/04_order/
214•boris_m•15h ago•57 comments

Traders placed over $1B in perfectly timed bets on the Iran war

https://www.theguardian.com/world/2026/apr/18/iran-war-bets-ethics-concerns
97•trocado•3h ago•79 comments

It's OK to compare floating-points for equality

https://lisyarus.github.io/blog/posts/its-ok-to-compare-floating-points-for-equality.html
162•coinfused•4d ago•110 comments

Show HN: I made a calculator that works over disjoint sets of intervals

https://victorpoughon.github.io/interval-calculator/
281•fouronnes3•20h ago•48 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
256•RickJWagner•9h ago•259 comments