\[\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}
\]
↓
\[\frac{1}{\frac{\sqrt{3}}{\mathsf{hypot}\left(x, \mathsf{hypot}\left(y, z\right)\right)}}
\]
(FPCore (x y z)
:precision binary64
(sqrt (/ (+ (+ (* x x) (* y y)) (* z z)) 3.0)))
↓
(FPCore (x y z)
:precision binary64
(/ 1.0 (/ (sqrt 3.0) (hypot x (hypot y z)))))
double code(double x, double y, double z) {
return sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
}
↓
double code(double x, double y, double z) {
return 1.0 / (sqrt(3.0) / hypot(x, hypot(y, z)));
}
public static double code(double x, double y, double z) {
return Math.sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
}
↓
public static double code(double x, double y, double z) {
return 1.0 / (Math.sqrt(3.0) / Math.hypot(x, Math.hypot(y, z)));
}
def code(x, y, z):
return math.sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0))
↓
def code(x, y, z):
return 1.0 / (math.sqrt(3.0) / math.hypot(x, math.hypot(y, z)))
function code(x, y, z)
return sqrt(Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) + Float64(z * z)) / 3.0))
end
↓
function code(x, y, z)
return Float64(1.0 / Float64(sqrt(3.0) / hypot(x, hypot(y, z))))
end
function tmp = code(x, y, z)
tmp = sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
end
↓
function tmp = code(x, y, z)
tmp = 1.0 / (sqrt(3.0) / hypot(x, hypot(y, z)));
end
code[x_, y_, z_] := N[Sqrt[N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]], $MachinePrecision]
↓
code[x_, y_, z_] := N[(1.0 / N[(N[Sqrt[3.0], $MachinePrecision] / N[Sqrt[x ^ 2 + N[Sqrt[y ^ 2 + z ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}
↓
\frac{1}{\frac{\sqrt{3}}{\mathsf{hypot}\left(x, \mathsf{hypot}\left(y, z\right)\right)}}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 19520 |
|---|
\[\frac{\mathsf{hypot}\left(x, \mathsf{hypot}\left(y, z\right)\right)}{\sqrt{3}}
\]
| Alternative 2 |
|---|
| Error | 42.4 |
|---|
| Cost | 13320 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq 3.8210762002133727 \cdot 10^{-28}:\\
\;\;\;\;\frac{-0.5 \cdot \left(y \cdot \frac{y}{x}\right) - x}{\sqrt{3}}\\
\mathbf{elif}\;z \leq 6.250342313438228 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{hypot}\left(z, y\right)}{\sqrt{3}}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 16.5 |
|---|
| Cost | 13320 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq 3.8210762002133727 \cdot 10^{-28}:\\
\;\;\;\;\frac{\mathsf{hypot}\left(y, x\right)}{\sqrt{3}}\\
\mathbf{elif}\;z \leq 6.250342313438228 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{hypot}\left(z, y\right)}{\sqrt{3}}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 20.8 |
|---|
| Cost | 13056 |
|---|
\[\sqrt{0.3333333333333333} \cdot \mathsf{hypot}\left(z, x\right)
\]
| Alternative 5 |
|---|
| Error | 45.3 |
|---|
| Cost | 7764 |
|---|
\[\begin{array}{l}
t_0 := \frac{z}{\sqrt{3}}\\
\mathbf{if}\;z \leq 1027893.9002576969:\\
\;\;\;\;\frac{1}{\frac{\sqrt{3}}{-x}}\\
\mathbf{elif}\;z \leq 1.8573995064406585 \cdot 10^{+32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.2867170564516421 \cdot 10^{+56}:\\
\;\;\;\;\frac{-x}{\sqrt{3}}\\
\mathbf{elif}\;z \leq 1.8184327216002477 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\frac{z \cdot z}{3}}\\
\mathbf{elif}\;z \leq 3.8347126517875565 \cdot 10^{+129}:\\
\;\;\;\;\sqrt{0.3333333333333333} \cdot \left(z \cdot \frac{z}{\frac{x}{-0.5}} - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 45.6 |
|---|
| Cost | 7764 |
|---|
\[\begin{array}{l}
t_0 := \frac{z}{\sqrt{3}}\\
\mathbf{if}\;z \leq 1027893.9002576969:\\
\;\;\;\;\frac{-0.5 \cdot \left(y \cdot \frac{y}{x}\right) - x}{\sqrt{3}}\\
\mathbf{elif}\;z \leq 1.8573995064406585 \cdot 10^{+32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.2867170564516421 \cdot 10^{+56}:\\
\;\;\;\;\frac{-x}{\sqrt{3}}\\
\mathbf{elif}\;z \leq 1.8184327216002477 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\frac{z \cdot z}{3}}\\
\mathbf{elif}\;z \leq 3.8347126517875565 \cdot 10^{+129}:\\
\;\;\;\;\sqrt{0.3333333333333333} \cdot \left(z \cdot \frac{z}{\frac{x}{-0.5}} - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 43.2 |
|---|
| Cost | 7496 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq 3.8210762002133727 \cdot 10^{-28}:\\
\;\;\;\;\frac{-0.5 \cdot \left(y \cdot \frac{y}{x}\right) - x}{\sqrt{3}}\\
\mathbf{elif}\;z \leq 6.250342313438228 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\sqrt{3}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 45.3 |
|---|
| Cost | 7316 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{\sqrt{3}}\\
t_1 := \frac{z}{\sqrt{3}}\\
\mathbf{if}\;z \leq 1027893.9002576969:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.8573995064406585 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.2867170564516421 \cdot 10^{+56}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.8184327216002477 \cdot 10^{+118}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8347126517875565 \cdot 10^{+129}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 45.3 |
|---|
| Cost | 7316 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{\sqrt{3}}\\
t_1 := \frac{z}{\sqrt{3}}\\
\mathbf{if}\;z \leq 1027893.9002576969:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.8573995064406585 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.2867170564516421 \cdot 10^{+56}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.8184327216002477 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\frac{z \cdot z}{3}}\\
\mathbf{elif}\;z \leq 3.8347126517875565 \cdot 10^{+129}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 45.3 |
|---|
| Cost | 7316 |
|---|
\[\begin{array}{l}
t_0 := \frac{z}{\sqrt{3}}\\
t_1 := \frac{-x}{\sqrt{3}}\\
\mathbf{if}\;z \leq 1027893.9002576969:\\
\;\;\;\;\frac{1}{\frac{\sqrt{3}}{-x}}\\
\mathbf{elif}\;z \leq 1.8573995064406585 \cdot 10^{+32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.2867170564516421 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8184327216002477 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\frac{z \cdot z}{3}}\\
\mathbf{elif}\;z \leq 3.8347126517875565 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 52.5 |
|---|
| Cost | 6592 |
|---|
\[\frac{z}{\sqrt{3}}
\]