Isotropic LOD (LOD)

Percentage Accurate: 68.1% → 68.1%
Time: 34.6s
Alternatives: 15
Speedup: N/A×

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 15 alternatives:

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

Initial Program: 68.1% 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: 68.1% 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 \infty:\\ \;\;\;\;\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^{{\left(\sqrt[3]{\log \left(\mathsf{max}\left({t\_4}^{2}, {t\_0}^{2}\right)\right)}\right)}^{3} \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)))
        INFINITY)
     (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
       (* (pow (cbrt (log (fmax (pow t_4 2.0) (pow t_0 2.0)))) 3.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))) <= ((float) INFINITY)) {
		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((powf(cbrtf(logf(fmaxf(powf(t_4, 2.0f), powf(t_0, 2.0f)))), 3.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(Inf))
		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((cbrt(log((((t_4 ^ Float32(2.0)) != (t_4 ^ Float32(2.0))) ? (t_0 ^ Float32(2.0)) : (((t_0 ^ Float32(2.0)) != (t_0 ^ Float32(2.0))) ? (t_4 ^ Float32(2.0)) : max((t_4 ^ Float32(2.0)), (t_0 ^ Float32(2.0))))))) ^ Float32(3.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 \infty:\\
\;\;\;\;\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^{{\left(\sqrt[3]{\log \left(\mathsf{max}\left({t\_4}^{2}, {t\_0}^{2}\right)\right)}\right)}^{3} \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)))) < +inf.0

    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. Add Preprocessing
    3. Taylor expanded in w around 0 69.6%

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

    if +inf.0 < (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 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. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/269.6%

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

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

      \[\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)} \]
    5. Taylor expanded in dY.u around inf 56.8%

      \[\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.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Step-by-step derivation
      1. *-commutative56.8%

        \[\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}}\right)\right) \cdot 0.5}\right) \]
    7. Simplified56.8%

      \[\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}}\right)\right) \cdot 0.5}\right) \]
    8. Step-by-step derivation
      1. add-cube-cbrt56.1%

        \[\leadsto \log_{2} \left(e^{\color{blue}{\left(\left(\sqrt[3]{\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)} \cdot \sqrt[3]{\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}\right) \cdot \sqrt[3]{\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}\right)} \cdot 0.5}\right) \]
      2. pow356.1%

        \[\leadsto \log_{2} \left(e^{\color{blue}{{\left(\sqrt[3]{\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right)}\right)}^{3}} \cdot 0.5}\right) \]
    9. Applied egg-rr56.1%

      \[\leadsto \log_{2} \left(e^{\color{blue}{{\left(\sqrt[3]{\log \left(\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}\right)\right)}\right)}^{3}} \cdot 0.5}\right) \]
    10. Taylor expanded in dX.w around inf 38.5%

      \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\log \left(\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)}\right)}^{3} \cdot 0.5}\right) \]
    11. Step-by-step derivation
      1. unpow238.5%

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

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      3. swap-sqr38.4%

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      4. unpow238.4%

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

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

    \[\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 \infty:\\ \;\;\;\;\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^{{\left(\sqrt[3]{\log \left(\mathsf{max}\left({\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}, {\left(\left\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 56.6% accurate, 1.2× speedup?

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{0.5 \cdot \log \left(\mathsf{max}\left({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(t\_0, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right)}\right)\\


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

    1. Initial program 72.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 72.6%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified72.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 0 66.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative66.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}} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow266.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow266.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr66.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative66.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow266.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow266.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr66.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt66.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine66.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine66.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow266.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified66.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Step-by-step derivation
      1. add-exp-log66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{\log \left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)}\right) \]
      2. log-pow66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, e^{\color{blue}{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    9. Applied egg-rr66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    10. Taylor expanded in dY.u around inf 61.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) \]
    11. Step-by-step derivation
      1. *-commutative61.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. unpow261.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. unpow261.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-sqr61.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. unpow261.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) \]
    12. Simplified61.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) \]

    if 6e4 < dY.v

    1. Initial program 55.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/255.4%

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

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

      \[\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)} \]
    5. Taylor expanded in dX.u around inf 54.8%

      \[\leadsto \log_{2} \left(e^{\log \left(\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) \cdot 0.5}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.v \leq 60000:\\ \;\;\;\;\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\log_{2} \left(e^{0.5 \cdot \log \left(\mathsf{max}\left({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)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 62.8% accurate, 1.2× speedup?

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


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

    1. Initial program 69.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. Add Preprocessing
    3. Taylor expanded in w around 0 69.7%

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

      \[\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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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 200 < dX.v

    1. Initial program 69.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 69.4%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified69.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.w around 0 61.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative61.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}} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow261.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow261.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr61.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative61.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow261.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow261.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr61.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt61.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine61.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine61.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow261.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified61.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Step-by-step derivation
      1. add-exp-log61.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{\log \left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)}\right) \]
      2. log-pow61.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, e^{\color{blue}{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    9. Applied egg-rr61.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    10. Taylor expanded in dY.u around inf 58.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, 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) \]
    11. Step-by-step derivation
      1. *-commutative58.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, 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.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, 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.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, 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.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, 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.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, 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) \]
    12. Simplified58.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, 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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.v \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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 63.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \left\lfloord\right\rfloor \cdot dX.w\\
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.u \leq 2000:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t\_0, \left\lfloorh\right\rfloor \cdot dX.v\right)\right)}^{2}, t\_1\right)}\right)\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in w around 0 71.8%

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

      \[\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) \]

    if 2e3 < dX.u

    1. Initial program 57.9%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 57.9%

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

      \[\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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.u \leq 2000:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;\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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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} \]
  5. Add Preprocessing

