Isotropic LOD (LOD)

Percentage Accurate: 68.5% → 71.3%
Time: 32.9s
Alternatives: 20
Speedup: 1.0×

Specification

?
\[\left(\left(\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(1 \leq d \land d \leq 4096\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|dX.w\right| \land \left|dX.w\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 \left(10^{-20} \leq \left|dY.w\right| \land \left|dY.w\right| \leq 10^{+20}\right)\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_2 := \left\lfloorh\right\rfloor \cdot dX.v\\ t_3 := \left\lfloord\right\rfloor \cdot dY.w\\ t_4 := \left\lfloord\right\rfloor \cdot dX.w\\ t_5 := \left\lfloorw\right\rfloor \cdot dX.u\\ \log_{2} \left(\sqrt{\mathsf{max}\left(\left(t\_5 \cdot t\_5 + t\_2 \cdot t\_2\right) + t\_4 \cdot t\_4, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_3 \cdot t\_3\right)}\right) \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (* (floor w) dY.u))
        (t_1 (* (floor h) dY.v))
        (t_2 (* (floor h) dX.v))
        (t_3 (* (floor d) dY.w))
        (t_4 (* (floor d) dX.w))
        (t_5 (* (floor w) dX.u)))
   (log2
    (sqrt
     (fmax
      (+ (+ (* t_5 t_5) (* t_2 t_2)) (* t_4 t_4))
      (+ (+ (* t_0 t_0) (* t_1 t_1)) (* t_3 t_3)))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = floorf(w) * dY_46_u;
	float t_1 = floorf(h) * dY_46_v;
	float t_2 = floorf(h) * dX_46_v;
	float t_3 = floorf(d) * dY_46_w;
	float t_4 = floorf(d) * dX_46_w;
	float t_5 = floorf(w) * dX_46_u;
	return log2f(sqrtf(fmaxf((((t_5 * t_5) + (t_2 * t_2)) + (t_4 * t_4)), (((t_0 * t_0) + (t_1 * t_1)) + (t_3 * t_3)))));
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(floor(w) * dY_46_u)
	t_1 = Float32(floor(h) * dY_46_v)
	t_2 = Float32(floor(h) * dX_46_v)
	t_3 = Float32(floor(d) * dY_46_w)
	t_4 = Float32(floor(d) * dX_46_w)
	t_5 = Float32(floor(w) * dX_46_u)
	return log2(sqrt(((Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4)) != Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4))) ? Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3)) : ((Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3)) != Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3))) ? Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4)) : max(Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4)), Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3)))))))
end
function tmp = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(w) * dY_46_u;
	t_1 = floor(h) * dY_46_v;
	t_2 = floor(h) * dX_46_v;
	t_3 = floor(d) * dY_46_w;
	t_4 = floor(d) * dX_46_w;
	t_5 = floor(w) * dX_46_u;
	tmp = log2(sqrt(max((((t_5 * t_5) + (t_2 * t_2)) + (t_4 * t_4)), (((t_0 * t_0) + (t_1 * t_1)) + (t_3 * t_3)))));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_2 := \left\lfloorh\right\rfloor \cdot dX.v\\
t_3 := \left\lfloord\right\rfloor \cdot dY.w\\
t_4 := \left\lfloord\right\rfloor \cdot dX.w\\
t_5 := \left\lfloorw\right\rfloor \cdot dX.u\\
\log_{2} \left(\sqrt{\mathsf{max}\left(\left(t\_5 \cdot t\_5 + t\_2 \cdot t\_2\right) + t\_4 \cdot t\_4, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_3 \cdot t\_3\right)}\right)
\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 20 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: 68.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_2 := \left\lfloorh\right\rfloor \cdot dX.v\\ t_3 := \left\lfloord\right\rfloor \cdot dY.w\\ t_4 := \left\lfloord\right\rfloor \cdot dX.w\\ t_5 := \left\lfloorw\right\rfloor \cdot dX.u\\ \log_{2} \left(\sqrt{\mathsf{max}\left(\left(t\_5 \cdot t\_5 + t\_2 \cdot t\_2\right) + t\_4 \cdot t\_4, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_3 \cdot t\_3\right)}\right) \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (* (floor w) dY.u))
        (t_1 (* (floor h) dY.v))
        (t_2 (* (floor h) dX.v))
        (t_3 (* (floor d) dY.w))
        (t_4 (* (floor d) dX.w))
        (t_5 (* (floor w) dX.u)))
   (log2
    (sqrt
     (fmax
      (+ (+ (* t_5 t_5) (* t_2 t_2)) (* t_4 t_4))
      (+ (+ (* t_0 t_0) (* t_1 t_1)) (* t_3 t_3)))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = floorf(w) * dY_46_u;
	float t_1 = floorf(h) * dY_46_v;
	float t_2 = floorf(h) * dX_46_v;
	float t_3 = floorf(d) * dY_46_w;
	float t_4 = floorf(d) * dX_46_w;
	float t_5 = floorf(w) * dX_46_u;
	return log2f(sqrtf(fmaxf((((t_5 * t_5) + (t_2 * t_2)) + (t_4 * t_4)), (((t_0 * t_0) + (t_1 * t_1)) + (t_3 * t_3)))));
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(floor(w) * dY_46_u)
	t_1 = Float32(floor(h) * dY_46_v)
	t_2 = Float32(floor(h) * dX_46_v)
	t_3 = Float32(floor(d) * dY_46_w)
	t_4 = Float32(floor(d) * dX_46_w)
	t_5 = Float32(floor(w) * dX_46_u)
	return log2(sqrt(((Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4)) != Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4))) ? Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3)) : ((Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3)) != Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3))) ? Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4)) : max(Float32(Float32(Float32(t_5 * t_5) + Float32(t_2 * t_2)) + Float32(t_4 * t_4)), Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_3 * t_3)))))))
end
function tmp = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(w) * dY_46_u;
	t_1 = floor(h) * dY_46_v;
	t_2 = floor(h) * dX_46_v;
	t_3 = floor(d) * dY_46_w;
	t_4 = floor(d) * dX_46_w;
	t_5 = floor(w) * dX_46_u;
	tmp = log2(sqrt(max((((t_5 * t_5) + (t_2 * t_2)) + (t_4 * t_4)), (((t_0 * t_0) + (t_1 * t_1)) + (t_3 * t_3)))));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_2 := \left\lfloorh\right\rfloor \cdot dX.v\\
t_3 := \left\lfloord\right\rfloor \cdot dY.w\\
t_4 := \left\lfloord\right\rfloor \cdot dX.w\\
t_5 := \left\lfloorw\right\rfloor \cdot dX.u\\
\log_{2} \left(\sqrt{\mathsf{max}\left(\left(t\_5 \cdot t\_5 + t\_2 \cdot t\_2\right) + t\_4 \cdot t\_4, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_3 \cdot t\_3\right)}\right)
\end{array}
\end{array}

