
(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 13 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 (- (* (/ x.im (hypot y.im y.re)) (/ y.re (hypot y.im y.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) {
return ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - ((y_46_im / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im / Math.hypot(y_46_im, y_46_re)) * (y_46_re / Math.hypot(y_46_im, y_46_re))) - ((y_46_im / Math.hypot(y_46_im, y_46_re)) * (x_46_re / Math.hypot(y_46_im, y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im / math.hypot(y_46_im, y_46_re)) * (y_46_re / math.hypot(y_46_im, y_46_re))) - ((y_46_im / math.hypot(y_46_im, y_46_re)) * (x_46_re / math.hypot(y_46_im, y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))) - Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(x_46_re / hypot(y_46_im, y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - ((y_46_im / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y$46$im / 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]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}
\end{array}
Initial program 65.0%
div-sub63.7%
add-sqr-sqrt63.7%
times-frac67.1%
fma-neg67.1%
hypot-define67.1%
hypot-define75.4%
associate-/l*80.5%
add-sqr-sqrt80.5%
pow280.5%
hypot-define80.5%
Applied egg-rr80.5%
fma-neg80.5%
hypot-undefine71.2%
unpow271.2%
unpow271.2%
+-commutative71.2%
unpow271.2%
unpow271.2%
hypot-define80.5%
hypot-undefine71.2%
unpow271.2%
unpow271.2%
+-commutative71.2%
unpow271.2%
unpow271.2%
hypot-define80.5%
Simplified80.5%
div-inv80.4%
unpow280.4%
associate-*l*96.1%
Applied egg-rr96.1%
associate-/r*96.8%
div-inv96.8%
un-div-inv96.9%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
Simplified96.9%
clear-num96.5%
associate-/r/96.9%
clear-num96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= t_0 (- INFINITY))
(-
(* (/ x.im (hypot y.im y.re)) (/ y.re (hypot y.im y.re)))
(/ x.re y.im))
(if (<= t_0 2e+247)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.im y.re (* y.im (- x.re))) (hypot y.re y.im)))
(-
(/ x.im y.re)
(/ x.re (* (hypot y.im y.re) (* (hypot y.im y.re) (/ 1.0 y.im)))))))))
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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im);
} else if (t_0 <= 2e+247) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im / y_46_re) - (x_46_re / (hypot(y_46_im, y_46_re) * (hypot(y_46_im, y_46_re) * (1.0 / y_46_im))));
}
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(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))) - Float64(x_46_re / y_46_im)); elseif (t_0 <= 2e+247) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re / Float64(hypot(y_46_im, y_46_re) * Float64(hypot(y_46_im, y_46_re) * Float64(1.0 / y_46_im))))); end return 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[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+247], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] * N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re}{y.im}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+247}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right) \cdot \left(\mathsf{hypot}\left(y.im, y.re\right) \cdot \frac{1}{y.im}\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < -inf.0Initial program 27.9%
div-sub14.8%
add-sqr-sqrt14.8%
times-frac42.8%
fma-neg42.8%
hypot-define42.8%
hypot-define43.1%
associate-/l*78.0%
add-sqr-sqrt78.0%
pow278.0%
hypot-define78.0%
Applied egg-rr78.0%
fma-neg78.0%
hypot-undefine77.7%
unpow277.7%
unpow277.7%
+-commutative77.7%
unpow277.7%
unpow277.7%
hypot-define78.0%
hypot-undefine77.7%
unpow277.7%
unpow277.7%
+-commutative77.7%
unpow277.7%
unpow277.7%
hypot-define78.0%
Simplified78.0%
Taylor expanded in y.im around inf 88.2%
if -inf.0 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 1.9999999999999999e247Initial program 83.3%
*-un-lft-identity83.3%
add-sqr-sqrt83.3%
times-frac83.3%
hypot-define83.3%
fma-neg83.3%
distribute-rgt-neg-in83.3%
hypot-define97.5%
Applied egg-rr97.5%
if 1.9999999999999999e247 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 13.9%
div-sub11.9%
add-sqr-sqrt11.9%
times-frac23.4%
fma-neg23.4%
hypot-define23.4%
hypot-define44.7%
associate-/l*56.2%
add-sqr-sqrt56.2%
pow256.2%
hypot-define56.2%
Applied egg-rr56.2%
fma-neg56.2%
hypot-undefine30.5%
unpow230.5%
unpow230.5%
+-commutative30.5%
unpow230.5%
unpow230.5%
hypot-define56.2%
hypot-undefine30.5%
unpow230.5%
unpow230.5%
+-commutative30.5%
unpow230.5%
unpow230.5%
hypot-define56.2%
Simplified56.2%
div-inv56.2%
unpow256.2%
associate-*l*98.0%
Applied egg-rr98.0%
Taylor expanded in y.im around 0 78.1%
Final simplification92.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(-
(/ x.im y.re)
(/ (/ x.re (hypot y.im y.re)) (/ (hypot y.im y.re) y.im)))))
(if (<= y.re -3.05e-77)
t_0
(if (<= y.re 1.02e-141)
(-
(* (/ x.im (hypot y.im y.re)) (/ y.re (hypot y.im y.re)))
(/ x.re y.im))
(if (<= y.re 3.9e+70)
(/
(+
(* x.im y.re)
(fma x.re (- y.im) (fma x.re (- y.im) (* y.im x.re))))
(+ (* 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 / y_46_re) - ((x_46_re / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / y_46_im));
double tmp;
if (y_46_re <= -3.05e-77) {
tmp = t_0;
} else if (y_46_re <= 1.02e-141) {
tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im);
} else if (y_46_re <= 3.9e+70) {
tmp = ((x_46_im * y_46_re) + fma(x_46_re, -y_46_im, fma(x_46_re, -y_46_im, (y_46_im * x_46_re)))) / ((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 / y_46_re) - Float64(Float64(x_46_re / hypot(y_46_im, y_46_re)) / Float64(hypot(y_46_im, y_46_re) / y_46_im))) tmp = 0.0 if (y_46_re <= -3.05e-77) tmp = t_0; elseif (y_46_re <= 1.02e-141) tmp = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))) - Float64(x_46_re / y_46_im)); elseif (y_46_re <= 3.9e+70) tmp = Float64(Float64(Float64(x_46_im * y_46_re) + fma(x_46_re, Float64(-y_46_im), fma(x_46_re, Float64(-y_46_im), Float64(y_46_im * x_46_re)))) / 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 / y$46$re), $MachinePrecision] - N[(N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.05e-77], t$95$0, If[LessEqual[y$46$re, 1.02e-141], N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.9e+70], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] + N[(x$46$re * (-y$46$im) + N[(x$46$re * (-y$46$im) + N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $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}{y.re} - \frac{\frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{y.im}}\\
\mathbf{if}\;y.re \leq -3.05 \cdot 10^{-77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{-141}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 3.9 \cdot 10^{+70}:\\
\;\;\;\;\frac{x.im \cdot y.re + \mathsf{fma}\left(x.re, -y.im, \mathsf{fma}\left(x.re, -y.im, y.im \cdot x.re\right)\right)}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.0500000000000001e-77 or 3.89999999999999975e70 < y.re Initial program 55.6%
div-sub55.6%
add-sqr-sqrt55.6%
times-frac61.6%
fma-neg61.6%
hypot-define61.6%
hypot-define77.4%
associate-/l*79.1%
add-sqr-sqrt79.1%
pow279.1%
hypot-define79.1%
Applied egg-rr79.1%
fma-neg79.1%
hypot-undefine61.4%
unpow261.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
unpow261.4%
hypot-define79.1%
hypot-undefine61.4%
unpow261.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
unpow261.4%
hypot-define79.1%
Simplified79.1%
div-inv79.1%
unpow279.1%
associate-*l*94.3%
Applied egg-rr94.3%
associate-/r*97.5%
div-inv97.5%
un-div-inv97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in y.im around 0 84.8%
if -3.0500000000000001e-77 < y.re < 1.02e-141Initial program 68.8%
div-sub65.3%
add-sqr-sqrt65.3%
times-frac63.7%
fma-neg63.7%
hypot-define63.7%
hypot-define64.8%
associate-/l*76.5%
add-sqr-sqrt76.5%
pow276.5%
hypot-define76.5%
Applied egg-rr76.5%
fma-neg76.5%
hypot-undefine75.3%
unpow275.3%
unpow275.3%
+-commutative75.3%
unpow275.3%
unpow275.3%
hypot-define76.5%
hypot-undefine75.3%
unpow275.3%
unpow275.3%
+-commutative75.3%
unpow275.3%
unpow275.3%
hypot-define76.5%
Simplified76.5%
Taylor expanded in y.im around inf 88.5%
if 1.02e-141 < y.re < 3.89999999999999975e70Initial program 83.8%
prod-diff83.8%
*-commutative83.8%
fma-define83.8%
associate-+l+83.8%
distribute-rgt-neg-in83.8%
fma-define84.0%
*-commutative84.0%
fma-undefine83.8%
distribute-lft-neg-in83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
fma-define84.0%
Applied egg-rr84.0%
Final simplification86.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1
(-
(* (/ x.im (hypot y.im y.re)) (/ y.re (hypot y.im y.re)))
(/ x.re y.im))))
(if (<= y.im -6.2e+23)
t_1
(if (<= y.im -1.72e-141)
t_0
(if (<= y.im 1.26e-166)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.im 1.1e+56) 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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -6.2e+23) {
tmp = t_1;
} else if (y_46_im <= -1.72e-141) {
tmp = t_0;
} else if (y_46_im <= 1.26e-166) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 1.1e+56) {
tmp = t_0;
} else {
tmp = t_1;
}
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 * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im / Math.hypot(y_46_im, y_46_re)) * (y_46_re / Math.hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -6.2e+23) {
tmp = t_1;
} else if (y_46_im <= -1.72e-141) {
tmp = t_0;
} else if (y_46_im <= 1.26e-166) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 1.1e+56) {
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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = ((x_46_im / math.hypot(y_46_im, y_46_re)) * (y_46_re / math.hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -6.2e+23: tmp = t_1 elif y_46_im <= -1.72e-141: tmp = t_0 elif y_46_im <= 1.26e-166: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_im <= 1.1e+56: 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(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -6.2e+23) tmp = t_1; elseif (y_46_im <= -1.72e-141) tmp = t_0; elseif (y_46_im <= 1.26e-166) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_im <= 1.1e+56) 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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -6.2e+23) tmp = t_1; elseif (y_46_im <= -1.72e-141) tmp = t_0; elseif (y_46_im <= 1.26e-166) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_im <= 1.1e+56) 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[(y$46$im * x$46$re), $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[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.2e+23], t$95$1, If[LessEqual[y$46$im, -1.72e-141], t$95$0, If[LessEqual[y$46$im, 1.26e-166], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.1e+56], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -6.2 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.72 \cdot 10^{-141}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{-166}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.1 \cdot 10^{+56}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -6.19999999999999941e23 or 1.10000000000000008e56 < y.im Initial program 48.9%
div-sub48.9%
add-sqr-sqrt48.9%
times-frac48.3%
fma-neg48.3%
hypot-define48.3%
hypot-define59.9%
associate-/l*68.7%
add-sqr-sqrt68.7%
pow268.7%
hypot-define68.7%
Applied egg-rr68.7%
fma-neg68.7%
hypot-undefine55.1%
unpow255.1%
unpow255.1%
+-commutative55.1%
unpow255.1%
unpow255.1%
hypot-define68.7%
hypot-undefine55.1%
unpow255.1%
unpow255.1%
+-commutative55.1%
unpow255.1%
unpow255.1%
hypot-define68.7%
Simplified68.7%
Taylor expanded in y.im around inf 85.6%
if -6.19999999999999941e23 < y.im < -1.7199999999999999e-141 or 1.26e-166 < y.im < 1.10000000000000008e56Initial program 84.4%
if -1.7199999999999999e-141 < y.im < 1.26e-166Initial program 69.3%
Taylor expanded in y.re around inf 82.9%
+-commutative82.9%
mul-1-neg82.9%
unsub-neg82.9%
associate-/l*83.0%
associate-/r/82.8%
Simplified82.8%
*-un-lft-identity82.8%
unpow282.8%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
Final simplification85.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(-
(/ x.im y.re)
(/ (/ x.re (hypot y.im y.re)) (/ (hypot y.im y.re) y.im)))))
(if (<= y.re -6.2e-77)
t_0
(if (<= y.re 7.6e-138)
(-
(* (/ x.im (hypot y.im y.re)) (/ y.re (hypot y.im y.re)))
(/ x.re y.im))
(if (<= y.re 7e+70)
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* 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 / y_46_re) - ((x_46_re / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / y_46_im));
double tmp;
if (y_46_re <= -6.2e-77) {
tmp = t_0;
} else if (y_46_re <= 7.6e-138) {
tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im);
} else if (y_46_re <= 7e+70) {
tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((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 / y_46_re) - ((x_46_re / Math.hypot(y_46_im, y_46_re)) / (Math.hypot(y_46_im, y_46_re) / y_46_im));
double tmp;
if (y_46_re <= -6.2e-77) {
tmp = t_0;
} else if (y_46_re <= 7.6e-138) {
tmp = ((x_46_im / Math.hypot(y_46_im, y_46_re)) * (y_46_re / Math.hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im);
} else if (y_46_re <= 7e+70) {
tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((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 / y_46_re) - ((x_46_re / math.hypot(y_46_im, y_46_re)) / (math.hypot(y_46_im, y_46_re) / y_46_im)) tmp = 0 if y_46_re <= -6.2e-77: tmp = t_0 elif y_46_re <= 7.6e-138: tmp = ((x_46_im / math.hypot(y_46_im, y_46_re)) * (y_46_re / math.hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im) elif y_46_re <= 7e+70: tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((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 / y_46_re) - Float64(Float64(x_46_re / hypot(y_46_im, y_46_re)) / Float64(hypot(y_46_im, y_46_re) / y_46_im))) tmp = 0.0 if (y_46_re <= -6.2e-77) tmp = t_0; elseif (y_46_re <= 7.6e-138) tmp = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))) - Float64(x_46_re / y_46_im)); elseif (y_46_re <= 7e+70) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / 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 / y_46_re) - ((x_46_re / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / y_46_im)); tmp = 0.0; if (y_46_re <= -6.2e-77) tmp = t_0; elseif (y_46_re <= 7.6e-138) tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re))) - (x_46_re / y_46_im); elseif (y_46_re <= 7e+70) tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((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 / y$46$re), $MachinePrecision] - N[(N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -6.2e-77], t$95$0, If[LessEqual[y$46$re, 7.6e-138], N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7e+70], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $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}{y.re} - \frac{\frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{y.im}}\\
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{-77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 7.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{+70}:\\
\;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -6.20000000000000016e-77 or 7.00000000000000005e70 < y.re Initial program 55.6%
div-sub55.6%
add-sqr-sqrt55.6%
times-frac61.6%
fma-neg61.6%
hypot-define61.6%
hypot-define77.4%
associate-/l*79.1%
add-sqr-sqrt79.1%
pow279.1%
hypot-define79.1%
Applied egg-rr79.1%
fma-neg79.1%
hypot-undefine61.4%
unpow261.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
unpow261.4%
hypot-define79.1%
hypot-undefine61.4%
unpow261.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
unpow261.4%
hypot-define79.1%
Simplified79.1%
div-inv79.1%
unpow279.1%
associate-*l*94.3%
Applied egg-rr94.3%
associate-/r*97.5%
div-inv97.5%
un-div-inv97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in y.im around 0 84.8%
if -6.20000000000000016e-77 < y.re < 7.6000000000000005e-138Initial program 68.8%
div-sub65.3%
add-sqr-sqrt65.3%
times-frac63.7%
fma-neg63.7%
hypot-define63.7%
hypot-define64.8%
associate-/l*76.5%
add-sqr-sqrt76.5%
pow276.5%
hypot-define76.5%
Applied egg-rr76.5%
fma-neg76.5%
hypot-undefine75.3%
unpow275.3%
unpow275.3%
+-commutative75.3%
unpow275.3%
unpow275.3%
hypot-define76.5%
hypot-undefine75.3%
unpow275.3%
unpow275.3%
+-commutative75.3%
unpow275.3%
unpow275.3%
hypot-define76.5%
Simplified76.5%
Taylor expanded in y.im around inf 88.5%
if 7.6000000000000005e-138 < y.re < 7.00000000000000005e70Initial program 83.8%
Final simplification86.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.25e+24)
(- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))
(if (<= y.im -1.9e-141)
t_0
(if (<= y.im 1.26e-166)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.im 3.7e+86)
t_0
(- (* (/ x.im (hypot y.im y.re)) (/ 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 t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= -1.9e-141) {
tmp = t_0;
} else if (y_46_im <= 1.26e-166) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 3.7e+86) {
tmp = t_0;
} else {
tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / y_46_im)) - (x_46_re / y_46_im);
}
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 * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= -1.9e-141) {
tmp = t_0;
} else if (y_46_im <= 1.26e-166) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 3.7e+86) {
tmp = t_0;
} else {
tmp = ((x_46_im / Math.hypot(y_46_im, y_46_re)) * (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): t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.25e+24: tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) elif y_46_im <= -1.9e-141: tmp = t_0 elif y_46_im <= 1.26e-166: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_im <= 3.7e+86: tmp = t_0 else: tmp = ((x_46_im / math.hypot(y_46_im, y_46_re)) * (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) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.25e+24) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -1.9e-141) tmp = t_0; elseif (y_46_im <= 1.26e-166) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_im <= 3.7e+86) tmp = t_0; else tmp = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / y_46_im)) - 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) t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.25e+24) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); elseif (y_46_im <= -1.9e-141) tmp = t_0; elseif (y_46_im <= 1.26e-166) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_im <= 3.7e+86) tmp = t_0; else tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (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_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $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$im, -1.25e+24], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.9e-141], t$95$0, If[LessEqual[y$46$im, 1.26e-166], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.7e+86], t$95$0, N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+24}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{-141}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{-166}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.7 \cdot 10^{+86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.25000000000000011e24Initial program 48.7%
div-sub48.7%
add-sqr-sqrt48.7%
times-frac48.9%
fma-neg48.9%
hypot-define48.9%
hypot-define59.2%
associate-/l*68.8%
add-sqr-sqrt68.8%
pow268.8%
hypot-define68.8%
Applied egg-rr68.8%
fma-neg68.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define68.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define68.8%
Simplified68.8%
Taylor expanded in y.im around inf 89.3%
Taylor expanded in y.re around 0 73.5%
Taylor expanded in y.im around inf 84.2%
if -1.25000000000000011e24 < y.im < -1.89999999999999993e-141 or 1.26e-166 < y.im < 3.69999999999999992e86Initial program 84.1%
if -1.89999999999999993e-141 < y.im < 1.26e-166Initial program 69.3%
Taylor expanded in y.re around inf 82.9%
+-commutative82.9%
mul-1-neg82.9%
unsub-neg82.9%
associate-/l*83.0%
associate-/r/82.8%
Simplified82.8%
*-un-lft-identity82.8%
unpow282.8%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
if 3.69999999999999992e86 < y.im Initial program 46.3%
div-sub46.3%
add-sqr-sqrt46.3%
times-frac44.9%
fma-neg44.9%
hypot-define44.9%
hypot-define57.0%
associate-/l*65.7%
add-sqr-sqrt65.7%
pow265.7%
hypot-define65.7%
Applied egg-rr65.7%
fma-neg65.7%
hypot-undefine51.0%
unpow251.0%
unpow251.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define65.7%
hypot-undefine51.0%
unpow251.0%
unpow251.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define65.7%
Simplified65.7%
Taylor expanded in y.im around inf 82.4%
Taylor expanded in y.re around 0 78.9%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.25e+24)
(- (* (/ y.re (hypot y.im y.re)) (/ (- x.im) y.im)) (/ x.re y.im))
(if (<= y.im -3.2e-141)
t_0
(if (<= y.im 1.26e-166)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.im 1.46e+86)
t_0
(- (* (/ x.im (hypot y.im y.re)) (/ 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 t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = ((y_46_re / hypot(y_46_im, y_46_re)) * (-x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= -3.2e-141) {
tmp = t_0;
} else if (y_46_im <= 1.26e-166) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 1.46e+86) {
tmp = t_0;
} else {
tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / y_46_im)) - (x_46_re / y_46_im);
}
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 * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = ((y_46_re / Math.hypot(y_46_im, y_46_re)) * (-x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= -3.2e-141) {
tmp = t_0;
} else if (y_46_im <= 1.26e-166) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 1.46e+86) {
tmp = t_0;
} else {
tmp = ((x_46_im / Math.hypot(y_46_im, y_46_re)) * (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): t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.25e+24: tmp = ((y_46_re / math.hypot(y_46_im, y_46_re)) * (-x_46_im / y_46_im)) - (x_46_re / y_46_im) elif y_46_im <= -3.2e-141: tmp = t_0 elif y_46_im <= 1.26e-166: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_im <= 1.46e+86: tmp = t_0 else: tmp = ((x_46_im / math.hypot(y_46_im, y_46_re)) * (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) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.25e+24) tmp = Float64(Float64(Float64(y_46_re / hypot(y_46_im, y_46_re)) * Float64(Float64(-x_46_im) / y_46_im)) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -3.2e-141) tmp = t_0; elseif (y_46_im <= 1.26e-166) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_im <= 1.46e+86) tmp = t_0; else tmp = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / y_46_im)) - 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) t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.25e+24) tmp = ((y_46_re / hypot(y_46_im, y_46_re)) * (-x_46_im / y_46_im)) - (x_46_re / y_46_im); elseif (y_46_im <= -3.2e-141) tmp = t_0; elseif (y_46_im <= 1.26e-166) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_im <= 1.46e+86) tmp = t_0; else tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (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_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $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$im, -1.25e+24], N[(N[(N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[((-x$46$im) / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.2e-141], t$95$0, If[LessEqual[y$46$im, 1.26e-166], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.46e+86], t$95$0, N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+24}:\\
\;\;\;\;\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{-x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -3.2 \cdot 10^{-141}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{-166}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.46 \cdot 10^{+86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.25000000000000011e24Initial program 48.7%
div-sub48.7%
add-sqr-sqrt48.7%
times-frac48.9%
fma-neg48.9%
hypot-define48.9%
hypot-define59.2%
associate-/l*68.8%
add-sqr-sqrt68.8%
pow268.8%
hypot-define68.8%
Applied egg-rr68.8%
fma-neg68.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define68.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define68.8%
Simplified68.8%
Taylor expanded in y.im around inf 89.3%
Taylor expanded in y.im around -inf 84.3%
associate-*r/84.3%
neg-mul-184.3%
Simplified84.3%
if -1.25000000000000011e24 < y.im < -3.2000000000000001e-141 or 1.26e-166 < y.im < 1.46e86Initial program 84.1%
if -3.2000000000000001e-141 < y.im < 1.26e-166Initial program 69.3%
Taylor expanded in y.re around inf 82.9%
+-commutative82.9%
mul-1-neg82.9%
unsub-neg82.9%
associate-/l*83.0%
associate-/r/82.8%
Simplified82.8%
*-un-lft-identity82.8%
unpow282.8%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
if 1.46e86 < y.im Initial program 46.3%
div-sub46.3%
add-sqr-sqrt46.3%
times-frac44.9%
fma-neg44.9%
hypot-define44.9%
hypot-define57.0%
associate-/l*65.7%
add-sqr-sqrt65.7%
pow265.7%
hypot-define65.7%
Applied egg-rr65.7%
fma-neg65.7%
hypot-undefine51.0%
unpow251.0%
unpow251.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define65.7%
hypot-undefine51.0%
unpow251.0%
unpow251.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define65.7%
Simplified65.7%
Taylor expanded in y.im around inf 82.4%
Taylor expanded in y.re around 0 78.9%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.25e+24)
(- (/ (- y.re) (* y.im (/ (hypot y.im y.re) x.im))) (/ x.re y.im))
(if (<= y.im -9.2e-142)
t_0
(if (<= y.im 1.2e-172)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.im 4.7e+86)
t_0
(- (* (/ x.im (hypot y.im y.re)) (/ 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 t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = (-y_46_re / (y_46_im * (hypot(y_46_im, y_46_re) / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_im <= -9.2e-142) {
tmp = t_0;
} else if (y_46_im <= 1.2e-172) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 4.7e+86) {
tmp = t_0;
} else {
tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / y_46_im)) - (x_46_re / y_46_im);
}
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 * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = (-y_46_re / (y_46_im * (Math.hypot(y_46_im, y_46_re) / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_im <= -9.2e-142) {
tmp = t_0;
} else if (y_46_im <= 1.2e-172) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 4.7e+86) {
tmp = t_0;
} else {
tmp = ((x_46_im / Math.hypot(y_46_im, y_46_re)) * (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): t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.25e+24: tmp = (-y_46_re / (y_46_im * (math.hypot(y_46_im, y_46_re) / x_46_im))) - (x_46_re / y_46_im) elif y_46_im <= -9.2e-142: tmp = t_0 elif y_46_im <= 1.2e-172: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_im <= 4.7e+86: tmp = t_0 else: tmp = ((x_46_im / math.hypot(y_46_im, y_46_re)) * (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) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.25e+24) tmp = Float64(Float64(Float64(-y_46_re) / Float64(y_46_im * Float64(hypot(y_46_im, y_46_re) / x_46_im))) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -9.2e-142) tmp = t_0; elseif (y_46_im <= 1.2e-172) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_im <= 4.7e+86) tmp = t_0; else tmp = Float64(Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / y_46_im)) - 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) t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.25e+24) tmp = (-y_46_re / (y_46_im * (hypot(y_46_im, y_46_re) / x_46_im))) - (x_46_re / y_46_im); elseif (y_46_im <= -9.2e-142) tmp = t_0; elseif (y_46_im <= 1.2e-172) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_im <= 4.7e+86) tmp = t_0; else tmp = ((x_46_im / hypot(y_46_im, y_46_re)) * (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_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $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$im, -1.25e+24], N[(N[((-y$46$re) / N[(y$46$im * N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -9.2e-142], t$95$0, If[LessEqual[y$46$im, 1.2e-172], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.7e+86], t$95$0, N[(N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+24}:\\
\;\;\;\;\frac{-y.re}{y.im \cdot \frac{\mathsf{hypot}\left(y.im, y.re\right)}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -9.2 \cdot 10^{-142}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{-172}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 4.7 \cdot 10^{+86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.25000000000000011e24Initial program 48.7%
div-sub48.7%
add-sqr-sqrt48.7%
times-frac48.9%
fma-neg48.9%
hypot-define48.9%
hypot-define59.2%
associate-/l*68.8%
add-sqr-sqrt68.8%
pow268.8%
hypot-define68.8%
Applied egg-rr68.8%
fma-neg68.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define68.8%
hypot-undefine56.8%
unpow256.8%
unpow256.8%
+-commutative56.8%
unpow256.8%
unpow256.8%
hypot-define68.8%
Simplified68.8%
Taylor expanded in y.im around inf 89.3%
Taylor expanded in y.re around 0 73.5%
clear-num73.5%
frac-2neg73.5%
frac-times73.5%
*-un-lft-identity73.5%
add-sqr-sqrt73.5%
sqrt-unprod73.6%
sqr-neg73.6%
sqrt-unprod0.0%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
if -1.25000000000000011e24 < y.im < -9.20000000000000009e-142 or 1.2e-172 < y.im < 4.7000000000000002e86Initial program 84.1%
if -9.20000000000000009e-142 < y.im < 1.2e-172Initial program 69.3%
Taylor expanded in y.re around inf 82.9%
+-commutative82.9%
mul-1-neg82.9%
unsub-neg82.9%
associate-/l*83.0%
associate-/r/82.8%
Simplified82.8%
*-un-lft-identity82.8%
unpow282.8%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
if 4.7000000000000002e86 < y.im Initial program 46.3%
div-sub46.3%
add-sqr-sqrt46.3%
times-frac44.9%
fma-neg44.9%
hypot-define44.9%
hypot-define57.0%
associate-/l*65.7%
add-sqr-sqrt65.7%
pow265.7%
hypot-define65.7%
Applied egg-rr65.7%
fma-neg65.7%
hypot-undefine51.0%
unpow251.0%
unpow251.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define65.7%
hypot-undefine51.0%
unpow251.0%
unpow251.0%
+-commutative51.0%
unpow251.0%
unpow251.0%
hypot-define65.7%
Simplified65.7%
Taylor expanded in y.im around inf 82.4%
Taylor expanded in y.re around 0 78.9%
Final simplification83.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))))
(if (<= y.im -1.25e+24)
t_1
(if (<= y.im -1.2e-141)
t_0
(if (<= y.im 2.9e-167)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.im 4.1e+86) 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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = t_1;
} else if (y_46_im <= -1.2e-141) {
tmp = t_0;
} else if (y_46_im <= 2.9e-167) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 4.1e+86) {
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) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
if (y_46im <= (-1.25d+24)) then
tmp = t_1
else if (y_46im <= (-1.2d-141)) then
tmp = t_0
else if (y_46im <= 2.9d-167) then
tmp = (x_46im / y_46re) - (y_46im * ((x_46re / y_46re) / y_46re))
else if (y_46im <= 4.1d+86) 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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.25e+24) {
tmp = t_1;
} else if (y_46_im <= -1.2e-141) {
tmp = t_0;
} else if (y_46_im <= 2.9e-167) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_im <= 4.1e+86) {
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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -1.25e+24: tmp = t_1 elif y_46_im <= -1.2e-141: tmp = t_0 elif y_46_im <= 2.9e-167: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_im <= 4.1e+86: 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(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -1.25e+24) tmp = t_1; elseif (y_46_im <= -1.2e-141) tmp = t_0; elseif (y_46_im <= 2.9e-167) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_im <= 4.1e+86) 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) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -1.25e+24) tmp = t_1; elseif (y_46_im <= -1.2e-141) tmp = t_0; elseif (y_46_im <= 2.9e-167) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_im <= 4.1e+86) 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[(y$46$im * x$46$re), $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[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.25e+24], t$95$1, If[LessEqual[y$46$im, -1.2e-141], t$95$0, If[LessEqual[y$46$im, 2.9e-167], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.1e+86], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-141}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-167}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 4.1 \cdot 10^{+86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.25000000000000011e24 or 4.0999999999999999e86 < y.im Initial program 47.5%
div-sub47.5%
add-sqr-sqrt47.5%
times-frac46.9%
fma-neg46.9%
hypot-define46.9%
hypot-define58.1%
associate-/l*67.3%
add-sqr-sqrt67.3%
pow267.3%
hypot-define67.3%
Applied egg-rr67.3%
fma-neg67.3%
hypot-undefine53.9%
unpow253.9%
unpow253.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-define67.3%
hypot-undefine53.9%
unpow253.9%
unpow253.9%
+-commutative53.9%
unpow253.9%
unpow253.9%
hypot-define67.3%
Simplified67.3%
Taylor expanded in y.im around inf 85.9%
Taylor expanded in y.re around 0 76.2%
Taylor expanded in y.im around inf 81.6%
if -1.25000000000000011e24 < y.im < -1.2e-141 or 2.90000000000000003e-167 < y.im < 4.0999999999999999e86Initial program 84.1%
if -1.2e-141 < y.im < 2.90000000000000003e-167Initial program 69.3%
Taylor expanded in y.re around inf 82.9%
+-commutative82.9%
mul-1-neg82.9%
unsub-neg82.9%
associate-/l*83.0%
associate-/r/82.8%
Simplified82.8%
*-un-lft-identity82.8%
unpow282.8%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -9.2e-51) (not (<= y.im 4e+48))) (- (* (/ y.re y.im) (/ x.im y.im)) (/ 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 <= -9.2e-51) || !(y_46_im <= 4e+48)) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (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 <= (-9.2d-51)) .or. (.not. (y_46im <= 4d+48))) then
tmp = ((y_46re / y_46im) * (x_46im / y_46im)) - (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 <= -9.2e-51) || !(y_46_im <= 4e+48)) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (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 <= -9.2e-51) or not (y_46_im <= 4e+48): tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (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 <= -9.2e-51) || !(y_46_im <= 4e+48)) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - 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 <= -9.2e-51) || ~((y_46_im <= 4e+48))) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (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, -9.2e-51], N[Not[LessEqual[y$46$im, 4e+48]], $MachinePrecision]], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9.2 \cdot 10^{-51} \lor \neg \left(y.im \leq 4 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -9.20000000000000007e-51 or 4.00000000000000018e48 < y.im Initial program 54.1%
div-sub54.1%
add-sqr-sqrt54.1%
times-frac53.6%
fma-neg53.6%
hypot-define53.6%
hypot-define63.9%
associate-/l*71.9%
add-sqr-sqrt71.9%
pow271.9%
hypot-define71.9%
Applied egg-rr71.9%
fma-neg71.9%
hypot-undefine59.7%
unpow259.7%
unpow259.7%
+-commutative59.7%
unpow259.7%
unpow259.7%
hypot-define71.9%
hypot-undefine59.7%
unpow259.7%
unpow259.7%
+-commutative59.7%
unpow259.7%
unpow259.7%
hypot-define71.9%
Simplified71.9%
Taylor expanded in y.im around inf 83.5%
Taylor expanded in y.re around 0 70.5%
Taylor expanded in y.im around inf 77.5%
if -9.20000000000000007e-51 < y.im < 4.00000000000000018e48Initial program 75.7%
Taylor expanded in y.re around inf 65.8%
Final simplification71.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.3e-33) (not (<= y.im 4.2e+48))) (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im)) (- (/ x.im y.re) (* y.im (/ (/ x.re y.re) 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 <= -1.3e-33) || !(y_46_im <= 4.2e+48)) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / 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 <= (-1.3d-33)) .or. (.not. (y_46im <= 4.2d+48))) then
tmp = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
else
tmp = (x_46im / y_46re) - (y_46im * ((x_46re / y_46re) / 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 <= -1.3e-33) || !(y_46_im <= 4.2e+48)) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / 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 <= -1.3e-33) or not (y_46_im <= 4.2e+48): tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) else: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / 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 <= -1.3e-33) || !(y_46_im <= 4.2e+48)) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / 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 <= -1.3e-33) || ~((y_46_im <= 4.2e+48))) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); else tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / 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, -1.3e-33], N[Not[LessEqual[y$46$im, 4.2e+48]], $MachinePrecision]], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.3 \cdot 10^{-33} \lor \neg \left(y.im \leq 4.2 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.29999999999999997e-33 or 4.1999999999999997e48 < y.im Initial program 52.6%
div-sub52.6%
add-sqr-sqrt52.6%
times-frac52.1%
fma-neg52.1%
hypot-define52.1%
hypot-define62.8%
associate-/l*71.0%
add-sqr-sqrt71.0%
pow271.0%
hypot-define71.0%
Applied egg-rr71.0%
fma-neg71.0%
hypot-undefine58.4%
unpow258.4%
unpow258.4%
+-commutative58.4%
unpow258.4%
unpow258.4%
hypot-define71.0%
hypot-undefine58.4%
unpow258.4%
unpow258.4%
+-commutative58.4%
unpow258.4%
unpow258.4%
hypot-define71.0%
Simplified71.0%
Taylor expanded in y.im around inf 85.1%
Taylor expanded in y.re around 0 71.9%
Taylor expanded in y.im around inf 79.1%
if -1.29999999999999997e-33 < y.im < 4.1999999999999997e48Initial program 76.4%
Taylor expanded in y.re around inf 74.1%
+-commutative74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*74.9%
associate-/r/73.2%
Simplified73.2%
*-un-lft-identity73.2%
unpow273.2%
times-frac76.7%
Applied egg-rr76.7%
associate-*l/76.8%
*-lft-identity76.8%
Simplified76.8%
Final simplification77.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.1e-5) (not (<= y.im 4.3e+48))) (/ (- 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 <= -2.1e-5) || !(y_46_im <= 4.3e+48)) {
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 <= (-2.1d-5)) .or. (.not. (y_46im <= 4.3d+48))) 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 <= -2.1e-5) || !(y_46_im <= 4.3e+48)) {
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 <= -2.1e-5) or not (y_46_im <= 4.3e+48): 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 <= -2.1e-5) || !(y_46_im <= 4.3e+48)) tmp = Float64(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 <= -2.1e-5) || ~((y_46_im <= 4.3e+48))) 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, -2.1e-5], N[Not[LessEqual[y$46$im, 4.3e+48]], $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 -2.1 \cdot 10^{-5} \lor \neg \left(y.im \leq 4.3 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.09999999999999988e-5 or 4.29999999999999978e48 < y.im Initial program 50.2%
Taylor expanded in y.re around 0 70.7%
associate-*r/70.7%
neg-mul-170.7%
Simplified70.7%
if -2.09999999999999988e-5 < y.im < 4.29999999999999978e48Initial program 77.4%
Taylor expanded in y.re around inf 63.4%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
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;
}
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
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;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 65.0%
Taylor expanded in y.re around inf 41.4%
Final simplification41.4%
herbie shell --seed 2024030
(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))))