Alternative 5: 63.3% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 71.3%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 71.3%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified71.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 dY.w around 0 68.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-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, 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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow268.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow268.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr68.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow268.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow268.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr68.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt68.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine68.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine68.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow268.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified68.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]

    if 2.5e8 < dY.w

    1. Initial program 61.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. Add Preprocessing
    3. Taylor expanded in w around 0 61.7%

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

      \[\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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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 simplification66.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.w \leq 250000000:\\ \;\;\;\;\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\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\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\lfloorw\right\rfloor \cdot dX.u\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} \]
  5. Add Preprocessing

Alternative 6: 56.6% accurate, 1.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(e^{0.5 \cdot \log \left(\mathsf{max}\left({t\_1}^{2}, {\left(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.w, \mathsf{hypot}\left(t\_0, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)\right)}^{2}\right)\right)}\right)\\


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

    1. Initial program 72.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 72.6%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified72.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 0 66.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative66.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}} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow266.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow266.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr66.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative66.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow266.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow266.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr66.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt66.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine66.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine66.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow266.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified66.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Step-by-step derivation
      1. add-exp-log66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{\log \left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)}\right) \]
      2. log-pow66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, e^{\color{blue}{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    9. Applied egg-rr66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    10. Taylor expanded in dY.u around inf 61.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) \]
    11. Step-by-step derivation
      1. *-commutative61.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. unpow261.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. unpow261.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-sqr61.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. unpow261.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) \]
    12. Simplified61.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) \]

    if 1e5 < dY.v

    1. Initial program 55.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/255.4%

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

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

      \[\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)} \]
    5. Taylor expanded in dX.w around inf 55.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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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) \]
    6. Step-by-step derivation
      1. *-commutative30.2%

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

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

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

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

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right) \cdot 0.5}\right) \]
      6. *-commutative30.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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right) \cdot 0.5}\right) \]
    7. Simplified55.6%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(dX.w \cdot \left\lfloord\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) \cdot 0.5}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;dY.v \leq 100000:\\ \;\;\;\;\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\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(\mathsf{hypot}\left(\left\lfloord\right\rfloor \cdot dY.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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 56.1% accurate, 1.4× speedup?

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

    1. Initial program 70.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/270.1%

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

        \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right) \cdot 0.5}\right)} \]
    4. Applied egg-rr69.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)} \]
    5. Taylor expanded in dX.v around inf 57.0%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{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) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.v around 0 57.3%

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

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

    if 3e8 < dX.w

    1. Initial program 67.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 67.1%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified67.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.w around inf 62.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, 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. *-commutative62.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow262.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow262.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, dX.v \cdot \left\lfloorh\right\rfloor\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) \]
      4. swap-sqr62.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, dX.v \cdot \left\lfloorh\right\rfloor\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) \]
      5. unpow262.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, 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) \]
    7. Simplified62.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, 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) \]
    8. 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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.2%

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

