
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor h) dX.v))
(t_1 (* (floor w) dY.u))
(t_2 (* (floor w) dX.u))
(t_3 (+ (* t_2 t_2) (* t_0 t_0)))
(t_4 (* (floor h) dY.v))
(t_5 (+ (* t_1 t_1) (* t_4 t_4)))
(t_6 (/ 1.0 (sqrt (fmax t_3 t_5)))))
(if (>= t_3 t_5) (* t_6 t_2) (* t_6 t_1))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(h) * dX_46_v;
float t_1 = floorf(w) * dY_46_u;
float t_2 = floorf(w) * dX_46_u;
float t_3 = (t_2 * t_2) + (t_0 * t_0);
float t_4 = floorf(h) * dY_46_v;
float t_5 = (t_1 * t_1) + (t_4 * t_4);
float t_6 = 1.0f / sqrtf(fmaxf(t_3, t_5));
float tmp;
if (t_3 >= t_5) {
tmp = t_6 * t_2;
} else {
tmp = t_6 * t_1;
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(h) * dX_46_v) t_1 = Float32(floor(w) * dY_46_u) t_2 = Float32(floor(w) * dX_46_u) t_3 = Float32(Float32(t_2 * t_2) + Float32(t_0 * t_0)) t_4 = Float32(floor(h) * dY_46_v) t_5 = Float32(Float32(t_1 * t_1) + Float32(t_4 * t_4)) t_6 = Float32(Float32(1.0) / sqrt(((t_3 != t_3) ? t_5 : ((t_5 != t_5) ? t_3 : max(t_3, t_5))))) tmp = Float32(0.0) if (t_3 >= t_5) tmp = Float32(t_6 * t_2); else tmp = Float32(t_6 * t_1); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(h) * dX_46_v; t_1 = floor(w) * dY_46_u; t_2 = floor(w) * dX_46_u; t_3 = (t_2 * t_2) + (t_0 * t_0); t_4 = floor(h) * dY_46_v; t_5 = (t_1 * t_1) + (t_4 * t_4); t_6 = single(1.0) / sqrt(max(t_3, t_5)); tmp = single(0.0); if (t_3 >= t_5) tmp = t_6 * t_2; else tmp = t_6 * t_1; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor \cdot dX.v\\
t_1 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_2 := \left\lfloor w\right\rfloor \cdot dX.u\\
t_3 := t\_2 \cdot t\_2 + t\_0 \cdot t\_0\\
t_4 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_5 := t\_1 \cdot t\_1 + t\_4 \cdot t\_4\\
t_6 := \frac{1}{\sqrt{\mathsf{max}\left(t\_3, t\_5\right)}}\\
\mathbf{if}\;t\_3 \geq t\_5:\\
\;\;\;\;t\_6 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_6 \cdot t\_1\\
\end{array}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor h) dX.v))
(t_1 (* (floor w) dY.u))
(t_2 (* (floor w) dX.u))
(t_3 (+ (* t_2 t_2) (* t_0 t_0)))
(t_4 (* (floor h) dY.v))
(t_5 (+ (* t_1 t_1) (* t_4 t_4)))
(t_6 (/ 1.0 (sqrt (fmax t_3 t_5)))))
(if (>= t_3 t_5) (* t_6 t_2) (* t_6 t_1))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(h) * dX_46_v;
float t_1 = floorf(w) * dY_46_u;
float t_2 = floorf(w) * dX_46_u;
float t_3 = (t_2 * t_2) + (t_0 * t_0);
float t_4 = floorf(h) * dY_46_v;
float t_5 = (t_1 * t_1) + (t_4 * t_4);
float t_6 = 1.0f / sqrtf(fmaxf(t_3, t_5));
float tmp;
if (t_3 >= t_5) {
tmp = t_6 * t_2;
} else {
tmp = t_6 * t_1;
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(h) * dX_46_v) t_1 = Float32(floor(w) * dY_46_u) t_2 = Float32(floor(w) * dX_46_u) t_3 = Float32(Float32(t_2 * t_2) + Float32(t_0 * t_0)) t_4 = Float32(floor(h) * dY_46_v) t_5 = Float32(Float32(t_1 * t_1) + Float32(t_4 * t_4)) t_6 = Float32(Float32(1.0) / sqrt(((t_3 != t_3) ? t_5 : ((t_5 != t_5) ? t_3 : max(t_3, t_5))))) tmp = Float32(0.0) if (t_3 >= t_5) tmp = Float32(t_6 * t_2); else tmp = Float32(t_6 * t_1); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(h) * dX_46_v; t_1 = floor(w) * dY_46_u; t_2 = floor(w) * dX_46_u; t_3 = (t_2 * t_2) + (t_0 * t_0); t_4 = floor(h) * dY_46_v; t_5 = (t_1 * t_1) + (t_4 * t_4); t_6 = single(1.0) / sqrt(max(t_3, t_5)); tmp = single(0.0); if (t_3 >= t_5) tmp = t_6 * t_2; else tmp = t_6 * t_1; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor \cdot dX.v\\
t_1 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_2 := \left\lfloor w\right\rfloor \cdot dX.u\\
t_3 := t\_2 \cdot t\_2 + t\_0 \cdot t\_0\\
t_4 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_5 := t\_1 \cdot t\_1 + t\_4 \cdot t\_4\\
t_6 := \frac{1}{\sqrt{\mathsf{max}\left(t\_3, t\_5\right)}}\\
\mathbf{if}\;t\_3 \geq t\_5:\\
\;\;\;\;t\_6 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_6 \cdot t\_1\\
\end{array}
\end{array}
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor w) dY.u))
(t_1 (pow (hypot (* (floor h) dY.v) t_0) 2.0))
(t_2 (* dX.v (floor h)))
(t_3 (* dX.u (floor w)))
(t_4 (pow (hypot t_2 t_3) 2.0)))
(if (>= t_4 t_1)
(/ t_3 (sqrt (fmax (+ (pow t_2 2.0) (pow t_3 2.0)) t_1)))
(/ t_0 (sqrt (fmax t_4 t_1))))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(w) * dY_46_u;
float t_1 = powf(hypotf((floorf(h) * dY_46_v), t_0), 2.0f);
float t_2 = dX_46_v * floorf(h);
float t_3 = dX_46_u * floorf(w);
float t_4 = powf(hypotf(t_2, t_3), 2.0f);
float tmp;
if (t_4 >= t_1) {
tmp = t_3 / sqrtf(fmaxf((powf(t_2, 2.0f) + powf(t_3, 2.0f)), t_1));
} else {
tmp = t_0 / sqrtf(fmaxf(t_4, t_1));
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(w) * dY_46_u) t_1 = hypot(Float32(floor(h) * dY_46_v), t_0) ^ Float32(2.0) t_2 = Float32(dX_46_v * floor(h)) t_3 = Float32(dX_46_u * floor(w)) t_4 = hypot(t_2, t_3) ^ Float32(2.0) tmp = Float32(0.0) if (t_4 >= t_1) tmp = Float32(t_3 / sqrt(((Float32((t_2 ^ Float32(2.0)) + (t_3 ^ Float32(2.0))) != Float32((t_2 ^ Float32(2.0)) + (t_3 ^ Float32(2.0)))) ? t_1 : ((t_1 != t_1) ? Float32((t_2 ^ Float32(2.0)) + (t_3 ^ Float32(2.0))) : max(Float32((t_2 ^ Float32(2.0)) + (t_3 ^ Float32(2.0))), t_1))))); else tmp = Float32(t_0 / sqrt(((t_4 != t_4) ? t_1 : ((t_1 != t_1) ? t_4 : max(t_4, t_1))))); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(w) * dY_46_u; t_1 = hypot((floor(h) * dY_46_v), t_0) ^ single(2.0); t_2 = dX_46_v * floor(h); t_3 = dX_46_u * floor(w); t_4 = hypot(t_2, t_3) ^ single(2.0); tmp = single(0.0); if (t_4 >= t_1) tmp = t_3 / sqrt(max(((t_2 ^ single(2.0)) + (t_3 ^ single(2.0))), t_1)); else tmp = t_0 / sqrt(max(t_4, t_1)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_1 := {\left(\mathsf{hypot}\left(\left\lfloor h\right\rfloor \cdot dY.v, t\_0\right)\right)}^{2}\\
t_2 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_3 := dX.u \cdot \left\lfloor w\right\rfloor \\
t_4 := {\left(\mathsf{hypot}\left(t\_2, t\_3\right)\right)}^{2}\\
\mathbf{if}\;t\_4 \geq t\_1:\\
\;\;\;\;\frac{t\_3}{\sqrt{\mathsf{max}\left({t\_2}^{2} + {t\_3}^{2}, t\_1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\sqrt{\mathsf{max}\left(t\_4, t\_1\right)}}\\
\end{array}
\end{array}
Initial program 72.7%
Simplified72.7%
Applied egg-rr72.8%
Taylor expanded in w around 0 72.6%
Simplified72.9%
Taylor expanded in dX.v around 0 72.9%
unpow272.9%
unpow272.9%
swap-sqr72.9%
unpow272.9%
unpow272.9%
unpow272.9%
swap-sqr72.9%
unpow272.9%
+-commutative72.9%
Simplified72.9%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* dX.u (floor w)))
(t_1 (* (floor w) dY.u))
(t_2 (* dX.v (floor h)))
(t_3 (* (floor h) dY.v))
(t_4 (pow (hypot t_3 t_1) 2.0))
(t_5 (pow (hypot t_1 t_3) 2.0))
(t_6 (pow (hypot t_2 t_0) 2.0))
(t_7 (sqrt (fmax (pow (hypot t_0 t_2) 2.0) t_5))))
(if (<= dX.v 15.0)
(if (>= t_6 t_4)
(/ t_0 (sqrt (fmax (* (pow dX.u 2.0) (pow (floor w) 2.0)) t_4)))
(/ t_1 (sqrt (fmax t_6 t_4))))
(if (>= (pow t_2 2.0) t_5)
(* dX.u (/ (floor w) t_7))
(* (floor w) (/ dY.u t_7))))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = dX_46_u * floorf(w);
float t_1 = floorf(w) * dY_46_u;
float t_2 = dX_46_v * floorf(h);
float t_3 = floorf(h) * dY_46_v;
float t_4 = powf(hypotf(t_3, t_1), 2.0f);
float t_5 = powf(hypotf(t_1, t_3), 2.0f);
float t_6 = powf(hypotf(t_2, t_0), 2.0f);
float t_7 = sqrtf(fmaxf(powf(hypotf(t_0, t_2), 2.0f), t_5));
float tmp_1;
if (dX_46_v <= 15.0f) {
float tmp_2;
if (t_6 >= t_4) {
tmp_2 = t_0 / sqrtf(fmaxf((powf(dX_46_u, 2.0f) * powf(floorf(w), 2.0f)), t_4));
} else {
tmp_2 = t_1 / sqrtf(fmaxf(t_6, t_4));
}
tmp_1 = tmp_2;
} else if (powf(t_2, 2.0f) >= t_5) {
tmp_1 = dX_46_u * (floorf(w) / t_7);
} else {
tmp_1 = floorf(w) * (dY_46_u / t_7);
}
return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(dX_46_u * floor(w)) t_1 = Float32(floor(w) * dY_46_u) t_2 = Float32(dX_46_v * floor(h)) t_3 = Float32(floor(h) * dY_46_v) t_4 = hypot(t_3, t_1) ^ Float32(2.0) t_5 = hypot(t_1, t_3) ^ Float32(2.0) t_6 = hypot(t_2, t_0) ^ Float32(2.0) t_7 = sqrt((((hypot(t_0, t_2) ^ Float32(2.0)) != (hypot(t_0, t_2) ^ Float32(2.0))) ? t_5 : ((t_5 != t_5) ? (hypot(t_0, t_2) ^ Float32(2.0)) : max((hypot(t_0, t_2) ^ Float32(2.0)), t_5)))) tmp_1 = Float32(0.0) if (dX_46_v <= Float32(15.0)) tmp_2 = Float32(0.0) if (t_6 >= t_4) tmp_2 = Float32(t_0 / sqrt(((Float32((dX_46_u ^ Float32(2.0)) * (floor(w) ^ Float32(2.0))) != Float32((dX_46_u ^ Float32(2.0)) * (floor(w) ^ Float32(2.0)))) ? t_4 : ((t_4 != t_4) ? 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))), t_4))))); else tmp_2 = Float32(t_1 / sqrt(((t_6 != t_6) ? t_4 : ((t_4 != t_4) ? t_6 : max(t_6, t_4))))); end tmp_1 = tmp_2; elseif ((t_2 ^ Float32(2.0)) >= t_5) tmp_1 = Float32(dX_46_u * Float32(floor(w) / t_7)); else tmp_1 = Float32(floor(w) * Float32(dY_46_u / t_7)); end return tmp_1 end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = dX_46_u * floor(w); t_1 = floor(w) * dY_46_u; t_2 = dX_46_v * floor(h); t_3 = floor(h) * dY_46_v; t_4 = hypot(t_3, t_1) ^ single(2.0); t_5 = hypot(t_1, t_3) ^ single(2.0); t_6 = hypot(t_2, t_0) ^ single(2.0); t_7 = sqrt(max((hypot(t_0, t_2) ^ single(2.0)), t_5)); tmp_2 = single(0.0); if (dX_46_v <= single(15.0)) tmp_3 = single(0.0); if (t_6 >= t_4) tmp_3 = t_0 / sqrt(max(((dX_46_u ^ single(2.0)) * (floor(w) ^ single(2.0))), t_4)); else tmp_3 = t_1 / sqrt(max(t_6, t_4)); end tmp_2 = tmp_3; elseif ((t_2 ^ single(2.0)) >= t_5) tmp_2 = dX_46_u * (floor(w) / t_7); else tmp_2 = floor(w) * (dY_46_u / t_7); end tmp_4 = tmp_2; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := dX.u \cdot \left\lfloor w\right\rfloor \\
t_1 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_2 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_3 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_4 := {\left(\mathsf{hypot}\left(t\_3, t\_1\right)\right)}^{2}\\
t_5 := {\left(\mathsf{hypot}\left(t\_1, t\_3\right)\right)}^{2}\\
t_6 := {\left(\mathsf{hypot}\left(t\_2, t\_0\right)\right)}^{2}\\
t_7 := \sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t\_0, t\_2\right)\right)}^{2}, t\_5\right)}\\
\mathbf{if}\;dX.v \leq 15:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;t\_6 \geq t\_4:\\
\;\;\;\;\frac{t\_0}{\sqrt{\mathsf{max}\left({dX.u}^{2} \cdot {\left(\left\lfloor w\right\rfloor \right)}^{2}, t\_4\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{\sqrt{\mathsf{max}\left(t\_6, t\_4\right)}}\\
\end{array}\\
\mathbf{elif}\;{t\_2}^{2} \geq t\_5:\\
\;\;\;\;dX.u \cdot \frac{\left\lfloor w\right\rfloor }{t\_7}\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \frac{dY.u}{t\_7}\\
\end{array}
\end{array}
if dX.v < 15Initial program 73.5%
Simplified73.5%
Applied egg-rr73.5%
Taylor expanded in w around 0 73.3%
Simplified73.7%
Taylor expanded in dX.v around 0 65.8%
if 15 < dX.v Initial program 70.1%
Simplified70.0%
Taylor expanded in w around 0 70.2%
Simplified69.9%
Taylor expanded in dX.u around 0 69.9%
unpow269.9%
unpow269.9%
swap-sqr69.9%
unpow269.9%
Simplified69.9%
Taylor expanded in dX.v around 0 70.2%
Simplified69.9%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor w) dY.u))
(t_1 (pow (hypot (* (floor h) dY.v) t_0) 2.0))
(t_2 (* dX.u (floor w)))
(t_3 (pow (hypot (* dX.v (floor h)) t_2) 2.0))
(t_4 (sqrt (fmax t_3 t_1))))
(if (>= t_3 t_1) (/ t_2 t_4) (/ t_0 t_4))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(w) * dY_46_u;
float t_1 = powf(hypotf((floorf(h) * dY_46_v), t_0), 2.0f);
float t_2 = dX_46_u * floorf(w);
float t_3 = powf(hypotf((dX_46_v * floorf(h)), t_2), 2.0f);
float t_4 = sqrtf(fmaxf(t_3, t_1));
float tmp;
if (t_3 >= t_1) {
tmp = t_2 / t_4;
} else {
tmp = t_0 / t_4;
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(w) * dY_46_u) t_1 = hypot(Float32(floor(h) * dY_46_v), t_0) ^ Float32(2.0) t_2 = Float32(dX_46_u * floor(w)) t_3 = hypot(Float32(dX_46_v * floor(h)), t_2) ^ Float32(2.0) t_4 = sqrt(((t_3 != t_3) ? t_1 : ((t_1 != t_1) ? t_3 : max(t_3, t_1)))) tmp = Float32(0.0) if (t_3 >= t_1) tmp = Float32(t_2 / t_4); else tmp = Float32(t_0 / t_4); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(w) * dY_46_u; t_1 = hypot((floor(h) * dY_46_v), t_0) ^ single(2.0); t_2 = dX_46_u * floor(w); t_3 = hypot((dX_46_v * floor(h)), t_2) ^ single(2.0); t_4 = sqrt(max(t_3, t_1)); tmp = single(0.0); if (t_3 >= t_1) tmp = t_2 / t_4; else tmp = t_0 / t_4; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_1 := {\left(\mathsf{hypot}\left(\left\lfloor h\right\rfloor \cdot dY.v, t\_0\right)\right)}^{2}\\
t_2 := dX.u \cdot \left\lfloor w\right\rfloor \\
t_3 := {\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloor h\right\rfloor , t\_2\right)\right)}^{2}\\
t_4 := \sqrt{\mathsf{max}\left(t\_3, t\_1\right)}\\
\mathbf{if}\;t\_3 \geq t\_1:\\
\;\;\;\;\frac{t\_2}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_4}\\
\end{array}
\end{array}
Initial program 72.7%
Simplified72.7%
Applied egg-rr72.8%
Taylor expanded in w around 0 72.6%
Simplified72.9%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor w) dY.u))
(t_1 (* dX.v (floor h)))
(t_2 (* dX.u (floor w)))
(t_3 (pow (hypot t_1 t_2) 2.0))
(t_4 (* (floor h) dY.v))
(t_5 (pow (hypot t_4 t_0) 2.0))
(t_6 (sqrt (fmax t_3 t_5)))
(t_7 (/ t_0 t_6)))
(if (<= dY.v 0.019999999552965164)
(if (>= t_3 (pow t_0 2.0))
(/ t_2 (sqrt (fmax (+ (pow t_1 2.0) (pow t_2 2.0)) t_5)))
t_7)
(if (>= t_3 (pow t_4 2.0)) (/ t_2 t_6) t_7))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(w) * dY_46_u;
float t_1 = dX_46_v * floorf(h);
float t_2 = dX_46_u * floorf(w);
float t_3 = powf(hypotf(t_1, t_2), 2.0f);
float t_4 = floorf(h) * dY_46_v;
float t_5 = powf(hypotf(t_4, t_0), 2.0f);
float t_6 = sqrtf(fmaxf(t_3, t_5));
float t_7 = t_0 / t_6;
float tmp_1;
if (dY_46_v <= 0.019999999552965164f) {
float tmp_2;
if (t_3 >= powf(t_0, 2.0f)) {
tmp_2 = t_2 / sqrtf(fmaxf((powf(t_1, 2.0f) + powf(t_2, 2.0f)), t_5));
} else {
tmp_2 = t_7;
}
tmp_1 = tmp_2;
} else if (t_3 >= powf(t_4, 2.0f)) {
tmp_1 = t_2 / t_6;
} else {
tmp_1 = t_7;
}
return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(w) * dY_46_u) t_1 = Float32(dX_46_v * floor(h)) t_2 = Float32(dX_46_u * floor(w)) t_3 = hypot(t_1, t_2) ^ Float32(2.0) t_4 = Float32(floor(h) * dY_46_v) t_5 = hypot(t_4, t_0) ^ Float32(2.0) t_6 = sqrt(((t_3 != t_3) ? t_5 : ((t_5 != t_5) ? t_3 : max(t_3, t_5)))) t_7 = Float32(t_0 / t_6) tmp_1 = Float32(0.0) if (dY_46_v <= Float32(0.019999999552965164)) tmp_2 = Float32(0.0) if (t_3 >= (t_0 ^ Float32(2.0))) tmp_2 = Float32(t_2 / sqrt(((Float32((t_1 ^ Float32(2.0)) + (t_2 ^ Float32(2.0))) != Float32((t_1 ^ Float32(2.0)) + (t_2 ^ Float32(2.0)))) ? t_5 : ((t_5 != t_5) ? Float32((t_1 ^ Float32(2.0)) + (t_2 ^ Float32(2.0))) : max(Float32((t_1 ^ Float32(2.0)) + (t_2 ^ Float32(2.0))), t_5))))); else tmp_2 = t_7; end tmp_1 = tmp_2; elseif (t_3 >= (t_4 ^ Float32(2.0))) tmp_1 = Float32(t_2 / t_6); else tmp_1 = t_7; end return tmp_1 end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(w) * dY_46_u; t_1 = dX_46_v * floor(h); t_2 = dX_46_u * floor(w); t_3 = hypot(t_1, t_2) ^ single(2.0); t_4 = floor(h) * dY_46_v; t_5 = hypot(t_4, t_0) ^ single(2.0); t_6 = sqrt(max(t_3, t_5)); t_7 = t_0 / t_6; tmp_2 = single(0.0); if (dY_46_v <= single(0.019999999552965164)) tmp_3 = single(0.0); if (t_3 >= (t_0 ^ single(2.0))) tmp_3 = t_2 / sqrt(max(((t_1 ^ single(2.0)) + (t_2 ^ single(2.0))), t_5)); else tmp_3 = t_7; end tmp_2 = tmp_3; elseif (t_3 >= (t_4 ^ single(2.0))) tmp_2 = t_2 / t_6; else tmp_2 = t_7; end tmp_4 = tmp_2; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_1 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_2 := dX.u \cdot \left\lfloor w\right\rfloor \\
t_3 := {\left(\mathsf{hypot}\left(t\_1, t\_2\right)\right)}^{2}\\
t_4 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_5 := {\left(\mathsf{hypot}\left(t\_4, t\_0\right)\right)}^{2}\\
t_6 := \sqrt{\mathsf{max}\left(t\_3, t\_5\right)}\\
t_7 := \frac{t\_0}{t\_6}\\
\mathbf{if}\;dY.v \leq 0.019999999552965164:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;t\_3 \geq {t\_0}^{2}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\mathsf{max}\left({t\_1}^{2} + {t\_2}^{2}, t\_5\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_7\\
\end{array}\\
\mathbf{elif}\;t\_3 \geq {t\_4}^{2}:\\
\;\;\;\;\frac{t\_2}{t\_6}\\
\mathbf{else}:\\
\;\;\;\;t\_7\\
\end{array}
\end{array}
if dY.v < 0.0199999996Initial program 73.1%
Simplified73.2%
Applied egg-rr73.2%
Taylor expanded in w around 0 73.0%
Simplified73.3%
Taylor expanded in dX.v around 0 73.3%
unpow273.3%
unpow273.3%
swap-sqr73.3%
unpow273.3%
unpow273.3%
unpow273.3%
swap-sqr73.4%
unpow273.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in dY.v around 0 65.3%
*-commutative65.3%
unpow265.3%
unpow265.3%
swap-sqr65.3%
unpow265.3%
Simplified65.3%
if 0.0199999996 < dY.v Initial program 71.8%
Simplified71.7%
Applied egg-rr71.9%
Taylor expanded in w around 0 71.6%
Simplified72.0%
Taylor expanded in dY.v around inf 72.0%
*-commutative72.0%
unpow272.0%
unpow272.0%
swap-sqr72.0%
unpow272.0%
Simplified72.0%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor h) dY.v))
(t_1 (* dX.u (floor w)))
(t_2 (* (floor w) dY.u))
(t_3 (pow (hypot (* dX.v (floor h)) t_1) 2.0))
(t_4 (sqrt (fmax t_3 (pow (hypot t_0 t_2) 2.0))))
(t_5 (/ t_2 t_4))
(t_6 (/ t_1 t_4)))
(if (<= dY.v 0.019999999552965164)
(if (>= t_3 (pow t_2 2.0)) t_6 t_5)
(if (>= t_3 (pow t_0 2.0)) t_6 t_5))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(h) * dY_46_v;
float t_1 = dX_46_u * floorf(w);
float t_2 = floorf(w) * dY_46_u;
float t_3 = powf(hypotf((dX_46_v * floorf(h)), t_1), 2.0f);
float t_4 = sqrtf(fmaxf(t_3, powf(hypotf(t_0, t_2), 2.0f)));
float t_5 = t_2 / t_4;
float t_6 = t_1 / t_4;
float tmp_1;
if (dY_46_v <= 0.019999999552965164f) {
float tmp_2;
if (t_3 >= powf(t_2, 2.0f)) {
tmp_2 = t_6;
} else {
tmp_2 = t_5;
}
tmp_1 = tmp_2;
} else if (t_3 >= powf(t_0, 2.0f)) {
tmp_1 = t_6;
} else {
tmp_1 = t_5;
}
return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(h) * dY_46_v) t_1 = Float32(dX_46_u * floor(w)) t_2 = Float32(floor(w) * dY_46_u) t_3 = hypot(Float32(dX_46_v * floor(h)), t_1) ^ Float32(2.0) t_4 = sqrt(((t_3 != t_3) ? (hypot(t_0, t_2) ^ Float32(2.0)) : (((hypot(t_0, t_2) ^ Float32(2.0)) != (hypot(t_0, t_2) ^ Float32(2.0))) ? t_3 : max(t_3, (hypot(t_0, t_2) ^ Float32(2.0)))))) t_5 = Float32(t_2 / t_4) t_6 = Float32(t_1 / t_4) tmp_1 = Float32(0.0) if (dY_46_v <= Float32(0.019999999552965164)) tmp_2 = Float32(0.0) if (t_3 >= (t_2 ^ Float32(2.0))) tmp_2 = t_6; else tmp_2 = t_5; end tmp_1 = tmp_2; elseif (t_3 >= (t_0 ^ Float32(2.0))) tmp_1 = t_6; else tmp_1 = t_5; end return tmp_1 end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(h) * dY_46_v; t_1 = dX_46_u * floor(w); t_2 = floor(w) * dY_46_u; t_3 = hypot((dX_46_v * floor(h)), t_1) ^ single(2.0); t_4 = sqrt(max(t_3, (hypot(t_0, t_2) ^ single(2.0)))); t_5 = t_2 / t_4; t_6 = t_1 / t_4; tmp_2 = single(0.0); if (dY_46_v <= single(0.019999999552965164)) tmp_3 = single(0.0); if (t_3 >= (t_2 ^ single(2.0))) tmp_3 = t_6; else tmp_3 = t_5; end tmp_2 = tmp_3; elseif (t_3 >= (t_0 ^ single(2.0))) tmp_2 = t_6; else tmp_2 = t_5; end tmp_4 = tmp_2; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_1 := dX.u \cdot \left\lfloor w\right\rfloor \\
t_2 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_3 := {\left(\mathsf{hypot}\left(dX.v \cdot \left\lfloor h\right\rfloor , t\_1\right)\right)}^{2}\\
t_4 := \sqrt{\mathsf{max}\left(t\_3, {\left(\mathsf{hypot}\left(t\_0, t\_2\right)\right)}^{2}\right)}\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := \frac{t\_1}{t\_4}\\
\mathbf{if}\;dY.v \leq 0.019999999552965164:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;t\_3 \geq {t\_2}^{2}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}\\
\mathbf{elif}\;t\_3 \geq {t\_0}^{2}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if dY.v < 0.0199999996Initial program 73.1%
Simplified73.2%
Applied egg-rr73.2%
Taylor expanded in w around 0 73.0%
Simplified73.3%
Taylor expanded in dY.v around 0 65.3%
*-commutative65.3%
unpow265.3%
unpow265.3%
swap-sqr65.3%
unpow265.3%
Simplified65.3%
if 0.0199999996 < dY.v Initial program 71.8%
Simplified71.7%
Applied egg-rr71.9%
Taylor expanded in w around 0 71.6%
Simplified72.0%
Taylor expanded in dY.v around inf 72.0%
*-commutative72.0%
unpow272.0%
unpow272.0%
swap-sqr72.0%
unpow272.0%
Simplified72.0%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* dX.u (floor w)))
(t_1 (* (floor h) dY.v))
(t_2 (* dX.v (floor h)))
(t_3 (pow (hypot t_2 t_0) 2.0))
(t_4 (* (floor w) dY.u))
(t_5 (pow (hypot t_4 t_1) 2.0))
(t_6 (sqrt (fmax (pow (hypot t_0 t_2) 2.0) t_5)))
(t_7 (sqrt (fmax t_3 (pow (hypot t_1 t_4) 2.0)))))
(if (<= dX.u -0.004999999888241291)
(if (>= t_3 (pow t_1 2.0)) (/ t_0 t_7) (/ t_4 t_7))
(if (>= (pow t_2 2.0) t_5)
(* dX.u (/ (floor w) t_6))
(* (floor w) (/ dY.u t_6))))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = dX_46_u * floorf(w);
float t_1 = floorf(h) * dY_46_v;
float t_2 = dX_46_v * floorf(h);
float t_3 = powf(hypotf(t_2, t_0), 2.0f);
float t_4 = floorf(w) * dY_46_u;
float t_5 = powf(hypotf(t_4, t_1), 2.0f);
float t_6 = sqrtf(fmaxf(powf(hypotf(t_0, t_2), 2.0f), t_5));
float t_7 = sqrtf(fmaxf(t_3, powf(hypotf(t_1, t_4), 2.0f)));
float tmp_1;
if (dX_46_u <= -0.004999999888241291f) {
float tmp_2;
if (t_3 >= powf(t_1, 2.0f)) {
tmp_2 = t_0 / t_7;
} else {
tmp_2 = t_4 / t_7;
}
tmp_1 = tmp_2;
} else if (powf(t_2, 2.0f) >= t_5) {
tmp_1 = dX_46_u * (floorf(w) / t_6);
} else {
tmp_1 = floorf(w) * (dY_46_u / t_6);
}
return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(dX_46_u * floor(w)) t_1 = Float32(floor(h) * dY_46_v) t_2 = Float32(dX_46_v * floor(h)) t_3 = hypot(t_2, t_0) ^ Float32(2.0) t_4 = Float32(floor(w) * dY_46_u) t_5 = hypot(t_4, t_1) ^ Float32(2.0) t_6 = sqrt((((hypot(t_0, t_2) ^ Float32(2.0)) != (hypot(t_0, t_2) ^ Float32(2.0))) ? t_5 : ((t_5 != t_5) ? (hypot(t_0, t_2) ^ Float32(2.0)) : max((hypot(t_0, t_2) ^ Float32(2.0)), t_5)))) t_7 = sqrt(((t_3 != t_3) ? (hypot(t_1, t_4) ^ Float32(2.0)) : (((hypot(t_1, t_4) ^ Float32(2.0)) != (hypot(t_1, t_4) ^ Float32(2.0))) ? t_3 : max(t_3, (hypot(t_1, t_4) ^ Float32(2.0)))))) tmp_1 = Float32(0.0) if (dX_46_u <= Float32(-0.004999999888241291)) tmp_2 = Float32(0.0) if (t_3 >= (t_1 ^ Float32(2.0))) tmp_2 = Float32(t_0 / t_7); else tmp_2 = Float32(t_4 / t_7); end tmp_1 = tmp_2; elseif ((t_2 ^ Float32(2.0)) >= t_5) tmp_1 = Float32(dX_46_u * Float32(floor(w) / t_6)); else tmp_1 = Float32(floor(w) * Float32(dY_46_u / t_6)); end return tmp_1 end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = dX_46_u * floor(w); t_1 = floor(h) * dY_46_v; t_2 = dX_46_v * floor(h); t_3 = hypot(t_2, t_0) ^ single(2.0); t_4 = floor(w) * dY_46_u; t_5 = hypot(t_4, t_1) ^ single(2.0); t_6 = sqrt(max((hypot(t_0, t_2) ^ single(2.0)), t_5)); t_7 = sqrt(max(t_3, (hypot(t_1, t_4) ^ single(2.0)))); tmp_2 = single(0.0); if (dX_46_u <= single(-0.004999999888241291)) tmp_3 = single(0.0); if (t_3 >= (t_1 ^ single(2.0))) tmp_3 = t_0 / t_7; else tmp_3 = t_4 / t_7; end tmp_2 = tmp_3; elseif ((t_2 ^ single(2.0)) >= t_5) tmp_2 = dX_46_u * (floor(w) / t_6); else tmp_2 = floor(w) * (dY_46_u / t_6); end tmp_4 = tmp_2; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := dX.u \cdot \left\lfloor w\right\rfloor \\
t_1 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_2 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_3 := {\left(\mathsf{hypot}\left(t\_2, t\_0\right)\right)}^{2}\\
t_4 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_5 := {\left(\mathsf{hypot}\left(t\_4, t\_1\right)\right)}^{2}\\
t_6 := \sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(t\_0, t\_2\right)\right)}^{2}, t\_5\right)}\\
t_7 := \sqrt{\mathsf{max}\left(t\_3, {\left(\mathsf{hypot}\left(t\_1, t\_4\right)\right)}^{2}\right)}\\
\mathbf{if}\;dX.u \leq -0.004999999888241291:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;t\_3 \geq {t\_1}^{2}:\\
\;\;\;\;\frac{t\_0}{t\_7}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_4}{t\_7}\\
\end{array}\\
\mathbf{elif}\;{t\_2}^{2} \geq t\_5:\\
\;\;\;\;dX.u \cdot \frac{\left\lfloor w\right\rfloor }{t\_6}\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \frac{dY.u}{t\_6}\\
\end{array}
\end{array}
if dX.u < -0.00499999989Initial program 63.0%
Simplified62.8%
Applied egg-rr62.9%
Taylor expanded in w around 0 62.8%
Simplified63.3%
Taylor expanded in dY.v around inf 57.7%
*-commutative57.7%
unpow257.7%
unpow257.7%
swap-sqr57.7%
unpow257.7%
Simplified57.7%
if -0.00499999989 < dX.u Initial program 76.1%
Simplified76.0%
Taylor expanded in w around 0 76.0%
Simplified75.9%
Taylor expanded in dX.u around 0 72.6%
unpow272.6%
unpow272.6%
swap-sqr72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in dX.v around 0 72.8%
Simplified72.9%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (pow (hypot (* (floor w) dY.u) (* (floor h) dY.v)) 2.0))
(t_1 (* dX.v (floor h)))
(t_2 (sqrt (fmax (pow (hypot (* dX.u (floor w)) t_1) 2.0) t_0))))
(if (>= (pow t_1 2.0) t_0)
(* dX.u (/ (floor w) t_2))
(* (floor w) (/ dY.u t_2)))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = powf(hypotf((floorf(w) * dY_46_u), (floorf(h) * dY_46_v)), 2.0f);
float t_1 = dX_46_v * floorf(h);
float t_2 = sqrtf(fmaxf(powf(hypotf((dX_46_u * floorf(w)), t_1), 2.0f), t_0));
float tmp;
if (powf(t_1, 2.0f) >= t_0) {
tmp = dX_46_u * (floorf(w) / t_2);
} else {
tmp = floorf(w) * (dY_46_u / t_2);
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = hypot(Float32(floor(w) * dY_46_u), Float32(floor(h) * dY_46_v)) ^ Float32(2.0) t_1 = Float32(dX_46_v * floor(h)) t_2 = sqrt((((hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)) != (hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0))) ? t_0 : ((t_0 != t_0) ? (hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)) : max((hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)), t_0)))) tmp = Float32(0.0) if ((t_1 ^ Float32(2.0)) >= t_0) tmp = Float32(dX_46_u * Float32(floor(w) / t_2)); else tmp = Float32(floor(w) * Float32(dY_46_u / t_2)); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = hypot((floor(w) * dY_46_u), (floor(h) * dY_46_v)) ^ single(2.0); t_1 = dX_46_v * floor(h); t_2 = sqrt(max((hypot((dX_46_u * floor(w)), t_1) ^ single(2.0)), t_0)); tmp = single(0.0); if ((t_1 ^ single(2.0)) >= t_0) tmp = dX_46_u * (floor(w) / t_2); else tmp = floor(w) * (dY_46_u / t_2); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(\left\lfloor w\right\rfloor \cdot dY.u, \left\lfloor h\right\rfloor \cdot dY.v\right)\right)}^{2}\\
t_1 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_2 := \sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.u \cdot \left\lfloor w\right\rfloor , t\_1\right)\right)}^{2}, t\_0\right)}\\
\mathbf{if}\;{t\_1}^{2} \geq t\_0:\\
\;\;\;\;dX.u \cdot \frac{\left\lfloor w\right\rfloor }{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \frac{dY.u}{t\_2}\\
\end{array}
\end{array}
Initial program 72.7%
Simplified72.7%
Taylor expanded in w around 0 72.6%
Simplified72.5%
Taylor expanded in dX.u around 0 64.4%
unpow264.4%
unpow264.4%
swap-sqr64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in dX.v around 0 64.5%
Simplified64.6%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor w) dY.u))
(t_1 (* (floor h) dY.v))
(t_2 (* dX.v (floor h)))
(t_3 (pow t_2 2.0))
(t_4
(fmax
(pow (hypot (* dX.u (floor w)) t_2) 2.0)
(pow (hypot t_1 t_0) 2.0)))
(t_5 (sqrt t_4)))
(if (<= dY.v 0.10000000149011612)
(if (>= t_3 (pow t_0 2.0))
(* (floor w) (* dX.u (/ 1.0 t_5)))
(* (floor w) (* dY.u (sqrt (/ 1.0 t_4)))))
(if (>= t_3 (pow t_1 2.0))
(/ (floor w) (/ t_5 dX.u))
(* (floor w) (/ dY.u t_5))))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(w) * dY_46_u;
float t_1 = floorf(h) * dY_46_v;
float t_2 = dX_46_v * floorf(h);
float t_3 = powf(t_2, 2.0f);
float t_4 = fmaxf(powf(hypotf((dX_46_u * floorf(w)), t_2), 2.0f), powf(hypotf(t_1, t_0), 2.0f));
float t_5 = sqrtf(t_4);
float tmp_1;
if (dY_46_v <= 0.10000000149011612f) {
float tmp_2;
if (t_3 >= powf(t_0, 2.0f)) {
tmp_2 = floorf(w) * (dX_46_u * (1.0f / t_5));
} else {
tmp_2 = floorf(w) * (dY_46_u * sqrtf((1.0f / t_4)));
}
tmp_1 = tmp_2;
} else if (t_3 >= powf(t_1, 2.0f)) {
tmp_1 = floorf(w) / (t_5 / dX_46_u);
} else {
tmp_1 = floorf(w) * (dY_46_u / t_5);
}
return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(w) * dY_46_u) t_1 = Float32(floor(h) * dY_46_v) t_2 = Float32(dX_46_v * floor(h)) t_3 = t_2 ^ Float32(2.0) t_4 = ((hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0)) != (hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0))) ? (hypot(t_1, t_0) ^ Float32(2.0)) : (((hypot(t_1, t_0) ^ Float32(2.0)) != (hypot(t_1, t_0) ^ Float32(2.0))) ? (hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0)) : max((hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0)), (hypot(t_1, t_0) ^ Float32(2.0)))) t_5 = sqrt(t_4) tmp_1 = Float32(0.0) if (dY_46_v <= Float32(0.10000000149011612)) tmp_2 = Float32(0.0) if (t_3 >= (t_0 ^ Float32(2.0))) tmp_2 = Float32(floor(w) * Float32(dX_46_u * Float32(Float32(1.0) / t_5))); else tmp_2 = Float32(floor(w) * Float32(dY_46_u * sqrt(Float32(Float32(1.0) / t_4)))); end tmp_1 = tmp_2; elseif (t_3 >= (t_1 ^ Float32(2.0))) tmp_1 = Float32(floor(w) / Float32(t_5 / dX_46_u)); else tmp_1 = Float32(floor(w) * Float32(dY_46_u / t_5)); end return tmp_1 end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(w) * dY_46_u; t_1 = floor(h) * dY_46_v; t_2 = dX_46_v * floor(h); t_3 = t_2 ^ single(2.0); t_4 = max((hypot((dX_46_u * floor(w)), t_2) ^ single(2.0)), (hypot(t_1, t_0) ^ single(2.0))); t_5 = sqrt(t_4); tmp_2 = single(0.0); if (dY_46_v <= single(0.10000000149011612)) tmp_3 = single(0.0); if (t_3 >= (t_0 ^ single(2.0))) tmp_3 = floor(w) * (dX_46_u * (single(1.0) / t_5)); else tmp_3 = floor(w) * (dY_46_u * sqrt((single(1.0) / t_4))); end tmp_2 = tmp_3; elseif (t_3 >= (t_1 ^ single(2.0))) tmp_2 = floor(w) / (t_5 / dX_46_u); else tmp_2 = floor(w) * (dY_46_u / t_5); end tmp_4 = tmp_2; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_1 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_2 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_3 := {t\_2}^{2}\\
t_4 := \mathsf{max}\left({\left(\mathsf{hypot}\left(dX.u \cdot \left\lfloor w\right\rfloor , t\_2\right)\right)}^{2}, {\left(\mathsf{hypot}\left(t\_1, t\_0\right)\right)}^{2}\right)\\
t_5 := \sqrt{t\_4}\\
\mathbf{if}\;dY.v \leq 0.10000000149011612:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;t\_3 \geq {t\_0}^{2}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \left(dX.u \cdot \frac{1}{t\_5}\right)\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \left(dY.u \cdot \sqrt{\frac{1}{t\_4}}\right)\\
\end{array}\\
\mathbf{elif}\;t\_3 \geq {t\_1}^{2}:\\
\;\;\;\;\frac{\left\lfloor w\right\rfloor }{\frac{t\_5}{dX.u}}\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \frac{dY.u}{t\_5}\\
\end{array}
\end{array}
if dY.v < 0.100000001Initial program 73.1%
Simplified73.0%
Taylor expanded in w around 0 73.0%
Simplified72.8%
Taylor expanded in dX.u around 0 64.0%
unpow264.0%
unpow264.0%
swap-sqr64.0%
unpow264.0%
Simplified64.0%
sqrt-div64.1%
metadata-eval64.1%
*-commutative64.1%
*-commutative64.1%
Applied egg-rr64.1%
Taylor expanded in dY.v around 0 59.2%
*-commutative65.3%
unpow265.3%
unpow265.3%
swap-sqr65.3%
unpow265.3%
Simplified59.2%
if 0.100000001 < dY.v Initial program 71.8%
Simplified71.8%
Taylor expanded in w around 0 71.6%
Simplified71.8%
Taylor expanded in dX.u around 0 65.2%
unpow265.2%
unpow265.2%
swap-sqr65.2%
unpow265.2%
Simplified65.2%
Taylor expanded in dY.v around inf 65.2%
*-commutative72.0%
unpow272.0%
unpow272.0%
swap-sqr72.0%
unpow272.0%
Simplified65.2%
Taylor expanded in dX.v around 0 65.0%
Simplified65.2%
Final simplification61.1%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor w) dY.u))
(t_1 (* (floor h) dY.v))
(t_2 (* dX.v (floor h)))
(t_3 (pow t_2 2.0))
(t_4
(fmax
(pow (hypot (* dX.u (floor w)) t_2) 2.0)
(pow (hypot t_1 t_0) 2.0)))
(t_5 (sqrt (/ 1.0 t_4)))
(t_6 (sqrt t_4)))
(if (<= dY.v 0.019999999552965164)
(if (>= t_3 (pow t_0 2.0))
(* (floor w) (* dX.u t_5))
(* (floor w) (* dY.u t_5)))
(if (>= t_3 (pow t_1 2.0))
(/ (floor w) (/ t_6 dX.u))
(* (floor w) (/ dY.u t_6))))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(w) * dY_46_u;
float t_1 = floorf(h) * dY_46_v;
float t_2 = dX_46_v * floorf(h);
float t_3 = powf(t_2, 2.0f);
float t_4 = fmaxf(powf(hypotf((dX_46_u * floorf(w)), t_2), 2.0f), powf(hypotf(t_1, t_0), 2.0f));
float t_5 = sqrtf((1.0f / t_4));
float t_6 = sqrtf(t_4);
float tmp_1;
if (dY_46_v <= 0.019999999552965164f) {
float tmp_2;
if (t_3 >= powf(t_0, 2.0f)) {
tmp_2 = floorf(w) * (dX_46_u * t_5);
} else {
tmp_2 = floorf(w) * (dY_46_u * t_5);
}
tmp_1 = tmp_2;
} else if (t_3 >= powf(t_1, 2.0f)) {
tmp_1 = floorf(w) / (t_6 / dX_46_u);
} else {
tmp_1 = floorf(w) * (dY_46_u / t_6);
}
return tmp_1;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(w) * dY_46_u) t_1 = Float32(floor(h) * dY_46_v) t_2 = Float32(dX_46_v * floor(h)) t_3 = t_2 ^ Float32(2.0) t_4 = ((hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0)) != (hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0))) ? (hypot(t_1, t_0) ^ Float32(2.0)) : (((hypot(t_1, t_0) ^ Float32(2.0)) != (hypot(t_1, t_0) ^ Float32(2.0))) ? (hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0)) : max((hypot(Float32(dX_46_u * floor(w)), t_2) ^ Float32(2.0)), (hypot(t_1, t_0) ^ Float32(2.0)))) t_5 = sqrt(Float32(Float32(1.0) / t_4)) t_6 = sqrt(t_4) tmp_1 = Float32(0.0) if (dY_46_v <= Float32(0.019999999552965164)) tmp_2 = Float32(0.0) if (t_3 >= (t_0 ^ Float32(2.0))) tmp_2 = Float32(floor(w) * Float32(dX_46_u * t_5)); else tmp_2 = Float32(floor(w) * Float32(dY_46_u * t_5)); end tmp_1 = tmp_2; elseif (t_3 >= (t_1 ^ Float32(2.0))) tmp_1 = Float32(floor(w) / Float32(t_6 / dX_46_u)); else tmp_1 = Float32(floor(w) * Float32(dY_46_u / t_6)); end return tmp_1 end
function tmp_4 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(w) * dY_46_u; t_1 = floor(h) * dY_46_v; t_2 = dX_46_v * floor(h); t_3 = t_2 ^ single(2.0); t_4 = max((hypot((dX_46_u * floor(w)), t_2) ^ single(2.0)), (hypot(t_1, t_0) ^ single(2.0))); t_5 = sqrt((single(1.0) / t_4)); t_6 = sqrt(t_4); tmp_2 = single(0.0); if (dY_46_v <= single(0.019999999552965164)) tmp_3 = single(0.0); if (t_3 >= (t_0 ^ single(2.0))) tmp_3 = floor(w) * (dX_46_u * t_5); else tmp_3 = floor(w) * (dY_46_u * t_5); end tmp_2 = tmp_3; elseif (t_3 >= (t_1 ^ single(2.0))) tmp_2 = floor(w) / (t_6 / dX_46_u); else tmp_2 = floor(w) * (dY_46_u / t_6); end tmp_4 = tmp_2; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_1 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_2 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_3 := {t\_2}^{2}\\
t_4 := \mathsf{max}\left({\left(\mathsf{hypot}\left(dX.u \cdot \left\lfloor w\right\rfloor , t\_2\right)\right)}^{2}, {\left(\mathsf{hypot}\left(t\_1, t\_0\right)\right)}^{2}\right)\\
t_5 := \sqrt{\frac{1}{t\_4}}\\
t_6 := \sqrt{t\_4}\\
\mathbf{if}\;dY.v \leq 0.019999999552965164:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;t\_3 \geq {t\_0}^{2}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \left(dX.u \cdot t\_5\right)\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \left(dY.u \cdot t\_5\right)\\
\end{array}\\
\mathbf{elif}\;t\_3 \geq {t\_1}^{2}:\\
\;\;\;\;\frac{\left\lfloor w\right\rfloor }{\frac{t\_6}{dX.u}}\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \frac{dY.u}{t\_6}\\
\end{array}
\end{array}
if dY.v < 0.0199999996Initial program 73.1%
Simplified73.0%
Taylor expanded in w around 0 73.0%
Simplified72.8%
Taylor expanded in dX.u around 0 64.0%
unpow264.0%
unpow264.0%
swap-sqr64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in dY.v around 0 59.1%
*-commutative65.3%
unpow265.3%
unpow265.3%
swap-sqr65.3%
unpow265.3%
Simplified59.1%
if 0.0199999996 < dY.v Initial program 71.8%
Simplified71.8%
Taylor expanded in w around 0 71.6%
Simplified71.8%
Taylor expanded in dX.u around 0 65.2%
unpow265.2%
unpow265.2%
swap-sqr65.2%
unpow265.2%
Simplified65.2%
Taylor expanded in dY.v around inf 65.2%
*-commutative72.0%
unpow272.0%
unpow272.0%
swap-sqr72.0%
unpow272.0%
Simplified65.2%
Taylor expanded in dX.v around 0 65.0%
Simplified65.2%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor h) dY.v))
(t_1 (* dX.v (floor h)))
(t_2 (pow (hypot (* dX.u (floor w)) t_1) 2.0))
(t_3 (pow t_0 2.0)))
(if (>= (pow t_1 2.0) t_3)
(* (floor w) (* dX.u (sqrt (/ 1.0 (fmax t_2 t_3)))))
(*
(floor w)
(*
dY.u
(sqrt (/ 1.0 (fmax t_2 (pow (hypot t_0 (* (floor w) dY.u)) 2.0)))))))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(h) * dY_46_v;
float t_1 = dX_46_v * floorf(h);
float t_2 = powf(hypotf((dX_46_u * floorf(w)), t_1), 2.0f);
float t_3 = powf(t_0, 2.0f);
float tmp;
if (powf(t_1, 2.0f) >= t_3) {
tmp = floorf(w) * (dX_46_u * sqrtf((1.0f / fmaxf(t_2, t_3))));
} else {
tmp = floorf(w) * (dY_46_u * sqrtf((1.0f / fmaxf(t_2, powf(hypotf(t_0, (floorf(w) * dY_46_u)), 2.0f)))));
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(h) * dY_46_v) t_1 = Float32(dX_46_v * floor(h)) t_2 = hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0) t_3 = t_0 ^ Float32(2.0) tmp = Float32(0.0) if ((t_1 ^ Float32(2.0)) >= t_3) tmp = Float32(floor(w) * Float32(dX_46_u * sqrt(Float32(Float32(1.0) / ((t_2 != t_2) ? t_3 : ((t_3 != t_3) ? t_2 : max(t_2, t_3))))))); else tmp = Float32(floor(w) * Float32(dY_46_u * sqrt(Float32(Float32(1.0) / ((t_2 != t_2) ? (hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0)) : (((hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0)) != (hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0))) ? t_2 : max(t_2, (hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0))))))))); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(h) * dY_46_v; t_1 = dX_46_v * floor(h); t_2 = hypot((dX_46_u * floor(w)), t_1) ^ single(2.0); t_3 = t_0 ^ single(2.0); tmp = single(0.0); if ((t_1 ^ single(2.0)) >= t_3) tmp = floor(w) * (dX_46_u * sqrt((single(1.0) / max(t_2, t_3)))); else tmp = floor(w) * (dY_46_u * sqrt((single(1.0) / max(t_2, (hypot(t_0, (floor(w) * dY_46_u)) ^ single(2.0)))))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_1 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_2 := {\left(\mathsf{hypot}\left(dX.u \cdot \left\lfloor w\right\rfloor , t\_1\right)\right)}^{2}\\
t_3 := {t\_0}^{2}\\
\mathbf{if}\;{t\_1}^{2} \geq t\_3:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \left(dX.u \cdot \sqrt{\frac{1}{\mathsf{max}\left(t\_2, t\_3\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \left(dY.u \cdot \sqrt{\frac{1}{\mathsf{max}\left(t\_2, {\left(\mathsf{hypot}\left(t\_0, \left\lfloor w\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}}\right)\\
\end{array}
\end{array}
Initial program 72.7%
Simplified72.7%
Taylor expanded in w around 0 72.6%
Simplified72.5%
Taylor expanded in dX.u around 0 64.4%
unpow264.4%
unpow264.4%
swap-sqr64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in dY.v around inf 58.7%
*-commutative63.6%
unpow263.6%
unpow263.6%
swap-sqr63.6%
unpow263.6%
Simplified58.7%
Taylor expanded in dY.v around inf 59.8%
*-commutative63.6%
unpow263.6%
unpow263.6%
swap-sqr63.6%
unpow263.6%
Simplified59.8%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor h) dY.v))
(t_1 (* dX.v (floor h)))
(t_2 (* (floor w) dY.u))
(t_3
(sqrt
(fmax
(pow (hypot (* dX.u (floor w)) t_1) 2.0)
(pow (hypot t_0 t_2) 2.0)))))
(if (>= (pow t_1 2.0) (pow t_0 2.0))
(* dX.u (/ (floor w) t_3))
(/ t_2 t_3))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(h) * dY_46_v;
float t_1 = dX_46_v * floorf(h);
float t_2 = floorf(w) * dY_46_u;
float t_3 = sqrtf(fmaxf(powf(hypotf((dX_46_u * floorf(w)), t_1), 2.0f), powf(hypotf(t_0, t_2), 2.0f)));
float tmp;
if (powf(t_1, 2.0f) >= powf(t_0, 2.0f)) {
tmp = dX_46_u * (floorf(w) / t_3);
} else {
tmp = t_2 / t_3;
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(h) * dY_46_v) t_1 = Float32(dX_46_v * floor(h)) t_2 = Float32(floor(w) * dY_46_u) t_3 = sqrt((((hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)) != (hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0))) ? (hypot(t_0, t_2) ^ Float32(2.0)) : (((hypot(t_0, t_2) ^ Float32(2.0)) != (hypot(t_0, t_2) ^ Float32(2.0))) ? (hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)) : max((hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)), (hypot(t_0, t_2) ^ Float32(2.0)))))) tmp = Float32(0.0) if ((t_1 ^ Float32(2.0)) >= (t_0 ^ Float32(2.0))) tmp = Float32(dX_46_u * Float32(floor(w) / t_3)); else tmp = Float32(t_2 / t_3); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(h) * dY_46_v; t_1 = dX_46_v * floor(h); t_2 = floor(w) * dY_46_u; t_3 = sqrt(max((hypot((dX_46_u * floor(w)), t_1) ^ single(2.0)), (hypot(t_0, t_2) ^ single(2.0)))); tmp = single(0.0); if ((t_1 ^ single(2.0)) >= (t_0 ^ single(2.0))) tmp = dX_46_u * (floor(w) / t_3); else tmp = t_2 / t_3; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_1 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_2 := \left\lfloor w\right\rfloor \cdot dY.u\\
t_3 := \sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.u \cdot \left\lfloor w\right\rfloor , t\_1\right)\right)}^{2}, {\left(\mathsf{hypot}\left(t\_0, t\_2\right)\right)}^{2}\right)}\\
\mathbf{if}\;{t\_1}^{2} \geq {t\_0}^{2}:\\
\;\;\;\;dX.u \cdot \frac{\left\lfloor w\right\rfloor }{t\_3}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{t\_3}\\
\end{array}
\end{array}
Initial program 72.7%
Simplified72.7%
Taylor expanded in w around 0 72.6%
Simplified72.5%
Taylor expanded in dX.u around 0 64.4%
unpow264.4%
unpow264.4%
swap-sqr64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in dY.v around inf 58.7%
*-commutative63.6%
unpow263.6%
unpow263.6%
swap-sqr63.6%
unpow263.6%
Simplified58.7%
Taylor expanded in dX.v around 0 58.8%
Simplified58.9%
Final simplification58.9%
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:precision binary32
(let* ((t_0 (* (floor h) dY.v))
(t_1 (* dX.v (floor h)))
(t_2
(sqrt
(fmax
(pow (hypot (* dX.u (floor w)) t_1) 2.0)
(pow (hypot t_0 (* (floor w) dY.u)) 2.0)))))
(if (>= (pow t_1 2.0) (pow t_0 2.0))
(/ (floor w) (/ t_2 dX.u))
(* (floor w) (/ dY.u t_2)))))
float code(float w, float h, float dX_46_u, float dX_46_v, float dY_46_u, float dY_46_v, float maxAniso) {
float t_0 = floorf(h) * dY_46_v;
float t_1 = dX_46_v * floorf(h);
float t_2 = sqrtf(fmaxf(powf(hypotf((dX_46_u * floorf(w)), t_1), 2.0f), powf(hypotf(t_0, (floorf(w) * dY_46_u)), 2.0f)));
float tmp;
if (powf(t_1, 2.0f) >= powf(t_0, 2.0f)) {
tmp = floorf(w) / (t_2 / dX_46_u);
} else {
tmp = floorf(w) * (dY_46_u / t_2);
}
return tmp;
}
function code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = Float32(floor(h) * dY_46_v) t_1 = Float32(dX_46_v * floor(h)) t_2 = sqrt((((hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)) != (hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0))) ? (hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0)) : (((hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0)) != (hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0))) ? (hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)) : max((hypot(Float32(dX_46_u * floor(w)), t_1) ^ Float32(2.0)), (hypot(t_0, Float32(floor(w) * dY_46_u)) ^ Float32(2.0)))))) tmp = Float32(0.0) if ((t_1 ^ Float32(2.0)) >= (t_0 ^ Float32(2.0))) tmp = Float32(floor(w) / Float32(t_2 / dX_46_u)); else tmp = Float32(floor(w) * Float32(dY_46_u / t_2)); end return tmp end
function tmp_2 = code(w, h, dX_46_u, dX_46_v, dY_46_u, dY_46_v, maxAniso) t_0 = floor(h) * dY_46_v; t_1 = dX_46_v * floor(h); t_2 = sqrt(max((hypot((dX_46_u * floor(w)), t_1) ^ single(2.0)), (hypot(t_0, (floor(w) * dY_46_u)) ^ single(2.0)))); tmp = single(0.0); if ((t_1 ^ single(2.0)) >= (t_0 ^ single(2.0))) tmp = floor(w) / (t_2 / dX_46_u); else tmp = floor(w) * (dY_46_u / t_2); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left\lfloor h\right\rfloor \cdot dY.v\\
t_1 := dX.v \cdot \left\lfloor h\right\rfloor \\
t_2 := \sqrt{\mathsf{max}\left({\left(\mathsf{hypot}\left(dX.u \cdot \left\lfloor w\right\rfloor , t\_1\right)\right)}^{2}, {\left(\mathsf{hypot}\left(t\_0, \left\lfloor w\right\rfloor \cdot dY.u\right)\right)}^{2}\right)}\\
\mathbf{if}\;{t\_1}^{2} \geq {t\_0}^{2}:\\
\;\;\;\;\frac{\left\lfloor w\right\rfloor }{\frac{t\_2}{dX.u}}\\
\mathbf{else}:\\
\;\;\;\;\left\lfloor w\right\rfloor \cdot \frac{dY.u}{t\_2}\\
\end{array}
\end{array}
Initial program 72.7%
Simplified72.7%
Taylor expanded in w around 0 72.6%
Simplified72.5%
Taylor expanded in dX.u around 0 64.4%
unpow264.4%
unpow264.4%
swap-sqr64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in dY.v around inf 58.7%
*-commutative63.6%
unpow263.6%
unpow263.6%
swap-sqr63.6%
unpow263.6%
Simplified58.7%
Taylor expanded in dX.v around 0 58.8%
Simplified58.9%
herbie shell --seed 2024182
(FPCore (w h dX.u dX.v dY.u dY.v maxAniso)
:name "Anisotropic x16 LOD (line direction, u)"
:precision binary32
:pre (and (and (and (and (and (and (and (<= 1.0 w) (<= w 16384.0)) (and (<= 1.0 h) (<= h 16384.0))) (and (<= 1e-20 (fabs dX.u)) (<= (fabs dX.u) 1e+20))) (and (<= 1e-20 (fabs dX.v)) (<= (fabs dX.v) 1e+20))) (and (<= 1e-20 (fabs dY.u)) (<= (fabs dY.u) 1e+20))) (and (<= 1e-20 (fabs dY.v)) (<= (fabs dY.v) 1e+20))) (== maxAniso 16.0))
(if (>= (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v)))) (* (/ 1.0 (sqrt (fmax (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v)))))) (* (floor w) dX.u)) (* (/ 1.0 (sqrt (fmax (+ (* (* (floor w) dX.u) (* (floor w) dX.u)) (* (* (floor h) dX.v) (* (floor h) dX.v))) (+ (* (* (floor w) dY.u) (* (floor w) dY.u)) (* (* (floor h) dY.v) (* (floor h) dY.v)))))) (* (floor w) dY.u))))