
(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 11 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
(if (<= y -7.2e+73)
(pow
(* (sqrt 2.0) (exp (* 0.25 (- (log (- (- z) x)) (log (/ -1.0 y))))))
2.0)
(if (<= y 3.4e-279)
(* 2.0 (sqrt (* x (+ y z))))
(* 2.0 (* (sqrt (+ y (* x (+ 1.0 (/ y z))))) (sqrt z))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -7.2e+73) {
tmp = pow((sqrt(2.0) * exp((0.25 * (log((-z - x)) - log((-1.0 / y)))))), 2.0);
} else if (y <= 3.4e-279) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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 <= (-7.2d+73)) then
tmp = (sqrt(2.0d0) * exp((0.25d0 * (log((-z - x)) - log(((-1.0d0) / y)))))) ** 2.0d0
else if (y <= 3.4d-279) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt((y + (x * (1.0d0 + (y / z))))) * 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 <= -7.2e+73) {
tmp = Math.pow((Math.sqrt(2.0) * Math.exp((0.25 * (Math.log((-z - x)) - Math.log((-1.0 / y)))))), 2.0);
} else if (y <= 3.4e-279) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt((y + (x * (1.0 + (y / z))))) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -7.2e+73: tmp = math.pow((math.sqrt(2.0) * math.exp((0.25 * (math.log((-z - x)) - math.log((-1.0 / y)))))), 2.0) elif y <= 3.4e-279: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt((y + (x * (1.0 + (y / z))))) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -7.2e+73) tmp = Float64(sqrt(2.0) * exp(Float64(0.25 * Float64(log(Float64(Float64(-z) - x)) - log(Float64(-1.0 / y)))))) ^ 2.0; elseif (y <= 3.4e-279) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + Float64(x * Float64(1.0 + Float64(y / z))))) * 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 <= -7.2e+73)
tmp = (sqrt(2.0) * exp((0.25 * (log((-z - x)) - log((-1.0 / y)))))) ^ 2.0;
elseif (y <= 3.4e-279)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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, -7.2e+73], N[Power[N[(N[Sqrt[2.0], $MachinePrecision] * N[Exp[N[(0.25 * N[(N[Log[N[((-z) - x), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[y, 3.4e-279], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + N[(x * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -7.2 \cdot 10^{+73}:\\
\;\;\;\;{\left(\sqrt{2} \cdot e^{0.25 \cdot \left(\log \left(\left(-z\right) - x\right) - \log \left(\frac{-1}{y}\right)\right)}\right)}^{2}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-279}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x \cdot \left(1 + \frac{y}{z}\right)} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -7.1999999999999998e73Initial program 43.1%
associate-+l+43.1%
+-commutative43.1%
distribute-rgt-in43.2%
Simplified43.2%
add-sqr-sqrt42.8%
sqrt-unprod43.2%
swap-sqr43.2%
add-sqr-sqrt43.2%
distribute-rgt-in43.1%
associate-+r+43.1%
*-commutative43.1%
distribute-lft-in43.4%
+-commutative43.4%
fma-undefine43.5%
add-sqr-sqrt43.5%
swap-sqr43.5%
sqrt-unprod43.1%
Applied egg-rr43.1%
Taylor expanded in y around -inf 83.3%
if -7.1999999999999998e73 < y < 3.40000000000000015e-279Initial program 77.7%
associate-+l+77.7%
+-commutative77.7%
distribute-rgt-in77.8%
Simplified77.8%
Taylor expanded in x around inf 53.3%
if 3.40000000000000015e-279 < y Initial program 65.2%
associate-+l+65.2%
+-commutative65.2%
distribute-rgt-in65.3%
Simplified65.3%
Taylor expanded in z around inf 55.7%
associate-/l*52.0%
Simplified52.0%
*-commutative52.0%
sqrt-prod52.4%
+-commutative52.4%
fma-define52.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 52.4%
Final simplification59.5%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (<= y -1.75e-275)
(pow
(* (exp (* 0.25 (- (log (- (- z) y)) (log (/ -1.0 x))))) (sqrt 2.0))
2.0)
(* 2.0 (* (sqrt (+ y (* x (+ 1.0 (/ y z))))) (sqrt z)))))assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.75e-275) {
tmp = pow((exp((0.25 * (log((-z - y)) - log((-1.0 / x))))) * sqrt(2.0)), 2.0);
} else {
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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 <= (-1.75d-275)) then
tmp = (exp((0.25d0 * (log((-z - y)) - log(((-1.0d0) / x))))) * sqrt(2.0d0)) ** 2.0d0
else
tmp = 2.0d0 * (sqrt((y + (x * (1.0d0 + (y / z))))) * 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 <= -1.75e-275) {
tmp = Math.pow((Math.exp((0.25 * (Math.log((-z - y)) - Math.log((-1.0 / x))))) * Math.sqrt(2.0)), 2.0);
} else {
tmp = 2.0 * (Math.sqrt((y + (x * (1.0 + (y / z))))) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.75e-275: tmp = math.pow((math.exp((0.25 * (math.log((-z - y)) - math.log((-1.0 / x))))) * math.sqrt(2.0)), 2.0) else: tmp = 2.0 * (math.sqrt((y + (x * (1.0 + (y / z))))) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.75e-275) tmp = Float64(exp(Float64(0.25 * Float64(log(Float64(Float64(-z) - y)) - log(Float64(-1.0 / x))))) * sqrt(2.0)) ^ 2.0; else tmp = Float64(2.0 * Float64(sqrt(Float64(y + Float64(x * Float64(1.0 + Float64(y / z))))) * 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 <= -1.75e-275)
tmp = (exp((0.25 * (log((-z - y)) - log((-1.0 / x))))) * sqrt(2.0)) ^ 2.0;
else
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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, -1.75e-275], N[Power[N[(N[Exp[N[(0.25 * N[(N[Log[N[((-z) - y), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + N[(x * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -1.75 \cdot 10^{-275}:\\
\;\;\;\;{\left(e^{0.25 \cdot \left(\log \left(\left(-z\right) - y\right) - \log \left(\frac{-1}{x}\right)\right)} \cdot \sqrt{2}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x \cdot \left(1 + \frac{y}{z}\right)} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -1.74999999999999984e-275Initial program 60.9%
associate-+l+60.9%
+-commutative60.9%
distribute-rgt-in61.1%
Simplified61.1%
add-sqr-sqrt60.6%
sqrt-unprod61.1%
swap-sqr61.1%
add-sqr-sqrt61.1%
distribute-rgt-in60.9%
associate-+r+60.9%
*-commutative60.9%
distribute-lft-in61.1%
+-commutative61.1%
fma-undefine61.1%
add-sqr-sqrt61.1%
swap-sqr61.1%
sqrt-unprod60.6%
Applied egg-rr60.6%
Taylor expanded in x around -inf 41.9%
if -1.74999999999999984e-275 < y Initial program 66.1%
associate-+l+66.1%
+-commutative66.1%
distribute-rgt-in66.1%
Simplified66.1%
Taylor expanded in z around inf 57.0%
associate-/l*53.5%
Simplified53.5%
*-commutative53.5%
sqrt-prod53.8%
+-commutative53.8%
fma-define53.8%
Applied egg-rr53.8%
Taylor expanded in x around 0 53.8%
Final simplification48.2%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (<= y -7.5e+73)
(* 2.0 (exp (* (- (log (- y)) (log (/ -1.0 x))) 0.5)))
(if (<= y 3.9e-284)
(* 2.0 (sqrt (* x (+ y z))))
(* 2.0 (* (sqrt (+ y (* x (+ 1.0 (/ y z))))) (sqrt z))))))assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e+73) {
tmp = 2.0 * exp(((log(-y) - log((-1.0 / x))) * 0.5));
} else if (y <= 3.9e-284) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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 <= (-7.5d+73)) then
tmp = 2.0d0 * exp(((log(-y) - log(((-1.0d0) / x))) * 0.5d0))
else if (y <= 3.9d-284) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt((y + (x * (1.0d0 + (y / z))))) * 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 <= -7.5e+73) {
tmp = 2.0 * Math.exp(((Math.log(-y) - Math.log((-1.0 / x))) * 0.5));
} else if (y <= 3.9e-284) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt((y + (x * (1.0 + (y / z))))) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -7.5e+73: tmp = 2.0 * math.exp(((math.log(-y) - math.log((-1.0 / x))) * 0.5)) elif y <= 3.9e-284: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt((y + (x * (1.0 + (y / z))))) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -7.5e+73) tmp = Float64(2.0 * exp(Float64(Float64(log(Float64(-y)) - log(Float64(-1.0 / x))) * 0.5))); elseif (y <= 3.9e-284) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + Float64(x * Float64(1.0 + Float64(y / z))))) * 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 <= -7.5e+73)
tmp = 2.0 * exp(((log(-y) - log((-1.0 / x))) * 0.5));
elseif (y <= 3.9e-284)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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, -7.5e+73], N[(2.0 * N[Exp[N[(N[(N[Log[(-y)], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-284], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + N[(x * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -7.5 \cdot 10^{+73}:\\
\;\;\;\;2 \cdot e^{\left(\log \left(-y\right) - \log \left(\frac{-1}{x}\right)\right) \cdot 0.5}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-284}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x \cdot \left(1 + \frac{y}{z}\right)} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < -7.5e73Initial program 43.1%
associate-+l+43.1%
+-commutative43.1%
distribute-rgt-in43.2%
Simplified43.2%
Taylor expanded in z around 0 19.7%
*-commutative19.7%
Simplified19.7%
pow1/219.9%
pow-to-exp18.5%
*-commutative18.5%
Applied egg-rr18.5%
Taylor expanded in x around -inf 40.0%
mul-1-neg40.0%
unsub-neg40.0%
neg-mul-140.0%
Simplified40.0%
if -7.5e73 < y < 3.8999999999999997e-284Initial program 77.4%
associate-+l+77.4%
+-commutative77.4%
distribute-rgt-in77.5%
Simplified77.5%
Taylor expanded in x around inf 52.6%
if 3.8999999999999997e-284 < y Initial program 65.5%
associate-+l+65.5%
+-commutative65.5%
distribute-rgt-in65.5%
Simplified65.5%
Taylor expanded in z around inf 56.0%
associate-/l*52.4%
Simplified52.4%
*-commutative52.4%
sqrt-prod52.8%
+-commutative52.8%
fma-define52.8%
Applied egg-rr52.8%
Taylor expanded in x around 0 52.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.05e-286) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (* (sqrt (+ y (* x (+ 1.0 (/ y z))))) (sqrt z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= 3.05e-286) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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.05d-286) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt((y + (x * (1.0d0 + (y / z))))) * 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.05e-286) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt((y + (x * (1.0 + (y / z))))) * Math.sqrt(z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= 3.05e-286: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt((y + (x * (1.0 + (y / z))))) * math.sqrt(z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= 3.05e-286) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(Float64(y + Float64(x * Float64(1.0 + Float64(y / z))))) * 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.05e-286)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt((y + (x * (1.0 + (y / z))))) * 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.05e-286], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + N[(x * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.05 \cdot 10^{-286}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x \cdot \left(1 + \frac{y}{z}\right)} \cdot \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 3.05000000000000016e-286Initial program 61.7%
associate-+l+61.7%
+-commutative61.7%
distribute-rgt-in61.9%
Simplified61.9%
Taylor expanded in x around inf 37.7%
if 3.05000000000000016e-286 < y Initial program 65.5%
associate-+l+65.5%
+-commutative65.5%
distribute-rgt-in65.5%
Simplified65.5%
Taylor expanded in z around inf 56.0%
associate-/l*52.4%
Simplified52.4%
*-commutative52.4%
sqrt-prod52.8%
+-commutative52.8%
fma-define52.8%
Applied egg-rr52.8%
Taylor expanded in x around 0 52.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 8.1e-280) (* 2.0 (sqrt (* x (+ y z)))) (* 2.0 (* (sqrt z) (sqrt (+ y x))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= 8.1e-280) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = 2.0 * (sqrt(z) * sqrt((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 <= 8.1d-280) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = 2.0d0 * (sqrt(z) * sqrt((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 <= 8.1e-280) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = 2.0 * (Math.sqrt(z) * Math.sqrt((y + x)));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= 8.1e-280: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = 2.0 * (math.sqrt(z) * math.sqrt((y + x))) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= 8.1e-280) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = Float64(2.0 * Float64(sqrt(z) * sqrt(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 <= 8.1e-280)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = 2.0 * (sqrt(z) * sqrt((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, 8.1e-280], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[z], $MachinePrecision] * N[Sqrt[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 8.1 \cdot 10^{-280}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y + x}\right)\\
\end{array}
\end{array}
if y < 8.1e-280Initial program 62.0%
associate-+l+62.0%
+-commutative62.0%
distribute-rgt-in62.2%
Simplified62.2%
Taylor expanded in x around inf 38.2%
if 8.1e-280 < y Initial program 65.2%
associate-+l+65.2%
+-commutative65.2%
distribute-rgt-in65.3%
Simplified65.3%
Taylor expanded in z around inf 37.6%
+-commutative37.6%
Simplified37.6%
*-commutative37.6%
sqrt-prod46.1%
+-commutative46.1%
Applied egg-rr46.1%
Final simplification42.2%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 5.3e-279) (* 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 <= 5.3e-279) {
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 <= 5.3d-279) 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 <= 5.3e-279) {
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 <= 5.3e-279: 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 <= 5.3e-279) 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 <= 5.3e-279)
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, 5.3e-279], 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 5.3 \cdot 10^{-279}:\\
\;\;\;\;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 < 5.3000000000000003e-279Initial program 62.0%
associate-+l+62.0%
+-commutative62.0%
distribute-rgt-in62.2%
Simplified62.2%
Taylor expanded in x around inf 38.2%
if 5.3000000000000003e-279 < y Initial program 65.2%
associate-+l+65.2%
+-commutative65.2%
distribute-rgt-in65.3%
Simplified65.3%
Taylor expanded in x around 0 24.4%
*-commutative24.4%
Simplified24.4%
*-commutative24.4%
sqrt-prod33.7%
Applied egg-rr33.7%
Final simplification35.9%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1.85e-249) (* 2.0 (sqrt (* x (+ y z)))) (sqrt (* z (* (+ y x) 4.0)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.85e-249) {
tmp = 2.0 * sqrt((x * (y + z)));
} else {
tmp = sqrt((z * ((y + x) * 4.0)));
}
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 <= (-1.85d-249)) then
tmp = 2.0d0 * sqrt((x * (y + z)))
else
tmp = sqrt((z * ((y + x) * 4.0d0)))
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 <= -1.85e-249) {
tmp = 2.0 * Math.sqrt((x * (y + z)));
} else {
tmp = Math.sqrt((z * ((y + x) * 4.0)));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.85e-249: tmp = 2.0 * math.sqrt((x * (y + z))) else: tmp = math.sqrt((z * ((y + x) * 4.0))) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.85e-249) tmp = Float64(2.0 * sqrt(Float64(x * Float64(y + z)))); else tmp = sqrt(Float64(z * Float64(Float64(y + x) * 4.0))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.85e-249)
tmp = 2.0 * sqrt((x * (y + z)));
else
tmp = sqrt((z * ((y + x) * 4.0)));
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, -1.85e-249], N[(2.0 * N[Sqrt[N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(z * N[(N[(y + x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-249}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(\left(y + x\right) \cdot 4\right)}\\
\end{array}
\end{array}
if y < -1.84999999999999988e-249Initial program 59.4%
associate-+l+59.4%
+-commutative59.4%
distribute-rgt-in59.5%
Simplified59.5%
Taylor expanded in x around inf 32.8%
if -1.84999999999999988e-249 < y Initial program 67.0%
associate-+l+67.0%
+-commutative67.0%
distribute-rgt-in67.1%
Simplified67.1%
Taylor expanded in z around inf 41.9%
+-commutative41.9%
Simplified41.9%
add-cbrt-cube29.5%
pow1/327.7%
add-sqr-sqrt27.7%
pow127.7%
pow1/227.7%
pow-prod-up27.7%
+-commutative27.7%
metadata-eval27.7%
Applied egg-rr27.7%
unpow1/329.5%
+-commutative29.5%
Simplified29.5%
pow129.5%
add-sqr-sqrt29.4%
sqrt-unprod29.5%
*-commutative29.5%
*-commutative29.5%
swap-sqr29.5%
cbrt-unprod17.7%
pow-prod-up17.8%
metadata-eval17.8%
pow317.8%
add-cbrt-cube41.9%
+-commutative41.9%
metadata-eval41.9%
Applied egg-rr41.9%
unpow141.9%
associate-*l*41.9%
+-commutative41.9%
Simplified41.9%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -4.5e-261) (* 2.0 (sqrt (* y x))) (sqrt (* z (* (+ y x) 4.0)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -4.5e-261) {
tmp = 2.0 * sqrt((y * x));
} else {
tmp = sqrt((z * ((y + x) * 4.0)));
}
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 <= (-4.5d-261)) then
tmp = 2.0d0 * sqrt((y * x))
else
tmp = sqrt((z * ((y + x) * 4.0d0)))
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 <= -4.5e-261) {
tmp = 2.0 * Math.sqrt((y * x));
} else {
tmp = Math.sqrt((z * ((y + x) * 4.0)));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -4.5e-261: tmp = 2.0 * math.sqrt((y * x)) else: tmp = math.sqrt((z * ((y + x) * 4.0))) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -4.5e-261) tmp = Float64(2.0 * sqrt(Float64(y * x))); else tmp = sqrt(Float64(z * Float64(Float64(y + x) * 4.0))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -4.5e-261)
tmp = 2.0 * sqrt((y * x));
else
tmp = sqrt((z * ((y + x) * 4.0)));
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, -4.5e-261], N[(2.0 * N[Sqrt[N[(y * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(z * N[(N[(y + x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-261}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(\left(y + x\right) \cdot 4\right)}\\
\end{array}
\end{array}
if y < -4.5000000000000001e-261Initial program 59.6%
associate-+l+59.6%
+-commutative59.6%
distribute-rgt-in59.7%
Simplified59.7%
Taylor expanded in z around 0 22.4%
*-commutative22.4%
Simplified22.4%
if -4.5000000000000001e-261 < y Initial program 67.0%
associate-+l+67.0%
+-commutative67.0%
distribute-rgt-in67.1%
Simplified67.1%
Taylor expanded in z around inf 41.4%
+-commutative41.4%
Simplified41.4%
add-cbrt-cube28.9%
pow1/327.1%
add-sqr-sqrt27.1%
pow127.1%
pow1/227.2%
pow-prod-up27.2%
+-commutative27.2%
metadata-eval27.2%
Applied egg-rr27.2%
unpow1/328.9%
+-commutative28.9%
Simplified28.9%
pow128.9%
add-sqr-sqrt28.8%
sqrt-unprod28.9%
*-commutative28.9%
*-commutative28.9%
swap-sqr28.9%
cbrt-unprod18.0%
pow-prod-up18.1%
metadata-eval18.1%
pow318.1%
add-cbrt-cube41.4%
+-commutative41.4%
metadata-eval41.4%
Applied egg-rr41.4%
unpow141.4%
associate-*l*41.4%
+-commutative41.4%
Simplified41.4%
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) (* z (+ y x))))))
assert(x < y && y < z);
double code(double x, double y, double z) {
return 2.0 * sqrt(((y * x) + (z * (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) + (z * (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) + (z * (y + x))));
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): return 2.0 * math.sqrt(((y * x) + (z * (y + x))))
x, y, z = sort([x, y, z]) function code(x, y, z) return Float64(2.0 * sqrt(Float64(Float64(y * x) + Float64(z * Float64(y + x))))) end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
tmp = 2.0 * sqrt(((y * x) + (z * (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[(N[(y * x), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
2 \cdot \sqrt{y \cdot x + z \cdot \left(y + x\right)}
\end{array}
Initial program 63.6%
associate-+l+63.6%
+-commutative63.6%
distribute-rgt-in63.7%
Simplified63.7%
Final simplification63.7%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1.85e-249) (* 2.0 (sqrt (* y x))) (sqrt (* y (* z 4.0)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.85e-249) {
tmp = 2.0 * sqrt((y * x));
} else {
tmp = sqrt((y * (z * 4.0)));
}
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 <= (-1.85d-249)) then
tmp = 2.0d0 * sqrt((y * x))
else
tmp = sqrt((y * (z * 4.0d0)))
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 <= -1.85e-249) {
tmp = 2.0 * Math.sqrt((y * x));
} else {
tmp = Math.sqrt((y * (z * 4.0)));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.85e-249: tmp = 2.0 * math.sqrt((y * x)) else: tmp = math.sqrt((y * (z * 4.0))) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.85e-249) tmp = Float64(2.0 * sqrt(Float64(y * x))); else tmp = sqrt(Float64(y * Float64(z * 4.0))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.85e-249)
tmp = 2.0 * sqrt((y * x));
else
tmp = sqrt((y * (z * 4.0)));
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, -1.85e-249], N[(2.0 * N[Sqrt[N[(y * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(y * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-249}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot \left(z \cdot 4\right)}\\
\end{array}
\end{array}
if y < -1.84999999999999988e-249Initial program 59.4%
associate-+l+59.4%
+-commutative59.4%
distribute-rgt-in59.5%
Simplified59.5%
Taylor expanded in z around 0 22.8%
*-commutative22.8%
Simplified22.8%
if -1.84999999999999988e-249 < y Initial program 67.0%
associate-+l+67.0%
+-commutative67.0%
distribute-rgt-in67.1%
Simplified67.1%
Taylor expanded in x around 0 22.6%
*-commutative22.6%
Simplified22.6%
add-sqr-sqrt22.4%
sqrt-unprod22.6%
swap-sqr22.6%
add-sqr-sqrt22.6%
metadata-eval22.6%
Applied egg-rr22.6%
associate-*l*22.6%
Simplified22.6%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (sqrt (* y (* z 4.0))))
assert(x < y && y < z);
double code(double x, double y, double z) {
return sqrt((y * (z * 4.0)));
}
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 = sqrt((y * (z * 4.0d0)))
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
return Math.sqrt((y * (z * 4.0)));
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): return math.sqrt((y * (z * 4.0)))
x, y, z = sort([x, y, z]) function code(x, y, z) return sqrt(Float64(y * Float64(z * 4.0))) end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
tmp = sqrt((y * (z * 4.0)));
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[Sqrt[N[(y * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\sqrt{y \cdot \left(z \cdot 4\right)}
\end{array}
Initial program 63.6%
associate-+l+63.6%
+-commutative63.6%
distribute-rgt-in63.7%
Simplified63.7%
Taylor expanded in x around 0 25.7%
*-commutative25.7%
Simplified25.7%
add-sqr-sqrt25.5%
sqrt-unprod25.7%
swap-sqr25.7%
add-sqr-sqrt25.7%
metadata-eval25.7%
Applied egg-rr25.7%
associate-*l*25.7%
Simplified25.7%
(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 2024117
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
:precision binary64
:alt
(! :herbie-platform default (if (< z 763695009057367500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 2 (sqrt (+ (* (+ x y) z) (* x y)))) (* (* (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4))) (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4)))) 2)))
(* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))