Anisotropic x16 LOD (LOD)

Percentage Accurate: 76.3% → 76.3%
Time: 24.6s
Alternatives: 6
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\lfloor h\right\rfloor \cdot dX.v\\ t_1 := \left\lfloor w\right\rfloor \cdot dY.u\\ t_2 := \left\lfloor h\right\rfloor \cdot dY.v\\ t_3 := \left\lfloor w\right\rfloor \cdot dX.u\\ t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_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\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{t\_5}{\left\lfloor maxAniso\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\lfloor h\right\rfloor  \cdot dX.v\\
t_1 := \left\lfloor w\right\rfloor  \cdot dY.u\\
t_2 := \left\lfloor h\right\rfloor  \cdot dY.v\\
t_3 := \left\lfloor w\right\rfloor  \cdot dX.u\\
t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_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\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{t\_5}{\left\lfloor maxAniso\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 6 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: 76.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloor h\right\rfloor \cdot dX.v\\ t_1 := \left\lfloor w\right\rfloor \cdot dY.u\\ t_2 := \left\lfloor h\right\rfloor \cdot dY.v\\ t_3 := \left\lfloor w\right\rfloor \cdot dX.u\\ t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_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\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{t\_5}{\left\lfloor maxAniso\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\lfloor h\right\rfloor  \cdot dX.v\\
t_1 := \left\lfloor w\right\rfloor  \cdot dY.u\\
t_2 := \left\lfloor h\right\rfloor  \cdot dY.v\\
t_3 := \left\lfloor w\right\rfloor  \cdot dX.u\\
t_4 := \mathsf{max}\left(t\_3 \cdot t\_3 + t\_0 \cdot t\_0, t\_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\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{t\_5}{\left\lfloor maxAniso\right\rfloor }\\

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


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

Alternative 1: 76.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\
t_1 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\
t_2 := \mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot t\_1, dX.v \cdot \left(dX.v \cdot t\_0\right)\right), \mathsf{fma}\left(dY.u, t\_1 \cdot dY.u, t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)\right)\\
t_3 := \left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor  \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{t\_2}{t\_3} > \left\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{\sqrt{t\_2}}{\left\lfloor maxAniso\right\rfloor }\\

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor  \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor  \cdot dY.u\right)}^{2}\right)}}\\


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

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Add Preprocessing
  3. Taylor expanded in w around 0

    \[\leadsto \mathsf{log2.f32}\left(\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}{\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{1}{\left\lfloor maxAniso\right\rfloor } \cdot \sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}}\\ } \end{array}}\right) \]
  4. Simplified77.2%

    \[\leadsto \log_{2} \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}\\ } \end{array}} \]
  5. Applied egg-rr77.2%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}}\\ \end{array} \]
  6. Final simplification77.2%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  7. Add Preprocessing

