Isotropic LOD (LOD)

Percentage Accurate: 67.3% → 70.8%
Time: 38.4s
Alternatives: 18
Speedup: 0.5×

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 18 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: 67.3% 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: 70.8% 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\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\\ \mathbf{if}\;\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) \leq 3.0000000054977558 \cdot 10^{+38}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\mathsf{fma}\left(t_5, t_5, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right) + dX.w \cdot \left(dX.w \cdot \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)\right), \mathsf{fma}\left(t_0, t_0, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dY.v\right)\right)\right) + \left\lfloord\right\rfloor \cdot \left(\left\lfloord\right\rfloor \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({t_4}^{2}, {t_3}^{2}\right)\right) \cdot 0.5}\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)))
   (if (<=
        (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)))
        3.0000000054977558e+38)
     (log2
      (sqrt
       (fmax
        (+
         (fma t_5 t_5 (* (floor h) (* (floor h) (* dX.v dX.v))))
         (* dX.w (* dX.w (* (floor d) (floor d)))))
        (+
         (fma t_0 t_0 (* (floor h) (* (floor h) (* dY.v dY.v))))
         (* (floor d) (* (floor d) (* dY.w dY.w)))))))
     (log2 (exp (* (log (fmax (pow t_4 2.0) (pow t_3 2.0))) 0.5))))))
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;
	float tmp;
	if (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))) <= 3.0000000054977558e+38f) {
		tmp = log2f(sqrtf(fmaxf((fmaf(t_5, t_5, (floorf(h) * (floorf(h) * (dX_46_v * dX_46_v)))) + (dX_46_w * (dX_46_w * (floorf(d) * floorf(d))))), (fmaf(t_0, t_0, (floorf(h) * (floorf(h) * (dY_46_v * dY_46_v)))) + (floorf(d) * (floorf(d) * (dY_46_w * dY_46_w)))))));
	} else {
		tmp = log2f(expf((logf(fmaxf(powf(t_4, 2.0f), powf(t_3, 2.0f))) * 0.5f)));
	}
	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(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)
	tmp = Float32(0.0)
	if (((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))))) <= Float32(3.0000000054977558e+38))
		tmp = log2(sqrt(((Float32(fma(t_5, t_5, Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v)))) + Float32(dX_46_w * Float32(dX_46_w * Float32(floor(d) * floor(d))))) != Float32(fma(t_5, t_5, Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v)))) + Float32(dX_46_w * Float32(dX_46_w * Float32(floor(d) * floor(d)))))) ? Float32(fma(t_0, t_0, Float32(floor(h) * Float32(floor(h) * Float32(dY_46_v * dY_46_v)))) + Float32(floor(d) * Float32(floor(d) * Float32(dY_46_w * dY_46_w)))) : ((Float32(fma(t_0, t_0, Float32(floor(h) * Float32(floor(h) * Float32(dY_46_v * dY_46_v)))) + Float32(floor(d) * Float32(floor(d) * Float32(dY_46_w * dY_46_w)))) != Float32(fma(t_0, t_0, Float32(floor(h) * Float32(floor(h) * Float32(dY_46_v * dY_46_v)))) + Float32(floor(d) * Float32(floor(d) * Float32(dY_46_w * dY_46_w))))) ? Float32(fma(t_5, t_5, Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v)))) + Float32(dX_46_w * Float32(dX_46_w * Float32(floor(d) * floor(d))))) : max(Float32(fma(t_5, t_5, Float32(floor(h) * Float32(floor(h) * Float32(dX_46_v * dX_46_v)))) + Float32(dX_46_w * Float32(dX_46_w * Float32(floor(d) * floor(d))))), Float32(fma(t_0, t_0, Float32(floor(h) * Float32(floor(h) * Float32(dY_46_v * dY_46_v)))) + Float32(floor(d) * Float32(floor(d) * Float32(dY_46_w * dY_46_w)))))))));
	else
		tmp = log2(exp(Float32(log((((t_4 ^ Float32(2.0)) != (t_4 ^ Float32(2.0))) ? (t_3 ^ Float32(2.0)) : (((t_3 ^ Float32(2.0)) != (t_3 ^ Float32(2.0))) ? (t_4 ^ Float32(2.0)) : max((t_4 ^ Float32(2.0)), (t_3 ^ Float32(2.0)))))) * Float32(0.5))));
	end
	return 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\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\\
\mathbf{if}\;\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) \leq 3.0000000054977558 \cdot 10^{+38}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\mathsf{fma}\left(t_5, t_5, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right) + dX.w \cdot \left(dX.w \cdot \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)\right), \mathsf{fma}\left(t_0, t_0, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dY.v\right)\right)\right) + \left\lfloord\right\rfloor \cdot \left(\left\lfloord\right\rfloor \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({t_4}^{2}, {t_3}^{2}\right)\right) \cdot 0.5}\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)))) < 3.00000001e38

    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. Simplified99.9%

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

    if 3.00000001e38 < (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 7.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. Applied egg-rr7.5%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 14.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative14.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow214.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow214.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr14.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow214.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified14.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.w around inf 18.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow218.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right)} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      2. unpow218.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr18.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot \left\lfloord\right\rfloor\right) \cdot \left(dX.w \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      4. unpow218.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    8. Simplified18.6%

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

    \[\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 3.0000000054977558 \cdot 10^{+38}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(\mathsf{fma}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dX.v \cdot dX.v\right)\right)\right) + dX.w \cdot \left(dX.w \cdot \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)\right), \mathsf{fma}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot \left(\left\lfloorh\right\rfloor \cdot \left(dY.v \cdot dY.v\right)\right)\right) + \left\lfloord\right\rfloor \cdot \left(\left\lfloord\right\rfloor \cdot \left(dY.w \cdot dY.w\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\ \end{array} \]

Alternative 2: 70.8% 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\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\\ \mathbf{if}\;\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) \leq 3.0000000054977558 \cdot 10^{+38}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t_4, \mathsf{hypot}\left(t_5, t_2\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(t_3, \mathsf{hypot}\left(t_0, t_1\right)\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({t_4}^{2}, {t_3}^{2}\right)\right) \cdot 0.5}\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)))
   (if (<=
        (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)))
        3.0000000054977558e+38)
     (log2
      (sqrt
       (fmax
        (pow (hypot t_4 (hypot t_5 t_2)) 2.0)
        (pow (hypot t_3 (hypot t_0 t_1)) 2.0))))
     (log2 (exp (* (log (fmax (pow t_4 2.0) (pow t_3 2.0))) 0.5))))))
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;
	float tmp;
	if (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))) <= 3.0000000054977558e+38f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf(t_4, hypotf(t_5, t_2)), 2.0f), powf(hypotf(t_3, hypotf(t_0, t_1)), 2.0f))));
	} else {
		tmp = log2f(expf((logf(fmaxf(powf(t_4, 2.0f), powf(t_3, 2.0f))) * 0.5f)));
	}
	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(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)
	tmp = Float32(0.0)
	if (((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))))) <= Float32(3.0000000054977558e+38))
		tmp = log2(sqrt((((hypot(t_4, hypot(t_5, t_2)) ^ Float32(2.0)) != (hypot(t_4, hypot(t_5, t_2)) ^ Float32(2.0))) ? (hypot(t_3, hypot(t_0, t_1)) ^ Float32(2.0)) : (((hypot(t_3, hypot(t_0, t_1)) ^ Float32(2.0)) != (hypot(t_3, hypot(t_0, t_1)) ^ Float32(2.0))) ? (hypot(t_4, hypot(t_5, t_2)) ^ Float32(2.0)) : max((hypot(t_4, hypot(t_5, t_2)) ^ Float32(2.0)), (hypot(t_3, hypot(t_0, t_1)) ^ Float32(2.0)))))));
	else
		tmp = log2(exp(Float32(log((((t_4 ^ Float32(2.0)) != (t_4 ^ Float32(2.0))) ? (t_3 ^ Float32(2.0)) : (((t_3 ^ Float32(2.0)) != (t_3 ^ Float32(2.0))) ? (t_4 ^ Float32(2.0)) : max((t_4 ^ Float32(2.0)), (t_3 ^ Float32(2.0)))))) * Float32(0.5))));
	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(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 = single(0.0);
	if (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))) <= single(3.0000000054977558e+38))
		tmp = log2(sqrt(max((hypot(t_4, hypot(t_5, t_2)) ^ single(2.0)), (hypot(t_3, hypot(t_0, t_1)) ^ single(2.0)))));
	else
		tmp = log2(exp((log(max((t_4 ^ single(2.0)), (t_3 ^ single(2.0)))) * single(0.5))));
	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\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\\
