
(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}
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 2e+145) (/ (/ (/ 1.0 (fma z z 1.0)) x) y) (* (/ (/ 1.0 x) (hypot 1.0 z)) (/ 1.0 (* z y)))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+145) {
tmp = ((1.0 / fma(z, z, 1.0)) / x) / y;
} else {
tmp = ((1.0 / x) / hypot(1.0, z)) * (1.0 / (z * y));
}
return tmp;
}
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 2e+145) tmp = Float64(Float64(Float64(1.0 / fma(z, z, 1.0)) / x) / y); else tmp = Float64(Float64(Float64(1.0 / x) / hypot(1.0, z)) * Float64(1.0 / Float64(z * y))); end return tmp end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+145], N[(N[(N[(1.0 / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{\frac{1}{\mathsf{fma}\left(z, z, 1\right)}}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{1}{z \cdot y}\\
\end{array}
\end{array}
if (*.f64 z z) < 2e145Initial program 98.5%
associate-/r*98.0%
+-commutative98.0%
fma-def98.0%
Simplified98.0%
fma-udef98.0%
+-commutative98.0%
associate-/r*98.5%
associate-/r*97.3%
div-inv97.2%
add-sqr-sqrt97.1%
times-frac98.9%
hypot-1-def98.9%
hypot-1-def98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 99.2%
associate-*r*98.0%
*-commutative98.0%
associate-*r*97.4%
associate-/r*97.6%
unpow297.6%
fma-udef97.6%
*-commutative97.6%
associate-/r*99.7%
Simplified99.7%
if 2e145 < (*.f64 z z) Initial program 76.8%
associate-/r*76.7%
+-commutative76.7%
fma-def76.7%
Simplified76.7%
fma-udef76.7%
+-commutative76.7%
associate-/r*76.8%
associate-/r*78.5%
div-inv78.5%
add-sqr-sqrt78.5%
times-frac81.0%
hypot-1-def81.0%
hypot-1-def95.7%
Applied egg-rr95.7%
Taylor expanded in z around inf 75.6%
Final simplification90.5%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ (/ 1.0 x) (hypot 1.0 z)) (/ (/ 1.0 y) (hypot 1.0 z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
return ((1.0 / x) / hypot(1.0, z)) * ((1.0 / y) / hypot(1.0, z));
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
return ((1.0 / x) / Math.hypot(1.0, z)) * ((1.0 / y) / Math.hypot(1.0, z));
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): return ((1.0 / x) / math.hypot(1.0, z)) * ((1.0 / y) / math.hypot(1.0, z))
z = abs(z) x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(1.0 / x) / hypot(1.0, z)) * Float64(Float64(1.0 / y) / hypot(1.0, z))) end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((1.0 / x) / hypot(1.0, z)) * ((1.0 / y) / hypot(1.0, z));
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(1.0 / x), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)}
\end{array}
Initial program 90.2%
associate-/r*89.8%
+-commutative89.8%
fma-def89.8%
Simplified89.8%
fma-udef89.8%
+-commutative89.8%
associate-/r*90.2%
associate-/r*90.1%
div-inv90.0%
add-sqr-sqrt90.0%
times-frac92.0%
hypot-1-def92.0%
hypot-1-def97.7%
Applied egg-rr97.7%
Final simplification97.7%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ 1.0 (* x (hypot 1.0 z))) (* (hypot 1.0 z) y)))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
return (1.0 / (x * hypot(1.0, z))) / (hypot(1.0, z) * y);
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
return (1.0 / (x * Math.hypot(1.0, z))) / (Math.hypot(1.0, z) * y);
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): return (1.0 / (x * math.hypot(1.0, z))) / (math.hypot(1.0, z) * y)
z = abs(z) x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(1.0 / Float64(x * hypot(1.0, z))) / Float64(hypot(1.0, z) * y)) end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (1.0 / (x * hypot(1.0, z))) / (hypot(1.0, z) * y);
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(1.0 / N[(x * N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{1}{x \cdot \mathsf{hypot}\left(1, z\right)}}{\mathsf{hypot}\left(1, z\right) \cdot y}
\end{array}
Initial program 90.2%
associate-/r*89.8%
+-commutative89.8%
fma-def89.8%
Simplified89.8%
fma-udef89.8%
+-commutative89.8%
associate-/r*90.2%
associate-/r*90.1%
div-inv90.0%
add-sqr-sqrt90.0%
times-frac92.0%
hypot-1-def92.0%
hypot-1-def97.7%
Applied egg-rr97.7%
associate-/l/97.6%
un-div-inv97.7%
associate-/l/97.5%
Applied egg-rr97.5%
Final simplification97.5%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 4e+184) (/ (/ (/ 1.0 (fma z z 1.0)) x) y) (/ (/ 1.0 (* z y)) (* x z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 4e+184) {
tmp = ((1.0 / fma(z, z, 1.0)) / x) / y;
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 4e+184) tmp = Float64(Float64(Float64(1.0 / fma(z, z, 1.0)) / x) / y); else tmp = Float64(Float64(1.0 / Float64(z * y)) / Float64(x * z)); end return tmp end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 4e+184], N[(N[(N[(1.0 / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 4 \cdot 10^{+184}:\\
\;\;\;\;\frac{\frac{\frac{1}{\mathsf{fma}\left(z, z, 1\right)}}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z \cdot y}}{x \cdot z}\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000007e184Initial program 97.4%
associate-/r*97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
fma-udef97.0%
+-commutative97.0%
associate-/r*97.4%
associate-/r*95.8%
div-inv95.7%
add-sqr-sqrt95.6%
times-frac98.0%
hypot-1-def98.0%
hypot-1-def98.0%
Applied egg-rr98.0%
Taylor expanded in x around 0 98.7%
associate-*r*97.0%
*-commutative97.0%
associate-*r*95.9%
associate-/r*96.1%
unpow296.1%
fma-udef96.1%
*-commutative96.1%
associate-/r*99.1%
Simplified99.1%
if 4.00000000000000007e184 < (*.f64 z z) Initial program 75.8%
associate-/r*75.6%
+-commutative75.6%
fma-def75.6%
Simplified75.6%
Taylor expanded in z around inf 75.6%
unpow275.6%
associate-*r*87.8%
*-commutative87.8%
Simplified87.8%
inv-pow87.8%
associate-*r*93.6%
unpow-prod-down93.4%
Applied egg-rr93.4%
unpow-193.4%
*-commutative93.4%
unpow-193.4%
Simplified93.4%
un-div-inv93.4%
associate-/r*93.4%
associate-/l/88.0%
associate-/r*87.8%
associate-*l*96.4%
*-commutative96.4%
associate-/r*96.6%
Applied egg-rr96.6%
Final simplification98.3%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 2e+44) (/ 1.0 (* x (+ y (* y (* z z))))) (/ (/ 1.0 (* z y)) (* x z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+44) {
tmp = 1.0 / (x * (y + (y * (z * z))));
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 2d+44) then
tmp = 1.0d0 / (x * (y + (y * (z * z))))
else
tmp = (1.0d0 / (z * y)) / (x * z)
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+44) {
tmp = 1.0 / (x * (y + (y * (z * z))));
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 2e+44: tmp = 1.0 / (x * (y + (y * (z * z)))) else: tmp = (1.0 / (z * y)) / (x * z) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 2e+44) tmp = Float64(1.0 / Float64(x * Float64(y + Float64(y * Float64(z * z))))); else tmp = Float64(Float64(1.0 / Float64(z * y)) / Float64(x * z)); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 2e+44)
tmp = 1.0 / (x * (y + (y * (z * z))));
else
tmp = (1.0 / (z * y)) / (x * z);
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+44], N[(1.0 / N[(x * N[(y + N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\frac{1}{x \cdot \left(y + y \cdot \left(z \cdot z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z \cdot y}}{x \cdot z}\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000002e44Initial program 99.7%
associate-/r*99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
fma-udef99.3%
distribute-lft-in99.3%
*-rgt-identity99.3%
Applied egg-rr99.3%
if 2.0000000000000002e44 < (*.f64 z z) Initial program 80.2%
associate-/r*79.9%
+-commutative79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in z around inf 79.9%
unpow279.9%
associate-*r*88.3%
*-commutative88.3%
Simplified88.3%
inv-pow88.3%
associate-*r*93.1%
unpow-prod-down93.0%
Applied egg-rr93.0%
unpow-193.0%
*-commutative93.0%
unpow-193.0%
Simplified93.0%
un-div-inv93.0%
associate-/r*93.0%
associate-/l/88.6%
associate-/r*88.3%
associate-*l*95.0%
*-commutative95.0%
associate-/r*95.3%
Applied egg-rr95.3%
Final simplification97.4%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 2e+44) (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))) (/ (/ 1.0 (* z y)) (* x z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+44) {
tmp = (1.0 / x) / (y * (1.0 + (z * z)));
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 2d+44) then
tmp = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
else
tmp = (1.0d0 / (z * y)) / (x * z)
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+44) {
tmp = (1.0 / x) / (y * (1.0 + (z * z)));
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 2e+44: tmp = (1.0 / x) / (y * (1.0 + (z * z))) else: tmp = (1.0 / (z * y)) / (x * z) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 2e+44) tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))); else tmp = Float64(Float64(1.0 / Float64(z * y)) / Float64(x * z)); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 2e+44)
tmp = (1.0 / x) / (y * (1.0 + (z * z)));
else
tmp = (1.0 / (z * y)) / (x * z);
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+44], N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z \cdot y}}{x \cdot z}\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000002e44Initial program 99.7%
if 2.0000000000000002e44 < (*.f64 z z) Initial program 80.2%
associate-/r*79.9%
+-commutative79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in z around inf 79.9%
unpow279.9%
associate-*r*88.3%
*-commutative88.3%
Simplified88.3%
inv-pow88.3%
associate-*r*93.1%
unpow-prod-down93.0%
Applied egg-rr93.0%
unpow-193.0%
*-commutative93.0%
unpow-193.0%
Simplified93.0%
un-div-inv93.0%
associate-/r*93.0%
associate-/l/88.6%
associate-/r*88.3%
associate-*l*95.0%
*-commutative95.0%
associate-/r*95.3%
Applied egg-rr95.3%
Final simplification97.5%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 2e+44) (/ (/ (/ 1.0 x) y) (+ 1.0 (* z z))) (/ (/ 1.0 (* z y)) (* x z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+44) {
tmp = ((1.0 / x) / y) / (1.0 + (z * z));
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 2d+44) then
tmp = ((1.0d0 / x) / y) / (1.0d0 + (z * z))
else
tmp = (1.0d0 / (z * y)) / (x * z)
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+44) {
tmp = ((1.0 / x) / y) / (1.0 + (z * z));
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 2e+44: tmp = ((1.0 / x) / y) / (1.0 + (z * z)) else: tmp = (1.0 / (z * y)) / (x * z) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 2e+44) tmp = Float64(Float64(Float64(1.0 / x) / y) / Float64(1.0 + Float64(z * z))); else tmp = Float64(Float64(1.0 / Float64(z * y)) / Float64(x * z)); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 2e+44)
tmp = ((1.0 / x) / y) / (1.0 + (z * z));
else
tmp = (1.0 / (z * y)) / (x * z);
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e+44], N[(N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision] / N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{y}}{1 + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z \cdot y}}{x \cdot z}\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000002e44Initial program 99.7%
associate-/r*99.7%
Simplified99.7%
if 2.0000000000000002e44 < (*.f64 z z) Initial program 80.2%
associate-/r*79.9%
+-commutative79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in z around inf 79.9%
unpow279.9%
associate-*r*88.3%
*-commutative88.3%
Simplified88.3%
inv-pow88.3%
associate-*r*93.1%
unpow-prod-down93.0%
Applied egg-rr93.0%
unpow-193.0%
*-commutative93.0%
unpow-193.0%
Simplified93.0%
un-div-inv93.0%
associate-/r*93.0%
associate-/l/88.6%
associate-/r*88.3%
associate-*l*95.0%
*-commutative95.0%
associate-/r*95.3%
Applied egg-rr95.3%
Final simplification97.5%
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (<= z 1.0)
(/ (/ 1.0 x) y)
(if (<= z 4.6e+181)
(/ 1.0 (* x (* z (* z y))))
(/ 1.0 (* z (* z (* x y)))))))z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x) / y;
} else if (z <= 4.6e+181) {
tmp = 1.0 / (x * (z * (z * y)));
} else {
tmp = 1.0 / (z * (z * (x * y)));
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.0d0) then
tmp = (1.0d0 / x) / y
else if (z <= 4.6d+181) then
tmp = 1.0d0 / (x * (z * (z * y)))
else
tmp = 1.0d0 / (z * (z * (x * y)))
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x) / y;
} else if (z <= 4.6e+181) {
tmp = 1.0 / (x * (z * (z * y)));
} else {
tmp = 1.0 / (z * (z * (x * y)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= 1.0: tmp = (1.0 / x) / y elif z <= 4.6e+181: tmp = 1.0 / (x * (z * (z * y))) else: tmp = 1.0 / (z * (z * (x * y))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= 1.0) tmp = Float64(Float64(1.0 / x) / y); elseif (z <= 4.6e+181) tmp = Float64(1.0 / Float64(x * Float64(z * Float64(z * y)))); else tmp = Float64(1.0 / Float64(z * Float64(z * Float64(x * y)))); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= 1.0)
tmp = (1.0 / x) / y;
elseif (z <= 4.6e+181)
tmp = 1.0 / (x * (z * (z * y)));
else
tmp = 1.0 / (z * (z * (x * y)));
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.6e+181], N[(1.0 / N[(x * N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+181}:\\
\;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(z \cdot y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \left(z \cdot \left(x \cdot y\right)\right)}\\
\end{array}
\end{array}
if z < 1Initial program 91.2%
associate-/r*91.0%
+-commutative91.0%
fma-def91.0%
Simplified91.0%
fma-udef91.0%
+-commutative91.0%
associate-/r*91.2%
associate-/r*91.6%
div-inv91.5%
add-sqr-sqrt91.5%
times-frac93.4%
hypot-1-def93.4%
hypot-1-def98.2%
Applied egg-rr98.2%
associate-/l/98.2%
un-div-inv98.4%
associate-/l/98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 67.7%
*-commutative67.7%
associate-/r*67.9%
Simplified67.9%
if 1 < z < 4.5999999999999998e181Initial program 92.0%
associate-/r*91.0%
+-commutative91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in z around inf 90.6%
unpow290.6%
associate-*r*93.1%
*-commutative93.1%
Simplified93.1%
if 4.5999999999999998e181 < z Initial program 75.6%
associate-/r*75.6%
+-commutative75.6%
fma-def75.6%
Simplified75.6%
Taylor expanded in z around inf 75.6%
unpow275.6%
*-commutative75.6%
associate-*l*75.4%
*-commutative75.4%
associate-*l*94.8%
Simplified94.8%
Final simplification73.5%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 1.0) (/ (/ 1.0 x) y) (/ 1.0 (* x (* y (* z z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 1.0) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (x * (y * (z * z)));
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 1.0d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / (x * (y * (z * z)))
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 1.0) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (x * (y * (z * z)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 1.0: tmp = (1.0 / x) / y else: tmp = 1.0 / (x * (y * (z * z))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 1.0) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(x * Float64(y * Float64(z * z)))); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 1.0)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / (x * (y * (z * z)));
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(x * N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(y \cdot \left(z \cdot z\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 1Initial program 99.7%
associate-/r*99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
fma-udef99.3%
+-commutative99.3%
associate-/r*99.7%
associate-/r*99.7%
div-inv99.5%
add-sqr-sqrt99.5%
times-frac99.5%
hypot-1-def99.6%
hypot-1-def99.5%
Applied egg-rr99.5%
associate-/l/99.6%
un-div-inv99.7%
associate-/l/99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 97.7%
*-commutative97.7%
associate-/r*98.1%
Simplified98.1%
if 1 < (*.f64 z z) Initial program 80.9%
associate-/r*80.6%
+-commutative80.6%
fma-def80.6%
Simplified80.6%
fma-udef80.6%
+-commutative80.6%
associate-/r*80.9%
associate-/r*80.8%
div-inv80.8%
add-sqr-sqrt80.8%
times-frac84.7%
hypot-1-def84.7%
hypot-1-def95.9%
Applied egg-rr95.9%
Taylor expanded in z around inf 85.8%
unpow285.8%
associate-*r*80.1%
associate-*l*88.1%
*-commutative88.1%
associate-*l*80.1%
Simplified80.1%
Final simplification89.0%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 0.0004) (/ (/ 1.0 x) y) (/ 1.0 (* x (* z (* z y))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0004) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (x * (z * (z * y)));
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 0.0004d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / (x * (z * (z * y)))
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0004) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (x * (z * (z * y)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0004: tmp = (1.0 / x) / y else: tmp = 1.0 / (x * (z * (z * y))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0004) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(x * Float64(z * Float64(z * y)))); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 0.0004)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / (x * (z * (z * y)));
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.0004], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(x * N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.0004:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(z \cdot y\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000019e-4Initial program 99.7%
associate-/r*99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
fma-udef99.3%
+-commutative99.3%
associate-/r*99.7%
associate-/r*99.7%
div-inv99.5%
add-sqr-sqrt99.5%
times-frac99.5%
hypot-1-def99.6%
hypot-1-def99.5%
Applied egg-rr99.5%
associate-/l/99.6%
un-div-inv99.7%
associate-/l/99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 97.7%
*-commutative97.7%
associate-/r*98.1%
Simplified98.1%
if 4.00000000000000019e-4 < (*.f64 z z) Initial program 80.9%
associate-/r*80.6%
+-commutative80.6%
fma-def80.6%
Simplified80.6%
Taylor expanded in z around inf 80.1%
unpow280.1%
associate-*r*88.1%
*-commutative88.1%
Simplified88.1%
Final simplification93.1%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 0.0004) (/ (/ 1.0 x) y) (/ 1.0 (* (* z y) (* x z)))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0004) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / ((z * y) * (x * z));
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 0.0004d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / ((z * y) * (x * z))
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0004) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / ((z * y) * (x * z));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0004: tmp = (1.0 / x) / y else: tmp = 1.0 / ((z * y) * (x * z)) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0004) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(Float64(z * y) * Float64(x * z))); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 0.0004)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / ((z * y) * (x * z));
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.0004], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(N[(z * y), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.0004:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(z \cdot y\right) \cdot \left(x \cdot z\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000019e-4Initial program 99.7%
associate-/r*99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
fma-udef99.3%
+-commutative99.3%
associate-/r*99.7%
associate-/r*99.7%
div-inv99.5%
add-sqr-sqrt99.5%
times-frac99.5%
hypot-1-def99.6%
hypot-1-def99.5%
Applied egg-rr99.5%
associate-/l/99.6%
un-div-inv99.7%
associate-/l/99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 97.7%
*-commutative97.7%
associate-/r*98.1%
Simplified98.1%
if 4.00000000000000019e-4 < (*.f64 z z) Initial program 80.9%
associate-/r*80.6%
+-commutative80.6%
fma-def80.6%
Simplified80.6%
fma-udef80.6%
+-commutative80.6%
associate-/r*80.9%
associate-/r*80.8%
div-inv80.8%
add-sqr-sqrt80.8%
times-frac84.7%
hypot-1-def84.7%
hypot-1-def95.9%
Applied egg-rr95.9%
associate-/l/95.7%
un-div-inv95.8%
associate-/l/95.5%
Applied egg-rr95.5%
Taylor expanded in z around inf 85.8%
*-commutative85.8%
unpow285.8%
*-commutative85.8%
associate-*r*80.1%
associate-*r*88.1%
associate-*r*94.6%
*-commutative94.6%
Simplified94.6%
Final simplification96.3%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* z z) 0.0004) (/ (/ 1.0 x) y) (/ (/ 1.0 (* z y)) (* x z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0004) {
tmp = (1.0 / x) / y;
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 0.0004d0) then
tmp = (1.0d0 / x) / y
else
tmp = (1.0d0 / (z * y)) / (x * z)
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0004) {
tmp = (1.0 / x) / y;
} else {
tmp = (1.0 / (z * y)) / (x * z);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0004: tmp = (1.0 / x) / y else: tmp = (1.0 / (z * y)) / (x * z) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0004) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(Float64(1.0 / Float64(z * y)) / Float64(x * z)); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 0.0004)
tmp = (1.0 / x) / y;
else
tmp = (1.0 / (z * y)) / (x * z);
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 0.0004], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(N[(1.0 / N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.0004:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z \cdot y}}{x \cdot z}\\
\end{array}
\end{array}
if (*.f64 z z) < 4.00000000000000019e-4Initial program 99.7%
associate-/r*99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
fma-udef99.3%
+-commutative99.3%
associate-/r*99.7%
associate-/r*99.7%
div-inv99.5%
add-sqr-sqrt99.5%
times-frac99.5%
hypot-1-def99.6%
hypot-1-def99.5%
Applied egg-rr99.5%
associate-/l/99.6%
un-div-inv99.7%
associate-/l/99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 97.7%
*-commutative97.7%
associate-/r*98.1%
Simplified98.1%
if 4.00000000000000019e-4 < (*.f64 z z) Initial program 80.9%
associate-/r*80.6%
+-commutative80.6%
fma-def80.6%
Simplified80.6%
Taylor expanded in z around inf 80.1%
unpow280.1%
associate-*r*88.1%
*-commutative88.1%
Simplified88.1%
inv-pow88.1%
associate-*r*92.7%
unpow-prod-down92.6%
Applied egg-rr92.6%
unpow-192.6%
*-commutative92.6%
unpow-192.6%
Simplified92.6%
un-div-inv92.7%
associate-/r*92.6%
associate-/l/88.4%
associate-/r*88.1%
associate-*l*94.6%
*-commutative94.6%
associate-/r*94.8%
Applied egg-rr94.8%
Final simplification96.5%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z 1.0) (/ (/ 1.0 x) y) (/ 1.0 (* y (* z (* x z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (y * (z * (x * z)));
}
return tmp;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.0d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / (y * (z * (x * z)))
end if
code = tmp
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.0) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (y * (z * (x * z)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= 1.0: tmp = (1.0 / x) / y else: tmp = 1.0 / (y * (z * (x * z))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= 1.0) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(y * Float64(z * Float64(x * z)))); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= 1.0)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / (y * (z * (x * z)));
end
tmp_2 = tmp;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, 1.0], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(y * N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot \left(z \cdot \left(x \cdot z\right)\right)}\\
\end{array}
\end{array}
if z < 1Initial program 91.2%
associate-/r*91.0%
+-commutative91.0%
fma-def91.0%
Simplified91.0%
fma-udef91.0%
+-commutative91.0%
associate-/r*91.2%
associate-/r*91.6%
div-inv91.5%
add-sqr-sqrt91.5%
times-frac93.4%
hypot-1-def93.4%
hypot-1-def98.2%
Applied egg-rr98.2%
associate-/l/98.2%
un-div-inv98.4%
associate-/l/98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 67.7%
*-commutative67.7%
associate-/r*67.9%
Simplified67.9%
if 1 < z Initial program 86.4%
associate-/r*85.8%
+-commutative85.8%
fma-def85.8%
Simplified85.8%
fma-udef85.8%
+-commutative85.8%
associate-/r*86.4%
associate-/r*84.7%
div-inv84.7%
add-sqr-sqrt84.7%
times-frac87.0%
hypot-1-def87.0%
hypot-1-def95.7%
Applied egg-rr95.7%
Taylor expanded in z around inf 87.1%
unpow287.1%
*-commutative87.1%
associate-*r*87.2%
*-commutative87.2%
Simplified87.2%
Final simplification72.1%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ 1.0 (* x y)))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
return 1.0 / (x * y);
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (x * y)
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
return 1.0 / (x * y);
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): return 1.0 / (x * y)
z = abs(z) x, y = sort([x, y]) function code(x, y, z) return Float64(1.0 / Float64(x * y)) end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = 1.0 / (x * y);
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x \cdot y}
\end{array}
Initial program 90.2%
associate-/r*89.8%
+-commutative89.8%
fma-def89.8%
Simplified89.8%
Taylor expanded in z around 0 55.4%
Final simplification55.4%
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ 1.0 x) y))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
return (1.0 / x) / y;
}
NOTE: z should be positive before calling this function
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / x) / y
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
return (1.0 / x) / y;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): return (1.0 / x) / y
z = abs(z) x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(1.0 / x) / y) end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (1.0 / x) / y;
end
NOTE: z should be positive before calling this function NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{1}{x}}{y}
\end{array}
Initial program 90.2%
associate-/r*89.8%
+-commutative89.8%
fma-def89.8%
Simplified89.8%
fma-udef89.8%
+-commutative89.8%
associate-/r*90.2%
associate-/r*90.1%
div-inv90.0%
add-sqr-sqrt90.0%
times-frac92.0%
hypot-1-def92.0%
hypot-1-def97.7%
Applied egg-rr97.7%
associate-/l/97.6%
un-div-inv97.7%
associate-/l/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 55.4%
*-commutative55.4%
associate-/r*55.6%
Simplified55.6%
Final simplification55.6%
(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 2023229
(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)))))