
(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 10 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}
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) NOTE: x, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ (/ (/ (/ 1.0 (sqrt y_m)) (hypot 1.0 z)) x) (* (sqrt y_m) (hypot 1.0 z)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
return y_s * ((((1.0 / sqrt(y_m)) / hypot(1.0, z)) / x) / (sqrt(y_m) * hypot(1.0, z)));
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
return y_s * ((((1.0 / Math.sqrt(y_m)) / Math.hypot(1.0, z)) / x) / (Math.sqrt(y_m) * Math.hypot(1.0, z)));
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): return y_s * ((((1.0 / math.sqrt(y_m)) / math.hypot(1.0, z)) / x) / (math.sqrt(y_m) * math.hypot(1.0, z)))
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) return Float64(y_s * Float64(Float64(Float64(Float64(1.0 / sqrt(y_m)) / hypot(1.0, z)) / x) / Float64(sqrt(y_m) * hypot(1.0, z)))) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp = code(y_s, x, y_m, z)
tmp = y_s * ((((1.0 / sqrt(y_m)) / hypot(1.0, z)) / x) / (sqrt(y_m) * hypot(1.0, z)));
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(N[(N[(N[(1.0 / N[Sqrt[y$95$m], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[(N[Sqrt[y$95$m], $MachinePrecision] * N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \frac{\frac{\frac{\frac{1}{\sqrt{y\_m}}}{\mathsf{hypot}\left(1, z\right)}}{x}}{\sqrt{y\_m} \cdot \mathsf{hypot}\left(1, z\right)}
\end{array}
Initial program 90.5%
associate-/l/90.4%
associate-*l*91.5%
*-commutative91.5%
sqr-neg91.5%
+-commutative91.5%
sqr-neg91.5%
fma-define91.5%
Simplified91.5%
associate-*r*92.5%
*-commutative92.5%
associate-/r*92.6%
*-commutative92.6%
associate-/l/92.6%
fma-undefine92.6%
+-commutative92.6%
associate-/r*90.5%
*-un-lft-identity90.5%
add-sqr-sqrt47.6%
times-frac47.6%
+-commutative47.6%
fma-undefine47.6%
*-commutative47.6%
sqrt-prod47.5%
fma-undefine47.5%
+-commutative47.5%
hypot-1-def47.5%
+-commutative47.5%
Applied egg-rr50.8%
associate-*r/50.8%
associate-*r/50.9%
*-rgt-identity50.9%
*-commutative50.9%
associate-/r*50.9%
Simplified50.9%
Final simplification50.9%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) NOTE: x, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ (/ 1.0 y_m) (* (hypot 1.0 z) (* (hypot 1.0 z) x)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
return y_s * ((1.0 / y_m) / (hypot(1.0, z) * (hypot(1.0, z) * x)));
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
return y_s * ((1.0 / y_m) / (Math.hypot(1.0, z) * (Math.hypot(1.0, z) * x)));
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): return y_s * ((1.0 / y_m) / (math.hypot(1.0, z) * (math.hypot(1.0, z) * x)))
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) return Float64(y_s * Float64(Float64(1.0 / y_m) / Float64(hypot(1.0, z) * Float64(hypot(1.0, z) * x)))) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp = code(y_s, x, y_m, z)
tmp = y_s * ((1.0 / y_m) / (hypot(1.0, z) * (hypot(1.0, z) * x)));
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(N[(1.0 / y$95$m), $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \frac{\frac{1}{y\_m}}{\mathsf{hypot}\left(1, z\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot x\right)}
\end{array}
Initial program 90.5%
associate-/l/90.4%
associate-*l*91.5%
*-commutative91.5%
sqr-neg91.5%
+-commutative91.5%
sqr-neg91.5%
fma-define91.5%
Simplified91.5%
associate-*r*92.5%
*-commutative92.5%
associate-/r*92.6%
*-commutative92.6%
associate-/l/92.6%
fma-undefine92.6%
+-commutative92.6%
associate-/r*90.5%
*-un-lft-identity90.5%
add-sqr-sqrt47.6%
times-frac47.6%
+-commutative47.6%
fma-undefine47.6%
*-commutative47.6%
sqrt-prod47.5%
fma-undefine47.5%
+-commutative47.5%
hypot-1-def47.5%
+-commutative47.5%
Applied egg-rr50.8%
associate-*r/50.8%
associate-*r/50.9%
*-rgt-identity50.9%
*-commutative50.9%
associate-/r*50.9%
Simplified50.9%
*-un-lft-identity50.9%
div-inv50.8%
associate-/l/50.8%
associate-/l/50.8%
frac-times48.6%
frac-times48.7%
metadata-eval48.7%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
Final simplification96.0%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) NOTE: x, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ 1.0 (* y_m (* (hypot 1.0 z) (* (hypot 1.0 z) x))))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
return y_s * (1.0 / (y_m * (hypot(1.0, z) * (hypot(1.0, z) * x))));
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
return y_s * (1.0 / (y_m * (Math.hypot(1.0, z) * (Math.hypot(1.0, z) * x))));
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): return y_s * (1.0 / (y_m * (math.hypot(1.0, z) * (math.hypot(1.0, z) * x))))
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) return Float64(y_s * Float64(1.0 / Float64(y_m * Float64(hypot(1.0, z) * Float64(hypot(1.0, z) * x))))) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp = code(y_s, x, y_m, z)
tmp = y_s * (1.0 / (y_m * (hypot(1.0, z) * (hypot(1.0, z) * x))));
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(1.0 / N[(y$95$m * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \frac{1}{y\_m \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot x\right)\right)}
\end{array}
Initial program 90.5%
associate-/l/90.4%
associate-*l*91.5%
*-commutative91.5%
sqr-neg91.5%
+-commutative91.5%
sqr-neg91.5%
fma-define91.5%
Simplified91.5%
add-sqr-sqrt49.4%
pow249.4%
*-commutative49.4%
sqrt-prod49.4%
fma-undefine49.4%
+-commutative49.4%
hypot-1-def52.4%
Applied egg-rr52.4%
unpow252.4%
associate-*l*52.4%
*-commutative52.4%
associate-*l*52.4%
add-sqr-sqrt95.9%
Applied egg-rr95.9%
Final simplification95.9%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (* z z) 1e+24)
(/ (/ 1.0 x) (* y_m (+ 1.0 (* z z))))
(/ 1.0 (* y_m (* (hypot 1.0 z) (* z x)))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 1e+24) {
tmp = (1.0 / x) / (y_m * (1.0 + (z * z)));
} else {
tmp = 1.0 / (y_m * (hypot(1.0, z) * (z * x)));
}
return y_s * tmp;
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 1e+24) {
tmp = (1.0 / x) / (y_m * (1.0 + (z * z)));
} else {
tmp = 1.0 / (y_m * (Math.hypot(1.0, z) * (z * x)));
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): tmp = 0 if (z * z) <= 1e+24: tmp = (1.0 / x) / (y_m * (1.0 + (z * z))) else: tmp = 1.0 / (y_m * (math.hypot(1.0, z) * (z * x))) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(z * z) <= 1e+24) tmp = Float64(Float64(1.0 / x) / Float64(y_m * Float64(1.0 + Float64(z * z)))); else tmp = Float64(1.0 / Float64(y_m * Float64(hypot(1.0, z) * Float64(z * x)))); end return Float64(y_s * tmp) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp_2 = code(y_s, x, y_m, z)
tmp = 0.0;
if ((z * z) <= 1e+24)
tmp = (1.0 / x) / (y_m * (1.0 + (z * z)));
else
tmp = 1.0 / (y_m * (hypot(1.0, z) * (z * x)));
end
tmp_2 = y_s * tmp;
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 1e+24], N[(N[(1.0 / x), $MachinePrecision] / N[(y$95$m * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y$95$m * N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 10^{+24}:\\
\;\;\;\;\frac{\frac{1}{x}}{y\_m \cdot \left(1 + z \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(\mathsf{hypot}\left(1, z\right) \cdot \left(z \cdot x\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 9.9999999999999998e23Initial program 99.6%
if 9.9999999999999998e23 < (*.f64 z z) Initial program 78.3%
associate-/l/78.4%
associate-*l*80.9%
*-commutative80.9%
sqr-neg80.9%
+-commutative80.9%
sqr-neg80.9%
fma-define80.9%
Simplified80.9%
add-sqr-sqrt44.0%
pow244.0%
*-commutative44.0%
sqrt-prod44.1%
fma-undefine44.1%
+-commutative44.1%
hypot-1-def51.0%
Applied egg-rr51.0%
unpow251.0%
associate-*l*51.0%
*-commutative51.0%
associate-*l*51.0%
add-sqr-sqrt91.2%
Applied egg-rr91.2%
Taylor expanded in z around inf 70.9%
Final simplification87.3%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= z 1e+154)
(/ 1.0 (* y_m (* x (fma z z 1.0))))
(* (/ (/ 1.0 z) y_m) (/ (/ 1.0 z) x)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (z <= 1e+154) {
tmp = 1.0 / (y_m * (x * fma(z, z, 1.0)));
} else {
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
}
return y_s * tmp;
}
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) tmp = 0.0 if (z <= 1e+154) tmp = Float64(1.0 / Float64(y_m * Float64(x * fma(z, z, 1.0)))); else tmp = Float64(Float64(Float64(1.0 / z) / y_m) * Float64(Float64(1.0 / z) / x)); end return Float64(y_s * tmp) end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[z, 1e+154], N[(1.0 / N[(y$95$m * N[(x * N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 10^{+154}:\\
\;\;\;\;\frac{1}{y\_m \cdot \left(x \cdot \mathsf{fma}\left(z, z, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{y\_m} \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if z < 1.00000000000000004e154Initial program 92.5%
associate-/l/92.4%
associate-*l*93.6%
*-commutative93.6%
sqr-neg93.6%
+-commutative93.6%
sqr-neg93.6%
fma-define93.6%
Simplified93.6%
if 1.00000000000000004e154 < z Initial program 67.1%
associate-/l/67.1%
associate-*l*67.1%
*-commutative67.1%
sqr-neg67.1%
+-commutative67.1%
sqr-neg67.1%
fma-define67.1%
Simplified67.1%
Taylor expanded in y around 0 67.1%
associate-*r*66.9%
+-commutative66.9%
unpow266.9%
fma-undefine66.9%
associate-/l/66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
add-sqr-sqrt66.9%
*-commutative66.9%
times-frac67.1%
sqrt-div67.1%
metadata-eval67.1%
sqrt-pow167.1%
metadata-eval67.1%
pow167.1%
sqrt-div67.1%
metadata-eval67.1%
sqrt-pow190.6%
metadata-eval90.6%
pow190.6%
Applied egg-rr90.6%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (* y_m (+ 1.0 (* z z)))))
(*
y_s
(if (<= t_0 INFINITY)
(/ (/ 1.0 x) t_0)
(* (/ (/ 1.0 z) y_m) (/ (/ 1.0 z) x))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
double t_0 = y_m * (1.0 + (z * z));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = (1.0 / x) / t_0;
} else {
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
}
return y_s * tmp;
}
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
double t_0 = y_m * (1.0 + (z * z));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (1.0 / x) / t_0;
} else {
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): t_0 = y_m * (1.0 + (z * z)) tmp = 0 if t_0 <= math.inf: tmp = (1.0 / x) / t_0 else: tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) t_0 = Float64(y_m * Float64(1.0 + Float64(z * z))) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(Float64(1.0 / x) / t_0); else tmp = Float64(Float64(Float64(1.0 / z) / y_m) * Float64(Float64(1.0 / z) / x)); end return Float64(y_s * tmp) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp_2 = code(y_s, x, y_m, z)
t_0 = y_m * (1.0 + (z * z));
tmp = 0.0;
if (t_0 <= Inf)
tmp = (1.0 / x) / t_0;
else
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
end
tmp_2 = y_s * tmp;
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, 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 * If[LessEqual[t$95$0, Infinity], N[(N[(1.0 / x), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
\begin{array}{l}
t_0 := y\_m \cdot \left(1 + z \cdot z\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\frac{1}{x}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{y\_m} \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
\end{array}
if (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))) < +inf.0Initial program 90.5%
if +inf.0 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))) Initial program 90.5%
associate-/l/90.4%
associate-*l*91.5%
*-commutative91.5%
sqr-neg91.5%
+-commutative91.5%
sqr-neg91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in y around 0 90.4%
associate-*r*92.5%
+-commutative92.5%
unpow292.5%
fma-undefine92.5%
associate-/l/92.6%
Simplified92.6%
Taylor expanded in z around inf 49.2%
add-sqr-sqrt49.2%
*-commutative49.2%
times-frac47.8%
sqrt-div47.9%
metadata-eval47.9%
sqrt-pow135.9%
metadata-eval35.9%
pow135.9%
sqrt-div35.9%
metadata-eval35.9%
sqrt-pow153.4%
metadata-eval53.4%
pow153.4%
Applied egg-rr53.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (* z z) 4e-5)
(/ (/ 1.0 x) y_m)
(* (/ (/ 1.0 z) y_m) (/ (/ 1.0 z) x)))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 4e-5) {
tmp = (1.0 / x) / y_m;
} else {
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 4d-5) then
tmp = (1.0d0 / x) / y_m
else
tmp = ((1.0d0 / z) / y_m) * ((1.0d0 / z) / x)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 4e-5) {
tmp = (1.0 / x) / y_m;
} else {
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): tmp = 0 if (z * z) <= 4e-5: tmp = (1.0 / x) / y_m else: tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(z * z) <= 4e-5) tmp = Float64(Float64(1.0 / x) / y_m); else tmp = Float64(Float64(Float64(1.0 / z) / y_m) * Float64(Float64(1.0 / z) / x)); end return Float64(y_s * tmp) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp_2 = code(y_s, x, y_m, z)
tmp = 0.0;
if ((z * z) <= 4e-5)
tmp = (1.0 / x) / y_m;
else
tmp = ((1.0 / z) / y_m) * ((1.0 / z) / x);
end
tmp_2 = y_s * tmp;
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 4e-5], N[(N[(1.0 / x), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{x}}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{y\_m} \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000033e-5Initial program 99.6%
Taylor expanded in z around 0 98.8%
if 4.00000000000000033e-5 < (*.f64 z z) Initial program 79.5%
associate-/l/79.5%
associate-*l*81.8%
*-commutative81.8%
sqr-neg81.8%
+-commutative81.8%
sqr-neg81.8%
fma-define81.8%
Simplified81.8%
Taylor expanded in y around 0 79.5%
associate-*r*84.2%
+-commutative84.2%
unpow284.2%
fma-undefine84.2%
associate-/l/84.2%
Simplified84.2%
Taylor expanded in z around inf 83.0%
add-sqr-sqrt82.9%
*-commutative82.9%
times-frac83.1%
sqrt-div83.2%
metadata-eval83.2%
sqrt-pow167.5%
metadata-eval67.5%
pow167.5%
sqrt-div67.5%
metadata-eval67.5%
sqrt-pow195.4%
metadata-eval95.4%
pow195.4%
Applied egg-rr95.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= (* z z) 4e-5)
(/ (/ 1.0 x) y_m)
(* (/ 1.0 z) (/ (/ 1.0 z) (* y_m x))))))y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 4e-5) {
tmp = (1.0 / x) / y_m;
} else {
tmp = (1.0 / z) * ((1.0 / z) / (y_m * x));
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 4d-5) then
tmp = (1.0d0 / x) / y_m
else
tmp = (1.0d0 / z) * ((1.0d0 / z) / (y_m * x))
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 4e-5) {
tmp = (1.0 / x) / y_m;
} else {
tmp = (1.0 / z) * ((1.0 / z) / (y_m * x));
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): tmp = 0 if (z * z) <= 4e-5: tmp = (1.0 / x) / y_m else: tmp = (1.0 / z) * ((1.0 / z) / (y_m * x)) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(z * z) <= 4e-5) tmp = Float64(Float64(1.0 / x) / y_m); else tmp = Float64(Float64(1.0 / z) * Float64(Float64(1.0 / z) / Float64(y_m * x))); end return Float64(y_s * tmp) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp_2 = code(y_s, x, y_m, z)
tmp = 0.0;
if ((z * z) <= 4e-5)
tmp = (1.0 / x) / y_m;
else
tmp = (1.0 / z) * ((1.0 / z) / (y_m * x));
end
tmp_2 = y_s * tmp;
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 4e-5], N[(N[(1.0 / x), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / z), $MachinePrecision] / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{x}}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\frac{1}{z}}{y\_m \cdot x}\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000033e-5Initial program 99.6%
Taylor expanded in z around 0 98.8%
if 4.00000000000000033e-5 < (*.f64 z z) Initial program 79.5%
associate-/l/79.5%
associate-*l*81.8%
*-commutative81.8%
sqr-neg81.8%
+-commutative81.8%
sqr-neg81.8%
fma-define81.8%
Simplified81.8%
Taylor expanded in y around 0 79.5%
associate-*r*84.2%
+-commutative84.2%
unpow284.2%
fma-undefine84.2%
associate-/l/84.2%
Simplified84.2%
Taylor expanded in z around inf 83.0%
add-sqr-sqrt82.9%
associate-/l*82.9%
sqrt-div83.0%
metadata-eval83.0%
sqrt-pow168.1%
metadata-eval68.1%
pow168.1%
sqrt-div68.0%
metadata-eval68.0%
sqrt-pow192.7%
metadata-eval92.7%
pow192.7%
*-commutative92.7%
Applied egg-rr92.7%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) NOTE: x, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= (* z z) 1.0) (/ (/ 1.0 x) y_m) (/ (/ 1.0 (* z z)) (* y_m x)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 1.0) {
tmp = (1.0 / x) / y_m;
} else {
tmp = (1.0 / (z * z)) / (y_m * x);
}
return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 1.0d0) then
tmp = (1.0d0 / x) / y_m
else
tmp = (1.0d0 / (z * z)) / (y_m * x)
end if
code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((z * z) <= 1.0) {
tmp = (1.0 / x) / y_m;
} else {
tmp = (1.0 / (z * z)) / (y_m * x);
}
return y_s * tmp;
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): tmp = 0 if (z * z) <= 1.0: tmp = (1.0 / x) / y_m else: tmp = (1.0 / (z * z)) / (y_m * x) return y_s * tmp
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) tmp = 0.0 if (Float64(z * z) <= 1.0) tmp = Float64(Float64(1.0 / x) / y_m); else tmp = Float64(Float64(1.0 / Float64(z * z)) / Float64(y_m * x)); end return Float64(y_s * tmp) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp_2 = code(y_s, x, y_m, z)
tmp = 0.0;
if ((z * z) <= 1.0)
tmp = (1.0 / x) / y_m;
else
tmp = (1.0 / (z * z)) / (y_m * x);
end
tmp_2 = y_s * tmp;
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(z * z), $MachinePrecision], 1.0], N[(N[(1.0 / x), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(1.0 / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \cdot z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x}}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z \cdot z}}{y\_m \cdot x}\\
\end{array}
\end{array}
if (*.f64 z z) < 1Initial program 99.6%
Taylor expanded in z around 0 98.8%
if 1 < (*.f64 z z) Initial program 79.5%
associate-/l/79.5%
associate-*l*81.8%
*-commutative81.8%
sqr-neg81.8%
+-commutative81.8%
sqr-neg81.8%
fma-define81.8%
Simplified81.8%
Taylor expanded in y around 0 79.5%
associate-*r*84.2%
+-commutative84.2%
unpow284.2%
fma-undefine84.2%
associate-/l/84.2%
Simplified84.2%
Taylor expanded in z around inf 83.0%
unpow283.0%
Applied egg-rr83.0%
Final simplification91.7%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) NOTE: x, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ 1.0 (* y_m x))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
assert(x < y_m && y_m < z);
double code(double y_s, double x, double y_m, double z) {
return y_s * (1.0 / (y_m * x));
}
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
NOTE: x, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (1.0d0 / (y_m * x))
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
assert x < y_m && y_m < z;
public static double code(double y_s, double x, double y_m, double z) {
return y_s * (1.0 / (y_m * x));
}
y\_m = math.fabs(y) y\_s = math.copysign(1.0, y) [x, y_m, z] = sort([x, y_m, z]) def code(y_s, x, y_m, z): return y_s * (1.0 / (y_m * x))
y\_m = abs(y) y\_s = copysign(1.0, y) x, y_m, z = sort([x, y_m, z]) function code(y_s, x, y_m, z) return Float64(y_s * Float64(1.0 / Float64(y_m * x))) end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
x, y_m, z = num2cell(sort([x, y_m, z])){:}
function tmp = code(y_s, x, y_m, z)
tmp = y_s * (1.0 / (y_m * x));
end
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, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(1.0 / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
[x, y_m, z] = \mathsf{sort}([x, y_m, z])\\
\\
y\_s \cdot \frac{1}{y\_m \cdot x}
\end{array}
Initial program 90.5%
associate-/l/90.4%
associate-*l*91.5%
*-commutative91.5%
sqr-neg91.5%
+-commutative91.5%
sqr-neg91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in z around 0 63.0%
(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 2024116
(FPCore (x y z)
:name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (if (< (* y (+ 1 (* z z))) -inf.0) (/ (/ 1 y) (* (+ 1 (* z z)) x)) (if (< (* y (+ 1 (* z z))) 868074325056725200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (/ 1 x) (* (+ 1 (* z z)) y)) (/ (/ 1 y) (* (+ 1 (* z z)) x)))))
(/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))