Alternative 1: 71.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_2 := \left\lfloord\right\rfloor \cdot dY.w\\ t_3 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ t_4 := \left\lfloord\right\rfloor \cdot dX.w\\ t_5 := \left\lfloorh\right\rfloor \cdot dX.v\\ t_6 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ t_7 := dX.v \cdot \left(dX.v \cdot t\_6\right)\\ t_8 := \left\lfloorw\right\rfloor \cdot dX.u\\ t_9 := {\left(\left\lfloorw\right\rfloor\right)}^{2}\\ \mathbf{if}\;\mathsf{max}\left(\left(t\_8 \cdot t\_8 + t\_5 \cdot t\_5\right) + t\_4 \cdot t\_4, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_2 \cdot t\_2\right) \leq 1.9999999360571385 \cdot 10^{+38}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot t\_9 + \left(t\_7 + \left(dX.w \cdot dX.w\right) \cdot t\_3\right), t\_9 \cdot \left(dY.u \cdot dY.u\right) + \left(dY.v \cdot \left(dY.v \cdot t\_6\right) + t\_3 \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t\_7, dY.w \cdot \left(dY.w \cdot t\_3\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (* (floor w) dY.u))
        (t_1 (* (floor h) dY.v))
        (t_2 (* (floor d) dY.w))
        (t_3 (pow (floor d) 2.0))
        (t_4 (* (floor d) dX.w))
        (t_5 (* (floor h) dX.v))
        (t_6 (pow (floor h) 2.0))
        (t_7 (* dX.v (* dX.v t_6)))
        (t_8 (* (floor w) dX.u))
        (t_9 (pow (floor w) 2.0)))
   (if (<=
        (fmax
         (+ (+ (* t_8 t_8) (* t_5 t_5)) (* t_4 t_4))
         (+ (+ (* t_0 t_0) (* t_1 t_1)) (* t_2 t_2)))
        1.9999999360571385e+38)
     (log2
      (sqrt
       (fmax
        (+ (* (* dX.u dX.u) t_9) (+ t_7 (* (* dX.w dX.w) t_3)))
        (+
         (* t_9 (* dY.u dY.u))
         (+ (* dY.v (* dY.v t_6)) (* t_3 (* dY.w dY.w)))))))
     (log2 (sqrt (fmax t_7 (* dY.w (* dY.w t_3))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = floorf(w) * dY_46_u;
	float t_1 = floorf(h) * dY_46_v;
	float t_2 = floorf(d) * dY_46_w;
	float t_3 = powf(floorf(d), 2.0f);
	float t_4 = floorf(d) * dX_46_w;
	float t_5 = floorf(h) * dX_46_v;
	float t_6 = powf(floorf(h), 2.0f);
	float t_7 = dX_46_v * (dX_46_v * t_6);
	float t_8 = floorf(w) * dX_46_u;
	float t_9 = powf(floorf(w), 2.0f);
	float tmp;
	if (fmaxf((((t_8 * t_8) + (t_5 * t_5)) + (t_4 * t_4)), (((t_0 * t_0) + (t_1 * t_1)) + (t_2 * t_2))) <= 1.9999999360571385e+38f) {
		tmp = log2f(sqrtf(fmaxf((((dX_46_u * dX_46_u) * t_9) + (t_7 + ((dX_46_w * dX_46_w) * t_3))), ((t_9 * (dY_46_u * dY_46_u)) + ((dY_46_v * (dY_46_v * t_6)) + (t_3 * (dY_46_w * dY_46_w)))))));
	} else {
		tmp = log2f(sqrtf(fmaxf(t_7, (dY_46_w * (dY_46_w * t_3)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(floor(w) * dY_46_u)
	t_1 = Float32(floor(h) * dY_46_v)
	t_2 = Float32(floor(d) * dY_46_w)
	t_3 = floor(d) ^ Float32(2.0)
	t_4 = Float32(floor(d) * dX_46_w)
	t_5 = Float32(floor(h) * dX_46_v)
	t_6 = floor(h) ^ Float32(2.0)
	t_7 = Float32(dX_46_v * Float32(dX_46_v * t_6))
	t_8 = Float32(floor(w) * dX_46_u)
	t_9 = floor(w) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (((Float32(Float32(Float32(t_8 * t_8) + Float32(t_5 * t_5)) + Float32(t_4 * t_4)) != Float32(Float32(Float32(t_8 * t_8) + Float32(t_5 * t_5)) + Float32(t_4 * t_4))) ? Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2)) : ((Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2)) != Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2))) ? Float32(Float32(Float32(t_8 * t_8) + Float32(t_5 * t_5)) + Float32(t_4 * t_4)) : max(Float32(Float32(Float32(t_8 * t_8) + Float32(t_5 * t_5)) + Float32(t_4 * t_4)), Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2))))) <= Float32(1.9999999360571385e+38))
		tmp = log2(sqrt(((Float32(Float32(Float32(dX_46_u * dX_46_u) * t_9) + Float32(t_7 + Float32(Float32(dX_46_w * dX_46_w) * t_3))) != Float32(Float32(Float32(dX_46_u * dX_46_u) * t_9) + Float32(t_7 + Float32(Float32(dX_46_w * dX_46_w) * t_3)))) ? Float32(Float32(t_9 * Float32(dY_46_u * dY_46_u)) + Float32(Float32(dY_46_v * Float32(dY_46_v * t_6)) + Float32(t_3 * Float32(dY_46_w * dY_46_w)))) : ((Float32(Float32(t_9 * Float32(dY_46_u * dY_46_u)) + Float32(Float32(dY_46_v * Float32(dY_46_v * t_6)) + Float32(t_3 * Float32(dY_46_w * dY_46_w)))) != Float32(Float32(t_9 * Float32(dY_46_u * dY_46_u)) + Float32(Float32(dY_46_v * Float32(dY_46_v * t_6)) + Float32(t_3 * Float32(dY_46_w * dY_46_w))))) ? Float32(Float32(Float32(dX_46_u * dX_46_u) * t_9) + Float32(t_7 + Float32(Float32(dX_46_w * dX_46_w) * t_3))) : max(Float32(Float32(Float32(dX_46_u * dX_46_u) * t_9) + Float32(t_7 + Float32(Float32(dX_46_w * dX_46_w) * t_3))), Float32(Float32(t_9 * Float32(dY_46_u * dY_46_u)) + Float32(Float32(dY_46_v * Float32(dY_46_v * t_6)) + Float32(t_3 * Float32(dY_46_w * dY_46_w)))))))));
	else
		tmp = log2(sqrt(((t_7 != t_7) ? Float32(dY_46_w * Float32(dY_46_w * t_3)) : ((Float32(dY_46_w * Float32(dY_46_w * t_3)) != Float32(dY_46_w * Float32(dY_46_w * t_3))) ? t_7 : max(t_7, Float32(dY_46_w * Float32(dY_46_w * t_3)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(w) * dY_46_u;
	t_1 = floor(h) * dY_46_v;
	t_2 = floor(d) * dY_46_w;
	t_3 = floor(d) ^ single(2.0);
	t_4 = floor(d) * dX_46_w;
	t_5 = floor(h) * dX_46_v;
	t_6 = floor(h) ^ single(2.0);
	t_7 = dX_46_v * (dX_46_v * t_6);
	t_8 = floor(w) * dX_46_u;
	t_9 = floor(w) ^ single(2.0);
	tmp = single(0.0);
	if (max((((t_8 * t_8) + (t_5 * t_5)) + (t_4 * t_4)), (((t_0 * t_0) + (t_1 * t_1)) + (t_2 * t_2))) <= single(1.9999999360571385e+38))
		tmp = log2(sqrt(max((((dX_46_u * dX_46_u) * t_9) + (t_7 + ((dX_46_w * dX_46_w) * t_3))), ((t_9 * (dY_46_u * dY_46_u)) + ((dY_46_v * (dY_46_v * t_6)) + (t_3 * (dY_46_w * dY_46_w)))))));
	else
		tmp = log2(sqrt(max(t_7, (dY_46_w * (dY_46_w * t_3)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_2 := \left\lfloord\right\rfloor \cdot dY.w\\
t_3 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\
t_4 := \left\lfloord\right\rfloor \cdot dX.w\\
t_5 := \left\lfloorh\right\rfloor \cdot dX.v\\
t_6 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\
t_7 := dX.v \cdot \left(dX.v \cdot t\_6\right)\\
t_8 := \left\lfloorw\right\rfloor \cdot dX.u\\
t_9 := {\left(\left\lfloorw\right\rfloor\right)}^{2}\\
\mathbf{if}\;\mathsf{max}\left(\left(t\_8 \cdot t\_8 + t\_5 \cdot t\_5\right) + t\_4 \cdot t\_4, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_2 \cdot t\_2\right) \leq 1.9999999360571385 \cdot 10^{+38}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot t\_9 + \left(t\_7 + \left(dX.w \cdot dX.w\right) \cdot t\_3\right), t\_9 \cdot \left(dY.u \cdot dY.u\right) + \left(dY.v \cdot \left(dY.v \cdot t\_6\right) + t\_3 \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t\_7, dY.w \cdot \left(dY.w \cdot t\_3\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (fmax.f32 (+.f32 (+.f32 (*.f32 (*.f32 (floor.f32 w) dX.u) (*.f32 (floor.f32 w) dX.u)) (*.f32 (*.f32 (floor.f32 h) dX.v) (*.f32 (floor.f32 h) dX.v))) (*.f32 (*.f32 (floor.f32 d) dX.w) (*.f32 (floor.f32 d) dX.w))) (+.f32 (+.f32 (*.f32 (*.f32 (floor.f32 w) dY.u) (*.f32 (floor.f32 w) dY.u)) (*.f32 (*.f32 (floor.f32 h) dY.v) (*.f32 (floor.f32 h) dY.v))) (*.f32 (*.f32 (floor.f32 d) dY.w) (*.f32 (floor.f32 d) dY.w)))) < 1.99999994e38

    1. Initial program 99.9%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

      \[\leadsto \color{blue}{\log_{2} \left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + \left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right) + \left(dY.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dY.v\right) + {\left(\left\lfloord\right\rfloor\right)}^{2} \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)} \]

    if 1.99999994e38 < (fmax.f32 (+.f32 (+.f32 (*.f32 (*.f32 (floor.f32 w) dX.u) (*.f32 (floor.f32 w) dX.u)) (*.f32 (*.f32 (floor.f32 h) dX.v) (*.f32 (floor.f32 h) dX.v))) (*.f32 (*.f32 (floor.f32 d) dX.w) (*.f32 (floor.f32 d) dX.w))) (+.f32 (+.f32 (*.f32 (*.f32 (floor.f32 w) dY.u) (*.f32 (floor.f32 w) dY.u)) (*.f32 (*.f32 (floor.f32 h) dY.v) (*.f32 (floor.f32 h) dY.v))) (*.f32 (*.f32 (floor.f32 d) dY.w) (*.f32 (floor.f32 d) dY.w))))

    1. Initial program 8.5%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3214.6%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified14.6%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3220.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified20.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right) \leq 1.9999999360571385 \cdot 10^{+38}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + \left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right) + \left(dY.v \cdot \left(dY.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor\right)}^{2} \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 68.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \log_{2} \left(\sqrt{\mathsf{max}\left(\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right) + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (log2
  (sqrt
   (fmax
    (+
     (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor d) dX.w) 2.0))
     (pow (* (floor h) dX.v) 2.0))
    (+
     (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0))
     (pow (* (floor d) dY.w) 2.0))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	return log2f(sqrtf(fmaxf(((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(d) * dX_46_w), 2.0f)) + powf((floorf(h) * dX_46_v), 2.0f)), ((powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f)) + powf((floorf(d) * dY_46_w), 2.0f)))));
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	return log2(sqrt(((Float32(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) : ((Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) != Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) ? Float32(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))))))))
end
function tmp = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = log2(sqrt(max(((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(d) * dX_46_w) ^ single(2.0))) + ((floor(h) * dX_46_v) ^ single(2.0))), ((((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0))) + ((floor(d) * dY_46_w) ^ single(2.0))))));
end
\begin{array}{l}

\\
\log_{2} \left(\sqrt{\mathsf{max}\left(\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right) + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 67.1%

    \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. sqrt-lowering-sqrt.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    2. fmax-lowering-fmax.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
  4. Applied egg-rr67.1%

    \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
  5. Final simplification67.1%

    \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right) + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
  6. Add Preprocessing

Alternative 3: 63.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\ t_2 := \left\lfloord\right\rfloor \cdot dY.w\\ t_3 := dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\\ \mathbf{if}\;dX.w \leq 5000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + t\_3, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_2 \cdot t\_2\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t\_3 + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({t\_0}^{2} + {t\_1}^{2}\right) + {t\_2}^{2}\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (* (floor w) dY.u))
        (t_1 (* (floor h) dY.v))
        (t_2 (* (floor d) dY.w))
        (t_3 (* dX.v (* dX.v (pow (floor h) 2.0)))))
   (if (<= dX.w 5000.0)
     (log2
      (sqrt
       (fmax
        (+ (* (* dX.u dX.u) (pow (floor w) 2.0)) t_3)
        (+ (+ (* t_0 t_0) (* t_1 t_1)) (* t_2 t_2)))))
     (log2
      (sqrt
       (fmax
        (+ t_3 (* dX.w (* dX.w (pow (floor d) 2.0))))
        (+ (+ (pow t_0 2.0) (pow t_1 2.0)) (pow t_2 2.0))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = floorf(w) * dY_46_u;
	float t_1 = floorf(h) * dY_46_v;
	float t_2 = floorf(d) * dY_46_w;
	float t_3 = dX_46_v * (dX_46_v * powf(floorf(h), 2.0f));
	float tmp;
	if (dX_46_w <= 5000.0f) {
		tmp = log2f(sqrtf(fmaxf((((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)) + t_3), (((t_0 * t_0) + (t_1 * t_1)) + (t_2 * t_2)))));
	} else {
		tmp = log2f(sqrtf(fmaxf((t_3 + (dX_46_w * (dX_46_w * powf(floorf(d), 2.0f)))), ((powf(t_0, 2.0f) + powf(t_1, 2.0f)) + powf(t_2, 2.0f)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(floor(w) * dY_46_u)
	t_1 = Float32(floor(h) * dY_46_v)
	t_2 = Float32(floor(d) * dY_46_w)
	t_3 = Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(5000.0))
		tmp = log2(sqrt(((Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + t_3) != Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + t_3)) ? Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2)) : ((Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2)) != Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2))) ? Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + t_3) : max(Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + t_3), Float32(Float32(Float32(t_0 * t_0) + Float32(t_1 * t_1)) + Float32(t_2 * t_2)))))));
	else
		tmp = log2(sqrt(((Float32(t_3 + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) != Float32(t_3 + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))))) ? Float32(Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) + (t_2 ^ Float32(2.0))) : ((Float32(Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) + (t_2 ^ Float32(2.0))) != Float32(Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) + (t_2 ^ Float32(2.0)))) ? Float32(t_3 + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) : max(Float32(t_3 + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))), Float32(Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) + (t_2 ^ Float32(2.0))))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(w) * dY_46_u;
	t_1 = floor(h) * dY_46_v;
	t_2 = floor(d) * dY_46_w;
	t_3 = dX_46_v * (dX_46_v * (floor(h) ^ single(2.0)));
	tmp = single(0.0);
	if (dX_46_w <= single(5000.0))
		tmp = log2(sqrt(max((((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))) + t_3), (((t_0 * t_0) + (t_1 * t_1)) + (t_2 * t_2)))));
	else
		tmp = log2(sqrt(max((t_3 + (dX_46_w * (dX_46_w * (floor(d) ^ single(2.0))))), (((t_0 ^ single(2.0)) + (t_1 ^ single(2.0))) + (t_2 ^ single(2.0))))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_1 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_2 := \left\lfloord\right\rfloor \cdot dY.w\\
t_3 := dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\\
\mathbf{if}\;dX.w \leq 5000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + t\_3, \left(t\_0 \cdot t\_0 + t\_1 \cdot t\_1\right) + t\_2 \cdot t\_2\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t\_3 + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({t\_0}^{2} + {t\_1}^{2}\right) + {t\_2}^{2}\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.w < 5e3

    1. Initial program 66.8%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + 1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      11. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      17. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      18. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified63.9%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]

    if 5e3 < dX.w

    1. Initial program 68.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr68.1%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified66.7%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 63.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\\ \mathbf{if}\;dX.u \leq 12000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), t\_0\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\frac{1}{\frac{1}{{\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}}}, t\_0\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0
         (+
          (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0))
          (pow (* (floor d) dY.w) 2.0))))
   (if (<= dX.u 12000000.0)
     (log2
      (sqrt
       (fmax
        (+
         (* dX.v (* dX.v (pow (floor h) 2.0)))
         (* dX.w (* dX.w (pow (floor d) 2.0))))
        t_0)))
     (log2
      (sqrt
       (fmax
        (/
         1.0
         (/ 1.0 (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor d) dX.w) 2.0))))
        t_0))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = (powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f)) + powf((floorf(d) * dY_46_w), 2.0f);
	float tmp;
	if (dX_46_u <= 12000000.0f) {
		tmp = log2f(sqrtf(fmaxf(((dX_46_v * (dX_46_v * powf(floorf(h), 2.0f))) + (dX_46_w * (dX_46_w * powf(floorf(d), 2.0f)))), t_0)));
	} else {
		tmp = log2f(sqrtf(fmaxf((1.0f / (1.0f / (powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(d) * dX_46_w), 2.0f)))), t_0)));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))
	tmp = Float32(0.0)
	if (dX_46_u <= Float32(12000000.0))
		tmp = log2(sqrt(((Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) != Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))))) ? t_0 : ((t_0 != t_0) ? Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) : max(Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))), t_0)))));
	else
		tmp = log2(sqrt(((Float32(Float32(1.0) / Float32(Float32(1.0) / Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))))) != Float32(Float32(1.0) / Float32(Float32(1.0) / Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0)))))) ? t_0 : ((t_0 != t_0) ? Float32(Float32(1.0) / Float32(Float32(1.0) / Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))))) : max(Float32(Float32(1.0) / Float32(Float32(1.0) / Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))))), t_0)))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = (((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0))) + ((floor(d) * dY_46_w) ^ single(2.0));
	tmp = single(0.0);
	if (dX_46_u <= single(12000000.0))
		tmp = log2(sqrt(max(((dX_46_v * (dX_46_v * (floor(h) ^ single(2.0)))) + (dX_46_w * (dX_46_w * (floor(d) ^ single(2.0))))), t_0)));
	else
		tmp = log2(sqrt(max((single(1.0) / (single(1.0) / (((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(d) * dX_46_w) ^ single(2.0))))), t_0)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\\
\mathbf{if}\;dX.u \leq 12000000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), t\_0\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\frac{1}{\frac{1}{{\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}}}, t\_0\right)}\right)\\


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

    1. Initial program 70.3%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr70.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified64.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]

    if 1.2e7 < dX.u

    1. Initial program 46.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr46.6%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.v around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified49.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    8. Step-by-step derivation
      1. flip3-+N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\frac{{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}^{3} + {\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}^{3}}{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) + \left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) - \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\frac{1}{\frac{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) + \left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) - \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)}{{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}^{3} + {\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}^{3}}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\frac{\frac{2}{2}}{\frac{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) + \left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) - \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)}{{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}^{3} + {\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}^{3}}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{/.f32}\left(\left(\frac{2}{2}\right), \left(\frac{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) + \left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right) - \left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right) \cdot \left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)}{{\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}^{3} + {\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    9. Applied egg-rr49.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\frac{1}{\frac{1}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2} + {\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}}}}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.u \leq 12000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\frac{1}{\frac{1}{{\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}}}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\\ t_1 := {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\ t_2 := {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\\ \mathbf{if}\;dX.u \leq 12000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left(t\_0 + t\_1\right) + t\_2\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, t\_0 + \left(t\_1 + t\_2\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (* (floor w) dY.u) 2.0))
        (t_1 (pow (* (floor h) dY.v) 2.0))
        (t_2 (pow (* (floor d) dY.w) 2.0)))
   (if (<= dX.u 12000000.0)
     (log2
      (sqrt
       (fmax
        (+
         (* dX.v (* dX.v (pow (floor h) 2.0)))
         (* dX.w (* dX.w (pow (floor d) 2.0))))
        (+ (+ t_0 t_1) t_2))))
     (log2
      (sqrt
       (fmax
        (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor d) dX.w) 2.0))
        (+ t_0 (+ t_1 t_2))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf((floorf(w) * dY_46_u), 2.0f);
	float t_1 = powf((floorf(h) * dY_46_v), 2.0f);
	float t_2 = powf((floorf(d) * dY_46_w), 2.0f);
	float tmp;
	if (dX_46_u <= 12000000.0f) {
		tmp = log2f(sqrtf(fmaxf(((dX_46_v * (dX_46_v * powf(floorf(h), 2.0f))) + (dX_46_w * (dX_46_w * powf(floorf(d), 2.0f)))), ((t_0 + t_1) + t_2))));
	} else {
		tmp = log2f(sqrtf(fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(d) * dX_46_w), 2.0f)), (t_0 + (t_1 + t_2)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(floor(w) * dY_46_u) ^ Float32(2.0)
	t_1 = Float32(floor(h) * dY_46_v) ^ Float32(2.0)
	t_2 = Float32(floor(d) * dY_46_w) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_u <= Float32(12000000.0))
		tmp = log2(sqrt(((Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) != Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))))) ? Float32(Float32(t_0 + t_1) + t_2) : ((Float32(Float32(t_0 + t_1) + t_2) != Float32(Float32(t_0 + t_1) + t_2)) ? Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) : max(Float32(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) + Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))), Float32(Float32(t_0 + t_1) + t_2))))));
	else
		tmp = log2(sqrt(((Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0)))) ? Float32(t_0 + Float32(t_1 + t_2)) : ((Float32(t_0 + Float32(t_1 + t_2)) != Float32(t_0 + Float32(t_1 + t_2))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))), Float32(t_0 + Float32(t_1 + t_2)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = (floor(w) * dY_46_u) ^ single(2.0);
	t_1 = (floor(h) * dY_46_v) ^ single(2.0);
	t_2 = (floor(d) * dY_46_w) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_u <= single(12000000.0))
		tmp = log2(sqrt(max(((dX_46_v * (dX_46_v * (floor(h) ^ single(2.0)))) + (dX_46_w * (dX_46_w * (floor(d) ^ single(2.0))))), ((t_0 + t_1) + t_2))));
	else
		tmp = log2(sqrt(max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(d) * dX_46_w) ^ single(2.0))), (t_0 + (t_1 + t_2)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, t\_0 + \left(t\_1 + t\_2\right)\right)}\right)\\


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

    1. Initial program 70.3%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr70.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified64.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]

    if 1.2e7 < dX.u

    1. Initial program 46.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr46.6%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.v around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified49.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    8. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \left(\left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
    9. Applied egg-rr49.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2} + {\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.u \leq 12000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 63.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\\ t_1 := {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\ t_2 := {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\\ t_3 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\\ \mathbf{if}\;dX.u \leq 12000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t\_0 + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, \left(t\_3 + t\_1\right) + t\_2\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + t\_0, t\_3 + \left(t\_1 + t\_2\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (* (floor d) dX.w) 2.0))
        (t_1 (pow (* (floor h) dY.v) 2.0))
        (t_2 (pow (* (floor d) dY.w) 2.0))
        (t_3 (pow (* (floor w) dY.u) 2.0)))
   (if (<= dX.u 12000000.0)
     (log2
      (sqrt (fmax (+ t_0 (pow (* (floor h) dX.v) 2.0)) (+ (+ t_3 t_1) t_2))))
     (log2
      (sqrt
       (fmax (+ (pow (* (floor w) dX.u) 2.0) t_0) (+ t_3 (+ t_1 t_2))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf((floorf(d) * dX_46_w), 2.0f);
	float t_1 = powf((floorf(h) * dY_46_v), 2.0f);
	float t_2 = powf((floorf(d) * dY_46_w), 2.0f);
	float t_3 = powf((floorf(w) * dY_46_u), 2.0f);
	float tmp;
	if (dX_46_u <= 12000000.0f) {
		tmp = log2f(sqrtf(fmaxf((t_0 + powf((floorf(h) * dX_46_v), 2.0f)), ((t_3 + t_1) + t_2))));
	} else {
		tmp = log2f(sqrtf(fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + t_0), (t_3 + (t_1 + t_2)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = Float32(floor(d) * dX_46_w) ^ Float32(2.0)
	t_1 = Float32(floor(h) * dY_46_v) ^ Float32(2.0)
	t_2 = Float32(floor(d) * dY_46_w) ^ Float32(2.0)
	t_3 = Float32(floor(w) * dY_46_u) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_u <= Float32(12000000.0))
		tmp = log2(sqrt(((Float32(t_0 + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) != Float32(t_0 + (Float32(floor(h) * dX_46_v) ^ Float32(2.0)))) ? Float32(Float32(t_3 + t_1) + t_2) : ((Float32(Float32(t_3 + t_1) + t_2) != Float32(Float32(t_3 + t_1) + t_2)) ? Float32(t_0 + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) : max(Float32(t_0 + (Float32(floor(h) * dX_46_v) ^ Float32(2.0))), Float32(Float32(t_3 + t_1) + t_2))))));
	else
		tmp = log2(sqrt(((Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + t_0) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + t_0)) ? Float32(t_3 + Float32(t_1 + t_2)) : ((Float32(t_3 + Float32(t_1 + t_2)) != Float32(t_3 + Float32(t_1 + t_2))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + t_0) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + t_0), Float32(t_3 + Float32(t_1 + t_2)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = (floor(d) * dX_46_w) ^ single(2.0);
	t_1 = (floor(h) * dY_46_v) ^ single(2.0);
	t_2 = (floor(d) * dY_46_w) ^ single(2.0);
	t_3 = (floor(w) * dY_46_u) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_u <= single(12000000.0))
		tmp = log2(sqrt(max((t_0 + ((floor(h) * dX_46_v) ^ single(2.0))), ((t_3 + t_1) + t_2))));
	else
		tmp = log2(sqrt(max((((floor(w) * dX_46_u) ^ single(2.0)) + t_0), (t_3 + (t_1 + t_2)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\\
t_1 := {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\\
t_2 := {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\\
t_3 := {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\\
\mathbf{if}\;dX.u \leq 12000000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t\_0 + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, \left(t\_3 + t\_1\right) + t\_2\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + t\_0, t\_3 + \left(t\_1 + t\_2\right)\right)}\right)\\


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

    1. Initial program 70.3%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr70.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified64.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\left(dX.w \cdot \left\lfloord\right\rfloor\right), 2\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \left(\left\lfloord\right\rfloor\right)\right), 2\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. pow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{pow.f32}\left(\left(dX.v \cdot \left\lfloorh\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \left(\left\lfloorh\right\rfloor\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. floor-lowering-floor.f3264.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    9. Applied egg-rr64.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2} + {\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]

    if 1.2e7 < dX.u

    1. Initial program 46.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr46.6%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.v around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified49.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    8. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \left(\left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
    9. Applied egg-rr49.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2} + {\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.u \leq 12000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 62.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.v \leq 900000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (if (<= dX.v 900000.0)
   (log2
    (sqrt
     (fmax
      (+ (pow (* (floor w) dX.u) 2.0) (pow (* (floor d) dX.w) 2.0))
      (+
       (pow (* (floor w) dY.u) 2.0)
       (+ (pow (* (floor h) dY.v) 2.0) (pow (* (floor d) dY.w) 2.0))))))
   (log2
    (sqrt
     (fmax
      (+
       (* (* dX.u dX.u) (pow (floor w) 2.0))
       (* dX.v (* dX.v (pow (floor h) 2.0))))
      (* dY.w (* dY.w (pow (floor d) 2.0))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float tmp;
	if (dX_46_v <= 900000.0f) {
		tmp = log2f(sqrtf(fmaxf((powf((floorf(w) * dX_46_u), 2.0f) + powf((floorf(d) * dX_46_w), 2.0f)), (powf((floorf(w) * dY_46_u), 2.0f) + (powf((floorf(h) * dY_46_v), 2.0f) + powf((floorf(d) * dY_46_w), 2.0f))))));
	} else {
		tmp = log2f(sqrtf(fmaxf((((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)) + (dX_46_v * (dX_46_v * powf(floorf(h), 2.0f)))), (dY_46_w * (dY_46_w * powf(floorf(d), 2.0f))))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(900000.0))
		tmp = log2(sqrt(((Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) != Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0)))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))))) ? Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) : max(Float32((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dX_46_w) ^ Float32(2.0))), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))))))));
	else
		tmp = log2(sqrt(((Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) != Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))))) ? Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) : ((Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) != Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0))))) ? Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) : max(Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))), Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = single(0.0);
	if (dX_46_v <= single(900000.0))
		tmp = log2(sqrt(max((((floor(w) * dX_46_u) ^ single(2.0)) + ((floor(d) * dX_46_w) ^ single(2.0))), (((floor(w) * dY_46_u) ^ single(2.0)) + (((floor(h) * dY_46_v) ^ single(2.0)) + ((floor(d) * dY_46_w) ^ single(2.0)))))));
	else
		tmp = log2(sqrt(max((((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))) + (dX_46_v * (dX_46_v * (floor(h) ^ single(2.0))))), (dY_46_w * (dY_46_w * (floor(d) ^ single(2.0)))))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;dX.v \leq 900000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 9e5

    1. Initial program 69.8%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr69.8%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.v around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left(dX.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dX.u\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dX.u}^{2}} \cdot {dX.u}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\frac{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.u}^{2}}{{dX.u}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(dX.u, \mathsf{*.f32}\left(dX.u, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right)\right), \left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified61.9%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    8. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.u \cdot \left(dX.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right) + dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \left(\left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
    9. Applied egg-rr61.9%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2} + {\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)} \]

    if 9e5 < dX.v

    1. Initial program 55.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + 1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      11. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      17. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      18. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3252.8%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified52.8%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 900000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 56.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 100000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot t\_0\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot t\_0\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor d) 2.0)))
   (if (<= dX.v 100000.0)
     (log2
      (sqrt
       (fmax
        (* dX.w (* dX.w t_0))
        (+
         (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor h) dY.v) 2.0))
         (pow (* (floor d) dY.w) 2.0)))))
     (log2
      (sqrt
       (fmax
        (+
         (* (* dX.u dX.u) (pow (floor w) 2.0))
         (* dX.v (* dX.v (pow (floor h) 2.0))))
        (* dY.w (* dY.w t_0))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(d), 2.0f);
	float tmp;
	if (dX_46_v <= 100000.0f) {
		tmp = log2f(sqrtf(fmaxf((dX_46_w * (dX_46_w * t_0)), ((powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(h) * dY_46_v), 2.0f)) + powf((floorf(d) * dY_46_w), 2.0f)))));
	} else {
		tmp = log2f(sqrtf(fmaxf((((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)) + (dX_46_v * (dX_46_v * powf(floorf(h), 2.0f)))), (dY_46_w * (dY_46_w * t_0)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(100000.0))
		tmp = log2(sqrt(((Float32(dX_46_w * Float32(dX_46_w * t_0)) != Float32(dX_46_w * Float32(dX_46_w * t_0))) ? Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) : ((Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) != Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) ? Float32(dX_46_w * Float32(dX_46_w * t_0)) : max(Float32(dX_46_w * Float32(dX_46_w * t_0)), Float32(Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))))))));
	else
		tmp = log2(sqrt(((Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) != Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))))) ? Float32(dY_46_w * Float32(dY_46_w * t_0)) : ((Float32(dY_46_w * Float32(dY_46_w * t_0)) != Float32(dY_46_w * Float32(dY_46_w * t_0))) ? Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) : max(Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))), Float32(dY_46_w * Float32(dY_46_w * t_0)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(100000.0))
		tmp = log2(sqrt(max((dX_46_w * (dX_46_w * t_0)), ((((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0))) + ((floor(d) * dY_46_w) ^ single(2.0))))));
	else
		tmp = log2(sqrt(max((((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))) + (dX_46_v * (dX_46_v * (floor(h) ^ single(2.0))))), (dY_46_w * (dY_46_w * t_0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.v \leq 100000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot t\_0\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 1e5

    1. Initial program 69.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
      2. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right)\right), \left(\left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right)\right)\right) \]
    4. Applied egg-rr69.4%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2} + \left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]
    5. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dX.w\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dX.w\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.w, \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{*.f32}\left(dX.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3255.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), 2\right)\right)\right)\right)\right) \]
    7. Simplified55.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]

    if 1e5 < dX.v

    1. Initial program 57.8%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + 1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      11. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      17. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      18. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3253.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified53.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 100000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 56.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.v \leq 100000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (if (<= dX.v 100000.0)
   (log2
    (sqrt
     (fmax
      (pow (* (floor d) dX.w) 2.0)
      (+
       (pow (* (floor w) dY.u) 2.0)
       (+ (pow (* (floor h) dY.v) 2.0) (pow (* (floor d) dY.w) 2.0))))))
   (log2
    (sqrt
     (fmax
      (+
       (* (* dX.u dX.u) (pow (floor w) 2.0))
       (* dX.v (* dX.v (pow (floor h) 2.0))))
      (* dY.w (* dY.w (pow (floor d) 2.0))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float tmp;
	if (dX_46_v <= 100000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), (powf((floorf(w) * dY_46_u), 2.0f) + (powf((floorf(h) * dY_46_v), 2.0f) + powf((floorf(d) * dY_46_w), 2.0f))))));
	} else {
		tmp = log2f(sqrtf(fmaxf((((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)) + (dX_46_v * (dX_46_v * powf(floorf(h), 2.0f)))), (dY_46_w * (dY_46_w * powf(floorf(d), 2.0f))))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(100000.0))
		tmp = log2(sqrt((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))))) ? (Float32(floor(d) * dX_46_w) ^ Float32(2.0)) : max((Float32(floor(d) * dX_46_w) ^ Float32(2.0)), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + Float32((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))))))));
	else
		tmp = log2(sqrt(((Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) != Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))))) ? Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) : ((Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) != Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0))))) ? Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) : max(Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))), Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = single(0.0);
	if (dX_46_v <= single(100000.0))
		tmp = log2(sqrt(max(((floor(d) * dX_46_w) ^ single(2.0)), (((floor(w) * dY_46_u) ^ single(2.0)) + (((floor(h) * dY_46_v) ^ single(2.0)) + ((floor(d) * dY_46_w) ^ single(2.0)))))));
	else
		tmp = log2(sqrt(max((((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))) + (dX_46_v * (dX_46_v * (floor(h) ^ single(2.0))))), (dY_46_w * (dY_46_w * (floor(d) ^ single(2.0)))))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;dX.v \leq 100000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 1e5

    1. Initial program 69.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Applied egg-rr55.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right) + {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)} \]

    if 1e5 < dX.v

    1. Initial program 57.8%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + 1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      11. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      17. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      18. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3253.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified53.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 100000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 48.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ t_1 := dY.w \cdot \left(dY.w \cdot t\_0\right)\\ t_2 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_0, t\_1 + t\_2 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot t\_2\right), t\_1\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor d) 2.0))
        (t_1 (* dY.w (* dY.w t_0)))
        (t_2 (pow (floor h) 2.0)))
   (if (<= dX.v 500.0)
     (log2 (sqrt (fmax (* (* dX.w dX.w) t_0) (+ t_1 (* t_2 (* dY.v dY.v))))))
     (log2
      (sqrt
       (fmax
        (+ (* (* dX.u dX.u) (pow (floor w) 2.0)) (* dX.v (* dX.v t_2)))
        t_1))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(d), 2.0f);
	float t_1 = dY_46_w * (dY_46_w * t_0);
	float t_2 = powf(floorf(h), 2.0f);
	float tmp;
	if (dX_46_v <= 500.0f) {
		tmp = log2f(sqrtf(fmaxf(((dX_46_w * dX_46_w) * t_0), (t_1 + (t_2 * (dY_46_v * dY_46_v))))));
	} else {
		tmp = log2f(sqrtf(fmaxf((((dX_46_u * dX_46_u) * powf(floorf(w), 2.0f)) + (dX_46_v * (dX_46_v * t_2))), t_1)));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ Float32(2.0)
	t_1 = Float32(dY_46_w * Float32(dY_46_w * t_0))
	t_2 = floor(h) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(500.0))
		tmp = log2(sqrt(((Float32(Float32(dX_46_w * dX_46_w) * t_0) != Float32(Float32(dX_46_w * dX_46_w) * t_0)) ? Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v))) : ((Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v))) != Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v)))) ? Float32(Float32(dX_46_w * dX_46_w) * t_0) : max(Float32(Float32(dX_46_w * dX_46_w) * t_0), Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v))))))));
	else
		tmp = log2(sqrt(((Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * t_2))) != Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * t_2)))) ? t_1 : ((t_1 != t_1) ? Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * t_2))) : max(Float32(Float32(Float32(dX_46_u * dX_46_u) * (floor(w) ^ Float32(2.0))) + Float32(dX_46_v * Float32(dX_46_v * t_2))), t_1)))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ single(2.0);
	t_1 = dY_46_w * (dY_46_w * t_0);
	t_2 = floor(h) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(500.0))
		tmp = log2(sqrt(max(((dX_46_w * dX_46_w) * t_0), (t_1 + (t_2 * (dY_46_v * dY_46_v))))));
	else
		tmp = log2(sqrt(max((((dX_46_u * dX_46_u) * (floor(w) ^ single(2.0))) + (dX_46_v * (dX_46_v * t_2))), t_1)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\
t_1 := dY.w \cdot \left(dY.w \cdot t\_0\right)\\
t_2 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.v \leq 500:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_0, t\_1 + t\_2 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot t\_2\right), t\_1\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 500

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.4%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.4%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      6. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      9. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      10. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      18. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      19. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right)\right) \]
    8. Simplified51.1%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]

    if 500 < dX.v

    1. Initial program 59.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + 1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({dX.u}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(dX.u \cdot dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      11. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.w}^{2} \cdot \frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}{{dX.w}^{2}} \cdot {dX.w}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot {dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right) \cdot \frac{{dX.w}^{2}}{{dX.w}^{2}}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(\frac{{dX.w}^{2}}{{dX.w}^{2}} \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      17. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left(1 \cdot \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      18. *-lft-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified57.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3252.7%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.u, dX.u\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right)\right), \mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified52.7%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 47.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ t_1 := dY.w \cdot \left(dY.w \cdot t\_0\right)\\ t_2 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_0, t\_1 + t\_2 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_2\right), t\_1\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor d) 2.0))
        (t_1 (* dY.w (* dY.w t_0)))
        (t_2 (pow (floor h) 2.0)))
   (if (<= dX.v 500.0)
     (log2 (sqrt (fmax (* (* dX.w dX.w) t_0) (+ t_1 (* t_2 (* dY.v dY.v))))))
     (log2 (sqrt (fmax (* dX.v (* dX.v t_2)) t_1))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(d), 2.0f);
	float t_1 = dY_46_w * (dY_46_w * t_0);
	float t_2 = powf(floorf(h), 2.0f);
	float tmp;
	if (dX_46_v <= 500.0f) {
		tmp = log2f(sqrtf(fmaxf(((dX_46_w * dX_46_w) * t_0), (t_1 + (t_2 * (dY_46_v * dY_46_v))))));
	} else {
		tmp = log2f(sqrtf(fmaxf((dX_46_v * (dX_46_v * t_2)), t_1)));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ Float32(2.0)
	t_1 = Float32(dY_46_w * Float32(dY_46_w * t_0))
	t_2 = floor(h) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(500.0))
		tmp = log2(sqrt(((Float32(Float32(dX_46_w * dX_46_w) * t_0) != Float32(Float32(dX_46_w * dX_46_w) * t_0)) ? Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v))) : ((Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v))) != Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v)))) ? Float32(Float32(dX_46_w * dX_46_w) * t_0) : max(Float32(Float32(dX_46_w * dX_46_w) * t_0), Float32(t_1 + Float32(t_2 * Float32(dY_46_v * dY_46_v))))))));
	else
		tmp = log2(sqrt(((Float32(dX_46_v * Float32(dX_46_v * t_2)) != Float32(dX_46_v * Float32(dX_46_v * t_2))) ? t_1 : ((t_1 != t_1) ? Float32(dX_46_v * Float32(dX_46_v * t_2)) : max(Float32(dX_46_v * Float32(dX_46_v * t_2)), t_1)))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ single(2.0);
	t_1 = dY_46_w * (dY_46_w * t_0);
	t_2 = floor(h) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(500.0))
		tmp = log2(sqrt(max(((dX_46_w * dX_46_w) * t_0), (t_1 + (t_2 * (dY_46_v * dY_46_v))))));
	else
		tmp = log2(sqrt(max((dX_46_v * (dX_46_v * t_2)), t_1)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\
t_1 := dY.w \cdot \left(dY.w \cdot t\_0\right)\\
t_2 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.v \leq 500:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_0, t\_1 + t\_2 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_2\right), t\_1\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 500

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.4%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.4%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.u around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      6. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      9. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      10. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right)\right) \]
      14. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right)\right)\right)\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      18. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      19. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right)\right) \]
    8. Simplified51.1%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]

    if 500 < dX.v

    1. Initial program 59.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3249.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified49.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 48.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ t_1 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 100000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_0, t\_1 \cdot \left(dY.v \cdot dY.v\right) + dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_1\right), dY.w \cdot \left(dY.w \cdot t\_0\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor d) 2.0)) (t_1 (pow (floor h) 2.0)))
   (if (<= dX.v 100000.0)
     (log2
      (sqrt
       (fmax
        (* (* dX.w dX.w) t_0)
        (+ (* t_1 (* dY.v dY.v)) (* dY.u (* dY.u (pow (floor w) 2.0)))))))
     (log2 (sqrt (fmax (* dX.v (* dX.v t_1)) (* dY.w (* dY.w t_0))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(d), 2.0f);
	float t_1 = powf(floorf(h), 2.0f);
	float tmp;
	if (dX_46_v <= 100000.0f) {
		tmp = log2f(sqrtf(fmaxf(((dX_46_w * dX_46_w) * t_0), ((t_1 * (dY_46_v * dY_46_v)) + (dY_46_u * (dY_46_u * powf(floorf(w), 2.0f)))))));
	} else {
		tmp = log2f(sqrtf(fmaxf((dX_46_v * (dX_46_v * t_1)), (dY_46_w * (dY_46_w * t_0)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ Float32(2.0)
	t_1 = floor(h) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(100000.0))
		tmp = log2(sqrt(((Float32(Float32(dX_46_w * dX_46_w) * t_0) != Float32(Float32(dX_46_w * dX_46_w) * t_0)) ? Float32(Float32(t_1 * Float32(dY_46_v * dY_46_v)) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0))))) : ((Float32(Float32(t_1 * Float32(dY_46_v * dY_46_v)) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0))))) != Float32(Float32(t_1 * Float32(dY_46_v * dY_46_v)) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0)))))) ? Float32(Float32(dX_46_w * dX_46_w) * t_0) : max(Float32(Float32(dX_46_w * dX_46_w) * t_0), Float32(Float32(t_1 * Float32(dY_46_v * dY_46_v)) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0))))))))));
	else
		tmp = log2(sqrt(((Float32(dX_46_v * Float32(dX_46_v * t_1)) != Float32(dX_46_v * Float32(dX_46_v * t_1))) ? Float32(dY_46_w * Float32(dY_46_w * t_0)) : ((Float32(dY_46_w * Float32(dY_46_w * t_0)) != Float32(dY_46_w * Float32(dY_46_w * t_0))) ? Float32(dX_46_v * Float32(dX_46_v * t_1)) : max(Float32(dX_46_v * Float32(dX_46_v * t_1)), Float32(dY_46_w * Float32(dY_46_w * t_0)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ single(2.0);
	t_1 = floor(h) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(100000.0))
		tmp = log2(sqrt(max(((dX_46_w * dX_46_w) * t_0), ((t_1 * (dY_46_v * dY_46_v)) + (dY_46_u * (dY_46_u * (floor(w) ^ single(2.0))))))));
	else
		tmp = log2(sqrt(max((dX_46_v * (dX_46_v * t_1)), (dY_46_w * (dY_46_w * t_0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_1\right), dY.w \cdot \left(dY.w \cdot t\_0\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 1e5

    1. Initial program 69.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right)\right) \]
      11. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f3244.6%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right)\right) \]
    8. Simplified44.6%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]

    if 1e5 < dX.v

    1. Initial program 57.8%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3247.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified47.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3244.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified44.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 100000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right) + dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 47.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 108:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) + dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_0\right), t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor h) 2.0)))
   (if (<= dX.v 108.0)
     (log2
      (sqrt
       (fmax
        (pow (* (floor d) dX.w) 2.0)
        (+
         (* dY.w (* dY.w (pow (floor d) 2.0)))
         (* dY.u (* dY.u (pow (floor w) 2.0)))))))
     (log2 (sqrt (fmax (* dX.v (* dX.v t_0)) (* t_0 (* dY.v dY.v))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(h), 2.0f);
	float tmp;
	if (dX_46_v <= 108.0f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), ((dY_46_w * (dY_46_w * powf(floorf(d), 2.0f))) + (dY_46_u * (dY_46_u * powf(floorf(w), 2.0f)))))));
	} else {
		tmp = log2f(sqrtf(fmaxf((dX_46_v * (dX_46_v * t_0)), (t_0 * (dY_46_v * dY_46_v)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(h) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(108.0))
		tmp = log2(sqrt((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? Float32(Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0))))) : ((Float32(Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0))))) != Float32(Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0)))))) ? (Float32(floor(d) * dX_46_w) ^ Float32(2.0)) : max((Float32(floor(d) * dX_46_w) ^ Float32(2.0)), Float32(Float32(dY_46_w * Float32(dY_46_w * (floor(d) ^ Float32(2.0)))) + Float32(dY_46_u * Float32(dY_46_u * (floor(w) ^ Float32(2.0))))))))));
	else
		tmp = log2(sqrt(((Float32(dX_46_v * Float32(dX_46_v * t_0)) != Float32(dX_46_v * Float32(dX_46_v * t_0))) ? Float32(t_0 * Float32(dY_46_v * dY_46_v)) : ((Float32(t_0 * Float32(dY_46_v * dY_46_v)) != Float32(t_0 * Float32(dY_46_v * dY_46_v))) ? Float32(dX_46_v * Float32(dX_46_v * t_0)) : max(Float32(dX_46_v * Float32(dX_46_v * t_0)), Float32(t_0 * Float32(dY_46_v * dY_46_v)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(h) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(108.0))
		tmp = log2(sqrt(max(((floor(d) * dX_46_w) ^ single(2.0)), ((dY_46_w * (dY_46_w * (floor(d) ^ single(2.0)))) + (dY_46_u * (dY_46_u * (floor(w) ^ single(2.0))))))));
	else
		tmp = log2(sqrt(max((dX_46_v * (dX_46_v * t_0)), (t_0 * (dY_46_v * dY_46_v)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.v \leq 108:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) + dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_0\right), t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 108

    1. Initial program 68.9%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      6. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left(\frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right)\right) \]
      15. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left(\frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
    8. Simplified46.2%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\left(dX.w \cdot \left\lfloord\right\rfloor\right), 2\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \left(\left\lfloord\right\rfloor\right)\right), 2\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3246.2%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr46.2%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)}\right) \]

    if 108 < dX.v

    1. Initial program 60.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3251.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified51.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3248.8%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified48.8%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 108:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) + dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 47.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 108:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_0\right), t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor h) 2.0)))
   (if (<= dX.v 108.0)
     (log2
      (sqrt
       (fmax
        (pow (* (floor d) dX.w) 2.0)
        (+ (pow (* (floor w) dY.u) 2.0) (pow (* (floor d) dY.w) 2.0)))))
     (log2 (sqrt (fmax (* dX.v (* dX.v t_0)) (* t_0 (* dY.v dY.v))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(h), 2.0f);
	float tmp;
	if (dX_46_v <= 108.0f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), (powf((floorf(w) * dY_46_u), 2.0f) + powf((floorf(d) * dY_46_w), 2.0f)))));
	} else {
		tmp = log2f(sqrtf(fmaxf((dX_46_v * (dX_46_v * t_0)), (t_0 * (dY_46_v * dY_46_v)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(h) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(108.0))
		tmp = log2(sqrt((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) : ((Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) != Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))) ? (Float32(floor(d) * dX_46_w) ^ Float32(2.0)) : max((Float32(floor(d) * dX_46_w) ^ Float32(2.0)), Float32((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) + (Float32(floor(d) * dY_46_w) ^ Float32(2.0))))))));
	else
		tmp = log2(sqrt(((Float32(dX_46_v * Float32(dX_46_v * t_0)) != Float32(dX_46_v * Float32(dX_46_v * t_0))) ? Float32(t_0 * Float32(dY_46_v * dY_46_v)) : ((Float32(t_0 * Float32(dY_46_v * dY_46_v)) != Float32(t_0 * Float32(dY_46_v * dY_46_v))) ? Float32(dX_46_v * Float32(dX_46_v * t_0)) : max(Float32(dX_46_v * Float32(dX_46_v * t_0)), Float32(t_0 * Float32(dY_46_v * dY_46_v)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(h) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(108.0))
		tmp = log2(sqrt(max(((floor(d) * dX_46_w) ^ single(2.0)), (((floor(w) * dY_46_u) ^ single(2.0)) + ((floor(d) * dY_46_w) ^ single(2.0))))));
	else
		tmp = log2(sqrt(max((dX_46_v * (dX_46_v * t_0)), (t_0 * (dY_46_v * dY_46_v)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.v \leq 108:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_0\right), t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 108

    1. Initial program 68.9%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.0%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.0%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around 0

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-rgt-identityN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot 1\right)\right)\right)\right) \]
      2. *-inversesN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot \frac{{dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right) \]
      6. +-lowering-+.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      13. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left({dY.u}^{2} \cdot \frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left(\frac{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}{{dY.u}^{2}} \cdot {dY.u}^{2}\right)\right)\right)\right)\right) \]
      15. associate-*l/N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right), \left(\frac{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot {dY.u}^{2}}{{dY.u}^{2}}\right)\right)\right)\right)\right) \]
    8. Simplified46.2%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      2. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      3. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right) \cdot dY.w\right)\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + {\left(\left\lfloord\right\rfloor\right)}^{2} \cdot \left(dY.w \cdot dY.w\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + {\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}\right)\right)\right)\right) \]
      7. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) \cdot dY.u + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      9. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, \left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right) \cdot \left(dY.u \cdot dY.u\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      11. swap-sqrN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
      13. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)\right)\right) \]
    10. Applied egg-rr46.2%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)} \]

    if 108 < dX.v

    1. Initial program 60.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3251.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified51.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3248.8%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified48.8%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 108:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2} + {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 39.2% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\ t_1 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.w \leq 1000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_0\right), t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_1, dY.w \cdot \left(dY.w \cdot t\_1\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor h) 2.0)) (t_1 (pow (floor d) 2.0)))
   (if (<= dX.w 1000.0)
     (log2 (sqrt (fmax (* dX.v (* dX.v t_0)) (* t_0 (* dY.v dY.v)))))
     (log2 (sqrt (fmax (* (* dX.w dX.w) t_1) (* dY.w (* dY.w t_1))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(h), 2.0f);
	float t_1 = powf(floorf(d), 2.0f);
	float tmp;
	if (dX_46_w <= 1000.0f) {
		tmp = log2f(sqrtf(fmaxf((dX_46_v * (dX_46_v * t_0)), (t_0 * (dY_46_v * dY_46_v)))));
	} else {
		tmp = log2f(sqrtf(fmaxf(((dX_46_w * dX_46_w) * t_1), (dY_46_w * (dY_46_w * t_1)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(h) ^ Float32(2.0)
	t_1 = floor(d) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(1000.0))
		tmp = log2(sqrt(((Float32(dX_46_v * Float32(dX_46_v * t_0)) != Float32(dX_46_v * Float32(dX_46_v * t_0))) ? Float32(t_0 * Float32(dY_46_v * dY_46_v)) : ((Float32(t_0 * Float32(dY_46_v * dY_46_v)) != Float32(t_0 * Float32(dY_46_v * dY_46_v))) ? Float32(dX_46_v * Float32(dX_46_v * t_0)) : max(Float32(dX_46_v * Float32(dX_46_v * t_0)), Float32(t_0 * Float32(dY_46_v * dY_46_v)))))));
	else
		tmp = log2(sqrt(((Float32(Float32(dX_46_w * dX_46_w) * t_1) != Float32(Float32(dX_46_w * dX_46_w) * t_1)) ? Float32(dY_46_w * Float32(dY_46_w * t_1)) : ((Float32(dY_46_w * Float32(dY_46_w * t_1)) != Float32(dY_46_w * Float32(dY_46_w * t_1))) ? Float32(Float32(dX_46_w * dX_46_w) * t_1) : max(Float32(Float32(dX_46_w * dX_46_w) * t_1), Float32(dY_46_w * Float32(dY_46_w * t_1)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(h) ^ single(2.0);
	t_1 = floor(d) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_w <= single(1000.0))
		tmp = log2(sqrt(max((dX_46_v * (dX_46_v * t_0)), (t_0 * (dY_46_v * dY_46_v)))));
	else
		tmp = log2(sqrt(max(((dX_46_w * dX_46_w) * t_1), (dY_46_w * (dY_46_w * t_1)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloorh\right\rfloor\right)}^{2}\\
t_1 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.w \leq 1000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot t\_0\right), t\_0 \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot t\_1, dY.w \cdot \left(dY.w \cdot t\_1\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.w < 1e3

    1. Initial program 66.8%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3256.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified56.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3241.1%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified41.1%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]

    if 1e3 < dX.w

    1. Initial program 68.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3258.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified58.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3254.9%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified54.9%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.w \leq 1000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 39.7% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\ \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot t\_0\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot t\_0\right)\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (let* ((t_0 (pow (floor d) 2.0)))
   (if (<= dX.v 500.0)
     (log2 (sqrt (fmax (* dX.w (* dX.w t_0)) (pow (* (floor h) dY.v) 2.0))))
     (log2
      (sqrt
       (fmax (* dX.v (* dX.v (pow (floor h) 2.0))) (* dY.w (* dY.w t_0))))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float t_0 = powf(floorf(d), 2.0f);
	float tmp;
	if (dX_46_v <= 500.0f) {
		tmp = log2f(sqrtf(fmaxf((dX_46_w * (dX_46_w * t_0)), powf((floorf(h) * dY_46_v), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf((dX_46_v * (dX_46_v * powf(floorf(h), 2.0f))), (dY_46_w * (dY_46_w * t_0)))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(500.0))
		tmp = log2(sqrt(((Float32(dX_46_w * Float32(dX_46_w * t_0)) != Float32(dX_46_w * Float32(dX_46_w * t_0))) ? (Float32(floor(h) * dY_46_v) ^ Float32(2.0)) : (((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) ? Float32(dX_46_w * Float32(dX_46_w * t_0)) : max(Float32(dX_46_w * Float32(dX_46_w * t_0)), (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt(((Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) != Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0))))) ? Float32(dY_46_w * Float32(dY_46_w * t_0)) : ((Float32(dY_46_w * Float32(dY_46_w * t_0)) != Float32(dY_46_w * Float32(dY_46_w * t_0))) ? Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))) : max(Float32(dX_46_v * Float32(dX_46_v * (floor(h) ^ Float32(2.0)))), Float32(dY_46_w * Float32(dY_46_w * t_0)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	t_0 = floor(d) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_v <= single(500.0))
		tmp = log2(sqrt(max((dX_46_w * (dX_46_w * t_0)), ((floor(h) * dY_46_v) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((dX_46_v * (dX_46_v * (floor(h) ^ single(2.0)))), (dY_46_w * (dY_46_w * t_0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left\lfloord\right\rfloor\right)}^{2}\\
\mathbf{if}\;dX.v \leq 500:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot t\_0\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot t\_0\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 500

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.4%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.4%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      5. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      6. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    10. Applied egg-rr38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w}, {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right) \]
    11. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor \cdot dY.v\right), 2\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorh\right\rfloor\right), dY.v\right), 2\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right) \]
    12. Applied egg-rr38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w, \color{blue}{{\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}}\right)}\right) \]

    if 500 < dX.v

    1. Initial program 59.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3249.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified49.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.w \cdot dY.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\left({\left(\left\lfloord\right\rfloor\right)}^{2}\right), dY.w\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.w, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right), dY.w\right)\right)\right)\right)\right) \]
    8. Simplified44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.w \cdot \left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot dY.w\right)}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.w \cdot \left(dY.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 39.6% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (if (<= dX.v 500.0)
   (log2
    (sqrt
     (fmax
      (* dX.w (* dX.w (pow (floor d) 2.0)))
      (pow (* (floor h) dY.v) 2.0))))
   (log2
    (sqrt
     (fmax
      (* (floor h) (* (floor h) (* dX.v dX.v)))
      (pow (* (floor w) dY.u) 2.0))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float tmp;
	if (dX_46_v <= 500.0f) {
		tmp = log2f(sqrtf(fmaxf((dX_46_w * (dX_46_w * powf(floorf(d), 2.0f))), powf((floorf(h) * dY_46_v), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf((floorf(h) * (floorf(h) * (dX_46_v * dX_46_v))), powf((floorf(w) * dY_46_u), 2.0f))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(500.0))
		tmp = log2(sqrt(((Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))) != Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) ? (Float32(floor(h) * dY_46_v) ^ Float32(2.0)) : (((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) ? Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))) : max(Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))), (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt(((Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v))) != Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v)))) ? (Float32(floor(w) * dY_46_u) ^ Float32(2.0)) : (((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) ? Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v))) : max(Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v))), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = single(0.0);
	if (dX_46_v <= single(500.0))
		tmp = log2(sqrt(max((dX_46_w * (dX_46_w * (floor(d) ^ single(2.0)))), ((floor(h) * dY_46_v) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((floor(h) * (floor(h) * (dX_46_v * dX_46_v))), ((floor(w) * dY_46_u) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;dX.v \leq 500:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 500

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.4%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.4%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      5. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      6. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    10. Applied egg-rr38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w}, {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right) \]
    11. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor \cdot dY.v\right), 2\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorh\right\rfloor\right), dY.v\right), 2\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right) \]
    12. Applied egg-rr38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w, \color{blue}{{\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}}\right)}\right) \]

    if 500 < dX.v

    1. Initial program 59.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3249.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified49.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.u around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
    8. Simplified44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) \cdot dY.u\right)\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right)\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      6. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      8. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      9. pow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      10. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\left(dX.v \cdot \left\lfloorh\right\rfloor\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \left(\left\lfloorh\right\rfloor\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      13. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right), 2\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), dY.u\right), 2\right)\right)\right)\right) \]
      15. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
    10. Applied egg-rr44.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)} \]
    11. Step-by-step derivation
      1. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left({dX.v}^{2} \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorh\right\rfloor\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.v}^{2} \cdot \left\lfloorh\right\rfloor\right), \left(\left\lfloorh\right\rfloor\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\left({dX.v}^{2}\right), \left(\left\lfloorh\right\rfloor\right)\right), \left(\left\lfloorh\right\rfloor\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(dX.v \cdot dX.v\right), \left(\left\lfloorh\right\rfloor\right)\right), \left(\left\lfloorh\right\rfloor\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.v, dX.v\right), \left(\left\lfloorh\right\rfloor\right)\right), \left(\left\lfloorh\right\rfloor\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      8. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.v, dX.v\right), \mathsf{floor.f32}\left(h\right)\right), \left(\left\lfloorh\right\rfloor\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
      9. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.v, dX.v\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{floor.f32}\left(h\right)\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
    12. Applied egg-rr44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(\left(dX.v \cdot dX.v\right) \cdot \left\lfloorh\right\rfloor\right) \cdot \left\lfloorh\right\rfloor}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 39.6% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (if (<= dX.v 500.0)
   (log2
    (sqrt
     (fmax
      (* dX.w (* dX.w (pow (floor d) 2.0)))
      (pow (* (floor h) dY.v) 2.0))))
   (log2
    (sqrt (fmax (pow (* (floor h) dX.v) 2.0) (pow (* (floor w) dY.u) 2.0))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float tmp;
	if (dX_46_v <= 500.0f) {
		tmp = log2f(sqrtf(fmaxf((dX_46_w * (dX_46_w * powf(floorf(d), 2.0f))), powf((floorf(h) * dY_46_v), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(h) * dX_46_v), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(500.0))
		tmp = log2(sqrt(((Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))) != Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0))))) ? (Float32(floor(h) * dY_46_v) ^ Float32(2.0)) : (((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) ? Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))) : max(Float32(dX_46_w * Float32(dX_46_w * (floor(d) ^ Float32(2.0)))), (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((Float32(floor(h) * dX_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) ? (Float32(floor(w) * dY_46_u) ^ Float32(2.0)) : (((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) ? (Float32(floor(h) * dX_46_v) ^ Float32(2.0)) : max((Float32(floor(h) * dX_46_v) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = single(0.0);
	if (dX_46_v <= single(500.0))
		tmp = log2(sqrt(max((dX_46_w * (dX_46_w * (floor(d) ^ single(2.0)))), ((floor(h) * dY_46_v) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max(((floor(h) * dX_46_v) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;dX.v \leq 500:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 500

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.4%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.4%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      5. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
      6. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    10. Applied egg-rr38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w}, {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)}\right) \]
    11. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor \cdot dY.v\right), 2\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorh\right\rfloor\right), dY.v\right), 2\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), dX.w\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right) \]
    12. Applied egg-rr38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right) \cdot dX.w, \color{blue}{{\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}}\right)}\right) \]

    if 500 < dX.v

    1. Initial program 59.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3249.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified49.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.u around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
    8. Simplified44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) \cdot dY.u\right)\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right)\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      6. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      8. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      9. pow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      10. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\left(dX.v \cdot \left\lfloorh\right\rfloor\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \left(\left\lfloorh\right\rfloor\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      13. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right), 2\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), dY.u\right), 2\right)\right)\right)\right) \]
      15. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
    10. Applied egg-rr44.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 39.6% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (if (<= dX.v 500.0)
   (log2
    (sqrt (fmax (pow (* (floor d) dX.w) 2.0) (pow (* (floor h) dY.v) 2.0))))
   (log2
    (sqrt (fmax (pow (* (floor h) dX.v) 2.0) (pow (* (floor w) dY.u) 2.0))))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	float tmp;
	if (dX_46_v <= 500.0f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), powf((floorf(h) * dY_46_v), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(h) * dX_46_v), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	}
	return tmp;
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(500.0))
		tmp = log2(sqrt((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? (Float32(floor(h) * dY_46_v) ^ Float32(2.0)) : (((Float32(floor(h) * dY_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) ? (Float32(floor(d) * dX_46_w) ^ Float32(2.0)) : max((Float32(floor(d) * dX_46_w) ^ Float32(2.0)), (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((Float32(floor(h) * dX_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) ? (Float32(floor(w) * dY_46_u) ^ Float32(2.0)) : (((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) ? (Float32(floor(h) * dX_46_v) ^ Float32(2.0)) : max((Float32(floor(h) * dX_46_v) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	end
	return tmp
end
function tmp_2 = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = single(0.0);
	if (dX_46_v <= single(500.0))
		tmp = log2(sqrt(max(((floor(d) * dX_46_w) ^ single(2.0)), ((floor(h) * dY_46_v) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max(((floor(h) * dX_46_v) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;dX.v \leq 500:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.v < 500

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.w around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left({dX.w}^{2}\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\left(dX.w \cdot dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \left({\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\left(\left\lfloord\right\rfloor\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. floor-lowering-floor.f3255.4%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified55.4%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \color{blue}{\left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      3. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      4. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left({dY.v}^{2}\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(dX.w, dX.w\right), \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(d\right), 2\right)\right), \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right), \mathsf{*.f32}\left(dY.v, dY.v\right)\right)\right)\right)\right) \]
    8. Simplified38.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot \left(dY.v \cdot dY.v\right)\right)\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}\right)\right)\right)\right) \]
      4. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      5. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.w \cdot \left(dX.w \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.w \cdot dX.w\right) \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      8. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      9. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\left(dX.w \cdot \left\lfloord\right\rfloor\right), 2\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \left(\left\lfloord\right\rfloor\right)\right), 2\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      11. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \left({\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)\right)\right)\right) \]
      12. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor \cdot dY.v\right), 2\right)\right)\right)\right) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorh\right\rfloor\right), dY.v\right), 2\right)\right)\right)\right) \]
      14. floor-lowering-floor.f3238.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.w, \mathsf{floor.f32}\left(d\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), 2\right)\right)\right)\right) \]
    10. Applied egg-rr38.5%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)} \]

    if 500 < dX.v

    1. Initial program 59.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in dX.v around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      7. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
      8. floor-lowering-floor.f3249.5%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. Simplified49.5%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    6. Taylor expanded in dY.u around inf

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right)\right)\right)\right) \]
      6. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
      7. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
    8. Simplified44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)}\right)}\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) \cdot dY.u\right)\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right)\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
      5. unpow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      6. fmax-lowering-fmax.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      8. pow2N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      9. pow-prod-downN/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      10. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\left(dX.v \cdot \left\lfloorh\right\rfloor\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \left(\left\lfloorh\right\rfloor\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      12. floor-lowering-floor.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
      13. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right), 2\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), dY.u\right), 2\right)\right)\right)\right) \]
      15. floor-lowering-floor.f3244.3%

        \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
    10. Applied egg-rr44.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \leq 500:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 35.8% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \end{array} \]
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
 :precision binary32
 (log2
  (sqrt (fmax (pow (* (floor h) dX.v) 2.0) (pow (* (floor w) dY.u) 2.0)))))
