Anisotropic x16 LOD (LOD)

Percentage Accurate: 75.6% → 75.6%
Time: 34.1s
Alternatives: 8
Speedup: N/A×

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\lfloorh\right\rfloor \cdot dX.v\\ t_1 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_2 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_3 := \left\lfloorw\right\rfloor \cdot dX.u\\ t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_1 \cdot t\_1 + t\_2 \cdot t\_2\right)\\ t_5 := \sqrt{t\_4}\\ t_6 := \left|t\_3 \cdot t\_2 - t\_0 \cdot t\_1\right|\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_4}{t\_6} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{t\_5}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_6}{t\_5}\\ \end{array} \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 w) dY.u))
        (t_2 (* (floor h) dY.v))
        (t_3 (* (floor w) dX.u))
        (t_4 (fmax (+ (* t_3 t_3) (* t_0 t_0)) (+ (* t_1 t_1) (* t_2 t_2))))
        (t_5 (sqrt t_4))
        (t_6 (fabs (- (* t_3 t_2) (* t_0 t_1)))))
   (log2
    (if (> (/ t_4 t_6) (floor maxAniso))
      (/ t_5 (floor maxAniso))
      (/ t_6 t_5)))))
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(w) * dY_46_u;
	float t_2 = floorf(h) * dY_46_v;
	float t_3 = floorf(w) * dX_46_u;
	float t_4 = fmaxf(((t_3 * t_3) + (t_0 * t_0)), ((t_1 * t_1) + (t_2 * t_2)));
	float t_5 = sqrtf(t_4);
	float t_6 = fabsf(((t_3 * t_2) - (t_0 * t_1)));
	float tmp;
	if ((t_4 / t_6) > floorf(maxAniso)) {
		tmp = t_5 / floorf(maxAniso);
	} else {
		tmp = t_6 / t_5;
	}
	return log2f(tmp);
}
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(w) * dY_46_u)
	t_2 = Float32(floor(h) * dY_46_v)
	t_3 = Float32(floor(w) * dX_46_u)
	t_4 = (Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)) != Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0))) ? Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2)) : ((Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2)) != Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2))) ? Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)) : max(Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)), Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2))))
	t_5 = sqrt(t_4)
	t_6 = abs(Float32(Float32(t_3 * t_2) - Float32(t_0 * t_1)))
	tmp = Float32(0.0)
	if (Float32(t_4 / t_6) > floor(maxAniso))
		tmp = Float32(t_5 / floor(maxAniso));
	else
		tmp = Float32(t_6 / t_5);
	end
	return log2(tmp)
end
function tmp_2 = 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(w) * dY_46_u;
	t_2 = floor(h) * dY_46_v;
	t_3 = floor(w) * dX_46_u;
	t_4 = max(((t_3 * t_3) + (t_0 * t_0)), ((t_1 * t_1) + (t_2 * t_2)));
	t_5 = sqrt(t_4);
	t_6 = abs(((t_3 * t_2) - (t_0 * t_1)));
	tmp = single(0.0);
	if ((t_4 / t_6) > floor(maxAniso))
		tmp = t_5 / floor(maxAniso);
	else
		tmp = t_6 / t_5;
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorh\right\rfloor \cdot dX.v\\
t_1 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_2 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_3 := \left\lfloorw\right\rfloor \cdot dX.u\\
t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_1 \cdot t\_1 + t\_2 \cdot t\_2\right)\\
t_5 := \sqrt{t\_4}\\
t_6 := \left|t\_3 \cdot t\_2 - t\_0 \cdot t\_1\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_4}{t\_6} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{t\_5}{\left\lfloormaxAniso\right\rfloor}\\

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


