Anisotropic x16 LOD (LOD)

Percentage Accurate: 76.7% → 76.7%
Time: 46.3s
Alternatives: 7
Speedup: N/A×

Specification

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

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

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


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

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 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.7% accurate, 1.0× speedup?

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

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

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


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

Alternative 1: 76.7% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\sqrt{\mathsf{max}\left(t\_4, t\_2\right)}}\\


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

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

    \[\leadsto \color{blue}{\log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}\\ \end{array}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. add-sqr-sqrt78.6%

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

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

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

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

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

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \color{blue}{{\left(dY.u \cdot \sqrt{\left\lfloorw\right\rfloor}\right)}^{2}}, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}\\ \end{array} \]
  6. Step-by-step derivation
    1. associate-*r*78.6%

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

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

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \color{blue}{{dX.v}^{2}}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, {\left(dY.u \cdot \sqrt{\left\lfloorw\right\rfloor}\right)}^{2}, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}\\ \end{array} \]
    4. unpow-prod-down78.6%

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

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

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

Alternative 2: 74.8% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{t\_0}{\sqrt{\mathsf{max}\left({t\_1}^{2}, t\_2\right)}}\right)\\


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

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

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

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;e^{\mathsf{log1p}\left(\frac{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot {dY.v}^{2}\right)\right)\right)}}\right)} - 1\\ \end{array} \]
  5. Simplified77.4%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left({dX.u}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{fma}\left({\left(\left\lfloorh\right\rfloor\right)}^{2}, {dY.v}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}}\right)\\ \end{array} \]
  6. Step-by-step derivation
    1. pow1/277.4%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 \cdot \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \frac{\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dX.v, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\\ \end{array}} \]
  9. Simplified77.4%

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

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{\color{blue}{dX.u \cdot dY.v} - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)\\ \end{array} \]
  11. Step-by-step derivation
    1. unpow277.6%

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

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

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

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

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

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

Alternative 3: 68.6% accurate, 1.3× speedup?

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

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

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


\end{array}\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \begin{array}{l}
\mathbf{if}\;\frac{\mathsf{max}\left({t\_3}^{2}, t\_2\right)}{t\_7} > \left\lfloormaxAniso\right\rfloor:\\
\;\;\;\;t\_5\\

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


\end{array}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.u < -0.0199999996

    1. Initial program 73.9%

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

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

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;e^{\mathsf{log1p}\left(\frac{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot {dY.v}^{2}\right)\right)\right)}}\right)} - 1\\ \end{array} \]
    5. Simplified74.0%

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left({dX.u}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{fma}\left({\left(\left\lfloorh\right\rfloor\right)}^{2}, {dY.v}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}}\right)\\ \end{array} \]
    6. Step-by-step derivation
      1. pow1/274.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \frac{\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dX.v, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\\ \end{array}} \]
    9. Simplified74.0%

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

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)\\ \end{array} \]
    11. Step-by-step derivation
      1. unpow274.0%

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

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

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

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

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

    if -0.0199999996 < dX.u

    1. Initial program 80.3%

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

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

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

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left({dX.u}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{fma}\left({\left(\left\lfloorh\right\rfloor\right)}^{2}, {dY.v}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}}\right)\\ \end{array} \]
    6. Step-by-step derivation
      1. pow1/278.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \frac{\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dX.v, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\\ \end{array}} \]
    9. Simplified78.7%

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

      \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\color{blue}{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)\\ \end{array} \]
    11. Step-by-step derivation
      1. unpow275.4%

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

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

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

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

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

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

Alternative 4: 64.6% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{t\_3}{t\_2}\right)\\


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

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

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

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;e^{\mathsf{log1p}\left(\frac{\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot {dY.v}^{2}\right)\right)\right)}}\right)} - 1\\ \end{array} \]
  5. Simplified77.4%

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dX.u - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dX.u \cdot dX.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left(dY.u \cdot dY.u\right) \cdot \left\lfloorw\right\rfloor, \left\lfloorh\right\rfloor \cdot \left(\left(dY.v \cdot dY.v\right) \cdot \left\lfloorh\right\rfloor\right)\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left(\mathsf{fma}\left({dX.u}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{fma}\left({\left(\left\lfloorh\right\rfloor\right)}^{2}, {dY.v}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}}\right)\\ \end{array} \]
  6. Step-by-step derivation
    1. pow1/277.4%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 \cdot \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dX.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor, \left\lfloorw\right\rfloor \cdot {dY.u}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \frac{\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dX.v, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\\ \end{array}} \]
  9. Simplified77.4%

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

    \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}{\left|\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.u \cdot dY.v - dX.v \cdot dY.u\right)\right)\right|} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\left\lfloorw\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \frac{dX.u \cdot dY.v - dX.v \cdot dY.u}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)\\ \end{array} \]
  11. Step-by-step derivation
    1. unpow277.6%

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

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

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

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

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

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

Alternative 5: 46.0% accurate, 1.3× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 46.1% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

        \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dY.v, \left\lfloorw\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}{dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot \left\lfloorw\right\rfloor\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dY.v, \left\lfloorw\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\color{blue}{\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right)}\right|}{\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dY.v, \left\lfloorw\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}}\\ \end{array} \]
      5. Step-by-step derivation
        1. unpow277.6%

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

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

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

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

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

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

      Alternative 7: 44.3% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

          \[\leadsto \log_{2} \begin{array}{l} \mathbf{if}\;\frac{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dY.v, \left\lfloorw\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}{dX.u \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot \left\lfloorw\right\rfloor\right)\right)} > \left\lfloormaxAniso\right\rfloor:\\ \;\;\;\;\frac{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dY.v, \left\lfloorw\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}}{\left\lfloormaxAniso\right\rfloor}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(dX.u \cdot dY.v - dX.v \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot \left\lfloorh\right\rfloor\right)\right|}{\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloorh\right\rfloor, dX.u \cdot \left\lfloorw\right\rfloor\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorh\right\rfloor \cdot dY.v, \left\lfloorw\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}}\\ \end{array} \]
        5. Step-by-step derivation
          1. unpow277.6%

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

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

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

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

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

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

        Reproduce

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