
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
double code(double x, double y, double z) {
return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0 * sqrt((((x * y) + (x * z)) + (y * z)))
end function
public static double code(double x, double y, double z) {
return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
def code(x, y, z): return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
function code(x, y, z) return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z)))) end
function tmp = code(x, y, z) tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z))); end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
double code(double x, double y, double z) {
return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0 * sqrt((((x * y) + (x * z)) + (y * z)))
end function
public static double code(double x, double y, double z) {
return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
def code(x, y, z): return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
function code(x, y, z) return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z)))) end
function tmp = code(x, y, z) tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z))); end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\end{array}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (log (- (- y) z)) (log (/ -1.0 x)))))
(if (<= y -6.1e+36)
(* 2.0 (pow (exp (* 0.25 t_0)) 2.0))
(if (<= y -5.6e-192)
(* 2.0 (sqrt (* x (+ y z))))
(if (<= y -5.2e-306)
(* 2.0 (/ 1.0 (pow (exp -0.5) t_0)))
(* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double t_0 = log((-y - z)) - log((-1.0 / x));
double tmp;
if (y <= -6.1e+36) {
tmp = 2.0 * pow(exp((0.25 * t_0)), 2.0);
} else if (y <= -5.6e-192) {
tmp = 2.0 * sqrt((x * (y + z)));
} else if (y <= -5.2e-306) {
tmp = 2.0 * (1.0 / pow(exp(-0.5), t_0));
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = log((-y - z)) - log(((-1.0d0) / x))
if (y <= (-6.1d+36)) then
tmp = 2.0d0 * (exp((0.25d0 * t_0)) ** 2.0d0)
else if (y <= (-5.6d-192)) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else if (y <= (-5.2d-306)) then
tmp = 2.0d0 * (1.0d0 / (exp((-0.5d0)) ** t_0))
else
tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double t_0 = Math.log((-y - z)) - Math.log((-1.0 / x));
double tmp;
if (y <= -6.1e+36) {
tmp = 2.0 * Math.pow(Math.exp((0.25 * t_0)), 2.0);
} else if (y <= -5.6e-192) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else if (y <= -5.2e-306) {
tmp = 2.0 * (1.0 / Math.pow(Math.exp(-0.5), t_0));
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): t_0 = math.log((-y - z)) - math.log((-1.0 / x)) tmp = 0 if y <= -6.1e+36: tmp = 2.0 * math.pow(math.exp((0.25 * t_0)), 2.0) elif y <= -5.6e-192: tmp = 2.0 * math.sqrt((x * (y + z))) elif y <= -5.2e-306: tmp = 2.0 * (1.0 / math.pow(math.exp(-0.5), t_0)) else: tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) t_0 = Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))) tmp = 0.0 if (y <= -6.1e+36) tmp = Float64(2.0 * (exp(Float64(0.25 * t_0)) ^ 2.0)); elseif (y <= -5.6e-192) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); elseif (y <= -5.2e-306) tmp = Float64(2.0 * Float64(1.0 / (exp(-0.5) ^ t_0))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
t_0 = log((-y - z)) - log((-1.0 / x));
tmp = 0.0;
if (y <= -6.1e+36)
tmp = 2.0 * (exp((0.25 * t_0)) ^ 2.0);
elseif (y <= -5.6e-192)
tmp = 2.0 * sqrt((x * (y + z)));
elseif (y <= -5.2e-306)
tmp = 2.0 * (1.0 / (exp(-0.5) ^ t_0));
else
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.1e+36], N[(2.0 * N[Power[N[Exp[N[(0.25 * t$95$0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.6e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-306], N[(2.0 * N[(1.0 / N[Power[N[Exp[-0.5], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := \log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{+36}:\\
\;\;\;\;2 \cdot {\left(e^{0.25 \cdot t_0}\right)}^{2}\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-306}:\\
\;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{t_0}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -6.1e36Initial program 55.6%
distribute-lft-out55.7%
Simplified55.7%
add-sqr-sqrt55.4%
pow255.4%
pow1/255.4%
sqrt-pow155.4%
fma-def56.1%
metadata-eval56.1%
Applied egg-rr56.1%
Taylor expanded in x around -inf 47.5%
if -6.1e36 < y < -5.60000000000000007e-192Initial program 85.4%
distribute-lft-out85.4%
Simplified85.4%
Taylor expanded in x around inf 52.8%
if -5.60000000000000007e-192 < y < -5.2000000000000001e-306Initial program 74.3%
distribute-lft-out74.3%
Simplified74.3%
flip-+58.7%
clear-num58.7%
pow258.7%
pow258.7%
Applied egg-rr58.7%
inv-pow58.7%
sqrt-pow158.7%
clear-num58.7%
unpow258.7%
unpow258.7%
flip-+72.3%
fma-udef72.3%
metadata-eval72.3%
Applied egg-rr72.3%
fma-def72.3%
+-commutative72.3%
fma-udef72.3%
Simplified72.3%
add-sqr-sqrt71.7%
unpow-prod-down71.6%
inv-pow71.6%
sqrt-pow171.5%
metadata-eval71.5%
inv-pow71.5%
sqrt-pow173.8%
metadata-eval73.8%
Applied egg-rr73.8%
pow-sqr74.1%
metadata-eval74.1%
unpow-174.1%
fma-udef74.1%
*-commutative74.1%
*-commutative74.1%
fma-def74.1%
*-commutative74.1%
+-commutative74.1%
Simplified74.1%
Taylor expanded in x around -inf 42.4%
exp-prod42.4%
+-commutative42.4%
mul-1-neg42.4%
unsub-neg42.4%
distribute-lft-in42.4%
mul-1-neg42.4%
unsub-neg42.4%
mul-1-neg42.4%
Simplified42.4%
if -5.2000000000000001e-306 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
add-sqr-sqrt69.0%
pow269.0%
pow1/269.0%
sqrt-pow169.1%
fma-def69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in z around inf 42.7%
pow-pow42.9%
metadata-eval42.9%
pow1/242.9%
sqrt-prod54.7%
Applied egg-rr54.7%
Final simplification51.3%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (log (- (- y) z)) (log (/ -1.0 x)))))
(if (<= y -2.6e+39)
(* 2.0 (/ 1.0 (exp (* t_0 -0.5))))
(if (<= y -6.5e-192)
(* 2.0 (sqrt (* x (+ y z))))
(if (<= y -1.1e-302)
(* 2.0 (/ 1.0 (pow (exp -0.5) t_0)))
(* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double t_0 = log((-y - z)) - log((-1.0 / x));
double tmp;
if (y <= -2.6e+39) {
tmp = 2.0 * (1.0 / exp((t_0 * -0.5)));
} else if (y <= -6.5e-192) {
tmp = 2.0 * sqrt((x * (y + z)));
} else if (y <= -1.1e-302) {
tmp = 2.0 * (1.0 / pow(exp(-0.5), t_0));
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = log((-y - z)) - log(((-1.0d0) / x))
if (y <= (-2.6d+39)) then
tmp = 2.0d0 * (1.0d0 / exp((t_0 * (-0.5d0))))
else if (y <= (-6.5d-192)) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else if (y <= (-1.1d-302)) then
tmp = 2.0d0 * (1.0d0 / (exp((-0.5d0)) ** t_0))
else
tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double t_0 = Math.log((-y - z)) - Math.log((-1.0 / x));
double tmp;
if (y <= -2.6e+39) {
tmp = 2.0 * (1.0 / Math.exp((t_0 * -0.5)));
} else if (y <= -6.5e-192) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else if (y <= -1.1e-302) {
tmp = 2.0 * (1.0 / Math.pow(Math.exp(-0.5), t_0));
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): t_0 = math.log((-y - z)) - math.log((-1.0 / x)) tmp = 0 if y <= -2.6e+39: tmp = 2.0 * (1.0 / math.exp((t_0 * -0.5))) elif y <= -6.5e-192: tmp = 2.0 * math.sqrt((x * (y + z))) elif y <= -1.1e-302: tmp = 2.0 * (1.0 / math.pow(math.exp(-0.5), t_0)) else: tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) t_0 = Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))) tmp = 0.0 if (y <= -2.6e+39) tmp = Float64(2.0 * Float64(1.0 / exp(Float64(t_0 * -0.5)))); elseif (y <= -6.5e-192) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); elseif (y <= -1.1e-302) tmp = Float64(2.0 * Float64(1.0 / (exp(-0.5) ^ t_0))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
t_0 = log((-y - z)) - log((-1.0 / x));
tmp = 0.0;
if (y <= -2.6e+39)
tmp = 2.0 * (1.0 / exp((t_0 * -0.5)));
elseif (y <= -6.5e-192)
tmp = 2.0 * sqrt((x * (y + z)));
elseif (y <= -1.1e-302)
tmp = 2.0 * (1.0 / (exp(-0.5) ^ t_0));
else
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+39], N[(2.0 * N[(1.0 / N[Exp[N[(t$95$0 * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.5e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.1e-302], N[(2.0 * N[(1.0 / N[Power[N[Exp[-0.5], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := \log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+39}:\\
\;\;\;\;2 \cdot \frac{1}{e^{t_0 \cdot -0.5}}\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-302}:\\
\;\;\;\;2 \cdot \frac{1}{{\left(e^{-0.5}\right)}^{t_0}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -2.6e39Initial program 55.6%
distribute-lft-out55.7%
Simplified55.7%
flip-+21.4%
clear-num21.4%
pow221.4%
pow221.4%
Applied egg-rr21.4%
inv-pow21.4%
sqrt-pow121.4%
clear-num21.4%
unpow221.4%
unpow221.4%
flip-+55.8%
fma-udef56.5%
metadata-eval56.5%
Applied egg-rr56.5%
fma-def55.8%
+-commutative55.8%
fma-udef56.5%
Simplified56.5%
add-sqr-sqrt56.4%
unpow-prod-down56.1%
inv-pow56.1%
sqrt-pow156.2%
metadata-eval56.2%
inv-pow56.2%
sqrt-pow156.1%
metadata-eval56.1%
Applied egg-rr56.1%
pow-sqr56.4%
metadata-eval56.4%
unpow-156.4%
fma-udef55.7%
*-commutative55.7%
*-commutative55.7%
fma-def56.4%
*-commutative56.4%
+-commutative56.4%
Simplified56.4%
Taylor expanded in x around -inf 47.5%
if -2.6e39 < y < -6.49999999999999966e-192Initial program 85.4%
distribute-lft-out85.4%
Simplified85.4%
Taylor expanded in x around inf 52.8%
if -6.49999999999999966e-192 < y < -1.10000000000000004e-302Initial program 75.7%
distribute-lft-out75.7%
Simplified75.7%
flip-+59.3%
clear-num59.3%
pow259.3%
pow259.3%
Applied egg-rr59.3%
inv-pow59.3%
sqrt-pow159.3%
clear-num59.3%
unpow259.3%
unpow259.3%
flip-+73.7%
fma-udef73.7%
metadata-eval73.7%
Applied egg-rr73.7%
fma-def73.7%
+-commutative73.7%
fma-udef73.7%
Simplified73.7%
add-sqr-sqrt73.2%
unpow-prod-down73.1%
inv-pow73.1%
sqrt-pow173.0%
metadata-eval73.0%
inv-pow73.0%
sqrt-pow175.2%
metadata-eval75.2%
Applied egg-rr75.2%
pow-sqr75.6%
metadata-eval75.6%
unpow-175.6%
fma-udef75.6%
*-commutative75.6%
*-commutative75.6%
fma-def75.6%
*-commutative75.6%
+-commutative75.6%
Simplified75.6%
Taylor expanded in x around -inf 42.3%
exp-prod42.3%
+-commutative42.3%
mul-1-neg42.3%
unsub-neg42.3%
distribute-lft-in42.3%
mul-1-neg42.3%
unsub-neg42.3%
mul-1-neg42.3%
Simplified42.3%
if -1.10000000000000004e-302 < y Initial program 69.1%
distribute-lft-out69.1%
Simplified69.1%
add-sqr-sqrt68.8%
pow268.8%
pow1/268.8%
sqrt-pow168.8%
fma-def69.2%
metadata-eval69.2%
Applied egg-rr69.2%
Taylor expanded in z around inf 42.8%
pow-pow43.0%
metadata-eval43.0%
pow1/243.0%
sqrt-prod54.6%
Applied egg-rr54.6%
Final simplification51.4%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
2.0
(/ 1.0 (exp (* (- (log (- (- y) z)) (log (/ -1.0 x))) -0.5))))))
(if (<= y -2.85e+38)
t_0
(if (<= y -5.6e-192)
(* 2.0 (sqrt (* x (+ y z))))
(if (<= y 4.3e-308) t_0 (* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double t_0 = 2.0 * (1.0 / exp(((log((-y - z)) - log((-1.0 / x))) * -0.5)));
double tmp;
if (y <= -2.85e+38) {
tmp = t_0;
} else if (y <= -5.6e-192) {
tmp = 2.0 * sqrt((x * (y + z)));
} else if (y <= 4.3e-308) {
tmp = t_0;
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 * (1.0d0 / exp(((log((-y - z)) - log(((-1.0d0) / x))) * (-0.5d0))))
if (y <= (-2.85d+38)) then
tmp = t_0
else if (y <= (-5.6d-192)) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else if (y <= 4.3d-308) then
tmp = t_0
else
tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double t_0 = 2.0 * (1.0 / Math.exp(((Math.log((-y - z)) - Math.log((-1.0 / x))) * -0.5)));
double tmp;
if (y <= -2.85e+38) {
tmp = t_0;
} else if (y <= -5.6e-192) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else if (y <= 4.3e-308) {
tmp = t_0;
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): t_0 = 2.0 * (1.0 / math.exp(((math.log((-y - z)) - math.log((-1.0 / x))) * -0.5))) tmp = 0 if y <= -2.85e+38: tmp = t_0 elif y <= -5.6e-192: tmp = 2.0 * math.sqrt((x * (y + z))) elif y <= 4.3e-308: tmp = t_0 else: tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) t_0 = Float64(2.0 * Float64(1.0 / exp(Float64(Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))) * -0.5)))) tmp = 0.0 if (y <= -2.85e+38) tmp = t_0; elseif (y <= -5.6e-192) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); elseif (y <= 4.3e-308) tmp = t_0; else tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
t_0 = 2.0 * (1.0 / exp(((log((-y - z)) - log((-1.0 / x))) * -0.5)));
tmp = 0.0;
if (y <= -2.85e+38)
tmp = t_0;
elseif (y <= -5.6e-192)
tmp = 2.0 * sqrt((x * (y + z)));
elseif (y <= 4.3e-308)
tmp = t_0;
else
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(2.0 * N[(1.0 / N[Exp[N[(N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.85e+38], t$95$0, If[LessEqual[y, -5.6e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e-308], t$95$0, N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := 2 \cdot \frac{1}{e^{\left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right) \cdot -0.5}}\\
\mathbf{if}\;y \leq -2.85 \cdot 10^{+38}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-308}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -2.8499999999999999e38 or -5.60000000000000007e-192 < y < 4.3000000000000002e-308Initial program 62.4%
distribute-lft-out62.5%
Simplified62.5%
flip-+35.0%
clear-num35.0%
pow235.0%
pow235.0%
Applied egg-rr35.0%
inv-pow35.0%
sqrt-pow135.0%
clear-num35.0%
unpow235.0%
unpow235.0%
flip-+61.8%
fma-udef62.3%
metadata-eval62.3%
Applied egg-rr62.3%
fma-def61.8%
+-commutative61.8%
fma-udef62.3%
Simplified62.3%
add-sqr-sqrt62.0%
unpow-prod-down61.8%
inv-pow61.8%
sqrt-pow161.8%
metadata-eval61.8%
inv-pow61.8%
sqrt-pow162.5%
metadata-eval62.5%
Applied egg-rr62.5%
pow-sqr62.9%
metadata-eval62.9%
unpow-162.9%
fma-udef62.4%
*-commutative62.4%
*-commutative62.4%
fma-def62.9%
*-commutative62.9%
+-commutative62.9%
Simplified62.9%
Taylor expanded in x around -inf 45.6%
if -2.8499999999999999e38 < y < -5.60000000000000007e-192Initial program 85.4%
distribute-lft-out85.4%
Simplified85.4%
Taylor expanded in x around inf 52.8%
if 4.3000000000000002e-308 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
add-sqr-sqrt69.0%
pow269.0%
pow1/269.0%
sqrt-pow169.1%
fma-def69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in z around inf 42.7%
pow-pow42.9%
metadata-eval42.9%
pow1/242.9%
sqrt-prod54.7%
Applied egg-rr54.7%
Final simplification51.3%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0
(* 2.0 (exp (* -0.5 (+ (log (/ -1.0 x)) (log (/ -1.0 (+ y z)))))))))
(if (<= y -7.5e+36)
t_0
(if (<= y -5.6e-192)
(* 2.0 (sqrt (* x (+ y z))))
(if (<= y -3.4e-301) t_0 (* 2.0 (* (sqrt (+ y x)) (sqrt z))))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double t_0 = 2.0 * exp((-0.5 * (log((-1.0 / x)) + log((-1.0 / (y + z))))));
double tmp;
if (y <= -7.5e+36) {
tmp = t_0;
} else if (y <= -5.6e-192) {
tmp = 2.0 * sqrt((x * (y + z)));
} else if (y <= -3.4e-301) {
tmp = t_0;
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 * exp(((-0.5d0) * (log(((-1.0d0) / x)) + log(((-1.0d0) / (y + z))))))
if (y <= (-7.5d+36)) then
tmp = t_0
else if (y <= (-5.6d-192)) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else if (y <= (-3.4d-301)) then
tmp = t_0
else
tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double t_0 = 2.0 * Math.exp((-0.5 * (Math.log((-1.0 / x)) + Math.log((-1.0 / (y + z))))));
double tmp;
if (y <= -7.5e+36) {
tmp = t_0;
} else if (y <= -5.6e-192) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else if (y <= -3.4e-301) {
tmp = t_0;
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): t_0 = 2.0 * math.exp((-0.5 * (math.log((-1.0 / x)) + math.log((-1.0 / (y + z)))))) tmp = 0 if y <= -7.5e+36: tmp = t_0 elif y <= -5.6e-192: tmp = 2.0 * math.sqrt((x * (y + z))) elif y <= -3.4e-301: tmp = t_0 else: tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) t_0 = Float64(2.0 * exp(Float64(-0.5 * Float64(log(Float64(-1.0 / x)) + log(Float64(-1.0 / Float64(y + z))))))) tmp = 0.0 if (y <= -7.5e+36) tmp = t_0; elseif (y <= -5.6e-192) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); elseif (y <= -3.4e-301) tmp = t_0; else tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
t_0 = 2.0 * exp((-0.5 * (log((-1.0 / x)) + log((-1.0 / (y + z))))));
tmp = 0.0;
if (y <= -7.5e+36)
tmp = t_0;
elseif (y <= -5.6e-192)
tmp = 2.0 * sqrt((x * (y + z)));
elseif (y <= -3.4e-301)
tmp = t_0;
else
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(2.0 * N[Exp[N[(-0.5 * N[(N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Log[N[(-1.0 / N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+36], t$95$0, If[LessEqual[y, -5.6e-192], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.4e-301], t$95$0, N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := 2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y + z}\right)\right)}\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-301}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -7.50000000000000054e36 or -5.60000000000000007e-192 < y < -3.4000000000000002e-301Initial program 63.3%
distribute-lft-out63.4%
Simplified63.4%
flip-+35.0%
clear-num35.1%
pow235.1%
pow235.1%
Applied egg-rr35.1%
inv-pow35.1%
sqrt-pow135.1%
clear-num35.1%
unpow235.1%
unpow235.1%
flip-+62.7%
fma-udef63.2%
metadata-eval63.2%
Applied egg-rr63.2%
fma-def62.7%
+-commutative62.7%
fma-udef63.2%
Simplified63.2%
Taylor expanded in x around -inf 46.2%
if -7.50000000000000054e36 < y < -5.60000000000000007e-192Initial program 85.4%
distribute-lft-out85.4%
Simplified85.4%
Taylor expanded in x around inf 52.8%
if -3.4000000000000002e-301 < y Initial program 68.6%
distribute-lft-out68.6%
Simplified68.6%
add-sqr-sqrt68.3%
pow268.3%
pow1/268.3%
sqrt-pow168.3%
fma-def68.7%
metadata-eval68.7%
Applied egg-rr68.7%
Taylor expanded in z around inf 42.5%
pow-pow42.7%
metadata-eval42.7%
pow1/242.7%
sqrt-prod55.0%
Applied egg-rr55.0%
Final simplification51.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (<= y -3.4e+37)
(* 2.0 (exp (* -0.5 (+ (log (/ -1.0 x)) (log (/ -1.0 y))))))
(if (<= y 9.2e-301)
(* 2.0 (sqrt (* x (+ y z))))
(* 2.0 (* (sqrt (+ y x)) (sqrt z))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -3.4e+37) {
tmp = 2.0 * exp((-0.5 * (log((-1.0 / x)) + log((-1.0 / y)))));
} else if (y <= 9.2e-301) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-3.4d+37)) then
tmp = 2.0d0 * exp(((-0.5d0) * (log(((-1.0d0) / x)) + log(((-1.0d0) / y)))))
else if (y <= 9.2d-301) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.4e+37) {
tmp = 2.0 * Math.exp((-0.5 * (Math.log((-1.0 / x)) + Math.log((-1.0 / y)))));
} else if (y <= 9.2e-301) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -3.4e+37: tmp = 2.0 * math.exp((-0.5 * (math.log((-1.0 / x)) + math.log((-1.0 / y))))) elif y <= 9.2e-301: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -3.4e+37) tmp = Float64(2.0 * exp(Float64(-0.5 * Float64(log(Float64(-1.0 / x)) + log(Float64(-1.0 / y)))))); elseif (y <= 9.2e-301) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -3.4e+37)
tmp = 2.0 * exp((-0.5 * (log((-1.0 / x)) + log((-1.0 / y)))));
elseif (y <= 9.2e-301)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -3.4e+37], N[(2.0 * N[Exp[N[(-0.5 * N[(N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Log[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-301], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+37}:\\
\;\;\;\;2 \cdot e^{-0.5 \cdot \left(\log \left(\frac{-1}{x}\right) + \log \left(\frac{-1}{y}\right)\right)}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-301}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -3.40000000000000006e37Initial program 55.6%
distribute-lft-out55.7%
Simplified55.7%
flip-+21.4%
clear-num21.4%
pow221.4%
pow221.4%
Applied egg-rr21.4%
inv-pow21.4%
sqrt-pow121.4%
clear-num21.4%
unpow221.4%
unpow221.4%
flip-+55.8%
fma-udef56.5%
metadata-eval56.5%
Applied egg-rr56.5%
fma-def55.8%
+-commutative55.8%
fma-udef56.5%
Simplified56.5%
Taylor expanded in x around -inf 47.5%
Taylor expanded in y around inf 0.0%
+-commutative0.0%
log-rec0.0%
sub-neg0.0%
log-div45.3%
Simplified45.3%
if -3.40000000000000006e37 < y < 9.2000000000000007e-301Initial program 80.9%
distribute-lft-out80.9%
Simplified80.9%
Taylor expanded in x around inf 59.1%
if 9.2000000000000007e-301 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
add-sqr-sqrt69.0%
pow269.0%
pow1/269.0%
sqrt-pow169.1%
fma-def69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in z around inf 42.7%
pow-pow42.9%
metadata-eval42.9%
pow1/242.9%
sqrt-prod54.7%
Applied egg-rr54.7%
Final simplification54.1%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 9.2e-301) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (* (sqrt (+ y x)) (sqrt z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= 9.2e-301) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 9.2d-301) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt((y + x)) * sqrt(z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 9.2e-301) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= 9.2e-301: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt((y + x)) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= 9.2e-301) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 9.2e-301)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 9.2e-301], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-301}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 9.2000000000000007e-301Initial program 70.5%
distribute-lft-out70.6%
Simplified70.6%
Taylor expanded in x around inf 47.1%
if 9.2000000000000007e-301 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
add-sqr-sqrt69.0%
pow269.0%
pow1/269.0%
sqrt-pow169.1%
fma-def69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in z around inf 42.7%
pow-pow42.9%
metadata-eval42.9%
pow1/242.9%
sqrt-prod54.7%
Applied egg-rr54.7%
Final simplification50.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 9.2e-301) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (* (sqrt z) (sqrt y)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= 9.2e-301) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt(z) * sqrt(y));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 9.2d-301) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt(z) * sqrt(y))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 9.2e-301) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt(z) * Math.sqrt(y));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= 9.2e-301: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt(z) * math.sqrt(y)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= 9.2e-301) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(z) * sqrt(y))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 9.2e-301)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt(z) * sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 9.2e-301], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[z], $MachinePrecision] * N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-301}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\end{array}
\end{array}
if y < 9.2000000000000007e-301Initial program 70.5%
distribute-lft-out70.6%
Simplified70.6%
Taylor expanded in x around inf 47.1%
if 9.2000000000000007e-301 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
Taylor expanded in x around 0 19.7%
*-commutative19.7%
sqrt-prod34.7%
Applied egg-rr34.7%
Final simplification41.0%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (+ (+ (* y x) (* x z)) (* y z)) 5e+264) (* 2.0 (sqrt (+ (* y z) (* x (+ y z))))) (* 2.0 (pow (/ (/ -1.0 y) (- (- z) x)) -0.5))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if ((((y * x) + (x * z)) + (y * z)) <= 5e+264) {
tmp = 2.0 * sqrt(((y * z) + (x * (y + z))));
} else {
tmp = 2.0 * pow(((-1.0 / y) / (-z - x)), -0.5);
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((((y * x) + (x * z)) + (y * z)) <= 5d+264) then
tmp = 2.0d0 * sqrt(((y * z) + (x * (y + z))))
else
tmp = 2.0d0 * ((((-1.0d0) / y) / (-z - x)) ** (-0.5d0))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if ((((y * x) + (x * z)) + (y * z)) <= 5e+264) {
tmp = 2.0 * Math.sqrt(((y * z) + (x * (y + z))));
} else {
tmp = 2.0 * Math.pow(((-1.0 / y) / (-z - x)), -0.5);
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if (((y * x) + (x * z)) + (y * z)) <= 5e+264: tmp = 2.0 * math.sqrt(((y * z) + (x * (y + z)))) else: tmp = 2.0 * math.pow(((-1.0 / y) / (-z - x)), -0.5) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(y * x) + Float64(x * z)) + Float64(y * z)) <= 5e+264) tmp = Float64(2.0 * sqrt(Float64(Float64(y * z) + Float64(x * Float64(y + z))))); else tmp = Float64(2.0 * (Float64(Float64(-1.0 / y) / Float64(Float64(-z) - x)) ^ -0.5)); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((((y * x) + (x * z)) + (y * z)) <= 5e+264)
tmp = 2.0 * sqrt(((y * z) + (x * (y + z))));
else
tmp = 2.0 * (((-1.0 / y) / (-z - x)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(N[(N[(y * x), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], 5e+264], N[(2.0 * N[Sqrt[N[(N[(y * z), $MachinePrecision] + N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Power[N[(N[(-1.0 / y), $MachinePrecision] / N[((-z) - x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot x + x \cdot z\right) + y \cdot z \leq 5 \cdot 10^{+264}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(\frac{\frac{-1}{y}}{\left(-z\right) - x}\right)}^{-0.5}\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 x z)) (*.f64 y z)) < 5.00000000000000033e264Initial program 96.2%
distribute-lft-out96.2%
Simplified96.2%
if 5.00000000000000033e264 < (+.f64 (+.f64 (*.f64 x y) (*.f64 x z)) (*.f64 y z)) Initial program 19.0%
distribute-lft-out19.1%
Simplified19.1%
flip-+0.5%
clear-num0.5%
pow20.5%
pow20.5%
Applied egg-rr0.5%
inv-pow0.5%
sqrt-pow10.5%
clear-num0.5%
unpow20.5%
unpow20.5%
flip-+19.1%
fma-udef20.1%
metadata-eval20.1%
Applied egg-rr20.1%
fma-def19.1%
+-commutative19.1%
fma-udef20.1%
Simplified20.1%
Taylor expanded in y around -inf 13.9%
associate-/r*17.2%
mul-1-neg17.2%
unsub-neg17.2%
mul-1-neg17.2%
Simplified17.2%
Final simplification69.3%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1e-307) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (pow (/ 1.0 (* z (+ y x))) -0.5))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= 1e-307) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * pow((1.0 / (z * (y + x))), -0.5);
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 1d-307) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * ((1.0d0 / (z * (y + x))) ** (-0.5d0))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1e-307) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * Math.pow((1.0 / (z * (y + x))), -0.5);
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= 1e-307: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * math.pow((1.0 / (z * (y + x))), -0.5) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= 1e-307) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * (Float64(1.0 / Float64(z * Float64(y + x))) ^ -0.5)); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 1e-307)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * ((1.0 / (z * (y + x))) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 1e-307], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Power[N[(1.0 / N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-307}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot {\left(\frac{1}{z \cdot \left(y + x\right)}\right)}^{-0.5}\\
\end{array}
\end{array}
if y < 9.99999999999999909e-308Initial program 70.5%
distribute-lft-out70.6%
Simplified70.6%
Taylor expanded in x around inf 47.1%
if 9.99999999999999909e-308 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
flip-+37.9%
clear-num37.9%
pow237.9%
pow237.9%
Applied egg-rr37.9%
inv-pow37.9%
sqrt-pow137.9%
clear-num37.9%
unpow237.9%
unpow237.9%
flip-+69.4%
fma-udef69.8%
metadata-eval69.8%
Applied egg-rr69.8%
fma-def69.4%
+-commutative69.4%
fma-udef69.8%
Simplified69.8%
Taylor expanded in z around inf 42.9%
Final simplification45.0%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* 2.0 (sqrt (+ (* y z) (* x (+ y z))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
return 2.0 * sqrt(((y * z) + (x * (y + z))));
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0 * sqrt(((y * z) + (x * (y + z))))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
return 2.0 * Math.sqrt(((y * z) + (x * (y + z))));
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): return 2.0 * math.sqrt(((y * z) + (x * (y + z))))
x, y, z = sort([x, y, z]) function code(x, y, z) return Float64(2.0 * sqrt(Float64(Float64(y * z) + Float64(x * Float64(y + z))))) end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
tmp = 2.0 * sqrt(((y * z) + (x * (y + z))));
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(y * z), $MachinePrecision] + N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}
\end{array}
Initial program 70.0%
distribute-lft-out70.0%
Simplified70.0%
Final simplification70.0%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -2.3e-288) (* 2.0 (sqrt (* y x))) (* 2.0 (sqrt (* z (+ y x))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e-288) {
tmp = 2.0 * sqrt((y * x));
} else {
tmp = 2.0 * sqrt((z * (y + x)));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.3d-288)) then
tmp = 2.0d0 * sqrt((y * x))
else
tmp = 2.0d0 * sqrt((z * (y + x)))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e-288) {
tmp = 2.0 * Math.sqrt((y * x));
} else {
tmp = 2.0 * Math.sqrt((z * (y + x)));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -2.3e-288: tmp = 2.0 * math.sqrt((y * x)) else: tmp = 2.0 * math.sqrt((z * (y + x))) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -2.3e-288) tmp = Float64(2.0 * sqrt(Float64(y * x))); else tmp = Float64(2.0 * sqrt(Float64(z * Float64(y + x)))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -2.3e-288)
tmp = 2.0 * sqrt((y * x));
else
tmp = 2.0 * sqrt((z * (y + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -2.3e-288], N[(2.0 * N[Sqrt[N[(y * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-288}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if y < -2.3e-288Initial program 70.6%
distribute-lft-out70.7%
Simplified70.7%
Taylor expanded in z around 0 29.1%
if -2.3e-288 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
Taylor expanded in z around inf 44.0%
Final simplification36.7%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1e-302) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (sqrt (* z (+ y x))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1e-302) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * sqrt((z * (y + x)));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1d-302)) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * sqrt((z * (y + x)))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1e-302) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * Math.sqrt((z * (y + x)));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1e-302: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * math.sqrt((z * (y + x))) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1e-302) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * sqrt(Float64(z * Float64(y + x)))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1e-302)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * sqrt((z * (y + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -1e-302], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-302}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if y < -9.9999999999999996e-303Initial program 70.8%
distribute-lft-out70.8%
Simplified70.8%
Taylor expanded in x around inf 47.0%
if -9.9999999999999996e-303 < y Initial program 69.1%
distribute-lft-out69.1%
Simplified69.1%
Taylor expanded in z around inf 43.0%
Final simplification45.0%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -5e-310) (* 2.0 (sqrt (* y x))) (* 2.0 (sqrt (* y z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -5e-310) {
tmp = 2.0 * sqrt((y * x));
} else {
tmp = 2.0 * sqrt((y * z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-5d-310)) then
tmp = 2.0d0 * sqrt((y * x))
else
tmp = 2.0d0 * sqrt((y * z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5e-310) {
tmp = 2.0 * Math.sqrt((y * x));
} else {
tmp = 2.0 * Math.sqrt((y * z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -5e-310: tmp = 2.0 * math.sqrt((y * x)) else: tmp = 2.0 * math.sqrt((y * z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -5e-310) tmp = Float64(2.0 * sqrt(Float64(y * x))); else tmp = Float64(2.0 * sqrt(Float64(y * z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -5e-310)
tmp = 2.0 * sqrt((y * x));
else
tmp = 2.0 * sqrt((y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -5e-310], N[(2.0 * N[Sqrt[N[(y * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\
\end{array}
\end{array}
if y < -4.999999999999985e-310Initial program 70.5%
distribute-lft-out70.6%
Simplified70.6%
Taylor expanded in z around 0 27.9%
if -4.999999999999985e-310 < y Initial program 69.4%
distribute-lft-out69.4%
Simplified69.4%
Taylor expanded in x around 0 19.7%
Final simplification23.9%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* 2.0 (sqrt (* y x))))
assert(x < y && y < z);
double code(double x, double y, double z) {
return 2.0 * sqrt((y * x));
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0 * sqrt((y * x))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
return 2.0 * Math.sqrt((y * x));
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): return 2.0 * math.sqrt((y * x))
x, y, z = sort([x, y, z]) function code(x, y, z) return Float64(2.0 * sqrt(Float64(y * x))) end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
tmp = 2.0 * sqrt((y * x));
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(y * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{y \cdot x}
\end{array}
Initial program 70.0%
distribute-lft-out70.0%
Simplified70.0%
Taylor expanded in z around 0 28.8%
Final simplification28.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z)))
(* (pow z 0.25) (pow y 0.25)))))
(if (< z 7.636950090573675e+176)
(* 2.0 (sqrt (+ (* (+ x y) z) (* x y))))
(* (* t_0 t_0) 2.0))))
double code(double x, double y, double z) {
double t_0 = (0.25 * ((pow(y, -0.75) * (pow(z, -0.75) * x)) * (y + z))) + (pow(z, 0.25) * pow(y, 0.25));
double tmp;
if (z < 7.636950090573675e+176) {
tmp = 2.0 * sqrt((((x + y) * z) + (x * y)));
} else {
tmp = (t_0 * t_0) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (0.25d0 * (((y ** (-0.75d0)) * ((z ** (-0.75d0)) * x)) * (y + z))) + ((z ** 0.25d0) * (y ** 0.25d0))
if (z < 7.636950090573675d+176) then
tmp = 2.0d0 * sqrt((((x + y) * z) + (x * y)))
else
tmp = (t_0 * t_0) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (0.25 * ((Math.pow(y, -0.75) * (Math.pow(z, -0.75) * x)) * (y + z))) + (Math.pow(z, 0.25) * Math.pow(y, 0.25));
double tmp;
if (z < 7.636950090573675e+176) {
tmp = 2.0 * Math.sqrt((((x + y) * z) + (x * y)));
} else {
tmp = (t_0 * t_0) * 2.0;
}
return tmp;
}
def code(x, y, z): t_0 = (0.25 * ((math.pow(y, -0.75) * (math.pow(z, -0.75) * x)) * (y + z))) + (math.pow(z, 0.25) * math.pow(y, 0.25)) tmp = 0 if z < 7.636950090573675e+176: tmp = 2.0 * math.sqrt((((x + y) * z) + (x * y))) else: tmp = (t_0 * t_0) * 2.0 return tmp
function code(x, y, z) t_0 = Float64(Float64(0.25 * Float64(Float64((y ^ -0.75) * Float64((z ^ -0.75) * x)) * Float64(y + z))) + Float64((z ^ 0.25) * (y ^ 0.25))) tmp = 0.0 if (z < 7.636950090573675e+176) tmp = Float64(2.0 * sqrt(Float64(Float64(Float64(x + y) * z) + Float64(x * y)))); else tmp = Float64(Float64(t_0 * t_0) * 2.0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (0.25 * (((y ^ -0.75) * ((z ^ -0.75) * x)) * (y + z))) + ((z ^ 0.25) * (y ^ 0.25)); tmp = 0.0; if (z < 7.636950090573675e+176) tmp = 2.0 * sqrt((((x + y) * z) + (x * y))); else tmp = (t_0 * t_0) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.25 * N[(N[(N[Power[y, -0.75], $MachinePrecision] * N[(N[Power[z, -0.75], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[z, 0.25], $MachinePrecision] * N[Power[y, 0.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, 7.636950090573675e+176], N[(2.0 * N[Sqrt[N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(\left({y}^{-0.75} \cdot \left({z}^{-0.75} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{0.25} \cdot {y}^{0.25}\\
\mathbf{if}\;z < 7.636950090573675 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot t_0\right) \cdot 2\\
\end{array}
\end{array}
herbie shell --seed 2023221
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
:precision binary64
:herbie-target
(if (< z 7.636950090573675e+176) (* 2.0 (sqrt (+ (* (+ x y) z) (* x y)))) (* (* (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25))) (+ (* 0.25 (* (* (pow y -0.75) (* (pow z -0.75) x)) (+ y z))) (* (pow z 0.25) (pow y 0.25)))) 2.0))
(* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))