
(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 12 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}
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (if (<= (* y (+ 1.0 (* z_m z_m))) 4e+307) (/ (/ 1.0 x) (fma (* z_m y) z_m y)) (* (/ 1.0 (hypot 1.0 z_m)) (/ 1.0 (* y (* z_m x))))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double tmp;
if ((y * (1.0 + (z_m * z_m))) <= 4e+307) {
tmp = (1.0 / x) / fma((z_m * y), z_m, y);
} else {
tmp = (1.0 / hypot(1.0, z_m)) * (1.0 / (y * (z_m * x)));
}
return tmp;
}
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) tmp = 0.0 if (Float64(y * Float64(1.0 + Float64(z_m * z_m))) <= 4e+307) tmp = Float64(Float64(1.0 / x) / fma(Float64(z_m * y), z_m, y)); else tmp = Float64(Float64(1.0 / hypot(1.0, z_m)) * Float64(1.0 / Float64(y * Float64(z_m * x)))); end return tmp end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := If[LessEqual[N[(y * N[(1.0 + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+307], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(z$95$m * y), $MachinePrecision] * z$95$m + y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y * N[(z$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z\_m \cdot z\_m\right) \leq 4 \cdot 10^{+307}:\\
\;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(z\_m \cdot y, z\_m, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(1, z\_m\right)} \cdot \frac{1}{y \cdot \left(z\_m \cdot x\right)}\\
\end{array}
\end{array}
if (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))) < 3.99999999999999994e307Initial program 96.6%
+-commutative96.6%
distribute-lft-in96.6%
associate-*r*97.1%
*-rgt-identity97.1%
fma-define97.1%
Applied egg-rr97.1%
if 3.99999999999999994e307 < (*.f64 y (+.f64 #s(literal 1 binary64) (*.f64 z z))) Initial program 78.4%
associate-/l/78.4%
remove-double-neg78.4%
distribute-rgt-neg-out78.4%
distribute-rgt-neg-out78.4%
remove-double-neg78.4%
associate-*l*85.5%
*-commutative85.5%
sqr-neg85.5%
+-commutative85.5%
sqr-neg85.5%
fma-define85.5%
Simplified85.5%
associate-*r*85.3%
*-commutative85.3%
associate-/r*85.3%
*-commutative85.3%
associate-/l/85.3%
fma-undefine85.3%
+-commutative85.3%
associate-/r*78.4%
*-un-lft-identity78.4%
add-sqr-sqrt78.4%
times-frac78.4%
+-commutative78.4%
fma-undefine78.4%
*-commutative78.4%
sqrt-prod78.4%
fma-undefine78.4%
+-commutative78.4%
hypot-1-def78.4%
+-commutative78.4%
Applied egg-rr99.6%
associate-/l/99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-/r*99.7%
*-commutative99.7%
Simplified99.7%
associate-/l/99.7%
div-inv99.8%
associate-*r*99.7%
associate-*l*99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 87.7%
Final simplification95.7%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (/ (/ (/ 1.0 (hypot 1.0 z_m)) (sqrt y)) (* x (* (hypot 1.0 z_m) (sqrt y)))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
return ((1.0 / hypot(1.0, z_m)) / sqrt(y)) / (x * (hypot(1.0, z_m) * sqrt(y)));
}
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
return ((1.0 / Math.hypot(1.0, z_m)) / Math.sqrt(y)) / (x * (Math.hypot(1.0, z_m) * Math.sqrt(y)));
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): return ((1.0 / math.hypot(1.0, z_m)) / math.sqrt(y)) / (x * (math.hypot(1.0, z_m) * math.sqrt(y)))
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) return Float64(Float64(Float64(1.0 / hypot(1.0, z_m)) / sqrt(y)) / Float64(x * Float64(hypot(1.0, z_m) * sqrt(y)))) end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp = code(x, y, z_m)
tmp = ((1.0 / hypot(1.0, z_m)) / sqrt(y)) / (x * (hypot(1.0, z_m) * sqrt(y)));
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := N[(N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y], $MachinePrecision]), $MachinePrecision] / N[(x * N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\frac{\frac{\frac{1}{\mathsf{hypot}\left(1, z\_m\right)}}{\sqrt{y}}}{x \cdot \left(\mathsf{hypot}\left(1, z\_m\right) \cdot \sqrt{y}\right)}
\end{array}
Initial program 93.9%
associate-/l/93.3%
remove-double-neg93.3%
distribute-rgt-neg-out93.3%
distribute-rgt-neg-out93.3%
remove-double-neg93.3%
associate-*l*94.0%
*-commutative94.0%
sqr-neg94.0%
+-commutative94.0%
sqr-neg94.0%
fma-define94.0%
Simplified94.0%
associate-*r*93.4%
*-commutative93.4%
associate-/r*93.4%
*-commutative93.4%
associate-/l/93.8%
fma-undefine93.8%
+-commutative93.8%
associate-/r*93.9%
*-un-lft-identity93.9%
add-sqr-sqrt50.0%
times-frac49.9%
+-commutative49.9%
fma-undefine49.9%
*-commutative49.9%
sqrt-prod49.9%
fma-undefine49.9%
+-commutative49.9%
hypot-1-def49.9%
+-commutative49.9%
Applied egg-rr53.1%
associate-/l/53.2%
associate-*r/53.2%
*-rgt-identity53.2%
associate-/r*53.2%
*-commutative53.2%
Simplified53.2%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (let* ((t_0 (* (hypot 1.0 z_m) (sqrt y)))) (/ (/ 1.0 (* x t_0)) t_0)))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double t_0 = hypot(1.0, z_m) * sqrt(y);
return (1.0 / (x * t_0)) / t_0;
}
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
double t_0 = Math.hypot(1.0, z_m) * Math.sqrt(y);
return (1.0 / (x * t_0)) / t_0;
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): t_0 = math.hypot(1.0, z_m) * math.sqrt(y) return (1.0 / (x * t_0)) / t_0
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) t_0 = Float64(hypot(1.0, z_m) * sqrt(y)) return Float64(Float64(1.0 / Float64(x * t_0)) / t_0) end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp = code(x, y, z_m)
t_0 = hypot(1.0, z_m) * sqrt(y);
tmp = (1.0 / (x * t_0)) / t_0;
end
z_m = N[Abs[z], $MachinePrecision]
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
code[x_, y_, z$95$m_] := Block[{t$95$0 = N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 / N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(1, z\_m\right) \cdot \sqrt{y}\\
\frac{\frac{1}{x \cdot t\_0}}{t\_0}
\end{array}
\end{array}
Initial program 93.9%
associate-/l/93.3%
remove-double-neg93.3%
distribute-rgt-neg-out93.3%
distribute-rgt-neg-out93.3%
remove-double-neg93.3%
associate-*l*94.0%
*-commutative94.0%
sqr-neg94.0%
+-commutative94.0%
sqr-neg94.0%
fma-define94.0%
Simplified94.0%
associate-*r*93.4%
*-commutative93.4%
associate-/r*93.4%
*-commutative93.4%
associate-/l/93.8%
fma-undefine93.8%
+-commutative93.8%
associate-/r*93.9%
*-un-lft-identity93.9%
add-sqr-sqrt50.0%
times-frac49.9%
+-commutative49.9%
fma-undefine49.9%
*-commutative49.9%
sqrt-prod49.9%
fma-undefine49.9%
+-commutative49.9%
hypot-1-def49.9%
+-commutative49.9%
Applied egg-rr53.1%
associate-*l/53.2%
*-lft-identity53.2%
associate-/l/53.2%
*-commutative53.2%
Simplified53.2%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (/ 1.0 (* y (pow (* (hypot 1.0 z_m) (sqrt x)) 2.0))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
return 1.0 / (y * pow((hypot(1.0, z_m) * sqrt(x)), 2.0));
}
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
return 1.0 / (y * Math.pow((Math.hypot(1.0, z_m) * Math.sqrt(x)), 2.0));
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): return 1.0 / (y * math.pow((math.hypot(1.0, z_m) * math.sqrt(x)), 2.0))
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) return Float64(1.0 / Float64(y * (Float64(hypot(1.0, z_m) * sqrt(x)) ^ 2.0))) end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp = code(x, y, z_m)
tmp = 1.0 / (y * ((hypot(1.0, z_m) * sqrt(x)) ^ 2.0));
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := N[(1.0 / N[(y * N[Power[N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\frac{1}{y \cdot {\left(\mathsf{hypot}\left(1, z\_m\right) \cdot \sqrt{x}\right)}^{2}}
\end{array}
Initial program 93.9%
associate-/l/93.3%
remove-double-neg93.3%
distribute-rgt-neg-out93.3%
distribute-rgt-neg-out93.3%
remove-double-neg93.3%
associate-*l*94.0%
*-commutative94.0%
sqr-neg94.0%
+-commutative94.0%
sqr-neg94.0%
fma-define94.0%
Simplified94.0%
add-sqr-sqrt47.6%
pow247.6%
*-commutative47.6%
sqrt-prod47.5%
fma-undefine47.5%
+-commutative47.5%
hypot-1-def48.6%
Applied egg-rr48.6%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (* (/ 1.0 (hypot 1.0 z_m)) (/ 1.0 (* y (* (hypot 1.0 z_m) x)))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
return (1.0 / hypot(1.0, z_m)) * (1.0 / (y * (hypot(1.0, z_m) * x)));
}
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
return (1.0 / Math.hypot(1.0, z_m)) * (1.0 / (y * (Math.hypot(1.0, z_m) * x)));
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): return (1.0 / math.hypot(1.0, z_m)) * (1.0 / (y * (math.hypot(1.0, z_m) * x)))
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) return Float64(Float64(1.0 / hypot(1.0, z_m)) * Float64(1.0 / Float64(y * Float64(hypot(1.0, z_m) * x)))) end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp = code(x, y, z_m)
tmp = (1.0 / hypot(1.0, z_m)) * (1.0 / (y * (hypot(1.0, z_m) * x)));
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := N[(N[(1.0 / N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y * N[(N[Sqrt[1.0 ^ 2 + z$95$m ^ 2], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\frac{1}{\mathsf{hypot}\left(1, z\_m\right)} \cdot \frac{1}{y \cdot \left(\mathsf{hypot}\left(1, z\_m\right) \cdot x\right)}
\end{array}
Initial program 93.9%
associate-/l/93.3%
remove-double-neg93.3%
distribute-rgt-neg-out93.3%
distribute-rgt-neg-out93.3%
remove-double-neg93.3%
associate-*l*94.0%
*-commutative94.0%
sqr-neg94.0%
+-commutative94.0%
sqr-neg94.0%
fma-define94.0%
Simplified94.0%
associate-*r*93.4%
*-commutative93.4%
associate-/r*93.4%
*-commutative93.4%
associate-/l/93.8%
fma-undefine93.8%
+-commutative93.8%
associate-/r*93.9%
*-un-lft-identity93.9%
add-sqr-sqrt50.0%
times-frac49.9%
+-commutative49.9%
fma-undefine49.9%
*-commutative49.9%
sqrt-prod49.9%
fma-undefine49.9%
+-commutative49.9%
hypot-1-def49.9%
+-commutative49.9%
Applied egg-rr53.1%
associate-/l/53.2%
associate-*r/53.2%
*-rgt-identity53.2%
associate-/r*53.2%
*-commutative53.2%
Simplified53.2%
associate-/l/52.7%
div-inv52.7%
associate-*r*52.6%
associate-*l*52.6%
add-sqr-sqrt97.8%
Applied egg-rr97.8%
Final simplification97.8%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (if (<= (* z_m z_m) 2e+241) (/ 1.0 (* y (* x (fma z_m z_m 1.0)))) (* (/ (/ 1.0 z_m) y) (/ (/ 1.0 z_m) x))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 2e+241) {
tmp = 1.0 / (y * (x * fma(z_m, z_m, 1.0)));
} else {
tmp = ((1.0 / z_m) / y) * ((1.0 / z_m) / x);
}
return tmp;
}
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) tmp = 0.0 if (Float64(z_m * z_m) <= 2e+241) tmp = Float64(1.0 / Float64(y * Float64(x * fma(z_m, z_m, 1.0)))); else tmp = Float64(Float64(Float64(1.0 / z_m) / y) * Float64(Float64(1.0 / z_m) / x)); end return tmp end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 2e+241], N[(1.0 / N[(y * N[(x * N[(z$95$m * z$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision] * N[(N[(1.0 / z$95$m), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
\mathbf{if}\;z\_m \cdot z\_m \leq 2 \cdot 10^{+241}:\\
\;\;\;\;\frac{1}{y \cdot \left(x \cdot \mathsf{fma}\left(z\_m, z\_m, 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z\_m}}{y} \cdot \frac{\frac{1}{z\_m}}{x}\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000001e241Initial program 97.7%
associate-/l/96.9%
remove-double-neg96.9%
distribute-rgt-neg-out96.9%
distribute-rgt-neg-out96.9%
remove-double-neg96.9%
associate-*l*96.9%
*-commutative96.9%
sqr-neg96.9%
+-commutative96.9%
sqr-neg96.9%
fma-define96.9%
Simplified96.9%
if 2.0000000000000001e241 < (*.f64 z z) Initial program 82.8%
remove-double-neg82.8%
distribute-lft-neg-out82.8%
distribute-rgt-neg-in82.8%
associate-/r*84.0%
associate-/l/84.0%
associate-/l/84.0%
distribute-lft-neg-out84.0%
distribute-rgt-neg-in84.0%
distribute-lft-neg-in84.0%
remove-double-neg84.0%
sqr-neg84.0%
+-commutative84.0%
sqr-neg84.0%
fma-define84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in z around inf 84.0%
associate-/r*84.0%
add-sqr-sqrt84.0%
*-commutative84.0%
times-frac85.7%
sqrt-div85.7%
metadata-eval85.7%
sqrt-pow179.8%
metadata-eval79.8%
pow179.8%
sqrt-div79.8%
metadata-eval79.8%
sqrt-pow198.5%
metadata-eval98.5%
pow198.5%
Applied egg-rr98.5%
z_m = (fabs.f64 z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
(FPCore (x y z_m)
:precision binary64
(if (<= (* z_m z_m) 1e-9)
(/ (/ 1.0 x) y)
(if (<= (* z_m z_m) 1e+243)
(/ 1.0 (* y (* x (* z_m z_m))))
(/ (/ (/ 1.0 (* y x)) z_m) z_m))))z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 1e-9) {
tmp = (1.0 / x) / y;
} else if ((z_m * z_m) <= 1e+243) {
tmp = 1.0 / (y * (x * (z_m * z_m)));
} else {
tmp = ((1.0 / (y * x)) / z_m) / z_m;
}
return tmp;
}
z_m = abs(z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
real(8) function code(x, y, z_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if ((z_m * z_m) <= 1d-9) then
tmp = (1.0d0 / x) / y
else if ((z_m * z_m) <= 1d+243) then
tmp = 1.0d0 / (y * (x * (z_m * z_m)))
else
tmp = ((1.0d0 / (y * x)) / z_m) / z_m
end if
code = tmp
end function
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 1e-9) {
tmp = (1.0 / x) / y;
} else if ((z_m * z_m) <= 1e+243) {
tmp = 1.0 / (y * (x * (z_m * z_m)));
} else {
tmp = ((1.0 / (y * x)) / z_m) / z_m;
}
return tmp;
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): tmp = 0 if (z_m * z_m) <= 1e-9: tmp = (1.0 / x) / y elif (z_m * z_m) <= 1e+243: tmp = 1.0 / (y * (x * (z_m * z_m))) else: tmp = ((1.0 / (y * x)) / z_m) / z_m return tmp
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) tmp = 0.0 if (Float64(z_m * z_m) <= 1e-9) tmp = Float64(Float64(1.0 / x) / y); elseif (Float64(z_m * z_m) <= 1e+243) tmp = Float64(1.0 / Float64(y * Float64(x * Float64(z_m * z_m)))); else tmp = Float64(Float64(Float64(1.0 / Float64(y * x)) / z_m) / z_m); end return tmp end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp_2 = code(x, y, z_m)
tmp = 0.0;
if ((z_m * z_m) <= 1e-9)
tmp = (1.0 / x) / y;
elseif ((z_m * z_m) <= 1e+243)
tmp = 1.0 / (y * (x * (z_m * z_m)));
else
tmp = ((1.0 / (y * x)) / z_m) / z_m;
end
tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1e-9], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1e+243], N[(1.0 / N[(y * N[(x * N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(y * x), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
\mathbf{if}\;z\_m \cdot z\_m \leq 10^{-9}:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{elif}\;z\_m \cdot z\_m \leq 10^{+243}:\\
\;\;\;\;\frac{1}{y \cdot \left(x \cdot \left(z\_m \cdot z\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{y \cdot x}}{z\_m}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 z z) < 1.00000000000000006e-9Initial program 99.7%
Taylor expanded in z around 0 99.3%
if 1.00000000000000006e-9 < (*.f64 z z) < 1.0000000000000001e243Initial program 92.4%
associate-/l/91.7%
remove-double-neg91.7%
distribute-rgt-neg-out91.7%
distribute-rgt-neg-out91.7%
remove-double-neg91.7%
associate-*l*91.5%
*-commutative91.5%
sqr-neg91.5%
+-commutative91.5%
sqr-neg91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in z around inf 89.4%
pow289.4%
Applied egg-rr89.4%
if 1.0000000000000001e243 < (*.f64 z z) Initial program 82.6%
associate-/l/82.6%
remove-double-neg82.6%
distribute-rgt-neg-out82.6%
distribute-rgt-neg-out82.6%
remove-double-neg82.6%
associate-*l*85.4%
*-commutative85.4%
sqr-neg85.4%
+-commutative85.4%
sqr-neg85.4%
fma-define85.4%
Simplified85.4%
Taylor expanded in z around inf 85.4%
associate-/r*85.4%
*-un-lft-identity85.4%
pow285.4%
*-commutative85.4%
times-frac85.2%
pow285.2%
associate-/l/85.2%
Applied egg-rr85.2%
associate-*l/85.2%
*-un-lft-identity85.2%
associate-/r*85.2%
inv-pow85.2%
metadata-eval85.2%
pow-pow47.9%
unpow247.9%
associate-/r*50.8%
pow-pow93.9%
metadata-eval93.9%
inv-pow93.9%
associate-/l/93.9%
Applied egg-rr93.9%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (if (<= (* z_m z_m) 20000000.0) (/ (/ 1.0 x) (* y (+ 1.0 (* z_m z_m)))) (* (/ (/ 1.0 y) z_m) (/ (/ 1.0 x) z_m))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 20000000.0) {
tmp = (1.0 / x) / (y * (1.0 + (z_m * z_m)));
} else {
tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m);
}
return tmp;
}
z_m = abs(z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
real(8) function code(x, y, z_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if ((z_m * z_m) <= 20000000.0d0) then
tmp = (1.0d0 / x) / (y * (1.0d0 + (z_m * z_m)))
else
tmp = ((1.0d0 / y) / z_m) * ((1.0d0 / x) / z_m)
end if
code = tmp
end function
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 20000000.0) {
tmp = (1.0 / x) / (y * (1.0 + (z_m * z_m)));
} else {
tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m);
}
return tmp;
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): tmp = 0 if (z_m * z_m) <= 20000000.0: tmp = (1.0 / x) / (y * (1.0 + (z_m * z_m))) else: tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m) return tmp
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) tmp = 0.0 if (Float64(z_m * z_m) <= 20000000.0) tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z_m * z_m)))); else tmp = Float64(Float64(Float64(1.0 / y) / z_m) * Float64(Float64(1.0 / x) / z_m)); end return tmp end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp_2 = code(x, y, z_m)
tmp = 0.0;
if ((z_m * z_m) <= 20000000.0)
tmp = (1.0 / x) / (y * (1.0 + (z_m * z_m)));
else
tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m);
end
tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 20000000.0], N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
\mathbf{if}\;z\_m \cdot z\_m \leq 20000000:\\
\;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z\_m \cdot z\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{z\_m} \cdot \frac{\frac{1}{x}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 z z) < 2e7Initial program 99.7%
if 2e7 < (*.f64 z z) Initial program 86.7%
remove-double-neg86.7%
distribute-lft-neg-out86.7%
distribute-rgt-neg-in86.7%
associate-/r*86.5%
associate-/l/86.6%
associate-/l/86.6%
distribute-lft-neg-out86.6%
distribute-rgt-neg-in86.6%
distribute-lft-neg-in86.6%
remove-double-neg86.6%
sqr-neg86.6%
+-commutative86.6%
sqr-neg86.6%
fma-define86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in z around inf 86.6%
metadata-eval86.6%
frac-times86.6%
associate-*l/86.6%
associate-/r*86.5%
inv-pow86.5%
metadata-eval86.5%
pow-pow45.4%
associate-*r/45.4%
associate-*l/45.4%
unpow245.4%
times-frac50.4%
pow-pow96.5%
metadata-eval96.5%
inv-pow96.5%
Applied egg-rr96.5%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (if (<= (* z_m z_m) 1e-9) (/ (/ 1.0 x) y) (* (/ (/ 1.0 y) z_m) (/ (/ 1.0 x) z_m))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 1e-9) {
tmp = (1.0 / x) / y;
} else {
tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m);
}
return tmp;
}
z_m = abs(z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
real(8) function code(x, y, z_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if ((z_m * z_m) <= 1d-9) then
tmp = (1.0d0 / x) / y
else
tmp = ((1.0d0 / y) / z_m) * ((1.0d0 / x) / z_m)
end if
code = tmp
end function
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 1e-9) {
tmp = (1.0 / x) / y;
} else {
tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m);
}
return tmp;
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): tmp = 0 if (z_m * z_m) <= 1e-9: tmp = (1.0 / x) / y else: tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m) return tmp
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) tmp = 0.0 if (Float64(z_m * z_m) <= 1e-9) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(Float64(Float64(1.0 / y) / z_m) * Float64(Float64(1.0 / x) / z_m)); end return tmp end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp_2 = code(x, y, z_m)
tmp = 0.0;
if ((z_m * z_m) <= 1e-9)
tmp = (1.0 / x) / y;
else
tmp = ((1.0 / y) / z_m) * ((1.0 / x) / z_m);
end
tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1e-9], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
\mathbf{if}\;z\_m \cdot z\_m \leq 10^{-9}:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{z\_m} \cdot \frac{\frac{1}{x}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 z z) < 1.00000000000000006e-9Initial program 99.7%
Taylor expanded in z around 0 99.3%
if 1.00000000000000006e-9 < (*.f64 z z) Initial program 86.9%
remove-double-neg86.9%
distribute-lft-neg-out86.9%
distribute-rgt-neg-in86.9%
associate-/r*86.7%
associate-/l/86.8%
associate-/l/86.8%
distribute-lft-neg-out86.8%
distribute-rgt-neg-in86.8%
distribute-lft-neg-in86.8%
remove-double-neg86.8%
sqr-neg86.8%
+-commutative86.8%
sqr-neg86.8%
fma-define86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in z around inf 85.9%
metadata-eval85.9%
frac-times85.8%
associate-*l/85.8%
associate-/r*85.8%
inv-pow85.8%
metadata-eval85.8%
pow-pow44.6%
associate-*r/44.6%
associate-*l/44.6%
unpow244.6%
times-frac49.5%
pow-pow95.6%
metadata-eval95.6%
inv-pow95.6%
Applied egg-rr95.6%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (if (<= (* z_m z_m) 1.0) (/ (/ 1.0 x) y) (/ 1.0 (* y (* x (* z_m z_m))))))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 1.0) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (y * (x * (z_m * z_m)));
}
return tmp;
}
z_m = abs(z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
real(8) function code(x, y, z_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8) :: tmp
if ((z_m * z_m) <= 1.0d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / (y * (x * (z_m * z_m)))
end if
code = tmp
end function
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
double tmp;
if ((z_m * z_m) <= 1.0) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (y * (x * (z_m * z_m)));
}
return tmp;
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): tmp = 0 if (z_m * z_m) <= 1.0: tmp = (1.0 / x) / y else: tmp = 1.0 / (y * (x * (z_m * z_m))) return tmp
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) tmp = 0.0 if (Float64(z_m * z_m) <= 1.0) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(y * Float64(x * Float64(z_m * z_m)))); end return tmp end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp_2 = code(x, y, z_m)
tmp = 0.0;
if ((z_m * z_m) <= 1.0)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / (y * (x * (z_m * z_m)));
end
tmp_2 = tmp;
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := If[LessEqual[N[(z$95$m * z$95$m), $MachinePrecision], 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(y * N[(x * N[(z$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\begin{array}{l}
\mathbf{if}\;z\_m \cdot z\_m \leq 1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot \left(x \cdot \left(z\_m \cdot z\_m\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 1Initial program 99.7%
Taylor expanded in z around 0 99.3%
if 1 < (*.f64 z z) Initial program 86.9%
associate-/l/86.7%
remove-double-neg86.7%
distribute-rgt-neg-out86.7%
distribute-rgt-neg-out86.7%
remove-double-neg86.7%
associate-*l*88.1%
*-commutative88.1%
sqr-neg88.1%
+-commutative88.1%
sqr-neg88.1%
fma-define88.1%
Simplified88.1%
Taylor expanded in z around inf 87.2%
pow287.2%
Applied egg-rr87.2%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (/ (/ 1.0 x) y))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
return (1.0 / x) / y;
}
z_m = abs(z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
real(8) function code(x, y, z_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
code = (1.0d0 / x) / y
end function
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
return (1.0 / x) / y;
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): return (1.0 / x) / y
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) return Float64(Float64(1.0 / x) / y) end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp = code(x, y, z_m)
tmp = (1.0 / x) / y;
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\frac{\frac{1}{x}}{y}
\end{array}
Initial program 93.9%
Taylor expanded in z around 0 62.5%
z_m = (fabs.f64 z) NOTE: x, y, and z_m should be sorted in increasing order before calling this function. (FPCore (x y z_m) :precision binary64 (/ 1.0 (* y x)))
z_m = fabs(z);
assert(x < y && y < z_m);
double code(double x, double y, double z_m) {
return 1.0 / (y * x);
}
z_m = abs(z)
NOTE: x, y, and z_m should be sorted in increasing order before calling this function.
real(8) function code(x, y, z_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
code = 1.0d0 / (y * x)
end function
z_m = Math.abs(z);
assert x < y && y < z_m;
public static double code(double x, double y, double z_m) {
return 1.0 / (y * x);
}
z_m = math.fabs(z) [x, y, z_m] = sort([x, y, z_m]) def code(x, y, z_m): return 1.0 / (y * x)
z_m = abs(z) x, y, z_m = sort([x, y, z_m]) function code(x, y, z_m) return Float64(1.0 / Float64(y * x)) end
z_m = abs(z);
x, y, z_m = num2cell(sort([x, y, z_m])){:}
function tmp = code(x, y, z_m)
tmp = 1.0 / (y * x);
end
z_m = N[Abs[z], $MachinePrecision] NOTE: x, y, and z_m should be sorted in increasing order before calling this function. code[x_, y_, z$95$m_] := N[(1.0 / N[(y * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
[x, y, z_m] = \mathsf{sort}([x, y, z_m])\\
\\
\frac{1}{y \cdot x}
\end{array}
Initial program 93.9%
associate-/l/93.3%
remove-double-neg93.3%
distribute-rgt-neg-out93.3%
distribute-rgt-neg-out93.3%
remove-double-neg93.3%
associate-*l*94.0%
*-commutative94.0%
sqr-neg94.0%
+-commutative94.0%
sqr-neg94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in z around 0 62.4%
(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 2024110
(FPCore (x y z)
:name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
:precision binary64
:alt
(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)))))