\end{array}
\end{array}
\end{array}

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 75.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorh\right\rfloor \cdot dX.v\\ t_1 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_2 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_3 := \left\lfloorw\right\rfloor \cdot dX.u\\ t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_1 \cdot t\_1 + t\_2 \cdot t\_2\right)\\ t_5 := \sqrt{t\_4}\\ t_6 := \left|t\_3 \cdot t\_2 - t\_0 \cdot t\_1\right|\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_4}{t\_6} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{t\_5}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_6}{t\_5}\\ \end{array} \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 w) dY.u))
        (t_2 (* (floor h) dY.v))
        (t_3 (* (floor w) dX.u))
        (t_4 (fmax (+ (* t_3 t_3) (* t_0 t_0)) (+ (* t_1 t_1) (* t_2 t_2))))
        (t_5 (sqrt t_4))
        (t_6 (fabs (- (* t_3 t_2) (* t_0 t_1)))))
   (log2
    (if (> (/ t_4 t_6) (floor maxAniso))
      (/ t_5 (floor maxAniso))
      (/ t_6 t_5)))))
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(w) * dY_46_u;
	float t_2 = floorf(h) * dY_46_v;
	float t_3 = floorf(w) * dX_46_u;
	float t_4 = fmaxf(((t_3 * t_3) + (t_0 * t_0)), ((t_1 * t_1) + (t_2 * t_2)));
	float t_5 = sqrtf(t_4);
	float t_6 = fabsf(((t_3 * t_2) - (t_0 * t_1)));
	float tmp;
	if ((t_4 / t_6) > floorf(maxAniso)) {
		tmp = t_5 / floorf(maxAniso);
	} else {
		tmp = t_6 / t_5;
	}
	return log2f(tmp);
}
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(w) * dY_46_u)
	t_2 = Float32(floor(h) * dY_46_v)
	t_3 = Float32(floor(w) * dX_46_u)
	t_4 = (Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)) != Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0))) ? Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2)) : ((Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2)) != Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2))) ? Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)) : max(Float32(Float32(t_3 * t_3) + Float32(t_0 * t_0)), Float32(Float32(t_1 * t_1) + Float32(t_2 * t_2))))
	t_5 = sqrt(t_4)
	t_6 = abs(Float32(Float32(t_3 * t_2) - Float32(t_0 * t_1)))
	tmp = Float32(0.0)
	if (Float32(t_4 / t_6) > floor(maxAniso))
		tmp = Float32(t_5 / floor(maxAniso));
	else
		tmp = Float32(t_6 / t_5);
	end
	return log2(tmp)
end
function tmp_2 = 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(w) * dY_46_u;
	t_2 = floor(h) * dY_46_v;
	t_3 = floor(w) * dX_46_u;
	t_4 = max(((t_3 * t_3) + (t_0 * t_0)), ((t_1 * t_1) + (t_2 * t_2)));
	t_5 = sqrt(t_4);
	t_6 = abs(((t_3 * t_2) - (t_0 * t_1)));
	tmp = single(0.0);
	if ((t_4 / t_6) > floor(maxAniso))
		tmp = t_5 / floor(maxAniso);
	else
		tmp = t_6 / t_5;
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorh\right\rfloor \cdot dX.v\\
t_1 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_2 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_3 := \left\lfloorw\right\rfloor \cdot dX.u\\
t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_1 \cdot t\_1 + t\_2 \cdot t\_2\right)\\
t_5 := \sqrt{t\_4}\\
t_6 := \left|t\_3 \cdot t\_2 - t\_0 \cdot t\_1\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_4}{t\_6} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{t\_5}{\left\lfloormaxAniso\right\rfloor}\\

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


\end{array}
\end{array}
\end{array}

