
(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) 5e+94) (* (/ (/ 1.0 y) x) (/ 1.0 (fma z z 1.0))) (* (/ (/ 1.0 y) (hypot 1.0 z)) (/ (/ 1.0 z) x))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 5e+94) {
tmp = ((1.0 / y) / x) * (1.0 / fma(z, z, 1.0));
} else {
tmp = ((1.0 / y) / hypot(1.0, z)) * ((1.0 / z) / x);
}
return tmp;
}
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 5e+94) tmp = Float64(Float64(Float64(1.0 / y) / x) * Float64(1.0 / fma(z, z, 1.0))); else tmp = Float64(Float64(Float64(1.0 / y) / hypot(1.0, z)) * Float64(Float64(1.0 / z) / x)); 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], 5e+94], N[(N[(N[(1.0 / y), $MachinePrecision] / x), $MachinePrecision] * N[(1.0 / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+94}:\\
\;\;\;\;\frac{\frac{1}{y}}{x} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e94Initial program 97.8%
associate-/r*97.3%
*-commutative97.3%
sqr-neg97.3%
+-commutative97.3%
distribute-lft1-in97.3%
*-commutative97.3%
fma-def97.3%
sqr-neg97.3%
Simplified97.3%
associate-/r*97.8%
fma-udef97.8%
*-rgt-identity97.8%
distribute-lft-in97.8%
+-commutative97.8%
associate-/r*99.7%
associate-/r*99.6%
+-commutative99.6%
fma-udef99.6%
div-inv99.6%
*-commutative99.6%
associate-/r*99.7%
Applied egg-rr99.7%
if 5.0000000000000001e94 < (*.f64 z z) Initial program 77.7%
associate-/r*75.8%
associate-/r*75.9%
sqr-neg75.9%
+-commutative75.9%
sqr-neg75.9%
fma-def75.9%
Simplified75.9%
associate-/r*75.8%
div-inv75.8%
Applied egg-rr75.8%
*-commutative75.8%
add-sqr-sqrt75.8%
times-frac78.8%
fma-udef78.8%
+-commutative78.8%
hypot-1-def78.8%
fma-udef78.8%
+-commutative78.8%
hypot-1-def96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 78.1%
*-commutative78.1%
associate-/r*78.1%
Simplified78.1%
Final simplification90.6%
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 y) (hypot 1.0 z)) (/ (/ 1.0 x) (hypot 1.0 z))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
return ((1.0 / y) / hypot(1.0, z)) * ((1.0 / x) / hypot(1.0, z));
}
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
return ((1.0 / y) / Math.hypot(1.0, z)) * ((1.0 / x) / Math.hypot(1.0, z));
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): return ((1.0 / y) / math.hypot(1.0, z)) * ((1.0 / x) / math.hypot(1.0, z))
z = abs(z) x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(1.0 / y) / hypot(1.0, z)) * Float64(Float64(1.0 / x) / hypot(1.0, z))) end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((1.0 / y) / hypot(1.0, z)) * ((1.0 / x) / 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 / y), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / x), $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}{y}}{\mathsf{hypot}\left(1, z\right)} \cdot \frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}
\end{array}
Initial program 89.4%
associate-/r*89.7%
associate-/r*89.7%
sqr-neg89.7%
+-commutative89.7%
sqr-neg89.7%
fma-def89.7%
Simplified89.7%
associate-/r*89.7%
div-inv89.7%
Applied egg-rr89.7%
*-commutative89.7%
add-sqr-sqrt89.6%
times-frac90.6%
fma-udef90.6%
+-commutative90.6%
hypot-1-def90.6%
fma-udef90.6%
+-commutative90.6%
hypot-1-def98.1%
Applied egg-rr98.1%
Final simplification98.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 (<= (* y (+ 1.0 (* z z))) 4e+303) (/ (/ 1.0 x) (fma (* y z) z y)) (* (/ 1.0 z) (/ (/ 1.0 y) (* z x)))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((y * (1.0 + (z * z))) <= 4e+303) {
tmp = (1.0 / x) / fma((y * z), z, y);
} else {
tmp = (1.0 / z) * ((1.0 / y) / (z * x));
}
return tmp;
}
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(y * Float64(1.0 + Float64(z * z))) <= 4e+303) tmp = Float64(Float64(1.0 / x) / fma(Float64(y * z), z, y)); else tmp = Float64(Float64(1.0 / z) * Float64(Float64(1.0 / y) / Float64(z * x))); 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[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+303], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4 \cdot 10^{+303}:\\
\;\;\;\;\frac{\frac{1}{x}}{\mathsf{fma}\left(y \cdot z, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\frac{1}{y}}{z \cdot x}\\
\end{array}
\end{array}
if (*.f64 y (+.f64 1 (*.f64 z z))) < 4e303Initial program 91.2%
distribute-lft-in91.2%
*-rgt-identity91.2%
+-commutative91.2%
associate-*r*93.9%
fma-def93.9%
Applied egg-rr93.9%
if 4e303 < (*.f64 y (+.f64 1 (*.f64 z z))) Initial program 80.8%
associate-/r*80.8%
*-commutative80.8%
sqr-neg80.8%
+-commutative80.8%
distribute-lft1-in80.8%
*-commutative80.8%
fma-def80.8%
sqr-neg80.8%
Simplified80.8%
Taylor expanded in z around inf 80.8%
*-commutative80.8%
unpow280.8%
associate-*l*84.9%
associate-*l*93.3%
Simplified93.3%
associate-/r*93.4%
*-un-lft-identity93.4%
times-frac99.9%
Applied egg-rr99.9%
Final simplification95.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) 5e+94) (* (/ (/ 1.0 y) x) (/ 1.0 (fma z z 1.0))) (/ (/ (/ 1.0 z) y) (* z x))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 5e+94) {
tmp = ((1.0 / y) / x) * (1.0 / fma(z, z, 1.0));
} else {
tmp = ((1.0 / z) / y) / (z * x);
}
return tmp;
}
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 5e+94) tmp = Float64(Float64(Float64(1.0 / y) / x) * Float64(1.0 / fma(z, z, 1.0))); else tmp = Float64(Float64(Float64(1.0 / z) / y) / Float64(z * x)); 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], 5e+94], N[(N[(N[(1.0 / y), $MachinePrecision] / x), $MachinePrecision] * N[(1.0 / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+94}:\\
\;\;\;\;\frac{\frac{1}{y}}{x} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{z}}{y}}{z \cdot x}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e94Initial program 97.8%
associate-/r*97.3%
*-commutative97.3%
sqr-neg97.3%
+-commutative97.3%
distribute-lft1-in97.3%
*-commutative97.3%
fma-def97.3%
sqr-neg97.3%
Simplified97.3%
associate-/r*97.8%
fma-udef97.8%
*-rgt-identity97.8%
distribute-lft-in97.8%
+-commutative97.8%
associate-/r*99.7%
associate-/r*99.6%
+-commutative99.6%
fma-udef99.6%
div-inv99.6%
*-commutative99.6%
associate-/r*99.7%
Applied egg-rr99.7%
if 5.0000000000000001e94 < (*.f64 z z) Initial program 77.7%
associate-/r*77.7%
*-commutative77.7%
sqr-neg77.7%
+-commutative77.7%
distribute-lft1-in77.7%
*-commutative77.7%
fma-def77.7%
sqr-neg77.7%
Simplified77.7%
Taylor expanded in z around inf 77.7%
*-commutative77.7%
unpow277.7%
associate-*l*76.8%
associate-*l*90.0%
Simplified90.0%
associate-/r*90.0%
*-un-lft-identity90.0%
times-frac94.6%
Applied egg-rr94.6%
associate-*r/96.5%
un-div-inv96.5%
Applied egg-rr96.5%
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 (<= (* y (+ 1.0 (* z z))) 4e+303) (/ (/ 1.0 x) (+ y (* z (* y z)))) (* (/ 1.0 z) (/ (/ 1.0 y) (* z x)))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((y * (1.0 + (z * z))) <= 4e+303) {
tmp = (1.0 / x) / (y + (z * (y * z)));
} else {
tmp = (1.0 / z) * ((1.0 / y) / (z * x));
}
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 ((y * (1.0d0 + (z * z))) <= 4d+303) then
tmp = (1.0d0 / x) / (y + (z * (y * z)))
else
tmp = (1.0d0 / z) * ((1.0d0 / y) / (z * x))
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 ((y * (1.0 + (z * z))) <= 4e+303) {
tmp = (1.0 / x) / (y + (z * (y * z)));
} else {
tmp = (1.0 / z) * ((1.0 / y) / (z * x));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (y * (1.0 + (z * z))) <= 4e+303: tmp = (1.0 / x) / (y + (z * (y * z))) else: tmp = (1.0 / z) * ((1.0 / y) / (z * x)) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(y * Float64(1.0 + Float64(z * z))) <= 4e+303) tmp = Float64(Float64(1.0 / x) / Float64(y + Float64(z * Float64(y * z)))); else tmp = Float64(Float64(1.0 / z) * Float64(Float64(1.0 / y) / Float64(z * x))); end return tmp end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y * (1.0 + (z * z))) <= 4e+303)
tmp = (1.0 / x) / (y + (z * (y * z)));
else
tmp = (1.0 / z) * ((1.0 / y) / (z * x));
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[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+303], N[(N[(1.0 / x), $MachinePrecision] / N[(y + N[(z * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4 \cdot 10^{+303}:\\
\;\;\;\;\frac{\frac{1}{x}}{y + z \cdot \left(y \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\frac{1}{y}}{z \cdot x}\\
\end{array}
\end{array}
if (*.f64 y (+.f64 1 (*.f64 z z))) < 4e303Initial program 91.2%
distribute-lft-in91.2%
*-rgt-identity91.2%
+-commutative91.2%
associate-*r*93.9%
fma-def93.9%
Applied egg-rr93.9%
fma-udef93.9%
*-commutative93.9%
Applied egg-rr93.9%
if 4e303 < (*.f64 y (+.f64 1 (*.f64 z z))) Initial program 80.8%
associate-/r*80.8%
*-commutative80.8%
sqr-neg80.8%
+-commutative80.8%
distribute-lft1-in80.8%
*-commutative80.8%
fma-def80.8%
sqr-neg80.8%
Simplified80.8%
Taylor expanded in z around inf 80.8%
*-commutative80.8%
unpow280.8%
associate-*l*84.9%
associate-*l*93.3%
Simplified93.3%
associate-/r*93.4%
*-un-lft-identity93.4%
times-frac99.9%
Applied egg-rr99.9%
Final simplification95.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) 2e+47) (/ 1.0 (* x (+ y (* y (* z z))))) (/ (/ (/ 1.0 z) y) (* z x))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e+47) {
tmp = 1.0 / (x * (y + (y * (z * z))));
} else {
tmp = ((1.0 / z) / y) / (z * x);
}
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+47) then
tmp = 1.0d0 / (x * (y + (y * (z * z))))
else
tmp = ((1.0d0 / z) / y) / (z * x)
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+47) {
tmp = 1.0 / (x * (y + (y * (z * z))));
} else {
tmp = ((1.0 / z) / y) / (z * x);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 2e+47: tmp = 1.0 / (x * (y + (y * (z * z)))) else: tmp = ((1.0 / z) / y) / (z * x) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 2e+47) tmp = Float64(1.0 / Float64(x * Float64(y + Float64(y * Float64(z * z))))); else tmp = Float64(Float64(Float64(1.0 / z) / y) / Float64(z * x)); 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+47)
tmp = 1.0 / (x * (y + (y * (z * z))));
else
tmp = ((1.0 / z) / y) / (z * x);
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+47], N[(1.0 / N[(x * N[(y + N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] / y), $MachinePrecision] / N[(z * x), $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^{+47}:\\
\;\;\;\;\frac{1}{x \cdot \left(y + y \cdot \left(z \cdot z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{z}}{y}}{z \cdot x}\\
\end{array}
\end{array}
if (*.f64 z z) < 2.0000000000000001e47Initial program 99.7%
associate-/r*99.6%
*-commutative99.6%
sqr-neg99.6%
+-commutative99.6%
distribute-lft1-in99.6%
*-commutative99.6%
fma-def99.6%
sqr-neg99.6%
Simplified99.6%
fma-udef99.6%
Applied egg-rr99.6%
if 2.0000000000000001e47 < (*.f64 z z) Initial program 77.5%
associate-/r*77.0%
*-commutative77.0%
sqr-neg77.0%
+-commutative77.0%
distribute-lft1-in77.0%
*-commutative77.0%
fma-def77.0%
sqr-neg77.0%
Simplified77.0%
Taylor expanded in z around inf 77.0%
*-commutative77.0%
unpow277.0%
associate-*l*78.6%
associate-*l*90.4%
Simplified90.4%
associate-/r*91.0%
*-un-lft-identity91.0%
times-frac95.1%
Applied egg-rr95.1%
associate-*r/96.5%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification98.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) 1e+206) (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))) (/ 1.0 (* z (* x (* y z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 1e+206) {
tmp = (1.0 / x) / (y * (1.0 + (z * z)));
} else {
tmp = 1.0 / (z * (x * (y * 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) <= 1d+206) then
tmp = (1.0d0 / x) / (y * (1.0d0 + (z * z)))
else
tmp = 1.0d0 / (z * (x * (y * 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) <= 1e+206) {
tmp = (1.0 / x) / (y * (1.0 + (z * z)));
} else {
tmp = 1.0 / (z * (x * (y * z)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 1e+206: tmp = (1.0 / x) / (y * (1.0 + (z * z))) else: tmp = 1.0 / (z * (x * (y * z))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 1e+206) tmp = Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))); else tmp = Float64(1.0 / Float64(z * Float64(x * Float64(y * 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) <= 1e+206)
tmp = (1.0 / x) / (y * (1.0 + (z * z)));
else
tmp = 1.0 / (z * (x * (y * 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], 1e+206], N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(x * N[(y * 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 10^{+206}:\\
\;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \left(x \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 1e206Initial program 96.8%
if 1e206 < (*.f64 z z) Initial program 75.4%
associate-/r*75.4%
*-commutative75.4%
sqr-neg75.4%
+-commutative75.4%
distribute-lft1-in75.4%
*-commutative75.4%
fma-def75.4%
sqr-neg75.4%
Simplified75.4%
Taylor expanded in z around inf 75.4%
*-commutative75.4%
unpow275.4%
associate-*l*73.3%
associate-*l*89.1%
Simplified89.1%
Taylor expanded in y around 0 75.4%
*-commutative75.4%
unpow275.4%
associate-*r*85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in x around 0 75.4%
*-commutative75.4%
unpow275.4%
associate-*r*85.0%
*-commutative85.0%
associate-*r*85.0%
associate-*r*97.5%
*-commutative97.5%
Simplified97.5%
Final simplification97.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.0005) (/ (/ 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) <= 0.0005) {
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) <= 0.0005d0) 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) <= 0.0005) {
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) <= 0.0005: 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) <= 0.0005) 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) <= 0.0005)
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], 0.0005], 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 0.0005:\\
\;\;\;\;\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) < 5.0000000000000001e-4Initial program 99.7%
distribute-lft-in99.7%
*-rgt-identity99.7%
+-commutative99.7%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 99.0%
if 5.0000000000000001e-4 < (*.f64 z z) Initial program 80.3%
associate-/r*79.8%
*-commutative79.8%
sqr-neg79.8%
+-commutative79.8%
distribute-lft1-in79.8%
*-commutative79.8%
fma-def79.8%
sqr-neg79.8%
Simplified79.8%
Taylor expanded in z around inf 78.1%
unpow278.1%
Simplified78.1%
Final simplification87.9%
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.0005) (/ (/ 1.0 x) y) (/ 1.0 (* x (* z (* y z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0005) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (x * (z * (y * 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.0005d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / (x * (z * (y * 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.0005) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (x * (z * (y * z)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0005: tmp = (1.0 / x) / y else: tmp = 1.0 / (x * (z * (y * z))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0005) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(x * Float64(z * Float64(y * 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.0005)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / (x * (z * (y * 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.0005], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(x * N[(z * N[(y * 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 0.0005:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(z \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e-4Initial program 99.7%
distribute-lft-in99.7%
*-rgt-identity99.7%
+-commutative99.7%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 99.0%
if 5.0000000000000001e-4 < (*.f64 z z) Initial program 80.3%
associate-/r*79.8%
*-commutative79.8%
sqr-neg79.8%
+-commutative79.8%
distribute-lft1-in79.8%
*-commutative79.8%
fma-def79.8%
sqr-neg79.8%
Simplified79.8%
Taylor expanded in z around inf 78.1%
*-commutative78.1%
unpow278.1%
associate-*l*78.4%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in y around 0 78.1%
*-commutative78.1%
unpow278.1%
associate-*r*84.3%
*-commutative84.3%
Simplified84.3%
Final simplification91.2%
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.0005) (/ (/ 1.0 x) y) (/ 1.0 (* z (* x (* y z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0005) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (z * (x * (y * 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.0005d0) then
tmp = (1.0d0 / x) / y
else
tmp = 1.0d0 / (z * (x * (y * 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.0005) {
tmp = (1.0 / x) / y;
} else {
tmp = 1.0 / (z * (x * (y * z)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0005: tmp = (1.0 / x) / y else: tmp = 1.0 / (z * (x * (y * z))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0005) tmp = Float64(Float64(1.0 / x) / y); else tmp = Float64(1.0 / Float64(z * Float64(x * Float64(y * 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.0005)
tmp = (1.0 / x) / y;
else
tmp = 1.0 / (z * (x * (y * 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.0005], N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z * N[(x * N[(y * 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 0.0005:\\
\;\;\;\;\frac{\frac{1}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \left(x \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e-4Initial program 99.7%
distribute-lft-in99.7%
*-rgt-identity99.7%
+-commutative99.7%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 99.0%
if 5.0000000000000001e-4 < (*.f64 z z) Initial program 80.3%
associate-/r*79.8%
*-commutative79.8%
sqr-neg79.8%
+-commutative79.8%
distribute-lft1-in79.8%
*-commutative79.8%
fma-def79.8%
sqr-neg79.8%
Simplified79.8%
Taylor expanded in z around inf 78.1%
*-commutative78.1%
unpow278.1%
associate-*l*78.4%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in y around 0 78.1%
*-commutative78.1%
unpow278.1%
associate-*r*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in x around 0 78.1%
*-commutative78.1%
unpow278.1%
associate-*r*84.3%
*-commutative84.3%
associate-*r*84.3%
associate-*r*92.7%
*-commutative92.7%
Simplified92.7%
Final simplification95.6%
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.0005) (/ (- 1.0 (* z z)) (* y x)) (/ 1.0 (* z (* x (* y z))))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0005) {
tmp = (1.0 - (z * z)) / (y * x);
} else {
tmp = 1.0 / (z * (x * (y * 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.0005d0) then
tmp = (1.0d0 - (z * z)) / (y * x)
else
tmp = 1.0d0 / (z * (x * (y * 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.0005) {
tmp = (1.0 - (z * z)) / (y * x);
} else {
tmp = 1.0 / (z * (x * (y * z)));
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0005: tmp = (1.0 - (z * z)) / (y * x) else: tmp = 1.0 / (z * (x * (y * z))) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0005) tmp = Float64(Float64(1.0 - Float64(z * z)) / Float64(y * x)); else tmp = Float64(1.0 / Float64(z * Float64(x * Float64(y * 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.0005)
tmp = (1.0 - (z * z)) / (y * x);
else
tmp = 1.0 / (z * (x * (y * 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.0005], N[(N[(1.0 - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(x * N[(y * 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 0.0005:\\
\;\;\;\;\frac{1 - z \cdot z}{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \left(x \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e-4Initial program 99.7%
associate-/r*99.6%
*-commutative99.6%
sqr-neg99.6%
+-commutative99.6%
distribute-lft1-in99.6%
*-commutative99.6%
fma-def99.6%
sqr-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 90.1%
associate-/l/90.1%
+-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
associate-/r*90.1%
unpow290.1%
*-commutative90.1%
div-sub99.3%
Simplified99.3%
if 5.0000000000000001e-4 < (*.f64 z z) Initial program 80.3%
associate-/r*79.8%
*-commutative79.8%
sqr-neg79.8%
+-commutative79.8%
distribute-lft1-in79.8%
*-commutative79.8%
fma-def79.8%
sqr-neg79.8%
Simplified79.8%
Taylor expanded in z around inf 78.1%
*-commutative78.1%
unpow278.1%
associate-*l*78.4%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in y around 0 78.1%
*-commutative78.1%
unpow278.1%
associate-*r*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in x around 0 78.1%
*-commutative78.1%
unpow278.1%
associate-*r*84.3%
*-commutative84.3%
associate-*r*84.3%
associate-*r*92.7%
*-commutative92.7%
Simplified92.7%
Final simplification95.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 (if (<= (* z z) 0.0005) (/ (- 1.0 (* z z)) (* y x)) (/ (/ (/ 1.0 y) z) (* z x))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0005) {
tmp = (1.0 - (z * z)) / (y * x);
} else {
tmp = ((1.0 / y) / z) / (z * x);
}
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.0005d0) then
tmp = (1.0d0 - (z * z)) / (y * x)
else
tmp = ((1.0d0 / y) / z) / (z * x)
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.0005) {
tmp = (1.0 - (z * z)) / (y * x);
} else {
tmp = ((1.0 / y) / z) / (z * x);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0005: tmp = (1.0 - (z * z)) / (y * x) else: tmp = ((1.0 / y) / z) / (z * x) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0005) tmp = Float64(Float64(1.0 - Float64(z * z)) / Float64(y * x)); else tmp = Float64(Float64(Float64(1.0 / y) / z) / Float64(z * x)); 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.0005)
tmp = (1.0 - (z * z)) / (y * x);
else
tmp = ((1.0 / y) / z) / (z * x);
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.0005], N[(N[(1.0 - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.0005:\\
\;\;\;\;\frac{1 - z \cdot z}{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e-4Initial program 99.7%
associate-/r*99.6%
*-commutative99.6%
sqr-neg99.6%
+-commutative99.6%
distribute-lft1-in99.6%
*-commutative99.6%
fma-def99.6%
sqr-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 90.1%
associate-/l/90.1%
+-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
associate-/r*90.1%
unpow290.1%
*-commutative90.1%
div-sub99.3%
Simplified99.3%
if 5.0000000000000001e-4 < (*.f64 z z) Initial program 80.3%
associate-/r*80.9%
associate-/r*80.9%
sqr-neg80.9%
+-commutative80.9%
sqr-neg80.9%
fma-def80.9%
Simplified80.9%
associate-/r*80.9%
div-inv80.9%
Applied egg-rr80.9%
*-commutative80.9%
add-sqr-sqrt80.9%
times-frac82.8%
fma-udef82.8%
+-commutative82.8%
hypot-1-def82.8%
fma-udef82.8%
+-commutative82.8%
hypot-1-def96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 78.1%
*-commutative78.1%
associate-*r*78.4%
unpow278.4%
associate-/r*78.8%
*-rgt-identity78.8%
associate-*l*89.2%
*-commutative89.2%
times-frac93.2%
associate-/r*93.8%
associate-/r*93.1%
times-frac93.9%
*-lft-identity93.9%
associate-/r*94.5%
*-commutative94.5%
Simplified94.5%
Final simplification96.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 (if (<= (* z z) 0.0005) (/ (- 1.0 (* z z)) (* y x)) (/ (/ (/ 1.0 z) y) (* z x))))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 0.0005) {
tmp = (1.0 - (z * z)) / (y * x);
} else {
tmp = ((1.0 / z) / y) / (z * x);
}
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.0005d0) then
tmp = (1.0d0 - (z * z)) / (y * x)
else
tmp = ((1.0d0 / z) / y) / (z * x)
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.0005) {
tmp = (1.0 - (z * z)) / (y * x);
} else {
tmp = ((1.0 / z) / y) / (z * x);
}
return tmp;
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z * z) <= 0.0005: tmp = (1.0 - (z * z)) / (y * x) else: tmp = ((1.0 / z) / y) / (z * x) return tmp
z = abs(z) x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(z * z) <= 0.0005) tmp = Float64(Float64(1.0 - Float64(z * z)) / Float64(y * x)); else tmp = Float64(Float64(Float64(1.0 / z) / y) / Float64(z * x)); 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.0005)
tmp = (1.0 - (z * z)) / (y * x);
else
tmp = ((1.0 / z) / y) / (z * x);
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.0005], N[(N[(1.0 - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / z), $MachinePrecision] / y), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 0.0005:\\
\;\;\;\;\frac{1 - z \cdot z}{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{z}}{y}}{z \cdot x}\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e-4Initial program 99.7%
associate-/r*99.6%
*-commutative99.6%
sqr-neg99.6%
+-commutative99.6%
distribute-lft1-in99.6%
*-commutative99.6%
fma-def99.6%
sqr-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 90.1%
associate-/l/90.1%
+-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
associate-/r*90.1%
unpow290.1%
*-commutative90.1%
div-sub99.3%
Simplified99.3%
if 5.0000000000000001e-4 < (*.f64 z z) Initial program 80.3%
associate-/r*79.8%
*-commutative79.8%
sqr-neg79.8%
+-commutative79.8%
distribute-lft1-in79.8%
*-commutative79.8%
fma-def79.8%
sqr-neg79.8%
Simplified79.8%
Taylor expanded in z around inf 78.1%
*-commutative78.1%
unpow278.1%
associate-*l*78.4%
associate-*l*88.8%
Simplified88.8%
associate-/r*89.2%
*-un-lft-identity89.2%
times-frac93.2%
Applied egg-rr93.2%
associate-*r/94.4%
un-div-inv94.4%
Applied egg-rr94.4%
Final simplification96.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 (if (<= z 1.0) (/ (/ 1.0 x) y) (/ 1.0 (* x (* y 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 / (x * (y * 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 / (x * (y * 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 / (x * (y * 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 / (x * (y * 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(x * Float64(y * 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 / (x * (y * 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[(x * N[(y * z), $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}{x \cdot \left(y \cdot z\right)}\\
\end{array}
\end{array}
if z < 1Initial program 94.1%
distribute-lft-in94.1%
*-rgt-identity94.1%
+-commutative94.1%
associate-*r*95.6%
fma-def95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 71.6%
if 1 < z Initial program 77.4%
associate-/r*77.2%
associate-/r*77.3%
sqr-neg77.3%
+-commutative77.3%
sqr-neg77.3%
fma-def77.3%
Simplified77.3%
associate-/r*77.2%
div-inv77.3%
Applied egg-rr77.3%
*-commutative77.3%
add-sqr-sqrt77.3%
times-frac80.4%
fma-udef80.4%
+-commutative80.4%
hypot-1-def80.4%
fma-udef80.4%
+-commutative80.4%
hypot-1-def96.3%
Applied egg-rr96.3%
Taylor expanded in z around inf 94.7%
*-commutative94.7%
associate-/r*95.5%
Simplified95.5%
Taylor expanded in z around 0 42.8%
Final simplification63.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 (* y x)))
z = abs(z);
assert(x < y);
double code(double x, double y, double z) {
return 1.0 / (y * x);
}
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 / (y * x)
end function
z = Math.abs(z);
assert x < y;
public static double code(double x, double y, double z) {
return 1.0 / (y * x);
}
z = abs(z) [x, y] = sort([x, y]) def code(x, y, z): return 1.0 / (y * x)
z = abs(z) x, y = sort([x, y]) function code(x, y, z) return Float64(1.0 / Float64(y * x)) end
z = abs(z)
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = 1.0 / (y * x);
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[(y * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z = |z|\\
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y \cdot x}
\end{array}
Initial program 89.4%
associate-/r*89.1%
*-commutative89.1%
sqr-neg89.1%
+-commutative89.1%
distribute-lft1-in89.1%
*-commutative89.1%
fma-def89.1%
sqr-neg89.1%
Simplified89.1%
Taylor expanded in z around 0 57.9%
*-commutative57.9%
Simplified57.9%
Final simplification57.9%
(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 2023272
(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)))))