
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
double code(double x, double y, double z) {
return (1.0 / x) / (y * (1.0 + (z * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
end function
public static double code(double x, double y, double z) {
return (1.0 / x) / (y * (1.0 + (z * z)));
}
def code(x, y, z): return (1.0 / x) / (y * (1.0 + (z * z)))
function code(x, y, z) return Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))) end
function tmp = code(x, y, z) tmp = (1.0 / x) / (y * (1.0 + (z * z))); end
code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
double code(double x, double y, double z) {
return (1.0 / x) / (y * (1.0 + (z * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
end function
public static double code(double x, double y, double z) {
return (1.0 / x) / (y * (1.0 + (z * z)));
}
def code(x, y, z): return (1.0 / x) / (y * (1.0 + (z * z)))
function code(x, y, z) return Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))) end
function tmp = code(x, y, z) tmp = (1.0 / x) / (y * (1.0 + (z * z))); end
code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\end{array}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= y_m 8.6e+55)
(/ 1.0 (* (* (hypot 1.0 z) x_m) (* (hypot 1.0 z) y_m)))
(/ (/ (/ (/ 1.0 x_m) y_m) (hypot 1.0 z)) (hypot 1.0 z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (y_m <= 8.6e+55) {
tmp = 1.0 / ((hypot(1.0, z) * x_m) * (hypot(1.0, z) * y_m));
} else {
tmp = (((1.0 / x_m) / y_m) / hypot(1.0, z)) / hypot(1.0, z);
}
return y_s * (x_s * tmp);
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (y_m <= 8.6e+55) {
tmp = 1.0 / ((Math.hypot(1.0, z) * x_m) * (Math.hypot(1.0, z) * y_m));
} else {
tmp = (((1.0 / x_m) / y_m) / Math.hypot(1.0, z)) / Math.hypot(1.0, z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if y_m <= 8.6e+55: tmp = 1.0 / ((math.hypot(1.0, z) * x_m) * (math.hypot(1.0, z) * y_m)) else: tmp = (((1.0 / x_m) / y_m) / math.hypot(1.0, z)) / math.hypot(1.0, z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (y_m <= 8.6e+55) tmp = Float64(1.0 / Float64(Float64(hypot(1.0, z) * x_m) * Float64(hypot(1.0, z) * y_m))); else tmp = Float64(Float64(Float64(Float64(1.0 / x_m) / y_m) / hypot(1.0, z)) / hypot(1.0, z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (y_m <= 8.6e+55)
tmp = 1.0 / ((hypot(1.0, z) * x_m) * (hypot(1.0, z) * y_m));
else
tmp = (((1.0 / x_m) / y_m) / hypot(1.0, z)) / hypot(1.0, z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[y$95$m, 8.6e+55], N[(1.0 / N[(N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x$95$m), $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;y_m \leq 8.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{1}{\left(\mathsf{hypot}\left(1, z\right) \cdot x_m\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot y_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{x_m}}{y_m}}{\mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right)}\\
\end{array}\right)
\end{array}
if y < 8.5999999999999998e55Initial program 90.3%
associate-/l/90.1%
metadata-eval90.1%
associate-*r/90.1%
associate-/l/90.3%
associate-*r/90.3%
associate-/l*90.0%
associate-/r/90.1%
/-rgt-identity90.1%
associate-*l*89.7%
*-commutative89.7%
sqr-neg89.7%
+-commutative89.7%
sqr-neg89.7%
fma-def89.7%
Simplified89.7%
Taylor expanded in y around 0 90.1%
associate-*r*88.5%
+-commutative88.5%
unpow288.5%
fma-udef88.5%
Simplified88.5%
associate-*l*90.1%
associate-/r*90.3%
*-un-lft-identity90.3%
frac-times89.8%
associate-*r/88.4%
add-sqr-sqrt88.4%
times-frac90.8%
fma-udef90.8%
+-commutative90.8%
hypot-1-def90.8%
fma-udef90.8%
+-commutative90.8%
hypot-1-def98.4%
Applied egg-rr98.4%
*-commutative98.4%
associate-/l/98.3%
Simplified98.3%
*-commutative98.3%
associate-/l/98.3%
frac-times98.1%
metadata-eval98.1%
Applied egg-rr98.1%
if 8.5999999999999998e55 < y Initial program 85.3%
associate-/l/84.6%
metadata-eval84.6%
associate-*r/84.6%
associate-/l/85.3%
associate-*r/85.3%
associate-/l*84.5%
associate-/r/84.6%
/-rgt-identity84.6%
associate-*l*94.9%
*-commutative94.9%
sqr-neg94.9%
+-commutative94.9%
sqr-neg94.9%
fma-def94.9%
Simplified94.9%
fma-udef94.9%
+-commutative94.9%
*-commutative94.9%
associate-*l*84.6%
associate-/l/85.3%
add-sqr-sqrt85.3%
*-un-lft-identity85.3%
times-frac85.1%
*-commutative85.1%
sqrt-prod85.2%
hypot-1-def85.2%
*-commutative85.2%
sqrt-prod95.4%
hypot-1-def99.4%
Applied egg-rr99.4%
frac-times85.2%
*-un-lft-identity85.2%
swap-sqr85.2%
pow285.2%
add-sqr-sqrt85.3%
associate-/r*95.6%
hypot-udef95.6%
sqrt-pow295.6%
metadata-eval95.6%
metadata-eval95.6%
pow195.6%
+-commutative95.6%
fma-udef95.6%
associate-/l/85.3%
associate-/r*84.6%
associate-*l*94.9%
associate-/r*95.0%
*-commutative95.0%
add-sqr-sqrt95.0%
Applied egg-rr99.6%
Final simplification98.4%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (let* ((t_0 (* (hypot 1.0 z) (sqrt y_m)))) (* y_s (* x_s (* (/ 1.0 t_0) (/ (/ 1.0 x_m) t_0))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = hypot(1.0, z) * sqrt(y_m);
return y_s * (x_s * ((1.0 / t_0) * ((1.0 / x_m) / t_0)));
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = Math.hypot(1.0, z) * Math.sqrt(y_m);
return y_s * (x_s * ((1.0 / t_0) * ((1.0 / x_m) / t_0)));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): t_0 = math.hypot(1.0, z) * math.sqrt(y_m) return y_s * (x_s * ((1.0 / t_0) * ((1.0 / x_m) / t_0)))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) t_0 = Float64(hypot(1.0, z) * sqrt(y_m)) return Float64(y_s * Float64(x_s * Float64(Float64(1.0 / t_0) * Float64(Float64(1.0 / x_m) / t_0)))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
t_0 = hypot(1.0, z) * sqrt(y_m);
tmp = y_s * (x_s * ((1.0 / t_0) * ((1.0 / x_m) / t_0)));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(1, z\right) \cdot \sqrt{y_m}\\
y_s \cdot \left(x_s \cdot \left(\frac{1}{t_0} \cdot \frac{\frac{1}{x_m}}{t_0}\right)\right)
\end{array}
\end{array}
Initial program 89.4%
associate-/l/89.1%
metadata-eval89.1%
associate-*r/89.1%
associate-/l/89.4%
associate-*r/89.4%
associate-/l*89.0%
associate-/r/89.1%
/-rgt-identity89.1%
associate-*l*90.6%
*-commutative90.6%
sqr-neg90.6%
+-commutative90.6%
sqr-neg90.6%
fma-def90.6%
Simplified90.6%
fma-udef90.6%
+-commutative90.6%
*-commutative90.6%
associate-*l*89.1%
associate-/l/89.4%
add-sqr-sqrt40.6%
*-un-lft-identity40.6%
times-frac40.7%
*-commutative40.7%
sqrt-prod40.7%
hypot-1-def40.7%
*-commutative40.7%
sqrt-prod42.5%
hypot-1-def45.8%
Applied egg-rr45.8%
Final simplification45.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (pow (/ (pow x_m -0.5) (* (hypot 1.0 z) (sqrt y_m))) 2.0))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * pow((pow(x_m, -0.5) / (hypot(1.0, z) * sqrt(y_m))), 2.0));
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * Math.pow((Math.pow(x_m, -0.5) / (Math.hypot(1.0, z) * Math.sqrt(y_m))), 2.0));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * math.pow((math.pow(x_m, -0.5) / (math.hypot(1.0, z) * math.sqrt(y_m))), 2.0))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * (Float64((x_m ^ -0.5) / Float64(hypot(1.0, z) * sqrt(y_m))) ^ 2.0))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * (((x_m ^ -0.5) / (hypot(1.0, z) * sqrt(y_m))) ^ 2.0));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[Power[N[(N[Power[x$95$m, -0.5], $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot {\left(\frac{{x_m}^{-0.5}}{\mathsf{hypot}\left(1, z\right) \cdot \sqrt{y_m}}\right)}^{2}\right)
\end{array}
Initial program 89.4%
associate-/l/89.1%
metadata-eval89.1%
associate-*r/89.1%
associate-/l/89.4%
associate-*r/89.4%
associate-/l*89.0%
associate-/r/89.1%
/-rgt-identity89.1%
associate-*l*90.6%
*-commutative90.6%
sqr-neg90.6%
+-commutative90.6%
sqr-neg90.6%
fma-def90.6%
Simplified90.6%
fma-udef90.6%
+-commutative90.6%
*-commutative90.6%
associate-*l*89.1%
associate-/l/89.4%
add-sqr-sqrt55.4%
sqrt-div20.0%
inv-pow20.0%
sqrt-pow120.0%
metadata-eval20.0%
*-commutative20.0%
sqrt-prod20.0%
hypot-1-def20.0%
sqrt-div20.0%
inv-pow20.0%
sqrt-pow119.9%
metadata-eval19.9%
*-commutative19.9%
Applied egg-rr23.6%
unpow223.6%
Simplified23.6%
Final simplification23.6%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (* (/ 1.0 (* (hypot 1.0 z) x_m)) (/ (/ 1.0 y_m) (hypot 1.0 z))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * ((1.0 / (hypot(1.0, z) * x_m)) * ((1.0 / y_m) / hypot(1.0, z))));
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * ((1.0 / (Math.hypot(1.0, z) * x_m)) * ((1.0 / y_m) / Math.hypot(1.0, z))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * ((1.0 / (math.hypot(1.0, z) * x_m)) * ((1.0 / y_m) / math.hypot(1.0, z))))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(Float64(1.0 / Float64(hypot(1.0, z) * x_m)) * Float64(Float64(1.0 / y_m) / hypot(1.0, z))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * ((1.0 / (hypot(1.0, z) * x_m)) * ((1.0 / y_m) / hypot(1.0, z))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / y$95$m), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \left(\frac{1}{\mathsf{hypot}\left(1, z\right) \cdot x_m} \cdot \frac{\frac{1}{y_m}}{\mathsf{hypot}\left(1, z\right)}\right)\right)
\end{array}
Initial program 89.4%
associate-/l/89.1%
metadata-eval89.1%
associate-*r/89.1%
associate-/l/89.4%
associate-*r/89.4%
associate-/l*89.0%
associate-/r/89.1%
/-rgt-identity89.1%
associate-*l*90.6%
*-commutative90.6%
sqr-neg90.6%
+-commutative90.6%
sqr-neg90.6%
fma-def90.6%
Simplified90.6%
Taylor expanded in y around 0 89.1%
associate-*r*89.6%
+-commutative89.6%
unpow289.6%
fma-udef89.6%
Simplified89.6%
associate-*l*89.1%
associate-/r*89.4%
*-un-lft-identity89.4%
frac-times90.9%
associate-*r/89.7%
add-sqr-sqrt89.7%
times-frac91.3%
fma-udef91.3%
+-commutative91.3%
hypot-1-def91.3%
fma-udef91.3%
+-commutative91.3%
hypot-1-def98.3%
Applied egg-rr98.3%
*-commutative98.3%
associate-/l/98.2%
Simplified98.2%
Final simplification98.2%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (/ 1.0 (* (* (hypot 1.0 z) x_m) (* (hypot 1.0 z) y_m))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (1.0 / ((hypot(1.0, z) * x_m) * (hypot(1.0, z) * y_m))));
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (1.0 / ((Math.hypot(1.0, z) * x_m) * (Math.hypot(1.0, z) * y_m))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * (1.0 / ((math.hypot(1.0, z) * x_m) * (math.hypot(1.0, z) * y_m))))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(Float64(hypot(1.0, z) * x_m) * Float64(hypot(1.0, z) * y_m))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * (1.0 / ((hypot(1.0, z) * x_m) * (hypot(1.0, z) * y_m))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x$95$m), $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \frac{1}{\left(\mathsf{hypot}\left(1, z\right) \cdot x_m\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot y_m\right)}\right)
\end{array}
Initial program 89.4%
associate-/l/89.1%
metadata-eval89.1%
associate-*r/89.1%
associate-/l/89.4%
associate-*r/89.4%
associate-/l*89.0%
associate-/r/89.1%
/-rgt-identity89.1%
associate-*l*90.6%
*-commutative90.6%
sqr-neg90.6%
+-commutative90.6%
sqr-neg90.6%
fma-def90.6%
Simplified90.6%
Taylor expanded in y around 0 89.1%
associate-*r*89.6%
+-commutative89.6%
unpow289.6%
fma-udef89.6%
Simplified89.6%
associate-*l*89.1%
associate-/r*89.4%
*-un-lft-identity89.4%
frac-times90.9%
associate-*r/89.7%
add-sqr-sqrt89.7%
times-frac91.3%
fma-udef91.3%
+-commutative91.3%
hypot-1-def91.3%
fma-udef91.3%
+-commutative91.3%
hypot-1-def98.3%
Applied egg-rr98.3%
*-commutative98.3%
associate-/l/98.2%
Simplified98.2%
*-commutative98.2%
associate-/l/98.2%
frac-times97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Final simplification97.9%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (* z z) 5e+294)
(* (/ 1.0 y_m) (/ 1.0 (* x_m (fma z z 1.0))))
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z * z) <= 5e+294) {
tmp = (1.0 / y_m) * (1.0 / (x_m * fma(z, z, 1.0)));
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(z * z) <= 5e+294) tmp = Float64(Float64(1.0 / y_m) * Float64(1.0 / Float64(x_m * fma(z, z, 1.0)))); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 5e+294], N[(N[(1.0 / y$95$m), $MachinePrecision] * N[(1.0 / N[(x$95$m * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+294}:\\
\;\;\;\;\frac{1}{y_m} \cdot \frac{1}{x_m \cdot \mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
if (*.f64 z z) < 4.9999999999999999e294Initial program 95.5%
associate-/l/95.2%
metadata-eval95.2%
associate-*r/95.2%
associate-/l/95.5%
associate-*r/95.5%
associate-/l*95.1%
associate-/r/95.2%
/-rgt-identity95.2%
associate-*l*97.3%
*-commutative97.3%
sqr-neg97.3%
+-commutative97.3%
sqr-neg97.3%
fma-def97.3%
Simplified97.3%
associate-/r*97.6%
div-inv97.5%
Applied egg-rr97.5%
if 4.9999999999999999e294 < (*.f64 z z) Initial program 73.0%
associate-/l/73.0%
metadata-eval73.0%
associate-*r/73.0%
associate-/l/73.0%
associate-*r/73.0%
associate-/l*73.0%
associate-/r/73.0%
/-rgt-identity73.0%
associate-*l*73.0%
*-commutative73.0%
sqr-neg73.0%
+-commutative73.0%
sqr-neg73.0%
fma-def73.0%
Simplified73.0%
Taylor expanded in y around 0 73.0%
associate-*r*71.4%
+-commutative71.4%
unpow271.4%
fma-udef71.4%
Simplified71.4%
associate-*l*73.0%
associate-/r*73.0%
*-un-lft-identity73.0%
frac-times73.0%
associate-*r/71.3%
add-sqr-sqrt71.3%
times-frac73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def98.5%
Applied egg-rr98.5%
*-commutative98.5%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in z around inf 73.0%
*-commutative73.0%
associate-*l*73.0%
*-commutative73.0%
associate-/r*73.0%
Simplified73.0%
associate-/r*71.3%
un-div-inv71.3%
unpow271.3%
times-frac98.5%
Applied egg-rr98.5%
Final simplification97.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (* z z) 5e+294)
(/ 1.0 (* y_m (* x_m (fma z z 1.0))))
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z * z) <= 5e+294) {
tmp = 1.0 / (y_m * (x_m * fma(z, z, 1.0)));
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(z * z) <= 5e+294) tmp = Float64(1.0 / Float64(y_m * Float64(x_m * fma(z, z, 1.0)))); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 5e+294], N[(1.0 / N[(y$95$m * N[(x$95$m * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+294}:\\
\;\;\;\;\frac{1}{y_m \cdot \left(x_m \cdot \mathsf{fma}\left(z, z, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
if (*.f64 z z) < 4.9999999999999999e294Initial program 95.5%
associate-/l/95.2%
metadata-eval95.2%
associate-*r/95.2%
associate-/l/95.5%
associate-*r/95.5%
associate-/l*95.1%
associate-/r/95.2%
/-rgt-identity95.2%
associate-*l*97.3%
*-commutative97.3%
sqr-neg97.3%
+-commutative97.3%
sqr-neg97.3%
fma-def97.3%
Simplified97.3%
if 4.9999999999999999e294 < (*.f64 z z) Initial program 73.0%
associate-/l/73.0%
metadata-eval73.0%
associate-*r/73.0%
associate-/l/73.0%
associate-*r/73.0%
associate-/l*73.0%
associate-/r/73.0%
/-rgt-identity73.0%
associate-*l*73.0%
*-commutative73.0%
sqr-neg73.0%
+-commutative73.0%
sqr-neg73.0%
fma-def73.0%
Simplified73.0%
Taylor expanded in y around 0 73.0%
associate-*r*71.4%
+-commutative71.4%
unpow271.4%
fma-udef71.4%
Simplified71.4%
associate-*l*73.0%
associate-/r*73.0%
*-un-lft-identity73.0%
frac-times73.0%
associate-*r/71.3%
add-sqr-sqrt71.3%
times-frac73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def98.5%
Applied egg-rr98.5%
*-commutative98.5%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in z around inf 73.0%
*-commutative73.0%
associate-*l*73.0%
*-commutative73.0%
associate-/r*73.0%
Simplified73.0%
associate-/r*71.3%
un-div-inv71.3%
unpow271.3%
times-frac98.5%
Applied egg-rr98.5%
Final simplification97.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (* z z) 5e+294)
(/ (/ 1.0 y_m) (* x_m (fma z z 1.0)))
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z * z) <= 5e+294) {
tmp = (1.0 / y_m) / (x_m * fma(z, z, 1.0));
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(z * z) <= 5e+294) tmp = Float64(Float64(1.0 / y_m) / Float64(x_m * fma(z, z, 1.0))); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 5e+294], N[(N[(1.0 / y$95$m), $MachinePrecision] / N[(x$95$m * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+294}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{x_m \cdot \mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
if (*.f64 z z) < 4.9999999999999999e294Initial program 95.5%
associate-/l/95.2%
metadata-eval95.2%
associate-*r/95.2%
associate-/l/95.5%
associate-*r/95.5%
associate-/l*95.1%
associate-/r/95.2%
/-rgt-identity95.2%
associate-*l*97.3%
*-commutative97.3%
sqr-neg97.3%
+-commutative97.3%
sqr-neg97.3%
fma-def97.3%
Simplified97.3%
fma-udef97.3%
+-commutative97.3%
*-commutative97.3%
associate-*l*95.2%
associate-/l/95.5%
add-sqr-sqrt44.4%
*-un-lft-identity44.4%
times-frac44.4%
*-commutative44.4%
sqrt-prod44.5%
hypot-1-def44.5%
*-commutative44.5%
sqrt-prod47.0%
hypot-1-def47.0%
Applied egg-rr47.0%
frac-times44.4%
*-un-lft-identity44.4%
swap-sqr44.4%
pow244.4%
add-sqr-sqrt95.5%
associate-/r*97.6%
hypot-udef97.6%
sqrt-pow297.6%
metadata-eval97.6%
metadata-eval97.6%
pow197.6%
+-commutative97.6%
fma-udef97.6%
div-inv97.6%
associate-/l/97.5%
associate-*l/97.6%
*-un-lft-identity97.6%
*-commutative97.6%
Applied egg-rr97.6%
if 4.9999999999999999e294 < (*.f64 z z) Initial program 73.0%
associate-/l/73.0%
metadata-eval73.0%
associate-*r/73.0%
associate-/l/73.0%
associate-*r/73.0%
associate-/l*73.0%
associate-/r/73.0%
/-rgt-identity73.0%
associate-*l*73.0%
*-commutative73.0%
sqr-neg73.0%
+-commutative73.0%
sqr-neg73.0%
fma-def73.0%
Simplified73.0%
Taylor expanded in y around 0 73.0%
associate-*r*71.4%
+-commutative71.4%
unpow271.4%
fma-udef71.4%
Simplified71.4%
associate-*l*73.0%
associate-/r*73.0%
*-un-lft-identity73.0%
frac-times73.0%
associate-*r/71.3%
add-sqr-sqrt71.3%
times-frac73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def98.5%
Applied egg-rr98.5%
*-commutative98.5%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in z around inf 73.0%
*-commutative73.0%
associate-*l*73.0%
*-commutative73.0%
associate-/r*73.0%
Simplified73.0%
associate-/r*71.3%
un-div-inv71.3%
unpow271.3%
times-frac98.5%
Applied egg-rr98.5%
Final simplification97.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (* z z) 5e+294)
(/ (/ 1.0 (* x_m (fma z z 1.0))) y_m)
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z * z) <= 5e+294) {
tmp = (1.0 / (x_m * fma(z, z, 1.0))) / y_m;
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(z * z) <= 5e+294) tmp = Float64(Float64(1.0 / Float64(x_m * fma(z, z, 1.0))) / y_m); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 5e+294], N[(N[(1.0 / N[(x$95$m * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+294}:\\
\;\;\;\;\frac{\frac{1}{x_m \cdot \mathsf{fma}\left(z, z, 1\right)}}{y_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
if (*.f64 z z) < 4.9999999999999999e294Initial program 95.5%
associate-/l/95.2%
metadata-eval95.2%
associate-*r/95.2%
associate-/l/95.5%
associate-*r/95.5%
associate-/l*95.1%
associate-/r/95.2%
/-rgt-identity95.2%
associate-*l*97.3%
*-commutative97.3%
sqr-neg97.3%
+-commutative97.3%
sqr-neg97.3%
fma-def97.3%
Simplified97.3%
fma-udef97.3%
+-commutative97.3%
*-commutative97.3%
associate-*l*95.2%
associate-/l/95.5%
add-sqr-sqrt44.4%
*-un-lft-identity44.4%
times-frac44.4%
*-commutative44.4%
sqrt-prod44.5%
hypot-1-def44.5%
*-commutative44.5%
sqrt-prod47.0%
hypot-1-def47.0%
Applied egg-rr47.0%
frac-times44.4%
*-un-lft-identity44.4%
swap-sqr44.4%
pow244.4%
add-sqr-sqrt95.5%
associate-/r*97.6%
hypot-udef97.6%
sqrt-pow297.6%
metadata-eval97.6%
metadata-eval97.6%
pow197.6%
+-commutative97.6%
fma-udef97.6%
div-inv97.5%
frac-times97.5%
metadata-eval97.5%
Applied egg-rr97.5%
if 4.9999999999999999e294 < (*.f64 z z) Initial program 73.0%
associate-/l/73.0%
metadata-eval73.0%
associate-*r/73.0%
associate-/l/73.0%
associate-*r/73.0%
associate-/l*73.0%
associate-/r/73.0%
/-rgt-identity73.0%
associate-*l*73.0%
*-commutative73.0%
sqr-neg73.0%
+-commutative73.0%
sqr-neg73.0%
fma-def73.0%
Simplified73.0%
Taylor expanded in y around 0 73.0%
associate-*r*71.4%
+-commutative71.4%
unpow271.4%
fma-udef71.4%
Simplified71.4%
associate-*l*73.0%
associate-/r*73.0%
*-un-lft-identity73.0%
frac-times73.0%
associate-*r/71.3%
add-sqr-sqrt71.3%
times-frac73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def73.0%
fma-udef73.0%
+-commutative73.0%
hypot-1-def98.5%
Applied egg-rr98.5%
*-commutative98.5%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in z around inf 73.0%
*-commutative73.0%
associate-*l*73.0%
*-commutative73.0%
associate-/r*73.0%
Simplified73.0%
associate-/r*71.3%
un-div-inv71.3%
unpow271.3%
times-frac98.5%
Applied egg-rr98.5%
Final simplification97.8%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(let* ((t_0 (* y_m (+ 1.0 (* z z)))))
(*
y_s
(*
x_s
(if (<= t_0 5e+301)
(/ (/ 1.0 x_m) t_0)
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = y_m * (1.0 + (z * z));
double tmp;
if (t_0 <= 5e+301) {
tmp = (1.0 / x_m) / t_0;
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y_m * (1.0d0 + (z * z))
if (t_0 <= 5d+301) then
tmp = (1.0d0 / x_m) / t_0
else
tmp = ((1.0d0 / y_m) / z) * ((1.0d0 / x_m) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = y_m * (1.0 + (z * z));
double tmp;
if (t_0 <= 5e+301) {
tmp = (1.0 / x_m) / t_0;
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): t_0 = y_m * (1.0 + (z * z)) tmp = 0 if t_0 <= 5e+301: tmp = (1.0 / x_m) / t_0 else: tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) t_0 = Float64(y_m * Float64(1.0 + Float64(z * z))) tmp = 0.0 if (t_0 <= 5e+301) tmp = Float64(Float64(1.0 / x_m) / t_0); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
t_0 = y_m * (1.0 + (z * z));
tmp = 0.0;
if (t_0 <= 5e+301)
tmp = (1.0 / x_m) / t_0;
else
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[t$95$0, 5e+301], N[(N[(1.0 / x$95$m), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := y_m \cdot \left(1 + z \cdot z\right)\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\frac{\frac{1}{x_m}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
\end{array}
if (*.f64 y (+.f64 1 (*.f64 z z))) < 5.0000000000000004e301Initial program 93.6%
if 5.0000000000000004e301 < (*.f64 y (+.f64 1 (*.f64 z z))) Initial program 64.1%
associate-/l/64.1%
metadata-eval64.1%
associate-*r/64.1%
associate-/l/64.1%
associate-*r/64.1%
associate-/l*64.1%
associate-/r/64.1%
/-rgt-identity64.1%
associate-*l*76.9%
*-commutative76.9%
sqr-neg76.9%
+-commutative76.9%
sqr-neg76.9%
fma-def76.9%
Simplified76.9%
Taylor expanded in y around 0 64.1%
associate-*r*76.8%
+-commutative76.8%
unpow276.8%
fma-udef76.8%
Simplified76.8%
associate-*l*64.1%
associate-/r*64.1%
*-un-lft-identity64.1%
frac-times76.9%
associate-*r/76.5%
add-sqr-sqrt76.5%
times-frac74.3%
fma-udef74.3%
+-commutative74.3%
hypot-1-def74.3%
fma-udef74.3%
+-commutative74.3%
hypot-1-def97.2%
Applied egg-rr97.2%
*-commutative97.2%
associate-/l/97.2%
Simplified97.2%
Taylor expanded in z around inf 64.1%
*-commutative64.1%
associate-*l*76.9%
*-commutative76.9%
associate-/r*76.9%
Simplified76.9%
associate-/r*76.5%
un-div-inv76.5%
unpow276.5%
times-frac97.2%
Applied egg-rr97.2%
Final simplification94.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (* z z) 50000000000000.0)
(/ 1.0 (* x_m (* y_m (+ 1.0 (* z z)))))
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z * z) <= 50000000000000.0) {
tmp = 1.0 / (x_m * (y_m * (1.0 + (z * z))));
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 50000000000000.0d0) then
tmp = 1.0d0 / (x_m * (y_m * (1.0d0 + (z * z))))
else
tmp = ((1.0d0 / y_m) / z) * ((1.0d0 / x_m) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z * z) <= 50000000000000.0) {
tmp = 1.0 / (x_m * (y_m * (1.0 + (z * z))));
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if (z * z) <= 50000000000000.0: tmp = 1.0 / (x_m * (y_m * (1.0 + (z * z)))) else: tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(z * z) <= 50000000000000.0) tmp = Float64(1.0 / Float64(x_m * Float64(y_m * Float64(1.0 + Float64(z * z))))); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if ((z * z) <= 50000000000000.0)
tmp = 1.0 / (x_m * (y_m * (1.0 + (z * z))));
else
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 50000000000000.0], N[(1.0 / N[(x$95$m * N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 50000000000000:\\
\;\;\;\;\frac{1}{x_m \cdot \left(y_m \cdot \left(1 + z \cdot z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
if (*.f64 z z) < 5e13Initial program 99.6%
associate-/l/99.4%
Simplified99.4%
if 5e13 < (*.f64 z z) Initial program 79.1%
associate-/l/78.9%
metadata-eval78.9%
associate-*r/78.9%
associate-/l/79.1%
associate-*r/79.1%
associate-/l*78.9%
associate-/r/78.9%
/-rgt-identity78.9%
associate-*l*81.9%
*-commutative81.9%
sqr-neg81.9%
+-commutative81.9%
sqr-neg81.9%
fma-def81.9%
Simplified81.9%
Taylor expanded in y around 0 78.9%
associate-*r*79.9%
+-commutative79.9%
unpow279.9%
fma-udef79.9%
Simplified79.9%
associate-*l*78.9%
associate-/r*79.1%
*-un-lft-identity79.1%
frac-times82.1%
associate-*r/79.7%
add-sqr-sqrt79.7%
times-frac83.0%
fma-udef83.0%
+-commutative83.0%
hypot-1-def83.0%
fma-udef83.0%
+-commutative83.0%
hypot-1-def96.9%
Applied egg-rr96.9%
*-commutative96.9%
associate-/l/96.8%
Simplified96.8%
Taylor expanded in z around inf 78.9%
*-commutative78.9%
associate-*l*81.9%
*-commutative81.9%
associate-/r*82.0%
Simplified82.0%
associate-/r*79.7%
un-div-inv79.7%
unpow279.7%
times-frac96.9%
Applied egg-rr96.9%
Final simplification98.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z 1.0)
(/ (/ 1.0 x_m) y_m)
(* (/ 1.0 z) (/ (/ 1.0 x_m) (* z y_m)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x_m) / y_m;
} else {
tmp = (1.0 / z) * ((1.0 / x_m) / (z * y_m));
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.0d0) then
tmp = (1.0d0 / x_m) / y_m
else
tmp = (1.0d0 / z) * ((1.0d0 / x_m) / (z * y_m))
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x_m) / y_m;
} else {
tmp = (1.0 / z) * ((1.0 / x_m) / (z * y_m));
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= 1.0: tmp = (1.0 / x_m) / y_m else: tmp = (1.0 / z) * ((1.0 / x_m) / (z * y_m)) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= 1.0) tmp = Float64(Float64(1.0 / x_m) / y_m); else tmp = Float64(Float64(1.0 / z) * Float64(Float64(1.0 / x_m) / Float64(z * y_m))); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= 1.0)
tmp = (1.0 / x_m) / y_m;
else
tmp = (1.0 / z) * ((1.0 / x_m) / (z * y_m));
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, 1.0], N[(N[(1.0 / x$95$m), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x_m}}{y_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\frac{1}{x_m}}{z \cdot y_m}\\
\end{array}\right)
\end{array}
if z < 1Initial program 91.9%
Taylor expanded in z around 0 66.7%
if 1 < z Initial program 81.3%
associate-/l/81.3%
metadata-eval81.3%
associate-*r/81.3%
associate-/l/81.3%
associate-*r/81.3%
associate-/l*81.2%
associate-/r/81.3%
/-rgt-identity81.3%
associate-*l*85.9%
*-commutative85.9%
sqr-neg85.9%
+-commutative85.9%
sqr-neg85.9%
fma-def85.9%
Simplified85.9%
Taylor expanded in y around 0 81.3%
associate-*r*81.9%
+-commutative81.9%
unpow281.9%
fma-udef81.9%
Simplified81.9%
associate-*l*81.3%
associate-/r*81.3%
*-un-lft-identity81.3%
frac-times85.9%
associate-*r/81.1%
add-sqr-sqrt81.1%
times-frac84.3%
fma-udef84.3%
+-commutative84.3%
hypot-1-def84.3%
fma-udef84.3%
+-commutative84.3%
hypot-1-def96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l/96.7%
Simplified96.7%
Taylor expanded in z around inf 81.3%
*-commutative81.3%
associate-*l*85.9%
*-commutative85.9%
associate-/r*86.0%
Simplified86.0%
associate-/r*81.2%
un-div-inv81.1%
*-un-lft-identity81.1%
unpow281.1%
times-frac91.8%
associate-*l/91.8%
*-un-lft-identity91.8%
associate-/r*94.9%
*-commutative94.9%
Applied egg-rr94.9%
Final simplification73.4%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z 1.0)
(/ (/ 1.0 x_m) y_m)
(* (/ (/ 1.0 y_m) z) (/ (/ 1.0 x_m) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x_m) / y_m;
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.0d0) then
tmp = (1.0d0 / x_m) / y_m
else
tmp = ((1.0d0 / y_m) / z) * ((1.0d0 / x_m) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x_m) / y_m;
} else {
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= 1.0: tmp = (1.0 / x_m) / y_m else: tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= 1.0) tmp = Float64(Float64(1.0 / x_m) / y_m); else tmp = Float64(Float64(Float64(1.0 / y_m) / z) * Float64(Float64(1.0 / x_m) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= 1.0)
tmp = (1.0 / x_m) / y_m;
else
tmp = ((1.0 / y_m) / z) * ((1.0 / x_m) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, 1.0], N[(N[(1.0 / x$95$m), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(1.0 / y$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(N[(1.0 / x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x_m}}{y_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y_m}}{z} \cdot \frac{\frac{1}{x_m}}{z}\\
\end{array}\right)
\end{array}
if z < 1Initial program 91.9%
Taylor expanded in z around 0 66.7%
if 1 < z Initial program 81.3%
associate-/l/81.3%
metadata-eval81.3%
associate-*r/81.3%
associate-/l/81.3%
associate-*r/81.3%
associate-/l*81.2%
associate-/r/81.3%
/-rgt-identity81.3%
associate-*l*85.9%
*-commutative85.9%
sqr-neg85.9%
+-commutative85.9%
sqr-neg85.9%
fma-def85.9%
Simplified85.9%
Taylor expanded in y around 0 81.3%
associate-*r*81.9%
+-commutative81.9%
unpow281.9%
fma-udef81.9%
Simplified81.9%
associate-*l*81.3%
associate-/r*81.3%
*-un-lft-identity81.3%
frac-times85.9%
associate-*r/81.1%
add-sqr-sqrt81.1%
times-frac84.3%
fma-udef84.3%
+-commutative84.3%
hypot-1-def84.3%
fma-udef84.3%
+-commutative84.3%
hypot-1-def96.6%
Applied egg-rr96.6%
*-commutative96.6%
associate-/l/96.7%
Simplified96.7%
Taylor expanded in z around inf 81.3%
*-commutative81.3%
associate-*l*85.9%
*-commutative85.9%
associate-/r*86.0%
Simplified86.0%
associate-/r*81.2%
un-div-inv81.1%
unpow281.1%
times-frac96.6%
Applied egg-rr96.6%
Final simplification73.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (if (<= z 1.0) (/ (/ 1.0 x_m) y_m) (/ 1.0 (* x_m (* z y_m)))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x_m) / y_m;
} else {
tmp = 1.0 / (x_m * (z * y_m));
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.0d0) then
tmp = (1.0d0 / x_m) / y_m
else
tmp = 1.0d0 / (x_m * (z * y_m))
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x_m) / y_m;
} else {
tmp = 1.0 / (x_m * (z * y_m));
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= 1.0: tmp = (1.0 / x_m) / y_m else: tmp = 1.0 / (x_m * (z * y_m)) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= 1.0) tmp = Float64(Float64(1.0 / x_m) / y_m); else tmp = Float64(1.0 / Float64(x_m * Float64(z * y_m))); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= 1.0)
tmp = (1.0 / x_m) / y_m;
else
tmp = 1.0 / (x_m * (z * y_m));
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, 1.0], N[(N[(1.0 / x$95$m), $MachinePrecision] / y$95$m), $MachinePrecision], N[(1.0 / N[(x$95$m * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x_m}}{y_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x_m \cdot \left(z \cdot y_m\right)}\\
\end{array}\right)
\end{array}
if z < 1Initial program 91.9%
Taylor expanded in z around 0 66.7%
if 1 < z Initial program 81.3%
associate-/l/81.3%
metadata-eval81.3%
associate-*r/81.3%
associate-/l/81.3%
associate-*r/81.3%
associate-/l*81.2%
associate-/r/81.3%
/-rgt-identity81.3%
associate-*l*85.9%
*-commutative85.9%
sqr-neg85.9%
+-commutative85.9%
sqr-neg85.9%
fma-def85.9%
Simplified85.9%
fma-udef85.9%
+-commutative85.9%
*-commutative85.9%
associate-*l*81.3%
associate-/l/81.3%
add-sqr-sqrt36.4%
*-un-lft-identity36.4%
times-frac36.4%
*-commutative36.4%
sqrt-prod36.5%
hypot-1-def36.5%
*-commutative36.5%
sqrt-prod39.5%
hypot-1-def45.6%
Applied egg-rr45.6%
frac-times39.5%
*-un-lft-identity39.5%
swap-sqr36.4%
pow236.4%
add-sqr-sqrt81.3%
associate-/r*86.0%
hypot-udef86.0%
sqrt-pow286.0%
metadata-eval86.0%
metadata-eval86.0%
pow186.0%
+-commutative86.0%
fma-udef86.0%
associate-/l/81.3%
associate-/r*81.3%
associate-*l*81.9%
associate-/r*81.2%
*-commutative81.2%
add-sqr-sqrt81.2%
Applied egg-rr91.9%
Taylor expanded in z around inf 95.0%
Taylor expanded in z around 0 43.1%
Final simplification61.1%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (/ 1.0 (* y_m x_m)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (1.0 / (y_m * x_m)));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (x_s * (1.0d0 / (y_m * x_m)))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (1.0 / (y_m * x_m)));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * (1.0 / (y_m * x_m)))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(1.0 / Float64(y_m * x_m)))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * (1.0 / (y_m * x_m)));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(1.0 / N[(y$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \frac{1}{y_m \cdot x_m}\right)
\end{array}
Initial program 89.4%
associate-/l/89.1%
metadata-eval89.1%
associate-*r/89.1%
associate-/l/89.4%
associate-*r/89.4%
associate-/l*89.0%
associate-/r/89.1%
/-rgt-identity89.1%
associate-*l*90.6%
*-commutative90.6%
sqr-neg90.6%
+-commutative90.6%
sqr-neg90.6%
fma-def90.6%
Simplified90.6%
Taylor expanded in z around 0 55.5%
Final simplification55.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 1.0 (* z z))) (t_1 (* y t_0)) (t_2 (/ (/ 1.0 y) (* t_0 x))))
(if (< t_1 (- INFINITY))
t_2
(if (< t_1 8.680743250567252e+305) (/ (/ 1.0 x) (* t_0 y)) t_2))))
double code(double x, double y, double z) {
double t_0 = 1.0 + (z * z);
double t_1 = y * t_0;
double t_2 = (1.0 / y) / (t_0 * x);
double tmp;
if (t_1 < -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 < 8.680743250567252e+305) {
tmp = (1.0 / x) / (t_0 * y);
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = 1.0 + (z * z);
double t_1 = y * t_0;
double t_2 = (1.0 / y) / (t_0 * x);
double tmp;
if (t_1 < -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 < 8.680743250567252e+305) {
tmp = (1.0 / x) / (t_0 * y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 + (z * z) t_1 = y * t_0 t_2 = (1.0 / y) / (t_0 * x) tmp = 0 if t_1 < -math.inf: tmp = t_2 elif t_1 < 8.680743250567252e+305: tmp = (1.0 / x) / (t_0 * y) else: tmp = t_2 return tmp
function code(x, y, z) t_0 = Float64(1.0 + Float64(z * z)) t_1 = Float64(y * t_0) t_2 = Float64(Float64(1.0 / y) / Float64(t_0 * x)) tmp = 0.0 if (t_1 < Float64(-Inf)) tmp = t_2; elseif (t_1 < 8.680743250567252e+305) tmp = Float64(Float64(1.0 / x) / Float64(t_0 * y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 + (z * z); t_1 = y * t_0; t_2 = (1.0 / y) / (t_0 * x); tmp = 0.0; if (t_1 < -Inf) tmp = t_2; elseif (t_1 < 8.680743250567252e+305) tmp = (1.0 / x) / (t_0 * y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / y), $MachinePrecision] / N[(t$95$0 * x), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$1, (-Infinity)], t$95$2, If[Less[t$95$1, 8.680743250567252e+305], N[(N[(1.0 / x), $MachinePrecision] / N[(t$95$0 * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + z \cdot z\\
t_1 := y \cdot t_0\\
t_2 := \frac{\frac{1}{y}}{t_0 \cdot x}\\
\mathbf{if}\;t_1 < -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 < 8.680743250567252 \cdot 10^{+305}:\\
\;\;\;\;\frac{\frac{1}{x}}{t_0 \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2024020
(FPCore (x y z)
:name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< (* y (+ 1.0 (* z z))) (- INFINITY)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x)) (if (< (* y (+ 1.0 (* z z))) 8.680743250567252e+305) (/ (/ 1.0 x) (* (+ 1.0 (* z z)) y)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x))))
(/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))