Alternative 1: 75.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\\ t_1 := {\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\\ t_2 := \mathsf{max}\left(t\_1, t\_0 + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\\ t_3 := \left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_2}{t\_3} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{t\_2}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_3}{{\left(\mathsf{max}\left(t\_1, t\_0 + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}^{0.5}}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (pow (* (floor w) dY.u) 2.0))
        (t_1 (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0)))
        (t_2 (fmax t_1 (+ t_0 (pow (* (floor h) dY.v) 2.0))))
        (t_3
         (fabs (* (floor w) (* (floor h) (- (* dX.u dY.v) (* dX.v dY.u)))))))
   (log2
    (if (> (/ t_2 t_3) (floor maxAniso))
      (/ (pow t_2 0.5) (floor maxAniso))
      (/
       t_3
       (pow (fmax t_1 (+ t_0 (* (pow (floor h) 2.0) (* dY.v dY.v)))) 0.5))))))
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 = powf((floorf(w) * dY_46_u), 2.0f);
	float t_1 = powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f);
	float t_2 = fmaxf(t_1, (t_0 + powf((floorf(h) * dY_46_v), 2.0f)));
	float t_3 = fabsf((floorf(w) * (floorf(h) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))));
	float tmp;
	if ((t_2 / t_3) > floorf(maxAniso)) {
		tmp = powf(t_2, 0.5f) / floorf(maxAniso);
	} else {
		tmp = t_3 / powf(fmaxf(t_1, (t_0 + (powf(floorf(h), 2.0f) * (dY_46_v * dY_46_v)))), 0.5f);
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32(floor(w) * dY_46_u) ^ Float32(2.0)
	t_1 = Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))
	t_2 = (t_1 != t_1) ? Float32(t_0 + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) : ((Float32(t_0 + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) != Float32(t_0 + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))) ? t_1 : max(t_1, Float32(t_0 + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))
	t_3 = abs(Float32(floor(w) * Float32(floor(h) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u)))))
	tmp = Float32(0.0)
	if (Float32(t_2 / t_3) > floor(maxAniso))
		tmp = Float32((t_2 ^ Float32(0.5)) / floor(maxAniso));
	else
		tmp = Float32(t_3 / (((t_1 != t_1) ? Float32(t_0 + Float32((floor(h) ^ Float32(2.0)) * Float32(dY_46_v * dY_46_v))) : ((Float32(t_0 + Float32((floor(h) ^ Float32(2.0)) * Float32(dY_46_v * dY_46_v))) != Float32(t_0 + Float32((floor(h) ^ Float32(2.0)) * Float32(dY_46_v * dY_46_v)))) ? t_1 : max(t_1, Float32(t_0 + Float32((floor(h) ^ Float32(2.0)) * Float32(dY_46_v * dY_46_v)))))) ^ Float32(0.5)));
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = (floor(w) * dY_46_u) ^ single(2.0);
	t_1 = ((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0));
	t_2 = max(t_1, (t_0 + ((floor(h) * dY_46_v) ^ single(2.0))));
	t_3 = abs((floor(w) * (floor(h) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))));
	tmp = single(0.0);
	if ((t_2 / t_3) > floor(maxAniso))
		tmp = (t_2 ^ single(0.5)) / floor(maxAniso);
	else
		tmp = t_3 / (max(t_1, (t_0 + ((floor(h) ^ single(2.0)) * (dY_46_v * dY_46_v)))) ^ single(0.5));
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\\
t_1 := {\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\\
t_2 := \mathsf{max}\left(t\_1, t\_0 + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\\
t_3 := \left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_2}{t\_3} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{{t\_2}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{{\left(\mathsf{max}\left(t\_1, t\_0 + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}^{0.5}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Applied egg-rr75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  5. Step-by-step derivation
    1. unpow-prod-downN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    2. pow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(dY.v \cdot dY.v\right)\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    4. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    6. *-lowering-*.f3275.7%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
  6. Applied egg-rr75.7%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}^{0.5}}\\ \end{array} \]
  7. Add Preprocessing

Alternative 2: 75.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\\ t_1 := {t\_0}^{0.5}\\ t_2 := \left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_0}{t\_2} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{t\_1}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_2}{t\_1}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0
         (fmax
          (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
          (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0))))
        (t_1 (pow t_0 0.5))
        (t_2
         (fabs (* (floor w) (* (floor h) (- (* dX.u dY.v) (* dX.v dY.u)))))))
   (log2
    (if (> (/ t_0 t_2) (floor maxAniso))
      (/ t_1 (floor maxAniso))
      (/ t_2 t_1)))))
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 = fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), (powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f)));
	float t_1 = powf(t_0, 0.5f);
	float t_2 = fabsf((floorf(w) * (floorf(h) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))));
	float tmp;
	if ((t_0 / t_2) > floorf(maxAniso)) {
		tmp = t_1 / floorf(maxAniso);
	} else {
		tmp = t_2 / t_1;
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = (Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))
	t_1 = t_0 ^ Float32(0.5)
	t_2 = abs(Float32(floor(w) * Float32(floor(h) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u)))))
	tmp = Float32(0.0)
	if (Float32(t_0 / t_2) > floor(maxAniso))
		tmp = Float32(t_1 / floor(maxAniso));
	else
		tmp = Float32(t_2 / t_1);
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), (((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0))));
	t_1 = t_0 ^ single(0.5);
	t_2 = abs((floor(w) * (floor(h) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))));
	tmp = single(0.0);
	if ((t_0 / t_2) > floor(maxAniso))
		tmp = t_1 / floor(maxAniso);
	else
		tmp = t_2 / t_1;
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\\
t_1 := {t\_0}^{0.5}\\
t_2 := \left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_0}{t\_2} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{t\_1}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{t\_1}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Applied egg-rr75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  5. Add Preprocessing

