
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -5.6e-43)
(/
(* x.re (/ (fma x.im (/ y.re x.re) (- y.im)) (hypot y.im y.re)))
(hypot y.im y.re))
(if (<= x.re 2.5e-28)
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(* x.re (/ (- y.im) (pow (hypot y.re y.im) 2.0))))
(*
(/ (- (* x.im (/ y.re x.re)) y.im) (hypot y.im y.re))
(/ x.re (hypot y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -5.6e-43) {
tmp = (x_46_re * (fma(x_46_im, (y_46_re / x_46_re), -y_46_im) / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re);
} else if (x_46_re <= 2.5e-28) {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re * (-y_46_im / pow(hypot(y_46_re, y_46_im), 2.0))));
} else {
tmp = (((x_46_im * (y_46_re / x_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -5.6e-43) tmp = Float64(Float64(x_46_re * Float64(fma(x_46_im, Float64(y_46_re / x_46_re), Float64(-y_46_im)) / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)); elseif (x_46_re <= 2.5e-28) tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re * Float64(Float64(-y_46_im) / (hypot(y_46_re, y_46_im) ^ 2.0)))); else tmp = Float64(Float64(Float64(Float64(x_46_im * Float64(y_46_re / x_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * Float64(x_46_re / hypot(y_46_im, y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -5.6e-43], N[(N[(x$46$re * N[(N[(x$46$im * N[(y$46$re / x$46$re), $MachinePrecision] + (-y$46$im)), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.5e-28], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[((-y$46$im) / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x$46$im * N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision] - y$46$im), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{x.re \cdot \frac{\mathsf{fma}\left(x.im, \frac{y.re}{x.re}, -y.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;x.re \leq 2.5 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re \cdot \frac{-y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{x.re} - y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}
\end{array}
if x.re < -5.5999999999999996e-43Initial program 55.5%
fmm-def55.5%
distribute-rgt-neg-out55.5%
+-commutative55.5%
fma-define55.5%
Simplified55.5%
Taylor expanded in x.re around inf 55.5%
+-commutative55.5%
mul-1-neg55.5%
sub-neg55.5%
associate-/l*55.5%
Simplified55.5%
*-commutative55.5%
add-sqr-sqrt55.5%
times-frac60.7%
fma-undefine60.7%
hypot-define60.7%
fma-undefine60.7%
hypot-define96.1%
Applied egg-rr96.1%
associate-*r/96.4%
fmm-def96.4%
Applied egg-rr96.4%
if -5.5999999999999996e-43 < x.re < 2.5000000000000001e-28Initial program 70.4%
fmm-def70.4%
distribute-rgt-neg-out70.4%
+-commutative70.4%
fma-define70.4%
Simplified70.4%
distribute-rgt-neg-out70.4%
fmm-def70.4%
fma-undefine70.4%
+-commutative70.4%
div-sub68.7%
*-commutative68.7%
add-sqr-sqrt68.7%
times-frac69.4%
fmm-def69.4%
hypot-define69.4%
hypot-define92.8%
associate-/l*93.8%
add-sqr-sqrt93.8%
pow293.8%
Applied egg-rr93.8%
if 2.5000000000000001e-28 < x.re Initial program 64.0%
fmm-def64.0%
distribute-rgt-neg-out64.0%
+-commutative64.0%
fma-define64.0%
Simplified64.0%
Taylor expanded in x.re around inf 64.0%
+-commutative64.0%
mul-1-neg64.0%
sub-neg64.0%
associate-/l*62.6%
Simplified62.6%
*-commutative62.6%
add-sqr-sqrt62.6%
times-frac64.7%
fma-undefine64.7%
hypot-define64.7%
fma-undefine64.7%
hypot-define94.4%
Applied egg-rr94.4%
Final simplification94.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.8e+124)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.re 4.8e+28)
(/
(* x.re (/ (fma x.im (/ y.re x.re) (- y.im)) (hypot y.im y.re)))
(hypot y.im y.re))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ (* x.re y.im) (- (pow y.re 2.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.8e+124) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_re <= 4.8e+28) {
tmp = (x_46_re * (fma(x_46_im, (y_46_re / x_46_re), -y_46_im) / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re);
} else {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), ((x_46_re * y_46_im) / -pow(y_46_re, 2.0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -2.8e+124) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_re <= 4.8e+28) tmp = Float64(Float64(x_46_re * Float64(fma(x_46_im, Float64(y_46_re / x_46_re), Float64(-y_46_im)) / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)); else tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(x_46_re * y_46_im) / Float64(-(y_46_re ^ 2.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.8e+124], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 4.8e+28], N[(N[(x$46$re * N[(N[(x$46$im * N[(y$46$re / x$46$re), $MachinePrecision] + (-y$46$im)), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * y$46$im), $MachinePrecision] / (-N[Power[y$46$re, 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+124}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{x.re \cdot \frac{\mathsf{fma}\left(x.im, \frac{y.re}{x.re}, -y.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re \cdot y.im}{-{y.re}^{2}}\right)\\
\end{array}
\end{array}
if y.re < -2.8e124Initial program 36.3%
fmm-def36.3%
distribute-rgt-neg-out36.3%
+-commutative36.3%
fma-define36.3%
Simplified36.3%
distribute-rgt-neg-out36.3%
fmm-def36.3%
fma-undefine36.3%
+-commutative36.3%
div-sub36.3%
*-commutative36.3%
add-sqr-sqrt36.3%
times-frac39.4%
fmm-def39.4%
hypot-define39.4%
hypot-define82.7%
associate-/l*83.3%
add-sqr-sqrt83.3%
pow283.3%
Applied egg-rr83.3%
Taylor expanded in y.re around inf 82.9%
mul-1-neg82.9%
sub-neg82.9%
associate-*r/86.8%
Simplified86.8%
if -2.8e124 < y.re < 4.79999999999999962e28Initial program 81.1%
fmm-def81.1%
distribute-rgt-neg-out81.1%
+-commutative81.1%
fma-define81.1%
Simplified81.1%
Taylor expanded in x.re around inf 77.2%
+-commutative77.2%
mul-1-neg77.2%
sub-neg77.2%
associate-/l*75.8%
Simplified75.8%
*-commutative75.8%
add-sqr-sqrt75.7%
times-frac76.8%
fma-undefine76.8%
hypot-define76.8%
fma-undefine76.8%
hypot-define90.9%
Applied egg-rr90.9%
associate-*r/91.4%
fmm-def91.4%
Applied egg-rr91.4%
if 4.79999999999999962e28 < y.re Initial program 47.7%
fmm-def47.7%
distribute-rgt-neg-out47.7%
+-commutative47.7%
fma-define47.7%
Simplified47.7%
distribute-rgt-neg-out47.7%
fmm-def47.7%
fma-undefine47.7%
+-commutative47.7%
div-sub47.7%
*-commutative47.7%
add-sqr-sqrt47.7%
times-frac50.2%
fmm-def50.2%
hypot-define50.3%
hypot-define85.1%
associate-/l*87.0%
add-sqr-sqrt87.0%
pow287.0%
Applied egg-rr87.0%
Taylor expanded in y.im around 0 80.5%
Final simplification88.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -4.1e+124)
t_0
(if (<= y.re 9.6e+20)
(/
(* x.re (/ (fma x.im (/ y.re x.re) (- y.im)) (hypot y.im y.re)))
(hypot y.im y.re))
(if (<= y.re 2.45e+92)
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -4.1e+124) {
tmp = t_0;
} else if (y_46_re <= 9.6e+20) {
tmp = (x_46_re * (fma(x_46_im, (y_46_re / x_46_re), -y_46_im) / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re);
} else if (y_46_re <= 2.45e+92) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -4.1e+124) tmp = t_0; elseif (y_46_re <= 9.6e+20) tmp = Float64(Float64(x_46_re * Float64(fma(x_46_im, Float64(y_46_re / x_46_re), Float64(-y_46_im)) / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)); elseif (y_46_re <= 2.45e+92) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -4.1e+124], t$95$0, If[LessEqual[y$46$re, 9.6e+20], N[(N[(x$46$re * N[(N[(x$46$im * N[(y$46$re / x$46$re), $MachinePrecision] + (-y$46$im)), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.45e+92], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -4.1 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 9.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{x.re \cdot \frac{\mathsf{fma}\left(x.im, \frac{y.re}{x.re}, -y.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+92}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.10000000000000001e124 or 2.4500000000000001e92 < y.re Initial program 34.5%
fmm-def34.5%
distribute-rgt-neg-out34.5%
+-commutative34.5%
fma-define34.5%
Simplified34.5%
distribute-rgt-neg-out34.5%
fmm-def34.5%
fma-undefine34.5%
+-commutative34.5%
div-sub34.5%
*-commutative34.5%
add-sqr-sqrt34.5%
times-frac37.7%
fmm-def37.7%
hypot-define37.7%
hypot-define81.9%
associate-/l*84.3%
add-sqr-sqrt84.3%
pow284.3%
Applied egg-rr84.3%
Taylor expanded in y.re around inf 79.7%
mul-1-neg79.7%
sub-neg79.7%
associate-*r/83.9%
Simplified83.9%
if -4.10000000000000001e124 < y.re < 9.6e20Initial program 80.8%
fmm-def80.8%
distribute-rgt-neg-out80.8%
+-commutative80.8%
fma-define80.9%
Simplified80.9%
Taylor expanded in x.re around inf 77.5%
+-commutative77.5%
mul-1-neg77.5%
sub-neg77.5%
associate-/l*76.1%
Simplified76.1%
*-commutative76.1%
add-sqr-sqrt76.1%
times-frac77.1%
fma-undefine77.1%
hypot-define77.1%
fma-undefine77.1%
hypot-define91.4%
Applied egg-rr91.4%
associate-*r/91.9%
fmm-def91.9%
Applied egg-rr91.9%
if 9.6e20 < y.re < 2.4500000000000001e92Initial program 99.8%
Final simplification89.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -4.4e+69)
t_0
(if (<= y.re -5e-130)
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 8.5e-83)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 1.15e+93)
(/ (fma x.im y.re (- (* x.re y.im))) (fma y.im y.im (* y.re y.re)))
t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -4.4e+69) {
tmp = t_0;
} else if (y_46_re <= -5e-130) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 8.5e-83) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.15e+93) {
tmp = fma(x_46_im, y_46_re, -(x_46_re * y_46_im)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -4.4e+69) tmp = t_0; elseif (y_46_re <= -5e-130) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 8.5e-83) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 1.15e+93) tmp = Float64(fma(x_46_im, y_46_re, Float64(-Float64(x_46_re * y_46_im))) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -4.4e+69], t$95$0, If[LessEqual[y$46$re, -5e-130], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.5e-83], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.15e+93], N[(N[(x$46$im * y$46$re + (-N[(x$46$re * y$46$im), $MachinePrecision])), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -4.4 \cdot 10^{+69}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -5 \cdot 10^{-130}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-83}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.15 \cdot 10^{+93}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, -x.re \cdot y.im\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.4000000000000003e69 or 1.1500000000000001e93 < y.re Initial program 37.9%
fmm-def37.9%
distribute-rgt-neg-out37.9%
+-commutative37.9%
fma-define37.9%
Simplified37.9%
distribute-rgt-neg-out37.9%
fmm-def37.9%
fma-undefine37.9%
+-commutative37.9%
div-sub37.9%
*-commutative37.9%
add-sqr-sqrt37.9%
times-frac42.4%
fmm-def42.4%
hypot-define42.4%
hypot-define81.3%
associate-/l*84.4%
add-sqr-sqrt84.4%
pow284.4%
Applied egg-rr84.4%
Taylor expanded in y.re around inf 79.4%
mul-1-neg79.4%
sub-neg79.4%
associate-*r/83.1%
Simplified83.1%
if -4.4000000000000003e69 < y.re < -4.9999999999999996e-130Initial program 89.7%
if -4.9999999999999996e-130 < y.re < 8.49999999999999938e-83Initial program 80.8%
fmm-def80.8%
distribute-rgt-neg-out80.8%
+-commutative80.8%
fma-define80.8%
Simplified80.8%
distribute-rgt-neg-out80.8%
fmm-def80.8%
fma-undefine80.8%
+-commutative80.8%
div-sub67.2%
*-commutative67.2%
add-sqr-sqrt67.2%
times-frac67.5%
fmm-def67.6%
hypot-define67.6%
hypot-define72.9%
associate-/l*75.9%
add-sqr-sqrt75.9%
pow275.9%
Applied egg-rr75.9%
Taylor expanded in y.im around inf 95.5%
associate-*r/94.8%
Simplified94.8%
if 8.49999999999999938e-83 < y.re < 1.1500000000000001e93Initial program 85.9%
fmm-def85.9%
distribute-rgt-neg-out85.9%
+-commutative85.9%
fma-define86.0%
Simplified86.0%
Final simplification87.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -5.8e+72)
t_0
(if (<= y.re 5.6e+20)
(*
(/ (- (* x.im (/ y.re x.re)) y.im) (hypot y.im y.re))
(/ x.re (hypot y.im y.re)))
(if (<= y.re 8e+91)
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -5.8e+72) {
tmp = t_0;
} else if (y_46_re <= 5.6e+20) {
tmp = (((x_46_im * (y_46_re / x_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re));
} else if (y_46_re <= 8e+91) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -5.8e+72) {
tmp = t_0;
} else if (y_46_re <= 5.6e+20) {
tmp = (((x_46_im * (y_46_re / x_46_re)) - y_46_im) / Math.hypot(y_46_im, y_46_re)) * (x_46_re / Math.hypot(y_46_im, y_46_re));
} else if (y_46_re <= 8e+91) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re tmp = 0 if y_46_re <= -5.8e+72: tmp = t_0 elif y_46_re <= 5.6e+20: tmp = (((x_46_im * (y_46_re / x_46_re)) - y_46_im) / math.hypot(y_46_im, y_46_re)) * (x_46_re / math.hypot(y_46_im, y_46_re)) elif y_46_re <= 8e+91: tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -5.8e+72) tmp = t_0; elseif (y_46_re <= 5.6e+20) tmp = Float64(Float64(Float64(Float64(x_46_im * Float64(y_46_re / x_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * Float64(x_46_re / hypot(y_46_im, y_46_re))); elseif (y_46_re <= 8e+91) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; tmp = 0.0; if (y_46_re <= -5.8e+72) tmp = t_0; elseif (y_46_re <= 5.6e+20) tmp = (((x_46_im * (y_46_re / x_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re)); elseif (y_46_re <= 8e+91) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e+72], t$95$0, If[LessEqual[y$46$re, 5.6e+20], N[(N[(N[(N[(x$46$im * N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision] - y$46$im), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8e+91], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{x.re} - y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+91}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.80000000000000034e72 or 8.00000000000000064e91 < y.re Initial program 38.2%
fmm-def38.2%
distribute-rgt-neg-out38.2%
+-commutative38.2%
fma-define38.2%
Simplified38.2%
distribute-rgt-neg-out38.2%
fmm-def38.2%
fma-undefine38.2%
+-commutative38.2%
div-sub38.2%
*-commutative38.2%
add-sqr-sqrt38.2%
times-frac42.8%
fmm-def42.8%
hypot-define42.8%
hypot-define82.0%
associate-/l*84.3%
add-sqr-sqrt84.3%
pow284.3%
Applied egg-rr84.3%
Taylor expanded in y.re around inf 80.1%
mul-1-neg80.1%
sub-neg80.1%
associate-*r/83.8%
Simplified83.8%
if -5.80000000000000034e72 < y.re < 5.6e20Initial program 82.0%
fmm-def82.0%
distribute-rgt-neg-out82.0%
+-commutative82.0%
fma-define82.1%
Simplified82.1%
Taylor expanded in x.re around inf 78.4%
+-commutative78.4%
mul-1-neg78.4%
sub-neg78.4%
associate-/l*77.6%
Simplified77.6%
*-commutative77.6%
add-sqr-sqrt77.6%
times-frac78.0%
fma-undefine78.0%
hypot-define78.0%
fma-undefine78.0%
hypot-define92.2%
Applied egg-rr92.2%
if 5.6e20 < y.re < 8.00000000000000064e91Initial program 99.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -8.6e+68)
t_1
(if (<= y.re -3.4e-128)
t_0
(if (<= y.re 1.16e-82)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 1.6e+93) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -8.6e+68) {
tmp = t_1;
} else if (y_46_re <= -3.4e-128) {
tmp = t_0;
} else if (y_46_re <= 1.16e-82) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.6e+93) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
if (y_46re <= (-8.6d+68)) then
tmp = t_1
else if (y_46re <= (-3.4d-128)) then
tmp = t_0
else if (y_46re <= 1.16d-82) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else if (y_46re <= 1.6d+93) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -8.6e+68) {
tmp = t_1;
} else if (y_46_re <= -3.4e-128) {
tmp = t_0;
} else if (y_46_re <= 1.16e-82) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.6e+93) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re tmp = 0 if y_46_re <= -8.6e+68: tmp = t_1 elif y_46_re <= -3.4e-128: tmp = t_0 elif y_46_re <= 1.16e-82: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 1.6e+93: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -8.6e+68) tmp = t_1; elseif (y_46_re <= -3.4e-128) tmp = t_0; elseif (y_46_re <= 1.16e-82) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 1.6e+93) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; tmp = 0.0; if (y_46_re <= -8.6e+68) tmp = t_1; elseif (y_46_re <= -3.4e-128) tmp = t_0; elseif (y_46_re <= 1.16e-82) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 1.6e+93) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -8.6e+68], t$95$1, If[LessEqual[y$46$re, -3.4e-128], t$95$0, If[LessEqual[y$46$re, 1.16e-82], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.6e+93], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -8.6 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -3.4 \cdot 10^{-128}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.16 \cdot 10^{-82}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+93}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -8.6000000000000002e68 or 1.6000000000000001e93 < y.re Initial program 37.9%
fmm-def37.9%
distribute-rgt-neg-out37.9%
+-commutative37.9%
fma-define37.9%
Simplified37.9%
distribute-rgt-neg-out37.9%
fmm-def37.9%
fma-undefine37.9%
+-commutative37.9%
div-sub37.9%
*-commutative37.9%
add-sqr-sqrt37.9%
times-frac42.4%
fmm-def42.4%
hypot-define42.4%
hypot-define81.3%
associate-/l*84.4%
add-sqr-sqrt84.4%
pow284.4%
Applied egg-rr84.4%
Taylor expanded in y.re around inf 79.4%
mul-1-neg79.4%
sub-neg79.4%
associate-*r/83.1%
Simplified83.1%
if -8.6000000000000002e68 < y.re < -3.39999999999999975e-128 or 1.16e-82 < y.re < 1.6000000000000001e93Initial program 87.9%
if -3.39999999999999975e-128 < y.re < 1.16e-82Initial program 80.8%
fmm-def80.8%
distribute-rgt-neg-out80.8%
+-commutative80.8%
fma-define80.8%
Simplified80.8%
distribute-rgt-neg-out80.8%
fmm-def80.8%
fma-undefine80.8%
+-commutative80.8%
div-sub67.2%
*-commutative67.2%
add-sqr-sqrt67.2%
times-frac67.5%
fmm-def67.6%
hypot-define67.6%
hypot-define72.9%
associate-/l*75.9%
add-sqr-sqrt75.9%
pow275.9%
Applied egg-rr75.9%
Taylor expanded in y.im around inf 95.5%
associate-*r/94.8%
Simplified94.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -6e-119) (not (<= y.re 0.016))) (/ (- x.im (* x.re (/ y.im y.re))) y.re) (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -6e-119) || !(y_46_re <= 0.016)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-6d-119)) .or. (.not. (y_46re <= 0.016d0))) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -6e-119) || !(y_46_re <= 0.016)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -6e-119) or not (y_46_re <= 0.016): tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -6e-119) || !(y_46_re <= 0.016)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -6e-119) || ~((y_46_re <= 0.016))) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -6e-119], N[Not[LessEqual[y$46$re, 0.016]], $MachinePrecision]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6 \cdot 10^{-119} \lor \neg \left(y.re \leq 0.016\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -6.0000000000000004e-119 or 0.016 < y.re Initial program 55.9%
fmm-def55.9%
distribute-rgt-neg-out55.9%
+-commutative55.9%
fma-define55.9%
Simplified55.9%
distribute-rgt-neg-out55.9%
fmm-def55.9%
fma-undefine55.9%
+-commutative55.9%
div-sub55.8%
*-commutative55.8%
add-sqr-sqrt55.8%
times-frac58.8%
fmm-def58.8%
hypot-define58.8%
hypot-define83.8%
associate-/l*86.0%
add-sqr-sqrt86.0%
pow286.0%
Applied egg-rr86.0%
Taylor expanded in y.re around inf 73.6%
mul-1-neg73.6%
sub-neg73.6%
associate-*r/76.0%
Simplified76.0%
if -6.0000000000000004e-119 < y.re < 0.016Initial program 81.7%
fmm-def81.7%
distribute-rgt-neg-out81.7%
+-commutative81.7%
fma-define81.7%
Simplified81.7%
distribute-rgt-neg-out81.7%
fmm-def81.7%
fma-undefine81.7%
+-commutative81.7%
div-sub70.2%
*-commutative70.2%
add-sqr-sqrt70.2%
times-frac70.5%
fmm-def70.5%
hypot-define70.5%
hypot-define75.1%
associate-/l*77.5%
add-sqr-sqrt77.5%
pow277.5%
Applied egg-rr77.5%
Taylor expanded in y.im around inf 90.9%
associate-*r/90.4%
Simplified90.4%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.7e-133) (not (<= y.re 0.00156))) (/ (- x.im (* x.re (/ y.im y.re))) y.re) (- (/ x.re y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.7e-133) || !(y_46_re <= 0.00156)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = -(x_46_re / y_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.7d-133)) .or. (.not. (y_46re <= 0.00156d0))) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else
tmp = -(x_46re / y_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.7e-133) || !(y_46_re <= 0.00156)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = -(x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.7e-133) or not (y_46_re <= 0.00156): tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = -(x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.7e-133) || !(y_46_re <= 0.00156)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(-Float64(x_46_re / y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.7e-133) || ~((y_46_re <= 0.00156))) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = -(x_46_re / y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.7e-133], N[Not[LessEqual[y$46$re, 0.00156]], $MachinePrecision]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], (-N[(x$46$re / y$46$im), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{-133} \lor \neg \left(y.re \leq 0.00156\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.70000000000000003e-133 or 0.00155999999999999997 < y.re Initial program 56.6%
fmm-def56.6%
distribute-rgt-neg-out56.6%
+-commutative56.6%
fma-define56.6%
Simplified56.6%
distribute-rgt-neg-out56.6%
fmm-def56.6%
fma-undefine56.6%
+-commutative56.6%
div-sub56.6%
*-commutative56.6%
add-sqr-sqrt56.6%
times-frac59.5%
fmm-def59.5%
hypot-define59.6%
hypot-define84.1%
associate-/l*86.2%
add-sqr-sqrt86.2%
pow286.2%
Applied egg-rr86.2%
Taylor expanded in y.re around inf 73.5%
mul-1-neg73.5%
sub-neg73.5%
associate-*r/75.8%
Simplified75.8%
if -1.70000000000000003e-133 < y.re < 0.00155999999999999997Initial program 81.0%
fmm-def81.1%
distribute-rgt-neg-out81.1%
+-commutative81.1%
fma-define81.1%
Simplified81.1%
Taylor expanded in y.re around 0 73.8%
associate-*r/73.8%
neg-mul-173.8%
Simplified73.8%
Final simplification75.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.75e-133) (not (<= y.re 0.65))) (/ x.im y.re) (- (/ x.re y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.75e-133) || !(y_46_re <= 0.65)) {
tmp = x_46_im / y_46_re;
} else {
tmp = -(x_46_re / y_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.75d-133)) .or. (.not. (y_46re <= 0.65d0))) then
tmp = x_46im / y_46re
else
tmp = -(x_46re / y_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.75e-133) || !(y_46_re <= 0.65)) {
tmp = x_46_im / y_46_re;
} else {
tmp = -(x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.75e-133) or not (y_46_re <= 0.65): tmp = x_46_im / y_46_re else: tmp = -(x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.75e-133) || !(y_46_re <= 0.65)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(-Float64(x_46_re / y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.75e-133) || ~((y_46_re <= 0.65))) tmp = x_46_im / y_46_re; else tmp = -(x_46_re / y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.75e-133], N[Not[LessEqual[y$46$re, 0.65]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], (-N[(x$46$re / y$46$im), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.75 \cdot 10^{-133} \lor \neg \left(y.re \leq 0.65\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.75000000000000001e-133 or 0.650000000000000022 < y.re Initial program 56.4%
fmm-def56.4%
distribute-rgt-neg-out56.4%
+-commutative56.4%
fma-define56.4%
Simplified56.4%
Taylor expanded in y.re around inf 63.2%
if -1.75000000000000001e-133 < y.re < 0.650000000000000022Initial program 81.2%
fmm-def81.3%
distribute-rgt-neg-out81.3%
+-commutative81.3%
fma-define81.3%
Simplified81.3%
Taylor expanded in y.re around 0 73.0%
associate-*r/73.0%
neg-mul-173.0%
Simplified73.0%
Final simplification66.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8e+201) (not (<= y.im 9e+198))) (/ x.re y.im) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -8e+201) || !(y_46_im <= 9e+198)) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-8d+201)) .or. (.not. (y_46im <= 9d+198))) then
tmp = x_46re / y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -8e+201) || !(y_46_im <= 9e+198)) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -8e+201) or not (y_46_im <= 9e+198): tmp = x_46_re / y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -8e+201) || !(y_46_im <= 9e+198)) tmp = Float64(x_46_re / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -8e+201) || ~((y_46_im <= 9e+198))) tmp = x_46_re / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -8e+201], N[Not[LessEqual[y$46$im, 9e+198]], $MachinePrecision]], N[(x$46$re / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -8 \cdot 10^{+201} \lor \neg \left(y.im \leq 9 \cdot 10^{+198}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -8.0000000000000003e201 or 9.00000000000000003e198 < y.im Initial program 38.7%
fmm-def38.7%
distribute-rgt-neg-out38.7%
+-commutative38.7%
fma-define38.7%
Simplified38.7%
Taylor expanded in y.re around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
Simplified83.9%
div-inv83.6%
add-sqr-sqrt36.4%
sqrt-unprod47.6%
sqr-neg47.6%
sqrt-unprod20.2%
add-sqr-sqrt37.4%
Applied egg-rr37.4%
associate-*r/37.4%
*-rgt-identity37.4%
Simplified37.4%
if -8.0000000000000003e201 < y.im < 9.00000000000000003e198Initial program 70.0%
fmm-def70.0%
distribute-rgt-neg-out70.0%
+-commutative70.0%
fma-define70.0%
Simplified70.0%
Taylor expanded in y.re around inf 54.1%
Final simplification51.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 1.4e+216) (/ x.im y.re) (/ x.im y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 1.4e+216) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= 1.4d+216) then
tmp = x_46im / y_46re
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 1.4e+216) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 1.4e+216: tmp = x_46_im / y_46_re else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 1.4e+216) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= 1.4e+216) tmp = x_46_im / y_46_re; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 1.4e+216], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 1.4 \cdot 10^{+216}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < 1.39999999999999991e216Initial program 67.6%
fmm-def67.6%
distribute-rgt-neg-out67.6%
+-commutative67.6%
fma-define67.6%
Simplified67.6%
Taylor expanded in y.re around inf 50.5%
if 1.39999999999999991e216 < y.im Initial program 31.3%
fmm-def31.3%
distribute-rgt-neg-out31.3%
+-commutative31.3%
fma-define31.3%
Simplified31.3%
Taylor expanded in x.re around inf 21.3%
+-commutative21.3%
mul-1-neg21.3%
sub-neg21.3%
associate-/l*21.3%
Simplified21.3%
*-commutative21.3%
add-sqr-sqrt21.3%
times-frac23.1%
fma-undefine23.1%
hypot-define23.1%
fma-undefine23.1%
hypot-define80.0%
Applied egg-rr80.0%
Taylor expanded in y.re around -inf 28.3%
mul-1-neg28.3%
distribute-neg-frac228.3%
Simplified28.3%
Taylor expanded in y.im around -inf 25.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 64.7%
fmm-def64.7%
distribute-rgt-neg-out64.7%
+-commutative64.7%
fma-define64.8%
Simplified64.8%
Taylor expanded in x.re around inf 58.8%
+-commutative58.8%
mul-1-neg58.8%
sub-neg58.8%
associate-/l*53.2%
Simplified53.2%
*-commutative53.2%
add-sqr-sqrt53.1%
times-frac54.0%
fma-undefine54.0%
hypot-define54.0%
fma-undefine54.0%
hypot-define73.2%
Applied egg-rr73.2%
Taylor expanded in y.re around -inf 33.3%
mul-1-neg33.3%
distribute-neg-frac233.3%
Simplified33.3%
Taylor expanded in y.im around -inf 10.7%
herbie shell --seed 2024176
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))