Get the latest tech news

Implementing complex numbers and FFT with just datatypes (2023)


Implementing complex numbers and FFT with just datatypes (no floats) - implementing_fft.md

The program above implements addition by repeated increment, and is the simplest numerical example where fusion makes a big difference, being exponential on Haskell and linear on HVM. Our ultimate goal is to come up with an implementation of Complex that can be used on FFT, and that is based purely on ADTs, i.e., no native floats, in such a way that is simple and direct enough to possibly fuse. Just to think of the complexity of floats (which include sign, mantissa, exponent, NaNs...), Dedekind Cuts, Cauchy Sequences and the like would give us the feeling we'll never find a representation of real numbers that is as nice and uniform as the Int type above.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of FFT

FFT

Photo of datatypes

datatypes

Photo of complex numbers

complex numbers

Related news:

News photo

The FFT Strikes Back: An Efficient Alternative to Self-Attention

News photo

List Any Linux Tracepoint with Their Arguments, Datatypes and Related Structs

News photo

FFT-based ocean-wave rendering, implemented in Godot