Alternative 2: 73.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_1 := \left\lfloor w\right\rfloor  \cdot dY.u\\
t_2 := \left\lfloor h\right\rfloor  \cdot dY.v\\
t_3 := t\_1 \cdot t\_1 + t\_2 \cdot t\_2\\
t_4 := dX.u \cdot \left\lfloor w\right\rfloor \\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left(t\_4 \cdot t\_4 + t\_0 \cdot t\_0, t\_3\right)}{\left|\mathsf{fma}\left(\mathsf{fma}\left(dX.u, dY.v, 0\right), \mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor , 0\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{\sqrt{\mathsf{max}\left({t\_4}^{2} + {t\_0}^{2}, {t\_2}^{2} + {t\_1}^{2}\right)}}{\left\lfloor maxAniso\right\rfloor }\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|\left(dX.v \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor  \cdot \left\lfloor h\right\rfloor \right)\right|}{\sqrt{\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), t\_3\right)}}\\


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

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Add Preprocessing
  3. 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\color{blue}{\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)}\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  4. 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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.u \cdot \left({\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dX.u\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dX.u\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\left(\left\lfloor w\right\rfloor \right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. floor-lowering-floor.f3276.9%

      \[\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  5. Simplified76.9%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\color{blue}{\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)}\right|}{\sqrt{\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  6. 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\color{blue}{\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  7. Step-by-step derivation
    1. +-rgt-identityN/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) + 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\left(\left(dX.u \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right) + 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    3. accelerator-lowering-fma.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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\left(dX.u \cdot dY.v\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. +-rgt-identityN/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\left(dX.u \cdot dY.v + 0\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. accelerator-lowering-fma.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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. --rgt-identityN/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor - 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. sub-negN/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor + \left(\mathsf{neg}\left(0\right)\right)\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. *-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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \left(\left\lfloor w\right\rfloor \cdot \left\lfloor h\right\rfloor + \left(\mathsf{neg}\left(0\right)\right)\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. metadata-evalN/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \left(\left\lfloor w\right\rfloor \cdot \left\lfloor h\right\rfloor + 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. accelerator-lowering-fma.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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\left(\left\lfloor w\right\rfloor \right), \left(\left\lfloor h\right\rfloor \right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    11. 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \left(\left\lfloor h\right\rfloor \right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    12. floor-lowering-floor.f3276.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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  8. Simplified76.5%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(dX.u, dY.v, 0\right), \mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor , 0\right), 0\right)}\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\left(-1 \cdot \left(dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  10. 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\left(-1 \cdot \left(\left(dX.v \cdot dY.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{fabs.f32}\left(\left(\left(-1 \cdot \left(dX.v \cdot dY.u\right)\right) \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(\left(-1 \cdot \left(dX.v \cdot dY.u\right)\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    4. mul-1-negN/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(\left(\mathsf{neg}\left(dX.v \cdot dY.u\right)\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. neg-sub0N/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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(\left(0 - dX.v \cdot dY.u\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(0, \left(dX.v \cdot dY.u\right)\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. *-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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(0, \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(0, \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{*.f32}\left(\left(\left\lfloor h\right\rfloor \right), \left(\left\lfloor w\right\rfloor \right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    9. 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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(0, \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \left(\left\lfloor w\right\rfloor \right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    10. floor-lowering-floor.f3275.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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\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{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), 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(0, \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  11. Simplified75.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\mathsf{fma}\left(\mathsf{fma}\left(dX.u, dY.v, 0\right), \mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor , 0\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(0 - dX.v \cdot dY.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right|}{\sqrt{\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  12. Step-by-step derivation
    1. 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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\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(0, \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    2. 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{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dX.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dX.v\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{fma.f32}\left(dX.u, dY.v, 0\right), \mathsf{fma.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{floor.f32}\left(h\right), 0\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right)\right), \left(\left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\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(0, \mathsf{*.f32}\left(dX.v, dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{floor.f32}\left(w\right)\right)\right)\right), \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  13. Applied egg-rr75.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\mathsf{fma}\left(\mathsf{fma}\left(dX.u, dY.v, 0\right), \mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor , 0\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\color{blue}{\sqrt{\mathsf{max}\left({\left(\left\lfloor w\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloor h\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2}\right)}}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(0 - dX.v \cdot dY.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right|}{\sqrt{\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  14. Final simplification75.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(dX.u \cdot \left\lfloor w\right\rfloor \right) \cdot \left(dX.u \cdot \left\lfloor w\right\rfloor \right) + \left(dX.v \cdot \left\lfloor h\right\rfloor \right) \cdot \left(dX.v \cdot \left\lfloor h\right\rfloor \right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\mathsf{fma}\left(\mathsf{fma}\left(dX.u, dY.v, 0\right), \mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor , 0\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(dX.v \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot \left\lfloor h\right\rfloor \right)\right|}{\sqrt{\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  15. Add Preprocessing

Alternative 3: 74.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\ t_1 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\ t_2 := t\_0 \cdot dY.u\\ t_3 := \left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|\\ t_4 := \mathsf{fma}\left(dX.u, dX.u \cdot t\_0, dX.v \cdot \left(dX.v \cdot t\_1\right)\right)\\ t_5 := \frac{\sqrt{\mathsf{max}\left(t\_4, \mathsf{fma}\left(dY.u, t\_2, t\_1 \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ t_6 := t\_3 \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ t_7 := \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(t\_4, dY.v \cdot \left(t\_1 \cdot dY.v\right)\right)}{t\_3} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;t\_6\\ \end{array}\\ \mathbf{if}\;dY.v \leq -6400:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;dY.v \leq 80000:\\ \;\;\;\;\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(t\_4, dY.u \cdot t\_2\right)}{t\_3} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;t\_6\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t\_7\\ \end{array} \end{array} \]
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
 :precision binary32
 (let* ((t_0 (pow (floor w) 2.0))
        (t_1 (pow (floor h) 2.0))
        (t_2 (* t_0 dY.u))
        (t_3
         (fabs
          (fma (floor h) (* (floor w) (fma dX.u dY.v (* dX.v (- dY.u)))) 0.0)))
        (t_4 (fma dX.u (* dX.u t_0) (* dX.v (* dX.v t_1))))
        (t_5
         (/
          (sqrt (fmax t_4 (fma dY.u t_2 (* t_1 (* dY.v dY.v)))))
          (floor maxAniso)))
        (t_6
         (*
          t_3
          (/
           1.0
           (sqrt
            (fmax
             (+ (pow (* dX.u (floor w)) 2.0) (pow (* dX.v (floor h)) 2.0))
             (+ (pow (* (floor h) dY.v) 2.0) (pow (* (floor w) dY.u) 2.0)))))))
        (t_7
         (log2
          (if (> (/ (fmax t_4 (* dY.v (* t_1 dY.v))) t_3) (floor maxAniso))
            t_5
            t_6))))
   (if (<= dY.v -6400.0)
     t_7
     (if (<= dY.v 80000.0)
       (log2 (if (> (/ (fmax t_4 (* dY.u t_2)) t_3) (floor maxAniso)) t_5 t_6))
       t_7))))
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), 2.0f);
	float t_1 = powf(floorf(h), 2.0f);
	float t_2 = t_0 * dY_46_u;
	float t_3 = fabsf(fmaf(floorf(h), (floorf(w) * fmaf(dX_46_u, dY_46_v, (dX_46_v * -dY_46_u))), 0.0f));
	float t_4 = fmaf(dX_46_u, (dX_46_u * t_0), (dX_46_v * (dX_46_v * t_1)));
	float t_5 = sqrtf(fmaxf(t_4, fmaf(dY_46_u, t_2, (t_1 * (dY_46_v * dY_46_v))))) / floorf(maxAniso);
	float t_6 = t_3 * (1.0f / sqrtf(fmaxf((powf((dX_46_u * floorf(w)), 2.0f) + powf((dX_46_v * floorf(h)), 2.0f)), (powf((floorf(h) * dY_46_v), 2.0f) + powf((floorf(w) * dY_46_u), 2.0f)))));
	float tmp;
	if ((fmaxf(t_4, (dY_46_v * (t_1 * dY_46_v))) / t_3) > floorf(maxAniso)) {
		tmp = t_5;
	} else {
		tmp = t_6;
	}
	float t_7 = log2f(tmp);
	float tmp_1;
	if (dY_46_v <= -6400.0f) {
		tmp_1 = t_7;
	} else if (dY_46_v <= 80000.0f) {
		float tmp_2;
		if ((fmaxf(t_4, (dY_46_u * t_2)) / t_3) > floorf(maxAniso)) {
			tmp_2 = t_5;
		} else {
			tmp_2 = t_6;
		}
		tmp_1 = log2f(tmp_2);
	} else {
		tmp_1 = t_7;
	}
	return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = floor(w) ^ Float32(2.0)
	t_1 = floor(h) ^ Float32(2.0)
	t_2 = Float32(t_0 * dY_46_u)
	t_3 = abs(fma(floor(h), Float32(floor(w) * fma(dX_46_u, dY_46_v, Float32(dX_46_v * Float32(-dY_46_u)))), Float32(0.0)))
	t_4 = fma(dX_46_u, Float32(dX_46_u * t_0), Float32(dX_46_v * Float32(dX_46_v * t_1)))
	t_5 = Float32(sqrt(((t_4 != t_4) ? fma(dY_46_u, t_2, Float32(t_1 * Float32(dY_46_v * dY_46_v))) : ((fma(dY_46_u, t_2, Float32(t_1 * Float32(dY_46_v * dY_46_v))) != fma(dY_46_u, t_2, Float32(t_1 * Float32(dY_46_v * dY_46_v)))) ? t_4 : max(t_4, fma(dY_46_u, t_2, Float32(t_1 * Float32(dY_46_v * dY_46_v))))))) / floor(maxAniso))
	t_6 = Float32(t_3 * Float32(Float32(1.0) / sqrt(((Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0))) != Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0)))) ? Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) : ((Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) != Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))) ? Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0))) : max(Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0))), Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))))))
	tmp = Float32(0.0)
	if (Float32(((t_4 != t_4) ? Float32(dY_46_v * Float32(t_1 * dY_46_v)) : ((Float32(dY_46_v * Float32(t_1 * dY_46_v)) != Float32(dY_46_v * Float32(t_1 * dY_46_v))) ? t_4 : max(t_4, Float32(dY_46_v * Float32(t_1 * dY_46_v))))) / t_3) > floor(maxAniso))
		tmp = t_5;
	else
		tmp = t_6;
	end
	t_7 = log2(tmp)
	tmp_1 = Float32(0.0)
	if (dY_46_v <= Float32(-6400.0))
		tmp_1 = t_7;
	elseif (dY_46_v <= Float32(80000.0))
		tmp_2 = Float32(0.0)
		if (Float32(((t_4 != t_4) ? Float32(dY_46_u * t_2) : ((Float32(dY_46_u * t_2) != Float32(dY_46_u * t_2)) ? t_4 : max(t_4, Float32(dY_46_u * t_2)))) / t_3) > floor(maxAniso))
			tmp_2 = t_5;
		else
			tmp_2 = t_6;
		end
		tmp_1 = log2(tmp_2);
	else
		tmp_1 = t_7;
	end
	return tmp_1
end
\begin{array}{l}

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

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


\end{array}\\
\mathbf{if}\;dY.v \leq -6400:\\
\;\;\;\;t\_7\\

\mathbf{elif}\;dY.v \leq 80000:\\
\;\;\;\;\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left(t\_4, dY.u \cdot t\_2\right)}{t\_3} > \left\lfloor maxAniso\right\rfloor :\\
\;\;\;\;t\_5\\

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


\end{array}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dY.v < -6400 or 8e4 < dY.v

    1. Initial program 76.7%

      \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

      \[\leadsto \mathsf{log2.f32}\left(\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}{\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{1}{\left\lfloor maxAniso\right\rfloor } \cdot \sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}}\\ } \end{array}}\right) \]
    4. Simplified76.7%

      \[\leadsto \log_{2} \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}\\ } \end{array}} \]
    5. Applied egg-rr76.7%

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}}\\ \end{array} \]
    6. Taylor expanded in dY.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.v \cdot dY.v\right) \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.v \cdot \left(dY.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.v, \left(dY.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dY.v, \left({\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
      5. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dY.v, \mathsf{pow.f32}\left(\left(\left\lfloor h\right\rfloor \right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
      6. floor-lowering-floor.f3276.6%

        \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.v, \mathsf{*.f32}\left(dY.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. Simplified76.6%

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \color{blue}{dY.v \cdot \left(dY.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]

    if -6400 < dY.v < 8e4

    1. Initial program 77.6%

      \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

      \[\leadsto \mathsf{log2.f32}\left(\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}{\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{1}{\left\lfloor maxAniso\right\rfloor } \cdot \sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}}\\ } \end{array}}\right) \]
    4. Simplified77.7%

      \[\leadsto \log_{2} \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}\\ } \end{array}} \]
    5. Applied egg-rr77.7%

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}}\\ \end{array} \]
    6. Taylor expanded in dY.u around inf

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    7. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
      5. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\left(\left\lfloor w\right\rfloor \right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
      6. floor-lowering-floor.f3277.0%

        \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    8. Simplified77.0%

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \color{blue}{dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.v \leq -6400:\\ \;\;\;\;\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), dY.v \cdot \left({\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot dY.v\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array}\\ \mathbf{elif}\;dY.v \leq 80000:\\ \;\;\;\;\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), dY.u \cdot \left({\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), dY.v \cdot \left({\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot dY.v\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 67.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\ t_1 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\ t_2 := t\_1 \cdot dY.u\\ t_3 := \mathsf{fma}\left(dX.u, dX.u \cdot t\_1, dX.v \cdot \left(dX.v \cdot t\_0\right)\right)\\ t_4 := \left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(t\_3, dY.u \cdot t\_2\right)}{t\_4} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(t\_3, \mathsf{fma}\left(dY.u, t\_2, t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;t\_4 \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \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 h) 2.0))
        (t_1 (pow (floor w) 2.0))
        (t_2 (* t_1 dY.u))
        (t_3 (fma dX.u (* dX.u t_1) (* dX.v (* dX.v t_0))))
        (t_4
         (fabs
          (fma
           (floor h)
           (* (floor w) (fma dX.u dY.v (* dX.v (- dY.u))))
           0.0))))
   (log2
    (if (> (/ (fmax t_3 (* dY.u t_2)) t_4) (floor maxAniso))
      (/
       (sqrt (fmax t_3 (fma dY.u t_2 (* t_0 (* dY.v dY.v)))))
       (floor maxAniso))
      (*
       t_4
       (/
        1.0
        (sqrt
         (fmax
          (+ (pow (* dX.u (floor w)) 2.0) (pow (* dX.v (floor h)) 2.0))
          (+ (pow (* (floor h) dY.v) 2.0) (pow (* (floor w) dY.u) 2.0))))))))))
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(h), 2.0f);
	float t_1 = powf(floorf(w), 2.0f);
	float t_2 = t_1 * dY_46_u;
	float t_3 = fmaf(dX_46_u, (dX_46_u * t_1), (dX_46_v * (dX_46_v * t_0)));
	float t_4 = fabsf(fmaf(floorf(h), (floorf(w) * fmaf(dX_46_u, dY_46_v, (dX_46_v * -dY_46_u))), 0.0f));
	float tmp;
	if ((fmaxf(t_3, (dY_46_u * t_2)) / t_4) > floorf(maxAniso)) {
		tmp = sqrtf(fmaxf(t_3, fmaf(dY_46_u, t_2, (t_0 * (dY_46_v * dY_46_v))))) / floorf(maxAniso);
	} else {
		tmp = t_4 * (1.0f / sqrtf(fmaxf((powf((dX_46_u * floorf(w)), 2.0f) + powf((dX_46_v * floorf(h)), 2.0f)), (powf((floorf(h) * dY_46_v), 2.0f) + powf((floorf(w) * dY_46_u), 2.0f)))));
	}
	return log2f(tmp);
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso)
	t_0 = floor(h) ^ Float32(2.0)
	t_1 = floor(w) ^ Float32(2.0)
	t_2 = Float32(t_1 * dY_46_u)
	t_3 = fma(dX_46_u, Float32(dX_46_u * t_1), Float32(dX_46_v * Float32(dX_46_v * t_0)))
	t_4 = abs(fma(floor(h), Float32(floor(w) * fma(dX_46_u, dY_46_v, Float32(dX_46_v * Float32(-dY_46_u)))), Float32(0.0)))
	tmp = Float32(0.0)
	if (Float32(((t_3 != t_3) ? Float32(dY_46_u * t_2) : ((Float32(dY_46_u * t_2) != Float32(dY_46_u * t_2)) ? t_3 : max(t_3, Float32(dY_46_u * t_2)))) / t_4) > floor(maxAniso))
		tmp = Float32(sqrt(((t_3 != t_3) ? fma(dY_46_u, t_2, Float32(t_0 * Float32(dY_46_v * dY_46_v))) : ((fma(dY_46_u, t_2, Float32(t_0 * Float32(dY_46_v * dY_46_v))) != fma(dY_46_u, t_2, Float32(t_0 * Float32(dY_46_v * dY_46_v)))) ? t_3 : max(t_3, fma(dY_46_u, t_2, Float32(t_0 * Float32(dY_46_v * dY_46_v))))))) / floor(maxAniso));
	else
		tmp = Float32(t_4 * Float32(Float32(1.0) / sqrt(((Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0))) != Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0)))) ? Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) : ((Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) != Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))) ? Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0))) : max(Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0))), Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))))));
	end
	return log2(tmp)
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\
t_1 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\
t_2 := t\_1 \cdot dY.u\\
t_3 := \mathsf{fma}\left(dX.u, dX.u \cdot t\_1, dX.v \cdot \left(dX.v \cdot t\_0\right)\right)\\
t_4 := \left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor  \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left(t\_3, dY.u \cdot t\_2\right)}{t\_4} > \left\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{\sqrt{\mathsf{max}\left(t\_3, \mathsf{fma}\left(dY.u, t\_2, t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\

\mathbf{else}:\\
\;\;\;\;t\_4 \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor  \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor  \cdot dY.u\right)}^{2}\right)}}\\


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

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Add Preprocessing
  3. Taylor expanded in w around 0

    \[\leadsto \mathsf{log2.f32}\left(\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}{\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{1}{\left\lfloor maxAniso\right\rfloor } \cdot \sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}}\\ } \end{array}}\right) \]
  4. Simplified77.2%

    \[\leadsto \log_{2} \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}\\ } \end{array}} \]
  5. Applied egg-rr77.2%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}}\\ \end{array} \]
  6. Taylor expanded in dY.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  7. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\left(\left\lfloor w\right\rfloor \right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. floor-lowering-floor.f3264.4%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  8. Simplified64.4%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \color{blue}{dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  9. Final simplification64.4%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), dY.u \cdot \left({\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  10. Add Preprocessing

Alternative 5: 64.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\
t_1 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\
t_2 := t\_1 \cdot dY.u\\
t_3 := \mathsf{fma}\left(dX.u, dX.u \cdot t\_1, dX.v \cdot \left(dX.v \cdot t\_0\right)\right)\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left(t\_3, dY.u \cdot t\_2\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor  \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{\sqrt{\mathsf{max}\left(t\_3, \mathsf{fma}\left(dY.u, t\_2, t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor  \cdot \mathsf{fma}\left(dX.v, -dY.u, \mathsf{fma}\left(dX.u, dY.v, 0\right)\right), 0\right)}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor  \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor  \cdot dY.u\right)}^{2}\right)}}\\


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

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Add Preprocessing
  3. Taylor expanded in w around 0

    \[\leadsto \mathsf{log2.f32}\left(\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}{\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{1}{\left\lfloor maxAniso\right\rfloor } \cdot \sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}}\\ } \end{array}}\right) \]
  4. Simplified77.2%

    \[\leadsto \log_{2} \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}\\ } \end{array}} \]
  5. Applied egg-rr77.2%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}}\\ \end{array} \]
  6. Taylor expanded in dY.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  7. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\left(\left\lfloor w\right\rfloor \right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. floor-lowering-floor.f3264.4%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  8. Simplified64.4%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \color{blue}{dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  9. Applied egg-rr60.8%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor \cdot \mathsf{fma}\left(dX.v, -dY.u, \mathsf{fma}\left(dX.u, dY.v, 0\right)\right), 0\right)}{\sqrt{\mathsf{max}\left({\left(\left\lfloor w\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloor h\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2}\right)}}\\ \end{array} \]
  10. Final simplification60.8%

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