Alternative 3: 74.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\\ t_1 := \left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_0}{t\_1} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{e^{2 \cdot \left(\log t\_0 \cdot 0.25\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1}{{t\_0}^{0.5}}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0
         (fmax
          (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
          (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0))))
        (t_1
         (fabs (* (floor w) (* (floor h) (- (* dX.u dY.v) (* dX.v dY.u)))))))
   (log2
    (if (> (/ t_0 t_1) (floor maxAniso))
      (/ (exp (* 2.0 (* (log t_0) 0.25))) (floor maxAniso))
      (/ t_1 (pow t_0 0.5))))))
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 = fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), (powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f)));
	float t_1 = fabsf((floorf(w) * (floorf(h) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))));
	float tmp;
	if ((t_0 / t_1) > floorf(maxAniso)) {
		tmp = expf((2.0f * (logf(t_0) * 0.25f))) / floorf(maxAniso);
	} else {
		tmp = t_1 / powf(t_0, 0.5f);
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = (Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))
	t_1 = abs(Float32(floor(w) * Float32(floor(h) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u)))))
	tmp = Float32(0.0)
	if (Float32(t_0 / t_1) > floor(maxAniso))
		tmp = Float32(exp(Float32(Float32(2.0) * Float32(log(t_0) * Float32(0.25)))) / floor(maxAniso));
	else
		tmp = Float32(t_1 / (t_0 ^ Float32(0.5)));
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), (((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0))));
	t_1 = abs((floor(w) * (floor(h) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))));
	tmp = single(0.0);
	if ((t_0 / t_1) > floor(maxAniso))
		tmp = exp((single(2.0) * (log(t_0) * single(0.25)))) / floor(maxAniso);
	else
		tmp = t_1 / (t_0 ^ single(0.5));
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\\
t_1 := \left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_0}{t\_1} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{e^{2 \cdot \left(\log t\_0 \cdot 0.25\right)}}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{{t\_0}^{0.5}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Applied egg-rr75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  5. Applied egg-rr75.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\color{blue}{e^{\left(\log \left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right) \cdot 0.25\right) \cdot 2}}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  6. Final simplification75.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{e^{2 \cdot \left(\log \left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right) \cdot 0.25\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  7. Add Preprocessing

Alternative 4: 74.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_1 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {t\_0}^{2}\right)\\ t_2 := {t\_1}^{0.5}\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_1}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot t\_0\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{t\_2}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorh\right\rfloor \cdot \frac{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{t\_2}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (* (floor h) dY.v))
        (t_1
         (fmax
          (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
          (+ (pow (* (floor w) dY.u) 2.0) (pow t_0 2.0))))
        (t_2 (pow t_1 0.5)))
   (log2
    (if (> (/ t_1 (fabs (* (floor w) (* dX.u t_0)))) (floor maxAniso))
      (/ t_2 (floor maxAniso))
      (*
       (floor h)
       (/ (fabs (* (floor w) (- (* dX.u dY.v) (* dX.v dY.u)))) t_2))))))
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) * dY_46_v;
	float t_1 = fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), (powf((floorf(w) * dY_46_u), 2.0f) + powf(t_0, 2.0f)));
	float t_2 = powf(t_1, 0.5f);
	float tmp;
	if ((t_1 / fabsf((floorf(w) * (dX_46_u * t_0)))) > floorf(maxAniso)) {
		tmp = t_2 / floorf(maxAniso);
	} else {
		tmp = floorf(h) * (fabsf((floorf(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))) / t_2);
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32(floor(h) * dY_46_v)
	t_1 = (Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0)))))
	t_2 = t_1 ^ Float32(0.5)
	tmp = Float32(0.0)
	if (Float32(t_1 / abs(Float32(floor(w) * Float32(dX_46_u * t_0)))) > floor(maxAniso))
		tmp = Float32(t_2 / floor(maxAniso));
	else
		tmp = Float32(floor(h) * Float32(abs(Float32(floor(w) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u)))) / t_2));
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = floor(h) * dY_46_v;
	t_1 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), (((floor(w) * dY_46_u) ^ single(2.0)) + (t_0 ^ single(2.0))));
	t_2 = t_1 ^ single(0.5);
	tmp = single(0.0);
	if ((t_1 / abs((floor(w) * (dX_46_u * t_0)))) > floor(maxAniso))
		tmp = t_2 / floor(maxAniso);
	else
		tmp = floor(h) * (abs((floor(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u)))) / t_2);
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_1 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {t\_0}^{2}\right)\\
t_2 := {t\_1}^{0.5}\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_1}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot t\_0\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{t\_2}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\left\lfloorh\right\rfloor \cdot \frac{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{t\_2}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\color{blue}{\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)}\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorw\right\rfloor\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left\lfloorw\right\rfloor \cdot \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dY.v \cdot dX.u\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \left(\left\lfloorh\right\rfloor\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. floor-lowering-floor.f3274.5%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(h\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  6. Simplified74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\color{blue}{\left\lfloorw\right\rfloor \cdot \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)}\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array} \]
  7. Applied egg-rr74.5%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  8. Applied egg-rr74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorh\right\rfloor \cdot \frac{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  9. Add Preprocessing

Alternative 5: 74.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_1 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {t\_0}^{2}\right)\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_1}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot t\_0\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{t\_1}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{t\_1}}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (* (floor h) dY.v))
        (t_1
         (fmax
          (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
          (+ (pow (* (floor w) dY.u) 2.0) (pow t_0 2.0)))))
   (log2
    (if (> (/ t_1 (fabs (* (floor w) (* dX.u t_0)))) (floor maxAniso))
      (/ (pow t_1 0.5) (floor maxAniso))
      (/
       (fabs (* (floor h) (* (floor w) (- (* dX.u dY.v) (* dX.v dY.u)))))
       (sqrt t_1))))))
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) * dY_46_v;
	float t_1 = fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), (powf((floorf(w) * dY_46_u), 2.0f) + powf(t_0, 2.0f)));
	float tmp;
	if ((t_1 / fabsf((floorf(w) * (dX_46_u * t_0)))) > floorf(maxAniso)) {
		tmp = powf(t_1, 0.5f) / floorf(maxAniso);
	} else {
		tmp = fabsf((floorf(h) * (floorf(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / sqrtf(t_1);
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32(floor(h) * dY_46_v)
	t_1 = (Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0)))))
	tmp = Float32(0.0)
	if (Float32(t_1 / abs(Float32(floor(w) * Float32(dX_46_u * t_0)))) > floor(maxAniso))
		tmp = Float32((t_1 ^ Float32(0.5)) / floor(maxAniso));
	else
		tmp = Float32(abs(Float32(floor(h) * Float32(floor(w) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u))))) / sqrt(t_1));
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = floor(h) * dY_46_v;
	t_1 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), (((floor(w) * dY_46_u) ^ single(2.0)) + (t_0 ^ single(2.0))));
	tmp = single(0.0);
	if ((t_1 / abs((floor(w) * (dX_46_u * t_0)))) > floor(maxAniso))
		tmp = (t_1 ^ single(0.5)) / floor(maxAniso);
	else
		tmp = abs((floor(h) * (floor(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / sqrt(t_1);
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_1 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {t\_0}^{2}\right)\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_1}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot t\_0\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{{t\_1}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{t\_1}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\color{blue}{\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)}\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorw\right\rfloor\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left\lfloorw\right\rfloor \cdot \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dY.v \cdot dX.u\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \left(\left\lfloorh\right\rfloor\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. floor-lowering-floor.f3274.5%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(h\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  6. Simplified74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\color{blue}{\left\lfloorw\right\rfloor \cdot \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)}\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array} \]
  7. Applied egg-rr74.5%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  8. Step-by-step derivation
    1. unpow1/2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\right)\\ \end{array}\right) \]
    2. sqrt-lowering-sqrt.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right)\\ \end{array}\right) \]
    3. unpow-prod-downN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right)\\ \end{array}\right) \]
    4. pow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. fmax-lowering-fmax.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  9. Applied egg-rr74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}}}\\ \end{array} \]
  10. Final simplification74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}}\\ \end{array} \]
  11. Add Preprocessing