Alternative 8: 56.1% accurate, 1.4× speedup?

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

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


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

    1. Initial program 70.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 70.4%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified70.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.w around inf 56.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, 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. *-commutative56.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow256.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow256.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, dX.v \cdot \left\lfloorh\right\rfloor\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) \]
      4. swap-sqr56.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, dX.v \cdot \left\lfloorh\right\rfloor\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) \]
      5. unpow256.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, 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) \]
    7. Simplified56.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, 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) \]

    if 500 < dY.u

    1. Initial program 67.3%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/267.3%

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

        \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right) \cdot 0.5}\right)} \]
    4. Applied egg-rr66.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)} \]
    5. Taylor expanded in dX.v around inf 61.1%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{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) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.v around 0 61.5%

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

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

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

Alternative 9: 56.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \left\lfloorh\right\rfloor \cdot dY.v\\
t_1 := \left\lfloorh\right\rfloor \cdot dX.v\\
\mathbf{if}\;dY.u \leq 22:\\
\;\;\;\;\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, t\_1\right)\right)\right)}^{2}, {t\_0}^{2}\right)}\right)\\

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


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

    1. Initial program 69.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. Add Preprocessing
    3. Taylor expanded in w around 0 69.7%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified69.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.w around 0 64.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, 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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative64.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, 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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow264.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, 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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow264.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, 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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr64.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, 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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative64.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow264.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow264.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \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 \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr64.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt64.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine64.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine64.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow264.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified64.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Taylor expanded in dY.u around 0 57.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    9. Step-by-step derivation
      1. *-commutative57.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\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      2. unpow257.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\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      3. unpow257.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\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      4. swap-sqr57.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\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      5. unpow257.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\lfloorh\right\rfloor \cdot dY.v\right)}^{2}}\right)}\right) \]
    10. Simplified57.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\lfloorh\right\rfloor \cdot dY.v\right)}^{2}}\right)}\right) \]

    if 22 < dY.u

    1. Initial program 69.3%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/269.3%

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

        \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right) \cdot 0.5}\right)} \]
    4. Applied egg-rr68.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)} \]
    5. Taylor expanded in dX.v around inf 62.3%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{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) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.v around 0 62.7%

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

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

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

Alternative 10: 56.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \left\lfloorw\right\rfloor \cdot dY.u\\
t_1 := \left\lfloorh\right\rfloor \cdot dX.v\\
\mathbf{if}\;dY.v \leq 100000:\\
\;\;\;\;\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, t\_1\right)\right)\right)}^{2}, {t\_0}^{2}\right)}\right)\\

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


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

    1. Initial program 72.6%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 72.6%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified72.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 0 66.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative66.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}} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow266.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} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow266.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr66.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)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative66.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow266.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow266.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr66.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 dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt66.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine66.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine66.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow266.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified66.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Step-by-step derivation
      1. add-exp-log66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{\log \left({\left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}\right)}}\right)}\right) \]
      2. log-pow66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, e^{\color{blue}{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    9. Applied egg-rr66.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{e^{2 \cdot \log \left(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}}\right)}\right) \]
    10. Taylor expanded in dY.u around inf 61.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) \]
    11. Step-by-step derivation
      1. *-commutative61.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. unpow261.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. unpow261.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-sqr61.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. unpow261.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) \]
    12. Simplified61.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) \]

    if 1e5 < dY.v

    1. Initial program 55.4%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/255.4%

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

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

      \[\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)} \]
    5. Taylor expanded in dX.v around inf 50.7%

      \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{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) \cdot 0.5}\right) \]
    6. Taylor expanded in dX.v around 0 51.2%

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

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

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

Alternative 11: 39.4% accurate, 1.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\log_{2} \left(\sqrt{\mathsf{max}\left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\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.v < 0.5

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/269.2%

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

        \[\leadsto \log_{2} \color{blue}{\left(e^{\log \left(\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)\right) \cdot 0.5}\right)} \]
    4. Applied egg-rr68.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)} \]
    5. Taylor expanded in dY.u around inf 57.0%

      \[\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.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}\right)\right) \cdot 0.5}\right) \]
    6. Step-by-step derivation
      1. *-commutative57.0%

        \[\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}}\right)\right) \cdot 0.5}\right) \]
    7. Simplified57.0%

      \[\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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}}\right)\right) \cdot 0.5}\right) \]
    8. Taylor expanded in dX.w around inf 41.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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right) \cdot 0.5}\right) \]
    9. Step-by-step derivation
      1. *-commutative41.0%

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

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

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

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

        \[\leadsto \log_{2} \left(e^{\log \left(\mathsf{max}\left(\color{blue}{{\left(\left\lfloord\right\rfloor \cdot dX.w\right)}^{2}}, {\left(\left\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right) \cdot 0.5}\right) \]
      6. *-commutative41.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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right) \cdot 0.5}\right) \]
    10. Simplified41.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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}\right)\right) \cdot 0.5}\right) \]

    if 0.5 < dX.v

    1. Initial program 71.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 71.1%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified71.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.w around inf 56.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. *-commutative56.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\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow256.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 \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow256.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}, \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-sqr56.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) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)}\right) \]
      5. unpow256.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) \]
    7. Simplified56.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) \]
    8. Taylor expanded in dX.v around inf 44.9%

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

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

