Anisotropic x16 LOD (ratio of anisotropy)

Specification

?
\[\left(\left(\left(\left(\left(\left(1 \leq w \land w \leq 16384\right) \land \left(1 \leq h \land h \leq 16384\right)\right) \land \left(10^{-20} \leq \left|dX.u\right| \land \left|dX.u\right| \leq 10^{+20}\right)\right) \land \left(10^{-20} \leq \left|dX.v\right| \land \left|dX.v\right| \leq 10^{+20}\right)\right) \land \left(10^{-20} \leq \left|dY.u\right| \land \left|dY.u\right| \leq 10^{+20}\right)\right) \land \left(10^{-20} \leq \left|dY.v\right| \land \left|dY.v\right| \leq 10^{+20}\right)\right) \land maxAniso = 16\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloor h\right\rfloor \cdot dX.v\\ t_1 := \left\lfloor h\right\rfloor \cdot dY.v\\ t_2 := \left\lfloor w\right\rfloor \cdot dY.u\\ t_3 := \left\lfloor w\right\rfloor \cdot dX.u\\ t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_2 \cdot t\_2 + t\_1 \cdot t\_1\right)\\ t_5 := \sqrt{t\_4}\\ t_6 := \left|t\_3 \cdot t\_1 - t\_0 \cdot t\_2\right|\\ t_7 := \frac{t\_4}{t\_6}\\ t_8 := t\_7 > \left\lfloor maxAniso\right\rfloor \\ t_9 := \begin{array}{l} \mathbf{if}\;t\_8:\\ \;\;\;\;\frac{t\_5}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_6}{t\_5}\\ \end{array}\\ t_10 := \begin{array}{l} \mathbf{if}\;t\_8:\\ \;\;\;\;\left\lfloor maxAniso\right\rfloor \\ \mathbf{else}:\\ \;\;\;\;t\_7\\ \end{array}\\ \mathbf{if}\;t\_9 < 1:\\ \;\;\;\;\mathsf{max}\left(1, t\_10 \cdot t\_9\right)\\ \mathbf{else}:\\ \;\;\;\;t\_10\\ \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (* (floor h) dX.v))
        (t_1 (* (floor h) dY.v))
        (t_2 (* (floor w) dY.u))
        (t_3 (* (floor w) dX.u))
        (t_4 (fmax (+ (* t_3 t_3) (* t_0 t_0)) (+ (* t_2 t_2) (* t_1 t_1))))
        (t_5 (sqrt t_4))
        (t_6 (fabs (- (* t_3 t_1) (* t_0 t_2))))
        (t_7 (/ t_4 t_6))
        (t_8 (> t_7 (floor maxAniso)))
        (t_9 (if t_8 (/ t_5 (floor maxAniso)) (/ t_6 t_5)))
        (t_10 (if t_8 (floor maxAniso) t_7)))
   (if (< t_9 1.0) (fmax 1.0 (* t_10 t_9)) t_10)))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
	float t_0 = floorf(h) * dX_46_v;
	float t_1 = floorf(h) * dY_46_v;
	float t_2 = floorf(w) * dY_46_u;
	float t_3 = floorf(w) * dX_46_u;
	float t_4 = fmaxf(((t_3 * t_3) + (t_0 * t_0)), ((t_2 * t_2) + (t_1 * t_1)));
	float t_5 = sqrtf(t_4);
	float t_6 = fabsf(((t_3 * t_1) - (t_0 * t_2)));
	float t_7 = t_4 / t_6;
	int t_8 = t_7 > floorf(maxAniso);
	float tmp;
	if (t_8) {
		tmp = t_5 / floorf(maxAniso);
	} else {
		tmp = t_6 / t_5;
	}
	float t_9 = tmp;
	float tmp_1;
	if (t_8) {
		tmp_1 = floorf(maxAniso);
	} else {
		tmp_1 = t_7;
	}
	float t_10 = tmp_1;
	float tmp_2;
	if (t_9 < 1.0f) {
		tmp_2 = fmaxf(1.0f, (t_10 * t_9));
	} else {
		tmp_2 = t_10;
	}
	return tmp_2;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32(floor(h) * dX_46_v)
	t_1 = Float32(floor(h) * dY_46_v)
	t_2 = Float32(floor(w) * dY_46_u)
	t_3 = Float32(floor(w) * dX_46_u)
	t_4 = fmax(Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)), Float32(Float32(t_2 * t_2) + Float32(t_1 * t_1)))
	t_5 = sqrt(t_4)
	t_6 = abs(Float32(Float32(t_3 * t_1) - Float32(t_0 * t_2)))
	t_7 = Float32(t_4 / t_6)
	t_8 = t_7 > floor(maxAniso)
	tmp = Float32(0.0)
	if (t_8)
		tmp = Float32(t_5 / floor(maxAniso));
	else
		tmp = Float32(t_6 / t_5);
	end
	t_9 = tmp
	tmp_1 = Float32(0.0)
	if (t_8)
		tmp_1 = floor(maxAniso);
	else
		tmp_1 = t_7;
	end
	t_10 = tmp_1
	tmp_2 = Float32(0.0)
	if (t_9 < Float32(1.0))
		tmp_2 = fmax(Float32(1.0), Float32(t_10 * t_9));
	else
		tmp_2 = t_10;
	end
	return tmp_2
