HNHacker News
TopNewBestAskShowJobs

GeertB

421 karma · joined October 31, 2014

Compiler and Database engineer. Polyglot. Love formal methods, floating-point, boundary between hardware and software.
submissionscomments
GeertB··on Ask HN: Those who left software development for a different technical field?
I know of one programmer who went from writing software to building cars, rockets and a solar grid. I hear he's doing quite well.
GeertB··on Show HN: Base24 binary-to-text encoding for humans
I really like the super high efficiency at the important multiple-of-4-byte increments. Using 7 base-24 characters to encode 32 bits is 99.7% efficient. However, I'd recommend using 7 base-24 digits followed by a blank as standard output format. This would allow for efficient 8 character <=> 32 bit conversions. Also, I think padding output to a multiple of 7 characters would be good, for similar reasons that it's good for base-64. Now you can concatenate encoded streams like you could byte streams, and recover on decode. As multiples of 32 bits are so common, padding would be used little in practice. On input, it would be fine to accept unpadded base-24 sequences, but valid base-24 output should always pad to a multiple of 7 chars (excluding the blanks that should be just for readability and not significant otherwise).

However, I strongly dislike the arbitrary mapping between character values and base-24 digits. There is a strong reason for using the order 2345679ABCEFGHKRSTWXYZ, which is that now encoded values compare the same as the original binary values. I did appreciate the 0x00000000 == ZZZZZZZ equivalence, but consistent ordering is just way more important IMO. Also 2222222 looks a lot like ZZZZZZZ. Just saying.

GeertB··on Toyota believes hydrogen fuel cells are the future
Battery management systems deal with this by using some energy to heat the pack. So dealing with cold temperatures is just a measure of insulation and some vampire drain. While driving, or parked in a garage, there are no issues of course. Note that Norway is the European country where Tesla cars are most popular, so the problem seems to be nonconsequential in practice.
GeertB··on Tesla Insurance
This is the right model for insurance: the potential reduction of claims incentivizes the car manufacturer to make cars safer and less expensive to repair.

Flip side: from its telemetry, Tesla can derive how safely you drive your car and adjust premiums accordingly. Is this good or bad?

GeertB··on Computing sin and cos in hardware with synthesisable Verilog
While CORDIC is great for fixed point, it has limitations for floating point. The original 8087 fsin and fcos instructions used CORDIC, but later versions of the architecture switched to polynomial approximations, see https://software.intel.com/sites/default/files/managed/f8/9c.... Today it's possible to develop implementations of these elementary functions on x86 CPUs that are more precise and more performant using regular multiply/addition/fused multiply add than even the current improved post-CORDIC fsin and fcos functions.

The main issue is that having an instruction executing a fixed-function block with a given (high) latency and little if any pipelining tends to be far worse than having many more fully pipelined multiply/add instructions. The other issue is that argument reduction and approximation over the reduced domain are not independent. For some parts of the domain, such as computing the sine of a number very close to a multiple of pi, you may need to spend more cycles reducing the argument accurately to counter cancelation effects. However, as the reduced argument is then very close to zero, a simple polynomial suffices.

So, for most modern systems, I'd put the effort in efficient pipelined fused-multiply-add and use that for all elementary functions. Fixed-function hardware for elementary functions has generally been proved sub-optimal.

← PreviousPage 2 of 2