Alternative 6: 74.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_1 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {t\_0}^{2}\\ t_2 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, t\_1\right)\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_2}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot t\_0\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{t\_2}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, t\_1\right)}}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (* (floor h) dY.v))
        (t_1 (+ (pow (* (floor w) dY.u) 2.0) (pow t_0 2.0)))
        (t_2
         (fmax
          (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
          t_1)))
   (log2
    (if (> (/ t_2 (fabs (* (floor w) (* dX.u t_0)))) (floor maxAniso))
      (/ (pow t_2 0.5) (floor maxAniso))
      (/
       (fabs (* (floor h) (* (floor w) (- (* dX.u dY.v) (* dX.v dY.u)))))
       (sqrt (fmax (* (* dX.u dX.u) (pow (floor w) 2.0)) t_1)))))))
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) * dY_46_v;
	float t_1 = powf((floorf(w) * dY_46_u), 2.0f) + powf(t_0, 2.0f);
	float t_2 = fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), t_1);
	float tmp;
	if ((t_2 / fabsf((floorf(w) * (dX_46_u * t_0)))) > floorf(maxAniso)) {
		tmp = powf(t_2, 0.5f) / floorf(maxAniso);
	} else {
		tmp = fabsf((floorf(h) * (floorf(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / sqrtf(fmaxf(((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)), t_1));
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32(floor(h) * dY_46_v)
	t_1 = Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (t_0 ^ Float32(2.0)))
	t_2 = (Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? t_1 : ((t_1 != t_1) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), t_1))
	tmp = Float32(0.0)
	if (Float32(t_2 / abs(Float32(floor(w) * Float32(dX_46_u * t_0)))) > floor(maxAniso))
		tmp = Float32((t_2 ^ Float32(0.5)) / floor(maxAniso));
	else
		tmp = Float32(abs(Float32(floor(h) * Float32(floor(w) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u))))) / sqrt(((Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) != Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0)))) ? t_1 : ((t_1 != t_1) ? Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) : max(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))), t_1)))));
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = floor(h) * dY_46_v;
	t_1 = ((floor(w) * dY_46_u) ^ single(2.0)) + (t_0 ^ single(2.0));
	t_2 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), t_1);
	tmp = single(0.0);
	if ((t_2 / abs((floor(w) * (dX_46_u * t_0)))) > floor(maxAniso))
		tmp = (t_2 ^ single(0.5)) / floor(maxAniso);
	else
		tmp = abs((floor(h) * (floor(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / sqrt(max(((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))), t_1));
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_1 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {t\_0}^{2}\\
t_2 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, t\_1\right)\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_2}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot t\_0\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{{t\_2}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, t\_1\right)}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\color{blue}{\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)}\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorw\right\rfloor\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left\lfloorw\right\rfloor \cdot \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dY.v \cdot dX.u\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \left(\left\lfloorh\right\rfloor\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. floor-lowering-floor.f3274.5%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(h\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  6. Simplified74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\color{blue}{\left\lfloorw\right\rfloor \cdot \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)}\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array} \]
  7. Applied egg-rr74.5%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  8. Step-by-step derivation
    1. unpow1/2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\right)\\ \end{array}\right) \]
    2. sqrt-lowering-sqrt.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right)\\ \end{array}\right) \]
    3. unpow-prod-downN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right)\\ \end{array}\right) \]
    4. pow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. fmax-lowering-fmax.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  9. Applied egg-rr74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}}}\\ \end{array} \]
  10. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\color{blue}{\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)}\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  11. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. unpow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f3274.3%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  12. Simplified74.3%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\color{blue}{\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)}\right|}{\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}}\\ \end{array} \]
  13. Final simplification74.3%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}}\\ \end{array} \]
  14. Add Preprocessing