end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = floor(h) * dX_46_v;
	t_1 = floor(h) * dY_46_v;
	t_2 = floor(w) * dY_46_u;
	t_3 = floor(w) * dX_46_u;
	t_4 = max(((t_3 * t_3) + (t_0 * t_0)), ((t_2 * t_2) + (t_1 * t_1)));
	t_5 = sqrt(t_4);
	t_6 = abs(((t_3 * t_1) - (t_0 * t_2)));
	t_7 = t_4 / t_6;
	t_8 = t_7 > floor(maxAniso);
	tmp = single(0.0);
	if (t_8)
		tmp = t_5 / floor(maxAniso);
	else
		tmp = t_6 / t_5;
	end
	t_9 = tmp;
	tmp_2 = single(0.0);
	if (t_8)
		tmp_2 = floor(maxAniso);
	else
		tmp_2 = t_7;
	end
	t_10 = tmp_2;
	tmp_3 = single(0.0);
	if (t_9 < single(1.0))
		tmp_3 = max(single(1.0), (t_10 * t_9));
	else
		tmp_3 = t_10;
	end
	tmp_4 = tmp_3;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor  \cdot dX.v\\
t_1 := \left\lfloor h\right\rfloor  \cdot dY.v\\
t_2 := \left\lfloor w\right\rfloor  \cdot dY.u\\
t_3 := \left\lfloor w\right\rfloor  \cdot dX.u\\
t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_2 \cdot t\_2 + t\_1 \cdot t\_1\right)\\
t_5 := \sqrt{t\_4}\\
t_6 := \left|t\_3 \cdot t\_1 - t\_0 \cdot t\_2\right|\\
t_7 := \frac{t\_4}{t\_6}\\
t_8 := t\_7 > \left\lfloor maxAniso\right\rfloor \\
t_9 := \begin{array}{l}
\mathbf{if}\;t\_8:\\
\;\;\;\;\frac{t\_5}{\left\lfloor maxAniso\right\rfloor }\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_6}{t\_5}\\


\end{array}\\
t_10 := \begin{array}{l}
\mathbf{if}\;t\_8:\\
\;\;\;\;\left\lfloor maxAniso\right\rfloor \\

\mathbf{else}:\\
\;\;\;\;t\_7\\


\end{array}\\
\mathbf{if}\;t\_9 < 1:\\
\;\;\;\;\mathsf{max}\left(1, t\_10 \cdot t\_9\right)\\

\mathbf{else}:\\
\;\;\;\;t\_10\\


\end{array}
\end{array}

Timeout after 2.5min

Use the --timeout flag to change the timeout.