Alternative 6: 40.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\\ t_1 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\ t_2 := {\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}\\ t_3 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\ \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(t\_2, t\_0\right)}{\mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor \cdot \mathsf{fma}\left(dX.v, -dY.u, \mathsf{fma}\left(dX.u, dY.v, 0\right)\right), 0\right)} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot t\_1, dX.v \cdot \left(dX.v \cdot t\_3\right)\right), \mathsf{fma}\left(dY.u, t\_1 \cdot dY.u, t\_3 \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left(t\_2, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + t\_0\right)}}\\ \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) 2.0))
        (t_2 (+ (pow (* dX.u (floor w)) 2.0) (pow (* dX.v (floor h)) 2.0)))
        (t_3 (pow (floor h) 2.0)))
   (log2
    (if (>
         (/
          (fmax t_2 t_0)
          (fma
           (floor w)
           (* (floor h) (fma dX.v (- dY.u) (fma dX.u dY.v 0.0)))
           0.0))
         (floor maxAniso))
      (/
       (sqrt
        (fmax
         (fma dX.u (* dX.u t_1) (* dX.v (* dX.v t_3)))
         (fma dY.u (* t_1 dY.u) (* t_3 (* dY.v dY.v)))))
       (floor maxAniso))
      (*
       (fabs
        (fma (floor h) (* (floor w) (fma dX.u dY.v (* dX.v (- dY.u)))) 0.0))
       (/ 1.0 (sqrt (fmax t_2 (+ (pow (* (floor h) dY.v) 2.0) t_0)))))))))
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), 2.0f);
	float t_2 = powf((dX_46_u * floorf(w)), 2.0f) + powf((dX_46_v * floorf(h)), 2.0f);
	float t_3 = powf(floorf(h), 2.0f);
	float tmp;
	if ((fmaxf(t_2, t_0) / fmaf(floorf(w), (floorf(h) * fmaf(dX_46_v, -dY_46_u, fmaf(dX_46_u, dY_46_v, 0.0f))), 0.0f)) > floorf(maxAniso)) {
		tmp = sqrtf(fmaxf(fmaf(dX_46_u, (dX_46_u * t_1), (dX_46_v * (dX_46_v * t_3))), fmaf(dY_46_u, (t_1 * dY_46_u), (t_3 * (dY_46_v * dY_46_v))))) / floorf(maxAniso);
	} else {
		tmp = fabsf(fmaf(floorf(h), (floorf(w) * fmaf(dX_46_u, dY_46_v, (dX_46_v * -dY_46_u))), 0.0f)) * (1.0f / sqrtf(fmaxf(t_2, (powf((floorf(h) * dY_46_v), 2.0f) + t_0))));
	}
	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 = floor(w) ^ Float32(2.0)
	t_2 = Float32((Float32(dX_46_u * floor(w)) ^ Float32(2.0)) + (Float32(dX_46_v * floor(h)) ^ Float32(2.0)))
	t_3 = floor(h) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (Float32(((t_2 != t_2) ? t_0 : ((t_0 != t_0) ? t_2 : max(t_2, t_0))) / fma(floor(w), Float32(floor(h) * fma(dX_46_v, Float32(-dY_46_u), fma(dX_46_u, dY_46_v, Float32(0.0)))), Float32(0.0))) > floor(maxAniso))
		tmp = Float32(sqrt(((fma(dX_46_u, Float32(dX_46_u * t_1), Float32(dX_46_v * Float32(dX_46_v * t_3))) != fma(dX_46_u, Float32(dX_46_u * t_1), Float32(dX_46_v * Float32(dX_46_v * t_3)))) ? fma(dY_46_u, Float32(t_1 * dY_46_u), Float32(t_3 * Float32(dY_46_v * dY_46_v))) : ((fma(dY_46_u, Float32(t_1 * dY_46_u), Float32(t_3 * Float32(dY_46_v * dY_46_v))) != fma(dY_46_u, Float32(t_1 * dY_46_u), Float32(t_3 * Float32(dY_46_v * dY_46_v)))) ? fma(dX_46_u, Float32(dX_46_u * t_1), Float32(dX_46_v * Float32(dX_46_v * t_3))) : max(fma(dX_46_u, Float32(dX_46_u * t_1), Float32(dX_46_v * Float32(dX_46_v * t_3))), fma(dY_46_u, Float32(t_1 * dY_46_u), Float32(t_3 * Float32(dY_46_v * dY_46_v))))))) / floor(maxAniso));
	else
		tmp = Float32(abs(fma(floor(h), Float32(floor(w) * fma(dX_46_u, dY_46_v, Float32(dX_46_v * Float32(-dY_46_u)))), Float32(0.0))) * Float32(Float32(1.0) / sqrt(((t_2 != t_2) ? Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + t_0) : ((Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + t_0) != Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + t_0)) ? t_2 : max(t_2, Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + t_0)))))));
	end
	return log2(tmp)
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloor w\right\rfloor  \cdot dY.u\right)}^{2}\\
t_1 := {\left(\left\lfloor w\right\rfloor \right)}^{2}\\
t_2 := {\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}\\
t_3 := {\left(\left\lfloor h\right\rfloor \right)}^{2}\\
\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left(t\_2, t\_0\right)}{\mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor  \cdot \mathsf{fma}\left(dX.v, -dY.u, \mathsf{fma}\left(dX.u, dY.v, 0\right)\right), 0\right)} > \left\lfloor maxAniso\right\rfloor :\\
\;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot t\_1, dX.v \cdot \left(dX.v \cdot t\_3\right)\right), \mathsf{fma}\left(dY.u, t\_1 \cdot dY.u, t\_3 \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\

\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor  \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left(t\_2, {\left(\left\lfloor h\right\rfloor  \cdot dY.v\right)}^{2} + t\_0\right)}}\\


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

    \[\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right) - \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right)\right|}{\sqrt{\mathsf{max}\left(\left(\left\lfloor w\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dX.u\right) + \left(\left\lfloor h\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dX.v\right), \left(\left\lfloor w\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloor w\right\rfloor \cdot dY.u\right) + \left(\left\lfloor h\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloor h\right\rfloor \cdot dY.v\right)\right)}}\\ \end{array} \]
  2. Add Preprocessing
  3. Taylor expanded in w around 0

    \[\leadsto \mathsf{log2.f32}\left(\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}{\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{1}{\left\lfloor maxAniso\right\rfloor } \cdot \sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|dX.u \cdot \left(dY.v \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right) - dX.v \cdot \left(dY.u \cdot \left(\left\lfloor h\right\rfloor \cdot \left\lfloor w\right\rfloor \right)\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}, {dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)}}\\ } \end{array}}\right) \]
  4. Simplified77.2%

    \[\leadsto \log_{2} \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \sqrt{\frac{1}{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}\\ } \end{array}} \]
  5. Applied egg-rr77.2%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}}\\ \end{array} \]
  6. Taylor expanded in dY.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  7. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloor w\right\rfloor \right)}^{2}\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    5. 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{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\left(\left\lfloor w\right\rfloor \right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
    6. floor-lowering-floor.f3264.4%

      \[\leadsto \mathsf{log2.f32}\left(\begin{array}{l} \mathbf{if}\;\mathsf{>.f32}\left(\mathsf{/.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right)\right), \mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right)\right), \mathsf{floor.f32}\left(maxAniso\right)\right):\\ \;\;\;\;\mathsf{/.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{fma.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{fma.f32}\left(dY.u, \mathsf{*.f32}\left(dY.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\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)\right), \mathsf{floor.f32}\left(maxAniso\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{*.f32}\left(\mathsf{fabs.f32}\left(\mathsf{fma.f32}\left(\mathsf{floor.f32}\left(h\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), \mathsf{fma.f32}\left(dX.u, dY.v, \mathsf{*.f32}\left(dX.v, \mathsf{neg.f32}\left(dY.u\right)\right)\right)\right), 0\right)\right), \mathsf{/.f32}\left(1, \mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{floor.f32}\left(w\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right)\right)\right)\\ \end{array}\right) \]
  8. Simplified64.4%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \color{blue}{dY.u \cdot \left(dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}\right)}\right)}{\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right|} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  9. Applied egg-rr39.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\color{blue}{\frac{\mathsf{max}\left({\left(\left\lfloor w\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloor h\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}{\mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor \cdot \mathsf{fma}\left(dX.v, -dY.u, \mathsf{fma}\left(dX.u, dY.v, 0\right)\right), 0\right)} > \left\lfloor maxAniso\right\rfloor }:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, dY.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  10. Final simplification39.1%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}{\mathsf{fma}\left(\left\lfloor w\right\rfloor , \left\lfloor h\right\rfloor \cdot \mathsf{fma}\left(dX.v, -dY.u, \mathsf{fma}\left(dX.u, dY.v, 0\right)\right), 0\right)} > \left\lfloor maxAniso\right\rfloor :\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(dX.u, dX.u \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, dX.v \cdot \left(dX.v \cdot {\left(\left\lfloor h\right\rfloor \right)}^{2}\right)\right), \mathsf{fma}\left(dY.u, {\left(\left\lfloor w\right\rfloor \right)}^{2} \cdot dY.u, {\left(\left\lfloor h\right\rfloor \right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)}}{\left\lfloor maxAniso\right\rfloor }\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\left\lfloor h\right\rfloor , \left\lfloor w\right\rfloor \cdot \mathsf{fma}\left(dX.u, dY.v, dX.v \cdot \left(-dY.u\right)\right), 0\right)\right| \cdot \frac{1}{\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloor w\right\rfloor \right)}^{2} + {\left(dX.v \cdot \left\lfloor h\right\rfloor \right)}^{2}, {\left(\left\lfloor h\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloor w\right\rfloor \cdot dY.u\right)}^{2}\right)}}\\ \end{array} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2024193 
(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)))))))))