float code(float w, float h, float d, float dX_46_u, float dX_46_v, float dX_46_w, float dY_46_u, float dY_46_v, float dY_46_w) {
	return log2f(sqrtf(fmaxf(powf((floorf(h) * dX_46_v), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
}
function code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	return log2(sqrt((((Float32(floor(h) * dX_46_v) ^ Float32(2.0)) != (Float32(floor(h) * dX_46_v) ^ Float32(2.0))) ? (Float32(floor(w) * dY_46_u) ^ Float32(2.0)) : (((Float32(floor(w) * dY_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dY_46_u) ^ Float32(2.0))) ? (Float32(floor(h) * dX_46_v) ^ Float32(2.0)) : max((Float32(floor(h) * dX_46_v) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))))
end
function tmp = code(w, h, d, dX_46_u, dX_46_v, dX_46_w, dY_46_u, dY_46_v, dY_46_w)
	tmp = log2(sqrt(max(((floor(h) * dX_46_v) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
end
\begin{array}{l}

\\
\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 67.1%

    \[\log_{2} \left(\sqrt{\mathsf{max}\left(\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)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in dX.v around inf

    \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\color{blue}{\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
  4. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    2. associate-*l*N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot dX.v\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \left({\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    7. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\left(\left\lfloorh\right\rfloor\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
    8. floor-lowering-floor.f3252.6%

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(h\right), dY.v\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right), \mathsf{*.f32}\left(\mathsf{floor.f32}\left(d\right), dY.w\right)\right)\right)\right)\right)\right) \]
  5. Simplified52.6%

    \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}, \left(\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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
  6. Taylor expanded in dY.u around inf

    \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \color{blue}{\left({dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)}\right)\right)\right) \]
  7. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(\left(dY.u \cdot dY.u\right) \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right) \]
    2. associate-*l*N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left(dY.u \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}\right)\right)\right)\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \left(dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\left({\left(\left\lfloorw\right\rfloor\right)}^{2}\right), dY.u\right)\right)\right)\right)\right) \]
    6. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
    7. floor-lowering-floor.f3233.3%

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{*.f32}\left(dX.v, \mathsf{pow.f32}\left(\mathsf{floor.f32}\left(h\right), 2\right)\right)\right), \mathsf{*.f32}\left(dY.u, \mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{floor.f32}\left(w\right), 2\right), dY.u\right)\right)\right)\right)\right) \]
  8. Simplified33.3%

    \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \color{blue}{dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)}\right)}\right) \]
  9. Step-by-step derivation
    1. sqrt-lowering-sqrt.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), dY.u \cdot \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right)\right)\right)\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot dY.u\right) \cdot dY.u\right)\right)\right)\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot \left(dY.u \cdot dY.u\right)\right)\right)\right)\right) \]
    4. unpow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)\right)\right) \]
    5. unpow-prod-downN/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\left(\mathsf{max}\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    6. fmax-lowering-fmax.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(dX.v \cdot \left(dX.v \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    7. associate-*r*N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left(\left(dX.v \cdot dX.v\right) \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    8. pow2N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    9. pow-prod-downN/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    10. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\left(dX.v \cdot \left\lfloorh\right\rfloor\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \left(\left\lfloorh\right\rfloor\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    12. floor-lowering-floor.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \left({\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)\right)\right) \]
    13. pow-lowering-pow.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right), 2\right)\right)\right)\right) \]
    14. *-lowering-*.f32N/A

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\left(\left\lfloorw\right\rfloor\right), dY.u\right), 2\right)\right)\right)\right) \]
    15. floor-lowering-floor.f3233.3%

      \[\leadsto \mathsf{log2.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{fmax.f32}\left(\mathsf{pow.f32}\left(\mathsf{*.f32}\left(dX.v, \mathsf{floor.f32}\left(h\right)\right), 2\right), \mathsf{pow.f32}\left(\mathsf{*.f32}\left(\mathsf{floor.f32}\left(w\right), dY.u\right), 2\right)\right)\right)\right) \]
  10. Applied egg-rr33.3%

    \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.v \cdot \left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)} \]
  11. Final simplification33.3%

    \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorh\right\rfloor \cdot dX.v\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024129 
(FPCore (w h d dX.u dX.v dX.w dY.u dY.v dY.w)
  :name "Isotropic LOD (LOD)"
  :precision binary32
  :pre (and (and (and (and (and (and (and (and (and (<= 1.0 w) (<= w 16384.0)) (and (<= 1.0 h) (<= h 16384.0))) (and (<= 1.0 d) (<= d 4096.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 dX.w)) (<= (fabs dX.w) 1e+20))) (and (<= 1e-20 (fabs dY.u)) (<= (fabs dY.u) 1e+20))) (and (<= 1e-20 (fabs dY.v)) (<= (fabs dY.v) 1e+20))) (and (<= 1e-20 (fabs dY.w)) (<= (fabs dY.w) 1e+20)))
  (log2 (sqrt (fmax (+ (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (* (* (floor d) dX.w) (* (floor d) dX.w))) (+ (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v))) (* (* (floor d) dY.w) (* (floor d) dY.w)))))))