Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,134 @@
#include <stdio.h>
.globl main
.section .text
.macro NEWLINE
mov x0, #10
stp x9, x10, [sp, #-16]!
bl putchar
ldp x9, x10, [sp], 16
.endm
.macro PRINTCHAR p
mov x1, \p
mov x0, #64
sub x0, x0, x1
stp x9, x10, [sp, #-16]!
bl putchar
ldp x9, x10, [sp], 16
.endm
xsize .req x9
xsize_w .req w9
ysize .req x10
ysize_w .req w10
min_imag .req s8
max_imag .req s9
min_real .req s10
max_real .req s9
imag .req s11
real .req s12
step_x .req s13
step_y .req s14
zi .req s15
zr .req s16
a .req s17
b .req s18
ftemp_1 .req s19
ftemp_2 .req s20
y .req x19
y_w .req w19
x .req x20
x_w .req w20
n .req x21
limit .req x22
itemp_1 .req x23
itemp_1w .req w23
/*
redefining register names
for easier implementation
*/
main:
stp xzr, lr, [sp, #-16]!
stp d8, d9, [sp, #-16]!
stp d10, d11,[sp, #-16]!
stp d12, d13,[sp, #-16]!
stp d14, d15,[sp, #-16]!
stp x19, x20,[sp, #-16]!
stp x21, x22,[sp, #-16]!
stp x23, x24,[sp, #-16]!
mov xsize, #108
mov ysize, #72
mov limit, #32
fmov min_imag, #-1.0
fmov max_imag, #1.0
fmov min_real, #-2.0
// fmov max_real #1.0
fsub step_x, max_real, min_real
scvtf ftemp_1, xsize_w
fdiv step_x, step_x, ftemp_1
fsub step_y, max_imag, min_imag
scvtf ftemp_1, ysize_w
fdiv step_y, step_y, ftemp_1
mov y, #0
1:
cmp y, ysize
b.eq 20f
scvtf ftemp_1, y_w
fmadd imag, step_y, ftemp_1, min_imag
mov x, #0
2:
cmp x, xsize
b.eq 15f
scvtf ftemp_1, x_w
fmadd real, step_y, ftemp_1, min_real
fmov zr, real
fmov zi, imag
mov n, #0
3:
cmp n, limit
b.eq 10f
fmul a, zr, zr
fmul b, zi, zi
fadd ftemp_1, a, b
fmov ftemp_2, #4.0
fcmp ftemp_1, ftemp_2
b.gt 10f
fmul zi, zi, zr
fmov ftemp_2, #2.0
fmadd zi, zi, ftemp_2, imag
fsub zr, a, b
fadd zr, zr, real
add n, n, #1
b 3b
10:
add x, x, #1
PRINTCHAR n
b 2b
15:
add y, y, #1
NEWLINE
b 1b
20:
ldp x23, x24,[sp], 16
ldp x21, x22,[sp], 16
ldp x19, x20,[sp], 16
ldp d14, d15,[sp], 16
ldp d12, d13,[sp], 16
ldp d10, d11,[sp], 16
ldp d8, d9, [sp], 16
ldp xzr, lr, [sp], 16
ret

View file

@ -1,5 +1,3 @@
# Mandelbrot
#
res = 4
maxiter = 200
#

View file

@ -1 +1 @@
mcf=. (<: 2:)@|@(] ((*:@] + [)^:((<: 2:)@|@])^:1000) 0:) NB. 1000 iterations test
mcf=. [: (<: 2:)@| ] ((*:@] + [)^:((<: 2:)@|@])^:1000) 0: NB. 1000 iterations test

View file

@ -1 +1 @@
viewmat mcf "0 @ domain (_2j_1 1j1) ; 0.1 NB. Complex interval and resolution
viewmat mcf "0 @ domain (_2j_1 1j1) ; 0.1 NB. Complex interval and resolution

View file

@ -32,7 +32,8 @@ heatmap(D .^ 1.0, c=:bone_1)
savefig("Mandelbrot_normal_map_1.png")
N = abs.(Z) .> 2 # advanced normal map effect using higher derivatives (distance estimation)
U = Z[N] .* dZ[N] .* ((1 .+ log.(abs.(Z[N]))) .* conj.(dZ[N] .^ 2) .- log.(abs.(Z[N])) .* conj.(Z[N] .* ddZ[N]))
H, K, L = abs.(Z[N] ./ dZ[N]), abs.(dZ[N] ./ ddZ[N]), log.(abs.(Z[N]))
U = Z[N] ./ dZ[N] .- (H ./ K) .^ 2 .* L ./ (1 .+ L) .* dZ[N] ./ ddZ[N]
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit normal vectors and light vector
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)

View file

@ -22,7 +22,7 @@ plt.imshow(S ** 0.1, cmap=plt.cm.twilight_shifted, origin="lower")
plt.savefig("Mandelbrot_set_1.png", dpi=200)
N = abs(Z) >= r # normalized iteration count
T[N] = T[N] - np.log2(np.log(np.abs(Z[N])) / np.log(r))
T[N] = T[N] - np.log2(np.log(abs(Z[N])) / np.log(r))
plt.imshow(T ** 0.1, cmap=plt.cm.twilight_shifted, origin="lower")
plt.savefig("Mandelbrot_set_2.png", dpi=200)

View file

@ -23,7 +23,7 @@ for k in range(n):
N = abs(Z) >= r # basic normal map effect and stripe average coloring (potential function)
P, Q = S[N] / T[N], (S[N] + np.sin(density * np.angle(Z[N]))) / (T[N] + 1)
U, V = Z[N] / dZ[N], 1 + (np.log2(np.log(np.abs(Z[N])) / np.log(r)) * (P - Q) + Q) * intensity
U, V = Z[N] / dZ[N], 1 + (np.log2(np.log(abs(Z[N])) / np.log(r)) * (P - Q) + Q) * intensity
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit normal vectors and light vector
D[N] = np.maximum((U.real * v.real + U.imag * v.imag + V * height) / (1 + height), 0)
@ -31,7 +31,8 @@ plt.imshow(D ** 1.0, cmap=plt.cm.bone, origin="lower")
plt.savefig("Mandelbrot_normal_map_1.png", dpi=200)
N = abs(Z) > 2 # advanced normal map effect using higher derivatives (distance estimation)
U = Z[N] * dZ[N] * ((1 + np.log(abs(Z[N]))) * np.conj(dZ[N] ** 2) - np.log(abs(Z[N])) * np.conj(Z[N] * ddZ[N]))
H, K, L = abs(Z[N] / dZ[N]), abs(dZ[N] / ddZ[N]), np.log(abs(Z[N]))
U = Z[N] / dZ[N] - (H / K) ** 2 * L / (1 + L) * dZ[N] / ddZ[N]
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit normal vectors and light vector
D[N] = np.maximum((U.real * v.real + U.imag * v.imag + height) / (1 + height), 0)