Alternative 7: 45.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\ t_1 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, t\_0\right)\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{t\_1}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{t\_1}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), t\_0\right)\right)}^{0.5}}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0)))
        (t_1
         (fmax
          (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
          t_0)))
   (log2
    (if (> (/ t_1 (* (floor w) (* (floor h) (* dX.u dY.v)))) (floor maxAniso))
      (/ (pow t_1 0.5) (floor maxAniso))
      (/
       (fabs (* (floor h) (* (floor w) (- (* dX.u dY.v) (* dX.v dY.u)))))
       (pow (fmax (* dX.v (* dX.v (pow (floor h) 2.0))) t_0) 0.5))))))
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 = powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f);
	float t_1 = fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), t_0);
	float tmp;
	if ((t_1 / (floorf(w) * (floorf(h) * (dX_46_u * dY_46_v)))) > floorf(maxAniso)) {
		tmp = powf(t_1, 0.5f) / floorf(maxAniso);
	} else {
		tmp = fabsf((floorf(h) * (floorf(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / powf(fmaxf((dX_46_v * (dX_46_v * powf(floorf(h), 2.0f))), t_0), 0.5f);
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))
	t_1 = (Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? t_0 : ((t_0 != t_0) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), t_0))
	tmp = Float32(0.0)
	if (Float32(t_1 / Float32(floor(w) * Float32(floor(h) * Float32(dX_46_u * dY_46_v)))) > floor(maxAniso))
		tmp = Float32((t_1 ^ Float32(0.5)) / floor(maxAniso));
	else
		tmp = Float32(abs(Float32(floor(h) * Float32(floor(w) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u))))) / (((Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) != Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) ? t_0 : ((t_0 != t_0) ? Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) : max(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))), t_0))) ^ Float32(0.5)));
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = ((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0));
	t_1 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), t_0);
	tmp = single(0.0);
	if ((t_1 / (floor(w) * (floor(h) * (dX_46_u * dY_46_v)))) > floor(maxAniso))
		tmp = (t_1 ^ single(0.5)) / floor(maxAniso);
	else
		tmp = abs((floor(h) * (floor(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / (max((dX_46_v * (dX_46_v * (floor(h) ^ single(2.0)))), t_0) ^ single(0.5));
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\
t_1 := \mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, t\_0\right)\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_1}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{{t\_1}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), t\_0\right)\right)}^{0.5}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\color{blue}{\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)}\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorw\right\rfloor\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left\lfloorw\right\rfloor \cdot \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dY.v \cdot dX.u\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \left(\left\lfloorh\right\rfloor\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. floor-lowering-floor.f3274.5%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(h\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  6. Simplified74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\color{blue}{\left\lfloorw\right\rfloor \cdot \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)}\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array} \]
  7. Applied egg-rr74.5%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  8. Applied egg-rr48.7%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\color{blue}{\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor}:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  9. Taylor expanded in dX.u around 0

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\color{blue}{\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)}\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
  10. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    2. associate-*l*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    7. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    8. floor-lowering-floor.f3250.1%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
  11. Simplified50.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\color{blue}{\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)}\right|}{{\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  12. Final simplification50.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  13. Add Preprocessing

Alternative 8: 43.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\ t_1 := {\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, t\_0\right)\right)}^{0.5}\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, t\_0\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{t\_1}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{t\_1}\\ \end{array} \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0)))
        (t_1
         (pow
          (fmax
           (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor h) dX.v) 2.0))
           t_0)
          0.5)))
   (log2
    (if (>
         (/
          (fmax (* (* dX.u dX.u) (pow (floor w) 2.0)) t_0)
          (* (floor w) (* (floor h) (* dX.u dY.v))))
         (floor maxAniso))
      (/ t_1 (floor maxAniso))
      (/
       (fabs (* (floor h) (* (floor w) (- (* dX.u dY.v) (* dX.v dY.u)))))
       t_1)))))
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 = powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f);
	float t_1 = powf(fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(h) * dX_46_v), 2.0f)), t_0), 0.5f);
	float tmp;
	if ((fmaxf(((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)), t_0) / (floorf(w) * (floorf(h) * (dX_46_u * dY_46_v)))) > floorf(maxAniso)) {
		tmp = t_1 / floorf(maxAniso);
	} else {
		tmp = fabsf((floorf(h) * (floorf(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / t_1;
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))
	t_1 = ((Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? t_0 : ((t_0 != t_0) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), t_0))) ^ Float32(0.5)
	tmp = Float32(0.0)
	if (Float32(((Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) != Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0)))) ? t_0 : ((t_0 != t_0) ? Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) : max(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))), t_0))) / Float32(floor(w) * Float32(floor(h) * Float32(dX_46_u * dY_46_v)))) > floor(maxAniso))
		tmp = Float32(t_1 / floor(maxAniso));
	else
		tmp = Float32(abs(Float32(floor(h) * Float32(floor(w) * Float32(Float32(dX_46_u * dY_46_v) - Float32(dX_46_v * dY_46_u))))) / t_1);
	end
	return log2(tmp)
