This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, useCallback, useRef } from 'react'; | |
/** | |
* Represents a point in 3D space within the Lorenz system. | |
*/ | |
interface Point { | |
x: number; | |
y: number; | |
z: number; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, useCallback, useRef } from 'react'; | |
type ColoredChar = { | |
char: string; | |
color: string; | |
}; | |
const defaultConfig = { | |
scale: 0.05, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const c = @cImport({ | |
@cInclude("stb_image.h"); | |
}); | |
fn cubic(x: f32) f32 { | |
const a = -0.5; | |
const abs_x = @abs(x); | |
if (abs_x <= 1.0) { | |
return (a + 2.0) * abs_x * abs_x * abs_x - (a + 3.0) * abs_x * abs_x + 1.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
// Can also try: | |
// 8 x 64 | |
// 16 x 64 | |
// Top GFLOPs/s on an Intel® Core™ i7-13620H Processor = 300.9 GFLOPs/s | |
// Comments were added using Claude. | |
// To run simply run zig build-exe -O ReleaseFast matmul_FP32.zig, then run the binary ./matmul_FP32 | |
// To test simply run zig test -O ReleaseFast matmul_FP32.zig | |
// To test performance on a generated binary, run : sudo perf stat -e cache-misses,cache-references,instructions,cycles ./matmul_FP32 |