Alternative 12: 47.9% accurate, 1.7× speedup?

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

\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 < 2.2e6

    1. Initial program 71.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 71.1%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified71.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 dY.w around 0 65.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative65.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow265.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow265.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr65.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.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative65.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow265.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow265.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr65.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) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt65.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine65.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine65.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow265.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified65.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Taylor expanded in dX.w around inf 51.4%

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

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

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      3. swap-sqr40.1%

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      4. unpow240.1%

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

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

    if 2.2e6 < dX.u

    1. Initial program 59.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 59.1%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified59.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.w around inf 55.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.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative55.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\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow255.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\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow255.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\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)}\right) \]
      4. swap-sqr55.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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)}\right) \]
      5. unpow255.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\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)}\right) \]
    7. Simplified55.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\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)}\right) \]
    8. Taylor expanded in dX.u around inf 50.6%

      \[\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\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    9. Taylor expanded in dX.w around 0 50.1%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    10. Step-by-step derivation
      1. unpow250.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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      2. unpow250.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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      3. swap-sqr50.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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      4. unpow250.1%

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

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

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

Alternative 13: 48.3% accurate, 1.7× speedup?

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

\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(\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.v < 0.5

    1. Initial program 69.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 69.2%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified69.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 dY.w around 0 64.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.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative64.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\lfloorw\right\rfloor\right)}^{2} \cdot {dY.u}^{2}} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      2. unpow264.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\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right)} \cdot {dY.u}^{2} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      3. unpow264.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}, \left(\left\lfloorw\right\rfloor \cdot \left\lfloorw\right\rfloor\right) \cdot \color{blue}{\left(dY.u \cdot dY.u\right)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      4. swap-sqr64.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\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right)} + {dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}\right)}\right) \]
      5. *-commutative64.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}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{{\left(\left\lfloorh\right\rfloor\right)}^{2} \cdot {dY.v}^{2}}\right)}\right) \]
      6. unpow264.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}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot \left\lfloorh\right\rfloor\right)} \cdot {dY.v}^{2}\right)}\right) \]
      7. unpow264.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}, \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 \left\lfloorh\right\rfloor\right) \cdot \color{blue}{\left(dY.v \cdot dY.v\right)}\right)}\right) \]
      8. swap-sqr64.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}, \left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \color{blue}{\left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      9. rem-square-sqrt64.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}{\sqrt{\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)} \cdot \sqrt{\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)}\right) \]
      10. hypot-undefine64.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}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)} \cdot \sqrt{\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)}\right) \]
      11. hypot-undefine64.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}, \mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \color{blue}{\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)}\right)}\right) \]
      12. unpow264.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    7. Simplified64.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(\mathsf{hypot}\left(\left\lfloorw\right\rfloor \cdot dY.u, \left\lfloorh\right\rfloor \cdot dY.v\right)\right)}^{2}}\right)}\right) \]
    8. Taylor expanded in dX.w around inf 51.4%

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

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

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      3. swap-sqr40.6%

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      4. unpow240.6%

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

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

    if 0.5 < dX.v

    1. Initial program 71.1%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 71.1%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified71.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.w around inf 56.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. *-commutative56.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\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow256.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 \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow256.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}, \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-sqr56.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) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)}\right) \]
      5. unpow256.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) \]
    7. Simplified56.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) \]
    8. Taylor expanded in dX.w around 0 55.3%

      \[\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\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow255.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} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      2. unpow255.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)} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      3. swap-sqr55.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)} + {dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      4. unpow255.3%

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

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

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

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

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

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

        \[\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\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    10. Simplified55.3%

      \[\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\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.2%

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

Alternative 14: 39.1% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 72.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 72.2%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified72.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 dY.w around inf 54.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.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative54.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\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow254.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\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow254.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\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)}\right) \]
      4. swap-sqr54.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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)}\right) \]
      5. unpow254.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\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)}\right) \]
    7. Simplified54.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\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)}\right) \]
    8. Taylor expanded in dX.w around inf 37.7%

      \[\leadsto \log_{2} \left(\sqrt{\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) \]
    9. Step-by-step derivation
      1. unpow241.4%

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

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      3. swap-sqr41.4%

        \[\leadsto \log_{2} \left(e^{{\left(\sqrt[3]{\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\lfloorw\right\rfloor \cdot dY.u\right)}^{2}\right)\right)}\right)}^{3} \cdot 0.5}\right) \]
      4. unpow241.4%

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

      \[\leadsto \log_{2} \left(\sqrt{\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) \]

    if 5 < dX.u

    1. Initial program 58.2%

      \[\log_{2} \left(\sqrt{\mathsf{max}\left(\left(\left(\left\lfloorw\right\rfloor \cdot dX.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dX.u\right) + \left(\left\lfloorh\right\rfloor \cdot dX.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dX.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dX.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dX.w\right), \left(\left(\left\lfloorw\right\rfloor \cdot dY.u\right) \cdot \left(\left\lfloorw\right\rfloor \cdot dY.u\right) + \left(\left\lfloorh\right\rfloor \cdot dY.v\right) \cdot \left(\left\lfloorh\right\rfloor \cdot dY.v\right)\right) + \left(\left\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)\right)}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0 58.2%

      \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
    4. Simplified58.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 dY.w around inf 51.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, 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. *-commutative51.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{{\left(\left\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
      2. unpow251.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, dX.v \cdot \left\lfloorh\right\rfloor\right)\right)\right)}^{2}, \color{blue}{\left(\left\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
      3. unpow251.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, dX.v \cdot \left\lfloorh\right\rfloor\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) \]
      4. swap-sqr51.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, dX.v \cdot \left\lfloorh\right\rfloor\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) \]
      5. unpow251.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, 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) \]
    7. Simplified51.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, 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) \]
    8. Taylor expanded in dX.u around inf 45.4%

      \[\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\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    9. Taylor expanded in dX.w around 0 44.3%

      \[\leadsto \log_{2} \left(\sqrt{\mathsf{max}\left(\color{blue}{{dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2}}, {\left(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    10. Step-by-step derivation
      1. unpow244.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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      2. unpow244.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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      3. swap-sqr44.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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
      4. unpow244.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;dX.u \leq 5:\\ \;\;\;\;\log_{2} \left(\sqrt{\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)\\ \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} \]
  5. Add Preprocessing

Alternative 15: 35.4% 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 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. Add Preprocessing
  3. Taylor expanded in w around 0 69.6%

    \[\leadsto \log_{2} \color{blue}{\left(\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dX.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dX.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right), {dY.u}^{2} \cdot {\left(\left\lfloorw\right\rfloor\right)}^{2} + \left({dY.v}^{2} \cdot {\left(\left\lfloorh\right\rfloor\right)}^{2} + {dY.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}\right)\right)}\right)} \]
  4. Simplified69.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.w around inf 53.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.w}^{2} \cdot {\left(\left\lfloord\right\rfloor\right)}^{2}}\right)}\right) \]
  6. Step-by-step derivation
    1. *-commutative53.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\lfloord\right\rfloor\right)}^{2} \cdot {dY.w}^{2}}\right)}\right) \]
    2. unpow253.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\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right)} \cdot {dY.w}^{2}\right)}\right) \]
    3. unpow253.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\lfloord\right\rfloor \cdot \left\lfloord\right\rfloor\right) \cdot \color{blue}{\left(dY.w \cdot dY.w\right)}\right)}\right) \]
    4. swap-sqr53.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\lfloord\right\rfloor \cdot dY.w\right) \cdot \left(\left\lfloord\right\rfloor \cdot dY.w\right)}\right)}\right) \]
    5. unpow253.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\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)}\right) \]
  7. Simplified53.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\lfloord\right\rfloor \cdot dY.w\right)}^{2}}\right)}\right) \]
  8. Taylor expanded in dX.u around inf 45.5%

    \[\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\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
  9. Taylor expanded in dX.w around 0 34.9%

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

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

      \[\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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    3. swap-sqr34.9%

      \[\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(\left\lfloord\right\rfloor \cdot dY.w\right)}^{2}\right)}\right) \]
    4. unpow234.9%

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

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

    \[\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) \]
  13. Add Preprocessing

Reproduce

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