\mathbf{if}\;\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) \leq 3.0000000054977558 \cdot 10^{+38}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t_4, \mathsf{hypot}\left(t_5, t_2\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(t_3, \mathsf{hypot}\left(t_0, t_1\right)\right)\right)}^{2}\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({t_4}^{2}, {t_3}^{2}\right)\right) \cdot 0.5}\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)))) < 3.00000001e38

    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. Applied egg-rr98.9%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def99.0%

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

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

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

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

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

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

    if 3.00000001e38 < (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 7.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. Applied egg-rr7.5%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 14.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative14.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow214.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow214.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr14.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow214.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified14.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.w around inf 18.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow218.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right)} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      2. unpow218.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr18.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot \left\lfloord\right\rfloor\right) \cdot \left(dX.w \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      4. unpow218.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    8. Simplified18.6%

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

    \[\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 3.0000000054977558 \cdot 10^{+38}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\ \end{array} \]

Alternative 3: 62.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloord\right\rfloor \cdot dY.w\\ t_1 := \left\lfloorw\right\rfloor \cdot dY.u\\ t_2 := \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\\ \mathbf{if}\;dY.v \leq 2000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, t_2\right)\right)}^{2}, {t_0}^{2} + {t_1}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({t_2}^{2}, {\left(\mathsf{hypot}\left(t_0, \mathsf{hypot}\left(t_1, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\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
 (let* ((t_0 (* (floor d) dY.w))
        (t_1 (* (floor w) dY.u))
        (t_2 (hypot (* (floor w) dX.u) (* (floor h) dX.v))))
   (if (<= dY.v 2000000.0)
     (log2
      (sqrt
       (fmax
        (pow (hypot (* (floor d) dX.w) t_2) 2.0)
        (+ (pow t_0 2.0) (pow t_1 2.0)))))
     (log2
      (sqrt
       (fmax
        (pow t_2 2.0)
        (pow (hypot t_0 (hypot t_1 (* (floor h) dY.v))) 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(d) * dY_46_w;
	float t_1 = floorf(w) * dY_46_u;
	float t_2 = hypotf((floorf(w) * dX_46_u), (floorf(h) * dX_46_v));
	float tmp;
	if (dY_46_v <= 2000000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(d) * dX_46_w), t_2), 2.0f), (powf(t_0, 2.0f) + powf(t_1, 2.0f)))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(t_2, 2.0f), powf(hypotf(t_0, hypotf(t_1, (floorf(h) * dY_46_v))), 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(d) * dY_46_w)
	t_1 = Float32(floor(w) * dY_46_u)
	t_2 = hypot(Float32(floor(w) * dX_46_u), Float32(floor(h) * dX_46_v))
	tmp = Float32(0.0)
	if (dY_46_v <= Float32(2000000.0))
		tmp = log2(sqrt((((hypot(Float32(floor(d) * dX_46_w), t_2) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dX_46_w), t_2) ^ Float32(2.0))) ? Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) : ((Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) != Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0)))) ? (hypot(Float32(floor(d) * dX_46_w), t_2) ^ Float32(2.0)) : max((hypot(Float32(floor(d) * dX_46_w), t_2) ^ Float32(2.0)), Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))))))));
	else
		tmp = log2(sqrt((((t_2 ^ Float32(2.0)) != (t_2 ^ Float32(2.0))) ? (hypot(t_0, hypot(t_1, Float32(floor(h) * dY_46_v))) ^ Float32(2.0)) : (((hypot(t_0, hypot(t_1, Float32(floor(h) * dY_46_v))) ^ Float32(2.0)) != (hypot(t_0, hypot(t_1, Float32(floor(h) * dY_46_v))) ^ Float32(2.0))) ? (t_2 ^ Float32(2.0)) : max((t_2 ^ Float32(2.0)), (hypot(t_0, hypot(t_1, Float32(floor(h) * dY_46_v))) ^ 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(d) * dY_46_w;
	t_1 = floor(w) * dY_46_u;
	t_2 = hypot((floor(w) * dX_46_u), (floor(h) * dX_46_v));
	tmp = single(0.0);
	if (dY_46_v <= single(2000000.0))
		tmp = log2(sqrt(max((hypot((floor(d) * dX_46_w), t_2) ^ single(2.0)), ((t_0 ^ single(2.0)) + (t_1 ^ single(2.0))))));
	else
		tmp = log2(sqrt(max((t_2 ^ single(2.0)), (hypot(t_0, hypot(t_1, (floor(h) * dY_46_v))) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({t_2}^{2}, {\left(\mathsf{hypot}\left(t_0, \mathsf{hypot}\left(t_1, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\\


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

    1. Initial program 70.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. Applied egg-rr70.0%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def70.0%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p70.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative70.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e6 < dY.v

    1. Initial program 55.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. Applied egg-rr54.9%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def54.9%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p55.5%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative55.5%

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

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

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

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

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\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)}^{1}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
      2. sqr-pow36.9%

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

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

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

Alternative 4: 62.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\\ t_1 := \left\lfloord\right\rfloor \cdot dY.w\\ \mathbf{if}\;dX.w \leq 400000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({t_0}^{2}, {\left(\mathsf{hypot}\left(t_1, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, t_0\right)\right)}^{2}, {t_1}^{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 (hypot (* (floor w) dX.u) (* (floor h) dX.v)))
        (t_1 (* (floor d) dY.w)))
   (if (<= dX.w 400000.0)
     (log2
      (sqrt
       (fmax
        (pow t_0 2.0)
        (pow (hypot t_1 (hypot (* (floor w) dY.u) (* (floor h) dY.v))) 2.0))))
     (log2
      (sqrt (fmax (pow (hypot (* (floor d) dX.w) t_0) 2.0) (pow t_1 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 = hypotf((floorf(w) * dX_46_u), (floorf(h) * dX_46_v));
	float t_1 = floorf(d) * dY_46_w;
	float tmp;
	if (dX_46_w <= 400000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(t_0, 2.0f), powf(hypotf(t_1, hypotf((floorf(w) * dY_46_u), (floorf(h) * dY_46_v))), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(d) * dX_46_w), t_0), 2.0f), powf(t_1, 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 = hypot(Float32(floor(w) * dX_46_u), Float32(floor(h) * dX_46_v))
	t_1 = Float32(floor(d) * dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(400000.0))
		tmp = log2(sqrt((((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? (hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)) : (((hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)) != (hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0))) ? (t_0 ^ Float32(2.0)) : max((t_0 ^ Float32(2.0)), (hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0))) ? (t_1 ^ Float32(2.0)) : (((t_1 ^ Float32(2.0)) != (t_1 ^ Float32(2.0))) ? (hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)) : max((hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)), (t_1 ^ 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 = hypot((floor(w) * dX_46_u), (floor(h) * dX_46_v));
	t_1 = floor(d) * dY_46_w;
	tmp = single(0.0);
	if (dX_46_w <= single(400000.0))
		tmp = log2(sqrt(max((t_0 ^ single(2.0)), (hypot(t_1, hypot((floor(w) * dY_46_u), (floor(h) * dY_46_v))) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((hypot((floor(d) * dX_46_w), t_0) ^ single(2.0)), (t_1 ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, t_0\right)\right)}^{2}, {t_1}^{2}\right)}\right)\\


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

    1. Initial program 69.0%

      \[\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. Applied egg-rr68.4%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.4%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p69.0%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative69.0%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative69.0%

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

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

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\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)}^{1}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
      2. sqr-pow48.4%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\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)}^{\left(\frac{1}{2}\right)} \cdot {\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}^{\left(\frac{1}{2}\right)}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
    7. Simplified61.5%

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

    if 4e5 < dX.w

    1. Initial program 62.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. Applied egg-rr62.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def62.1%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p62.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative62.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative62.6%

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative57.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow257.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow257.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr57.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow257.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    7. Simplified57.9%

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

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

Alternative 5: 62.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorh\right\rfloor \cdot dX.v\\ t_1 := {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\\ \mathbf{if}\;dX.w \leq 20000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, t_0\right)\right)}^{2}, t_1\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, t_0\right)\right)}^{2}, 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 (* (floor h) dX.v))
        (t_1
         (pow
          (hypot
           (* (floor d) dY.w)
           (hypot (* (floor w) dY.u) (* (floor h) dY.v)))
          2.0)))
   (if (<= dX.w 20000.0)
     (log2 (sqrt (fmax (pow (hypot (* (floor w) dX.u) t_0) 2.0) t_1)))
     (log2 (sqrt (fmax (pow (hypot (* (floor d) dX.w) t_0) 2.0) 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 = floorf(h) * dX_46_v;
	float t_1 = powf(hypotf((floorf(d) * dY_46_w), hypotf((floorf(w) * dY_46_u), (floorf(h) * dY_46_v))), 2.0f);
	float tmp;
	if (dX_46_w <= 20000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(w) * dX_46_u), t_0), 2.0f), t_1)));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(d) * dX_46_w), t_0), 2.0f), 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 = Float32(floor(h) * dX_46_v)
	t_1 = hypot(Float32(floor(d) * dY_46_w), hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(20000.0))
		tmp = log2(sqrt((((hypot(Float32(floor(w) * dX_46_u), t_0) ^ Float32(2.0)) != (hypot(Float32(floor(w) * dX_46_u), t_0) ^ Float32(2.0))) ? t_1 : ((t_1 != t_1) ? (hypot(Float32(floor(w) * dX_46_u), t_0) ^ Float32(2.0)) : max((hypot(Float32(floor(w) * dX_46_u), t_0) ^ Float32(2.0)), t_1)))));
	else
		tmp = log2(sqrt((((hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0))) ? t_1 : ((t_1 != t_1) ? (hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)) : max((hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)), 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) * dX_46_v;
	t_1 = hypot((floor(d) * dY_46_w), hypot((floor(w) * dY_46_u), (floor(h) * dY_46_v))) ^ single(2.0);
	tmp = single(0.0);
	if (dX_46_w <= single(20000.0))
		tmp = log2(sqrt(max((hypot((floor(w) * dX_46_u), t_0) ^ single(2.0)), t_1)));
	else
		tmp = log2(sqrt(max((hypot((floor(d) * dX_46_w), t_0) ^ single(2.0)), t_1)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, t_0\right)\right)}^{2}, t_1\right)}\right)\\


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

    1. Initial program 68.7%

      \[\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. Applied egg-rr68.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.1%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p68.7%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative68.7%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative68.7%

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

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

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\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)}^{1}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
      2. sqr-pow48.2%

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

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

    if 2e4 < dX.w

    1. Initial program 64.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. Applied egg-rr64.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def64.1%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p64.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative64.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative64.6%

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

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

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

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

Alternative 6: 54.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\ \mathbf{if}\;dX.w \leq 400000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, t_0\right)\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)}^{2}, {t_0}^{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 h) dY.v)))
   (if (<= dX.w 400000.0)
     (log2
      (sqrt
       (fmax
        (pow (* (floor w) dX.u) 2.0)
        (pow (hypot (* (floor d) dY.w) (hypot (* (floor w) dY.u) t_0)) 2.0))))
     (log2
      (sqrt
       (fmax
        (pow (hypot (* (floor d) dX.w) (* (floor h) dX.v)) 2.0)
        (pow t_0 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(h) * dY_46_v;
	float tmp;
	if (dX_46_w <= 400000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(w) * dX_46_u), 2.0f), powf(hypotf((floorf(d) * dY_46_w), hypotf((floorf(w) * dY_46_u), t_0)), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(d) * dX_46_w), (floorf(h) * dX_46_v)), 2.0f), powf(t_0, 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(h) * dY_46_v)
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(400000.0))
		tmp = log2(sqrt((((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dX_46_u) ^ Float32(2.0))) ? (hypot(Float32(floor(d) * dY_46_w), hypot(Float32(floor(w) * dY_46_u), t_0)) ^ Float32(2.0)) : (((hypot(Float32(floor(d) * dY_46_w), hypot(Float32(floor(w) * dY_46_u), t_0)) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dY_46_w), hypot(Float32(floor(w) * dY_46_u), t_0)) ^ Float32(2.0))) ? (Float32(floor(w) * dX_46_u) ^ Float32(2.0)) : max((Float32(floor(w) * dX_46_u) ^ Float32(2.0)), (hypot(Float32(floor(d) * dY_46_w), hypot(Float32(floor(w) * dY_46_u), t_0)) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((hypot(Float32(floor(d) * dX_46_w), Float32(floor(h) * dX_46_v)) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dX_46_w), Float32(floor(h) * dX_46_v)) ^ Float32(2.0))) ? (t_0 ^ Float32(2.0)) : (((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? (hypot(Float32(floor(d) * dX_46_w), Float32(floor(h) * dX_46_v)) ^ Float32(2.0)) : max((hypot(Float32(floor(d) * dX_46_w), Float32(floor(h) * dX_46_v)) ^ Float32(2.0)), (t_0 ^ 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(h) * dY_46_v;
	tmp = single(0.0);
	if (dX_46_w <= single(400000.0))
		tmp = log2(sqrt(max(((floor(w) * dX_46_u) ^ single(2.0)), (hypot((floor(d) * dY_46_w), hypot((floor(w) * dY_46_u), t_0)) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((hypot((floor(d) * dX_46_w), (floor(h) * dX_46_v)) ^ single(2.0)), (t_0 ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

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


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

    1. Initial program 69.0%

      \[\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. Applied egg-rr68.4%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.4%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p69.0%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative69.0%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative69.0%

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

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

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

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow255.1%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr55.1%

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

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

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

    if 4e5 < dX.w

    1. Initial program 62.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. Applied egg-rr62.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def62.1%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p62.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative62.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative62.6%

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

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

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

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

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

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

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

Alternative 7: 55.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorw\right\rfloor \cdot dX.u\\ t_1 := \left\lfloord\right\rfloor \cdot dY.w\\ \mathbf{if}\;dX.w \leq 0.00044999999227002263:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({t_0}^{2}, {\left(\mathsf{hypot}\left(t_1, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(t_0, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {t_1}^{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) dX.u)) (t_1 (* (floor d) dY.w)))
   (if (<= dX.w 0.00044999999227002263)
     (log2
      (sqrt
       (fmax
        (pow t_0 2.0)
        (pow (hypot t_1 (hypot (* (floor w) dY.u) (* (floor h) dY.v))) 2.0))))
     (log2
      (sqrt
       (fmax
        (pow (hypot (* (floor d) dX.w) (hypot t_0 (* (floor h) dX.v))) 2.0)
        (pow t_1 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) * dX_46_u;
	float t_1 = floorf(d) * dY_46_w;
	float tmp;
	if (dX_46_w <= 0.00044999999227002263f) {
		tmp = log2f(sqrtf(fmaxf(powf(t_0, 2.0f), powf(hypotf(t_1, hypotf((floorf(w) * dY_46_u), (floorf(h) * dY_46_v))), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(d) * dX_46_w), hypotf(t_0, (floorf(h) * dX_46_v))), 2.0f), powf(t_1, 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) * dX_46_u)
	t_1 = Float32(floor(d) * dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(0.00044999999227002263))
		tmp = log2(sqrt((((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? (hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)) : (((hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)) != (hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0))) ? (t_0 ^ Float32(2.0)) : max((t_0 ^ Float32(2.0)), (hypot(t_1, hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v))) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((hypot(Float32(floor(d) * dX_46_w), hypot(t_0, Float32(floor(h) * dX_46_v))) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dX_46_w), hypot(t_0, Float32(floor(h) * dX_46_v))) ^ Float32(2.0))) ? (t_1 ^ Float32(2.0)) : (((t_1 ^ Float32(2.0)) != (t_1 ^ Float32(2.0))) ? (hypot(Float32(floor(d) * dX_46_w), hypot(t_0, Float32(floor(h) * dX_46_v))) ^ Float32(2.0)) : max((hypot(Float32(floor(d) * dX_46_w), hypot(t_0, Float32(floor(h) * dX_46_v))) ^ Float32(2.0)), (t_1 ^ 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) * dX_46_u;
	t_1 = floor(d) * dY_46_w;
	tmp = single(0.0);
	if (dX_46_w <= single(0.00044999999227002263))
		tmp = log2(sqrt(max((t_0 ^ single(2.0)), (hypot(t_1, hypot((floor(w) * dY_46_u), (floor(h) * dY_46_v))) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((hypot((floor(d) * dX_46_w), hypot(t_0, (floor(h) * dX_46_v))) ^ single(2.0)), (t_1 ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(t_0, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {t_1}^{2}\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if dX.w < 4.49999992e-4

    1. Initial program 68.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. Applied egg-rr67.9%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.0%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p68.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative68.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative68.6%

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

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

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

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow255.2%

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

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

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

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

    if 4.49999992e-4 < dX.w

    1. Initial program 67.0%

      \[\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. Applied egg-rr66.3%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def66.3%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p67.0%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative67.0%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative67.0%

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative59.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow259.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow259.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr59.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow259.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    7. Simplified59.8%

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

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

Alternative 8: 47.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloord\right\rfloor \cdot dX.w\\ t_1 := \left\lfloorw\right\rfloor \cdot dX.u\\ \mathbf{if}\;dY.w \leq 200:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t_0, t_1\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{0.5 \cdot \log \left(\mathsf{max}\left({t_0}^{2} + {t_1}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\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
 (let* ((t_0 (* (floor d) dX.w)) (t_1 (* (floor w) dX.u)))
   (if (<= dY.w 200.0)
     (log2
      (sqrt (fmax (pow (hypot t_0 t_1) 2.0) (pow (* (floor w) dY.u) 2.0))))
     (log2
      (exp
       (*
        0.5
        (log
         (fmax
          (+ (pow t_0 2.0) (pow t_1 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) {
	float t_0 = floorf(d) * dX_46_w;
	float t_1 = floorf(w) * dX_46_u;
	float tmp;
	if (dY_46_w <= 200.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf(t_0, t_1), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(expf((0.5f * logf(fmaxf((powf(t_0, 2.0f) + powf(t_1, 2.0f)), powf((floorf(d) * dY_46_w), 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(d) * dX_46_w)
	t_1 = Float32(floor(w) * dX_46_u)
	tmp = Float32(0.0)
	if (dY_46_w <= Float32(200.0))
		tmp = log2(sqrt((((hypot(t_0, t_1) ^ Float32(2.0)) != (hypot(t_0, t_1) ^ 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))) ? (hypot(t_0, t_1) ^ Float32(2.0)) : max((hypot(t_0, t_1) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(exp(Float32(Float32(0.5) * log(((Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) != Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0)))) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) ? Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))) : max(Float32((t_0 ^ Float32(2.0)) + (t_1 ^ Float32(2.0))), (Float32(floor(d) * dY_46_w) ^ 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(d) * dX_46_w;
	t_1 = floor(w) * dX_46_u;
	tmp = single(0.0);
	if (dY_46_w <= single(200.0))
		tmp = log2(sqrt(max((hypot(t_0, t_1) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(exp((single(0.5) * log(max(((t_0 ^ single(2.0)) + (t_1 ^ single(2.0))), ((floor(d) * dY_46_w) ^ single(2.0)))))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{0.5 \cdot \log \left(\mathsf{max}\left({t_0}^{2} + {t_1}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\


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

    1. Initial program 69.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. Applied egg-rr68.4%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.4%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p69.1%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative69.1%

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative58.6%

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

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

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

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

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

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

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

    if 200 < dY.w

    1. Initial program 65.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. Applied egg-rr64.7%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 58.7%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative58.7%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow258.7%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow258.7%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr58.7%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow258.7%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified58.7%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.v around 0 53.2%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow253.2%

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

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr53.2%

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

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

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

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2} + \left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      7. swap-sqr53.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.w \leq 200:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{0.5 \cdot \log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2} + {\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right)}\right)\\ \end{array} \]

Alternative 9: 47.4% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloorw\right\rfloor \cdot dX.u\\ \mathbf{if}\;dY.w \leq 24999999488:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, t_0\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({t_0}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2} + {\left(\left\lfloorh\right\rfloor \cdot dY.v\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
 (let* ((t_0 (* (floor w) dX.u)))
   (if (<= dY.w 24999999488.0)
     (log2
      (sqrt
       (fmax
        (pow (hypot (* (floor d) dX.w) t_0) 2.0)
        (pow (* (floor w) dY.u) 2.0))))
     (log2
      (sqrt
       (fmax
        (pow t_0 2.0)
        (+ (pow (* (floor d) dY.w) 2.0) (pow (* (floor h) dY.v) 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) * dX_46_u;
	float tmp;
	if (dY_46_w <= 24999999488.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(d) * dX_46_w), t_0), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(t_0, 2.0f), (powf((floorf(d) * dY_46_w), 2.0f) + powf((floorf(h) * dY_46_v), 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) * dX_46_u)
	tmp = Float32(0.0)
	if (dY_46_w <= Float32(24999999488.0))
		tmp = log2(sqrt((((hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)) != (hypot(Float32(floor(d) * dX_46_w), t_0) ^ 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))) ? (hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)) : max((hypot(Float32(floor(d) * dX_46_w), t_0) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? Float32((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) : ((Float32((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0))) != Float32((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))) ? (t_0 ^ Float32(2.0)) : max((t_0 ^ Float32(2.0)), Float32((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) + (Float32(floor(h) * dY_46_v) ^ 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) * dX_46_u;
	tmp = single(0.0);
	if (dY_46_w <= single(24999999488.0))
		tmp = log2(sqrt(max((hypot((floor(d) * dX_46_w), t_0) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((t_0 ^ single(2.0)), (((floor(d) * dY_46_w) ^ single(2.0)) + ((floor(h) * dY_46_v) ^ single(2.0))))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

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


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

    1. Initial program 71.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. Applied egg-rr70.8%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def70.8%

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

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

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative60.7%

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

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

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

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

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

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

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

    if 24999999500 < dY.w

    1. Initial program 48.0%

      \[\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. Applied egg-rr47.7%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def47.7%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p48.0%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative48.0%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative48.0%

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow247.7%

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow247.7%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr47.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, \mathsf{fma}\left({dY.v}^{2}, {\left(\left\lfloorh\right\rfloor\right)}^{2}, {\left(dY.w \cdot \left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    12. Step-by-step derivation
      1. *-commutative50.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 46.7% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloord\right\rfloor \cdot dY.w\\ \mathbf{if}\;dX.w \leq 120000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, t_0\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {t_0}^{2}\right)\right) \cdot 0.5}\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 d) dY.w)))
   (if (<= dX.w 120000.0)
     (log2
      (sqrt
       (fmax
        (pow (* (floor w) dX.u) 2.0)
        (pow (hypot (* (floor w) dY.u) t_0) 2.0))))
     (log2
      (exp (* (log (fmax (pow (* (floor d) dX.w) 2.0) (pow t_0 2.0))) 0.5))))))
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(d) * dY_46_w;
	float tmp;
	if (dX_46_w <= 120000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(w) * dX_46_u), 2.0f), powf(hypotf((floorf(w) * dY_46_u), t_0), 2.0f))));
	} else {
		tmp = log2f(expf((logf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), powf(t_0, 2.0f))) * 0.5f)));
	}
	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) * dY_46_w)
	tmp = Float32(0.0)
	if (dX_46_w <= Float32(120000.0))
		tmp = log2(sqrt((((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dX_46_u) ^ Float32(2.0))) ? (hypot(Float32(floor(w) * dY_46_u), t_0) ^ Float32(2.0)) : (((hypot(Float32(floor(w) * dY_46_u), t_0) ^ Float32(2.0)) != (hypot(Float32(floor(w) * dY_46_u), t_0) ^ Float32(2.0))) ? (Float32(floor(w) * dX_46_u) ^ Float32(2.0)) : max((Float32(floor(w) * dX_46_u) ^ Float32(2.0)), (hypot(Float32(floor(w) * dY_46_u), t_0) ^ Float32(2.0)))))));
	else
		tmp = log2(exp(Float32(log((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? (t_0 ^ Float32(2.0)) : (((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? (Float32(floor(d) * dX_46_w) ^ Float32(2.0)) : max((Float32(floor(d) * dX_46_w) ^ Float32(2.0)), (t_0 ^ Float32(2.0)))))) * Float32(0.5))));
	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) * dY_46_w;
	tmp = single(0.0);
	if (dX_46_w <= single(120000.0))
		tmp = log2(sqrt(max(((floor(w) * dX_46_u) ^ single(2.0)), (hypot((floor(w) * dY_46_u), t_0) ^ single(2.0)))));
	else
		tmp = log2(exp((log(max(((floor(d) * dX_46_w) ^ single(2.0)), (t_0 ^ single(2.0)))) * single(0.5))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {t_0}^{2}\right)\right) \cdot 0.5}\right)\\


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

    1. Initial program 69.0%

      \[\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. Applied egg-rr68.4%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.4%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p69.0%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative69.0%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative69.0%

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

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

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

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow255.1%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr55.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\color{blue}{\left(\mathsf{hypot}\left(dY.u \cdot \left\lfloorw\right\rfloor, dY.w \cdot \left\lfloord\right\rfloor\right)\right)}}^{2}\right)}\right) \]
      10. *-commutative47.9%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\left(\mathsf{hypot}\left(\color{blue}{\left\lfloorw\right\rfloor \cdot dY.u}, dY.w \cdot \left\lfloord\right\rfloor\right)\right)}^{2}\right)}\right) \]
      11. *-commutative47.9%

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

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

    if 1.2e5 < dX.w

    1. Initial program 62.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. Applied egg-rr62.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 57.4%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative57.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow257.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow257.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr57.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow257.4%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified57.4%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.w around inf 51.2%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow251.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right)} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      2. unpow251.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr51.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot \left\lfloord\right\rfloor\right) \cdot \left(dX.w \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      4. unpow251.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    8. Simplified51.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.w \leq 120000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloord\right\rfloor \cdot dY.w\right)\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\ \end{array} \]

Alternative 11: 47.7% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.w \leq 50000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\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.w 50000.0)
   (log2
    (sqrt
     (fmax
      (pow (hypot (* (floor w) dX.u) (* (floor h) dX.v)) 2.0)
      (pow (* (floor w) dY.u) 2.0))))
   (log2
    (exp
     (*
      (log (fmax (pow (* (floor d) dX.w) 2.0) (pow (* (floor d) dY.w) 2.0)))
      0.5)))))
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_w <= 50000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf((floorf(w) * dX_46_u), (floorf(h) * dX_46_v)), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(expf((logf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), powf((floorf(d) * dY_46_w), 2.0f))) * 0.5f)));
	}
	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_w <= Float32(50000.0))
		tmp = log2(sqrt((((hypot(Float32(floor(w) * dX_46_u), Float32(floor(h) * dX_46_v)) ^ Float32(2.0)) != (hypot(Float32(floor(w) * dX_46_u), 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))) ? (hypot(Float32(floor(w) * dX_46_u), Float32(floor(h) * dX_46_v)) ^ Float32(2.0)) : max((hypot(Float32(floor(w) * dX_46_u), Float32(floor(h) * dX_46_v)) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(exp(Float32(log((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ 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(floor(d) * dY_46_w) ^ Float32(2.0)))))) * Float32(0.5))));
	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_w <= single(50000.0))
		tmp = log2(sqrt(max((hypot((floor(w) * dX_46_u), (floor(h) * dX_46_v)) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(exp((log(max(((floor(d) * dX_46_w) ^ single(2.0)), ((floor(d) * dY_46_w) ^ single(2.0)))) * single(0.5))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\


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

    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. Applied egg-rr68.2%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.3%

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

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

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative57.1%

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

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

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow148.5%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\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)}^{1}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
      2. sqr-pow48.5%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\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)}^{\left(\frac{1}{2}\right)} \cdot {\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}^{\left(\frac{1}{2}\right)}}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right) \]
    10. Simplified48.5%

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

    if 5e4 < dX.w

    1. Initial program 63.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. Applied egg-rr63.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 58.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative58.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow258.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow258.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr58.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow258.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified58.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.w around inf 52.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow252.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right)} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      2. unpow252.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr52.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot \left\lfloord\right\rfloor\right) \cdot \left(dX.w \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      4. unpow252.6%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    8. Simplified52.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.w \leq 50000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\ \end{array} \]

Alternative 12: 47.2% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloord\right\rfloor \cdot dX.w\\ \mathbf{if}\;dY.w \leq 65000001536:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t_0, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({t_0}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\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 d) dX.w)))
   (if (<= dY.w 65000001536.0)
     (log2
      (sqrt
       (fmax
        (pow (hypot t_0 (* (floor w) dX.u)) 2.0)
        (pow (* (floor w) dY.u) 2.0))))
     (log2
      (exp (* (log (fmax (pow t_0 2.0) (pow (* (floor d) dY.w) 2.0))) 0.5))))))
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(d) * dX_46_w;
	float tmp;
	if (dY_46_w <= 65000001536.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf(t_0, (floorf(w) * dX_46_u)), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(expf((logf(fmaxf(powf(t_0, 2.0f), powf((floorf(d) * dY_46_w), 2.0f))) * 0.5f)));
	}
	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)
	tmp = Float32(0.0)
	if (dY_46_w <= Float32(65000001536.0))
		tmp = log2(sqrt((((hypot(t_0, Float32(floor(w) * dX_46_u)) ^ Float32(2.0)) != (hypot(t_0, Float32(floor(w) * dX_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(w) * dY_46_u) ^ Float32(2.0))) ? (hypot(t_0, Float32(floor(w) * dX_46_u)) ^ Float32(2.0)) : max((hypot(t_0, Float32(floor(w) * dX_46_u)) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(exp(Float32(log((((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) ? (t_0 ^ Float32(2.0)) : max((t_0 ^ Float32(2.0)), (Float32(floor(d) * dY_46_w) ^ Float32(2.0)))))) * Float32(0.5))));
	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;
	tmp = single(0.0);
	if (dY_46_w <= single(65000001536.0))
		tmp = log2(sqrt(max((hypot(t_0, (floor(w) * dX_46_u)) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(exp((log(max((t_0 ^ single(2.0)), ((floor(d) * dY_46_w) ^ single(2.0)))) * single(0.5))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({t_0}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\


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

    1. Initial program 71.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. Applied egg-rr71.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def71.2%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p71.8%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative71.8%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative71.8%

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative60.7%

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

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

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

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

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

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

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

    if 65000001500 < dY.w

    1. Initial program 43.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. Applied egg-rr43.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 42.2%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative42.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow242.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow242.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr42.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow242.2%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified42.2%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.w around inf 42.8%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow242.8%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right)} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      2. unpow242.8%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr42.8%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot \left\lfloord\right\rfloor\right) \cdot \left(dX.w \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      4. unpow242.8%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    8. Simplified42.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.w \leq 65000001536:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\ \end{array} \]

Alternative 13: 48.2% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left\lfloord\right\rfloor \cdot dX.w\\ \mathbf{if}\;dX.v \leq 120000000:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t_0, \left\lfloorw\right\rfloor \cdot dX.u\right)\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t_0, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)}^{2}, {\left(\left\lfloorh\right\rfloor \cdot dY.v\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
 (let* ((t_0 (* (floor d) dX.w)))
   (if (<= dX.v 120000000.0)
     (log2
      (sqrt
       (fmax
        (pow (hypot t_0 (* (floor w) dX.u)) 2.0)
        (pow (* (floor w) dY.u) 2.0))))
     (log2
      (sqrt
       (fmax
        (pow (hypot t_0 (* (floor h) dX.v)) 2.0)
        (pow (* (floor h) dY.v) 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(d) * dX_46_w;
	float tmp;
	if (dX_46_v <= 120000000.0f) {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf(t_0, (floorf(w) * dX_46_u)), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf(hypotf(t_0, (floorf(h) * dX_46_v)), 2.0f), powf((floorf(h) * dY_46_v), 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(d) * dX_46_w)
	tmp = Float32(0.0)
	if (dX_46_v <= Float32(120000000.0))
		tmp = log2(sqrt((((hypot(t_0, Float32(floor(w) * dX_46_u)) ^ Float32(2.0)) != (hypot(t_0, Float32(floor(w) * dX_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(w) * dY_46_u) ^ Float32(2.0))) ? (hypot(t_0, Float32(floor(w) * dX_46_u)) ^ Float32(2.0)) : max((hypot(t_0, Float32(floor(w) * dX_46_u)) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((hypot(t_0, Float32(floor(h) * dX_46_v)) ^ Float32(2.0)) != (hypot(t_0, Float32(floor(h) * dX_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(h) * dY_46_v) ^ Float32(2.0))) ? (hypot(t_0, Float32(floor(h) * dX_46_v)) ^ Float32(2.0)) : max((hypot(t_0, Float32(floor(h) * dX_46_v)) ^ Float32(2.0)), (Float32(floor(h) * dY_46_v) ^ 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(d) * dX_46_w;
	tmp = single(0.0);
	if (dX_46_v <= single(120000000.0))
		tmp = log2(sqrt(max((hypot(t_0, (floor(w) * dX_46_u)) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max((hypot(t_0, (floor(h) * dX_46_v)) ^ single(2.0)), ((floor(h) * dY_46_v) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

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


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

    1. Initial program 68.7%

      \[\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. Applied egg-rr68.1%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.2%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p68.7%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative68.7%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative68.7%

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative56.2%

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

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

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

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

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

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

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

    if 1.2e8 < dX.v

    1. Initial program 64.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. Applied egg-rr63.8%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def63.8%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p64.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative64.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative64.6%

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)}^{2}, {\color{blue}{\left(dY.v \cdot \left\lfloorh\right\rfloor\right)}}^{2}\right)}\right) \]
    7. Step-by-step derivation
      1. *-commutative37.5%

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

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

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

Alternative 14: 38.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.w \leq 0.029999999329447746:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\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.w 0.029999999329447746)
   (log2
    (sqrt (fmax (pow (* (floor w) dX.u) 2.0) (pow (* (floor w) dY.u) 2.0))))
   (log2
    (exp
     (*
      (log (fmax (pow (* (floor d) dX.w) 2.0) (pow (* (floor d) dY.w) 2.0)))
      0.5)))))
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_w <= 0.029999999329447746f) {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(w) * dX_46_u), 2.0f), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(expf((logf(fmaxf(powf((floorf(d) * dX_46_w), 2.0f), powf((floorf(d) * dY_46_w), 2.0f))) * 0.5f)));
	}
	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_w <= Float32(0.029999999329447746))
		tmp = log2(sqrt((((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dX_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(w) * dY_46_u) ^ Float32(2.0))) ? (Float32(floor(w) * dX_46_u) ^ Float32(2.0)) : max((Float32(floor(w) * dX_46_u) ^ Float32(2.0)), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(exp(Float32(log((((Float32(floor(d) * dX_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dX_46_w) ^ Float32(2.0))) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ 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(floor(d) * dY_46_w) ^ Float32(2.0)))))) * Float32(0.5))));
	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_w <= single(0.029999999329447746))
		tmp = log2(sqrt(max(((floor(w) * dX_46_u) ^ single(2.0)), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(exp((log(max(((floor(d) * dX_46_w) ^ single(2.0)), ((floor(d) * dY_46_w) ^ single(2.0)))) * single(0.5))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\


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

    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. Applied egg-rr68.2%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.3%

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

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

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow255.0%

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow255.0%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr55.0%

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\color{blue}{\left(dY.u \cdot \left\lfloorw\right\rfloor\right)}}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\color{blue}{\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}}^{2}\right)}\right) \]
    10. Simplified40.7%

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

    if 0.0299999993 < dX.w

    1. Initial program 65.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. Applied egg-rr65.3%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right) \cdot 0.5}\right)} \]
    3. Taylor expanded in dY.w around inf 57.3%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    4. Step-by-step derivation
      1. *-commutative57.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)\right) \cdot 0.5}\right) \]
      2. unpow257.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)\right) \cdot 0.5}\right) \]
      3. unpow257.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      4. swap-sqr57.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)\right) \cdot 0.5}\right) \]
      5. unpow257.3%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    5. Simplified57.3%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.w around inf 48.0%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Step-by-step derivation
      1. unpow248.0%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot dX.w\right)} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      2. unpow248.0%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\left(dX.w \cdot dX.w\right) \cdot \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      3. swap-sqr48.0%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{\left(dX.w \cdot \left\lfloord\right\rfloor\right) \cdot \left(dX.w \cdot \left\lfloord\right\rfloor\right)}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
      4. unpow248.0%

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right) \]
    8. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.w \leq 0.029999999329447746:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)\right) \cdot 0.5}\right)\\ \end{array} \]

Alternative 15: 38.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;dX.u \leq 0.0949999988079071:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dX.w}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\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 dY.w\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.u 0.0949999988079071)
   (log2
    (sqrt
     (fmax
      (* (pow (floor d) 2.0) (pow dX.w 2.0))
      (pow (* (floor w) dY.u) 2.0))))
   (log2
    (sqrt (fmax (pow (* (floor w) dX.u) 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) {
	float tmp;
	if (dX_46_u <= 0.0949999988079071f) {
		tmp = log2f(sqrtf(fmaxf((powf(floorf(d), 2.0f) * powf(dX_46_w, 2.0f)), powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(powf((floorf(w) * dX_46_u), 2.0f), powf((floorf(d) * dY_46_w), 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_u <= Float32(0.0949999988079071))
		tmp = log2(sqrt(((Float32((floor(d) ^ Float32(2.0)) * (dX_46_w ^ Float32(2.0))) != Float32((floor(d) ^ Float32(2.0)) * (dX_46_w ^ 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(d) ^ Float32(2.0)) * (dX_46_w ^ Float32(2.0))) : max(Float32((floor(d) ^ Float32(2.0)) * (dX_46_w ^ Float32(2.0))), (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt((((Float32(floor(w) * dX_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dX_46_u) ^ Float32(2.0))) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) ? (Float32(floor(w) * dX_46_u) ^ Float32(2.0)) : max((Float32(floor(w) * dX_46_u) ^ Float32(2.0)), (Float32(floor(d) * dY_46_w) ^ 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_u <= single(0.0949999988079071))
		tmp = log2(sqrt(max(((floor(d) ^ single(2.0)) * (dX_46_w ^ single(2.0))), ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max(((floor(w) * dX_46_u) ^ single(2.0)), ((floor(d) * dY_46_w) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;dX.u \leq 0.0949999988079071:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dX.w}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\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 dY.w\right)}^{2}\right)}\right)\\


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

    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. Applied egg-rr67.5%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def67.5%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p68.1%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative68.1%

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(dX.u \cdot \left\lfloorw\right\rfloor, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative57.1%

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

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

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

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

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

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

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

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

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

    if 0.0949999988 < dX.u

    1. Initial program 68.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. Applied egg-rr67.5%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def67.5%

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

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

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

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

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

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

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

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow261.6%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr61.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.u \leq 0.0949999988079071:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dX.w}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\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 dY.w\right)}^{2}\right)}\right)\\ \end{array} \]

Alternative 16: 38.9% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}\\ \mathbf{if}\;dY.w \leq 40:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t_0, {\left(\left\lfloorh\right\rfloor \cdot dY.v\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t_0, {\left(\left\lfloord\right\rfloor \cdot dY.w\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
 (let* ((t_0 (pow (* (floor w) dX.u) 2.0)))
   (if (<= dY.w 40.0)
     (log2 (sqrt (fmax t_0 (pow (* (floor h) dY.v) 2.0))))
     (log2 (sqrt (fmax t_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) {
	float t_0 = powf((floorf(w) * dX_46_u), 2.0f);
	float tmp;
	if (dY_46_w <= 40.0f) {
		tmp = log2f(sqrtf(fmaxf(t_0, powf((floorf(h) * dY_46_v), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(t_0, powf((floorf(d) * dY_46_w), 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) * dX_46_u) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dY_46_w <= Float32(40.0))
		tmp = log2(sqrt(((t_0 != 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))) ? t_0 : max(t_0, (Float32(floor(h) * dY_46_v) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt(((t_0 != t_0) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) ? t_0 : max(t_0, (Float32(floor(d) * dY_46_w) ^ 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) * dX_46_u) ^ single(2.0);
	tmp = single(0.0);
	if (dY_46_w <= single(40.0))
		tmp = log2(sqrt(max(t_0, ((floor(h) * dY_46_v) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max(t_0, ((floor(d) * dY_46_w) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t_0, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\


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

    1. Initial program 69.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. Applied egg-rr68.9%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.9%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p69.6%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative69.6%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative69.6%

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

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

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

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow253.1%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr53.1%

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\color{blue}{\left(dY.v \cdot \left\lfloorh\right\rfloor\right)}}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. *-commutative34.0%

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

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

    if 40 < dY.w

    1. Initial program 64.0%

      \[\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. Applied egg-rr63.4%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def63.4%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p64.0%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative64.0%

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative64.0%

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow253.7%

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow253.7%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr53.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.w \leq 40:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\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\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\ \end{array} \]

Alternative 17: 39.0% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}\\ \mathbf{if}\;dY.w \leq 200:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t_0, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t_0, {\left(\left\lfloord\right\rfloor \cdot dY.w\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
 (let* ((t_0 (pow (* (floor w) dX.u) 2.0)))
   (if (<= dY.w 200.0)
     (log2 (sqrt (fmax t_0 (pow (* (floor w) dY.u) 2.0))))
     (log2 (sqrt (fmax t_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) {
	float t_0 = powf((floorf(w) * dX_46_u), 2.0f);
	float tmp;
	if (dY_46_w <= 200.0f) {
		tmp = log2f(sqrtf(fmaxf(t_0, powf((floorf(w) * dY_46_u), 2.0f))));
	} else {
		tmp = log2f(sqrtf(fmaxf(t_0, powf((floorf(d) * dY_46_w), 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) * dX_46_u) ^ Float32(2.0)
	tmp = Float32(0.0)
	if (dY_46_w <= Float32(200.0))
		tmp = log2(sqrt(((t_0 != t_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))) ? t_0 : max(t_0, (Float32(floor(w) * dY_46_u) ^ Float32(2.0)))))));
	else
		tmp = log2(sqrt(((t_0 != t_0) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) ? t_0 : max(t_0, (Float32(floor(d) * dY_46_w) ^ 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) * dX_46_u) ^ single(2.0);
	tmp = single(0.0);
	if (dY_46_w <= single(200.0))
		tmp = log2(sqrt(max(t_0, ((floor(w) * dY_46_u) ^ single(2.0)))));
	else
		tmp = log2(sqrt(max(t_0, ((floor(d) * dY_46_w) ^ single(2.0)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left(t_0, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)\\


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

    1. Initial program 69.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. Applied egg-rr68.4%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def68.4%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p69.1%

        \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} \]
      3. *-commutative69.1%

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

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow253.0%

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow253.0%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr53.0%

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

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

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

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\color{blue}{\left(dY.u \cdot \left\lfloorw\right\rfloor\right)}}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. *-commutative38.8%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(dX.u \cdot \left\lfloorw\right\rfloor\right)}^{2}, {\color{blue}{\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}}^{2}\right)}\right) \]
    10. Simplified38.8%

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

    if 200 < dY.w

    1. Initial program 65.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. Applied egg-rr64.7%

      \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
    3. Step-by-step derivation
      1. expm1-def64.7%

        \[\leadsto \log_{2} \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)\right)\right)} \]
      2. expm1-log1p65.3%

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

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

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.w \cdot \left\lfloord\right\rfloor, \mathsf{hypot}\left(\color{blue}{dX.u \cdot \left\lfloorw\right\rfloor}, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      5. *-commutative65.3%

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

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

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

        \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      2. unpow254.1%

        \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\left(dX.u \cdot dX.u\right) \cdot \color{blue}{\left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
      3. swap-sqr54.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.w \leq 200:\\ \;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\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 dY.w\right)}^{2}\right)}\right)\\ \end{array} \]

Alternative 18: 35.3% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\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) 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) * 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(floor(w) * dX_46_u) ^ Float32(2.0)) != (Float32(floor(w) * dX_46_u) ^ Float32(2.0))) ? (Float32(floor(d) * dY_46_w) ^ Float32(2.0)) : (((Float32(floor(d) * dY_46_w) ^ Float32(2.0)) != (Float32(floor(d) * dY_46_w) ^ Float32(2.0))) ? (Float32(floor(w) * dX_46_u) ^ Float32(2.0)) : max((Float32(floor(w) * dX_46_u) ^ 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) * dY_46_w) ^ single(2.0)))));
end
\begin{array}{l}

\\
\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\left\lfloorw\right\rfloor \cdot dX.u\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right)
\end{array}
Derivation
  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. Applied egg-rr67.5%

    \[\leadsto \log_{2} \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dX.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dX.u, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)\right)}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right)} - 1\right)} \]
  3. Step-by-step derivation
    1. expm1-def67.5%

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

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

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

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

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

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

    \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
  6. Step-by-step derivation
    1. unpow253.3%

      \[\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}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)}\right) \]
    2. unpow253.3%

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

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

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

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

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

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

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

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

Reproduce

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