end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = ((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0));
	t_1 = max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(h) * dX_46_v) ^ single(2.0))), t_0) ^ single(0.5);
	tmp = single(0.0);
	if ((max(((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))), t_0) / (floor(w) * (floor(h) * (dX_46_u * dY_46_v)))) > floor(maxAniso))
		tmp = t_1 / floor(maxAniso);
	else
		tmp = abs((floor(h) * (floor(w) * ((dX_46_u * dY_46_v) - (dX_46_v * dY_46_u))))) / t_1;
	end
	tmp_2 = log2(tmp);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\
t_1 := {\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, t\_0\right)\right)}^{0.5}\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, t\_0\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;\frac{t\_1}{\left\lfloormaxAniso\right\rfloor}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{t\_1}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right) - \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right), \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Simplified75.7%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\color{blue}{\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)}\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  5. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorw\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorw\right\rfloor\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left\lfloorw\right\rfloor \cdot \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dX.u \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left(dY.v \cdot dX.u\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \left(\left\lfloorh\right\rfloor\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. floor-lowering-floor.f3274.5%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(h\right)\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  6. Simplified74.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}{\left|\color{blue}{\left\lfloorw\right\rfloor \cdot \left(dY.v \cdot \left(dX.u \cdot \left\lfloorh\right\rfloor\right)\right)}\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right)\right) + \left\lfloorh\right\rfloor \cdot \left(dX.v \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right), \left\lfloorw\right\rfloor \cdot \left(dY.u \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \left(dY.v \cdot dY.v\right)\right)}}\\ \end{array} \]
  7. Applied egg-rr74.5%

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array}} \]
  8. Applied egg-rr48.7%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\color{blue}{\frac{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor}:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  9. Taylor expanded in dX.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
  10. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    2. unpow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    4. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
    5. floor-lowering-floor.f3248.3%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(dX.u, dY.v\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(dX.u, dY.v\right), \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{pow.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right), \frac{1}{2}\right)\right)\\ \end{array}\right) \]
  11. Simplified48.3%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\color{blue}{\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  12. Final simplification48.3%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorh\right\rfloor \cdot \left(\left\lfloorw\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|}{{\left(\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}^{0.5}}\\ \end{array} \]
  13. Add Preprocessing

Reproduce

?
herbie shell --seed 2024147 
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
  :name "Anisotropic x16 LOD (LOD)"
  :precision binary32
  :pre (and (and (and (and (and (and (and (<= 1.0 w) (<= w 16384.0)) (and (<= 1.0 h) (<= h 16384.0))) (and (<= 1e-20 (fabs dX.u)) (<= (fabs dX.u) 1e+20))) (and (<= 1e-20 (fabs dX.v)) (<= (fabs dX.v) 1e+20))) (and (<= 1e-20 (fabs dY.u)) (<= (fabs dY.u) 1e+20))) (and (<= 1e-20 (fabs dY.v)) (<= (fabs dY.v) 1e+20))) (== maxAniso 16.0))
  (log2 (if (> (/ (fmax (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v)))) (fabs (- (* (* (floor w) dX.u) (* (floor h) dY.v)) (* (* (floor h) dX.v) (* (floor w) dY.u))))) (floor maxAniso)) (/ (sqrt (fmax (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v))))) (floor maxAniso)) (/ (fabs (- (* (* (floor w) dX.u) (* (floor h) dY.v)) (* (* (floor h) dX.v) (* (floor w) dY.u)))) (sqrt (fmax (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v)))))))))