# Welcome to Reanimator Ltd

Reanimator Ltd specializes in hardcore programming and maths.

This website contains articles and code related to these subjects. I hope you find the articles interesting, and maybe even useful!

# Pixel-perfect Derivatives on GPU

Quick maths hack to get the correct per-pixel derivative of any value that is linear in worldspace.

# Hacking Timewarp to Fix Blurry Rotation in VR Games

Timewarp is almost designed to do this

What is in a normal map anyway?

# Finding the Nth Root

This article describes how to quickly find the Nth root using basic arithmetic operations and floating-point bit-twiddling hacks.

# SVD in 2D

How to compute the SVD in 2D (includes code)

# NP vs co-NP

co-NP and NP morally use the same resources (including time) on non-deterministic Turing machines, but you need a metasystem to do it.

# Why are Scrolling Messages Always in Italics?

The characters on 5x7 LED displays look upright when stationary, but slanted (italic) when moving. Why is that?

# A Novel Raytracing Algorithm for GPU

I present a novel acceleration structure and raytracing algorithm which explicitly leverages the capabilities of the GPU and avoids the "up and down the tree" nature of kd-tree raytracers.

# Finding the Exact Pseudoinverse

You're going to use full-blown SVD just to get the pseudoinverse? Really?

# Matrix Decomposition for Dummies

How do all these matrix decompositions work, and how do you code them?

# The Derivative of a Procedure

Some pretty out-there stuff about procedures having derivatives ...

# When Is This Expression True?

When is this expression true for random variables A, B and C?

``````p(A|C) = p(A|B)p(B|C) + p(A|!B)p(!B|C)
``````

Monads have a deep mystery surrounding them, but they're actually a very simple concept. There is nothing magic here - as a C++ programmer you've probably already done this yourself, or at least seen it done, but probably in a different context. Read more for my explanation of monads for C++ programmers.

# How to Isolate a Non-Deterministic Bug in Version Control

## An Adventure in Bayesian Inference

This article explores the question of how best to isolate a bug in version control using binary chop, when the bug doesn't always manifest. I derive a probabilistic algorithm to solve this "Bayesian Binary Search" problem, from first principles.

# I Have a Dream

An imaginary sales pitch from Reanimator Ltd, circa 2015 ...

# The Myth of the "Unrealizable" Filter

DSP textbooks will tell you that a filter graph containing a delay-free loop is "unrealizable". I demonstrate that "unrealizable" doesn't mean you can't code it.

Update 7th Mar 2012: added a worked example.

# Operators as Matrices

Should programming languages allow "naked operators" as objects?

# Quaternion Cheatsheet

Quaternion formulae for everyday use.

# SIMD Optimization of IIR Filters

IIR filters seem impossible to convert to SIMD code, since they have a tight loop containing an immediate dependency. This article will show you that it's not impossible, given the right maths.