
(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 11 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 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* x.re (/ (/ y.im (hypot y.im y.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 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 / hypot(y_46_im, y_46_re)) / -hypot(y_46_im, y_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 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_im, y_46_re)) / Float64(-hypot(y_46_im, y_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\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{\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{-\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 67.5%
div-sub65.1%
*-commutative65.1%
add-sqr-sqrt65.1%
times-frac67.0%
fmm-def67.0%
hypot-define67.0%
hypot-define82.3%
associate-/l*84.6%
add-sqr-sqrt84.6%
pow284.6%
hypot-define84.6%
Applied egg-rr84.6%
*-un-lft-identity84.6%
unpow284.6%
times-frac96.7%
hypot-undefine84.6%
+-commutative84.6%
hypot-undefine96.7%
hypot-undefine84.6%
+-commutative84.6%
hypot-undefine96.7%
Applied egg-rr96.7%
associate-*l/96.8%
*-lft-identity96.8%
Simplified96.8%
Final simplification96.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(* (/ y.im (pow (hypot y.re y.im) 2.0)) (- x.re))))
(t_1 (/ (- (/ y.re (/ y.im x.im)) x.re) y.im)))
(if (<= y.im -2.95e+180)
t_1
(if (<= y.im -1.3e-120)
t_0
(if (<= y.im 4e-175)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 2.2e+152) 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 = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), ((y_46_im / pow(hypot(y_46_re, y_46_im), 2.0)) * -x_46_re));
double t_1 = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -2.95e+180) {
tmp = t_1;
} else if (y_46_im <= -1.3e-120) {
tmp = t_0;
} else if (y_46_im <= 4e-175) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 2.2e+152) {
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 = 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(y_46_im / (hypot(y_46_re, y_46_im) ^ 2.0)) * Float64(-x_46_re))) t_1 = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -2.95e+180) tmp = t_1; elseif (y_46_im <= -1.3e-120) tmp = t_0; elseif (y_46_im <= 4e-175) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 2.2e+152) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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[(y$46$im / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.95e+180], t$95$1, If[LessEqual[y$46$im, -1.3e-120], t$95$0, If[LessEqual[y$46$im, 4e-175], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.2e+152], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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{y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot \left(-x.re\right)\right)\\
t_1 := \frac{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2.95 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.3 \cdot 10^{-120}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{-175}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+152}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -2.9500000000000001e180 or 2.1999999999999998e152 < y.im Initial program 34.3%
Taylor expanded in y.re around 0 70.4%
+-commutative70.4%
mul-1-neg70.4%
unsub-neg70.4%
unpow270.4%
associate-/r*74.1%
div-sub74.1%
*-commutative74.1%
associate-/l*89.2%
Simplified89.2%
clear-num91.0%
un-div-inv91.0%
Applied egg-rr91.0%
if -2.9500000000000001e180 < y.im < -1.3000000000000001e-120 or 4e-175 < y.im < 2.1999999999999998e152Initial program 78.0%
div-sub78.0%
*-commutative78.0%
add-sqr-sqrt77.9%
times-frac80.5%
fmm-def80.5%
hypot-define80.6%
hypot-define90.5%
associate-/l*93.9%
add-sqr-sqrt93.9%
pow293.9%
hypot-define93.9%
Applied egg-rr93.9%
if -1.3000000000000001e-120 < y.im < 4e-175Initial program 71.2%
div-sub63.8%
*-commutative63.8%
add-sqr-sqrt63.8%
times-frac66.4%
fmm-def66.4%
hypot-define66.4%
hypot-define89.1%
associate-/l*89.2%
add-sqr-sqrt89.2%
pow289.2%
hypot-define89.2%
Applied egg-rr89.2%
Taylor expanded in y.re around inf 96.3%
mul-1-neg96.3%
unsub-neg96.3%
*-commutative96.3%
Simplified96.3%
Final simplification94.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (/ y.re (/ y.im x.im)) x.re) y.im)))
(if (<= y.im -2.1e+118)
t_0
(if (<= y.im -2.5e-114)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
(if (<= y.im 5.4e-158)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.45e+75)
(/ (- (* y.re x.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 = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+118) {
tmp = t_0;
} else if (y_46_im <= -2.5e-114) {
tmp = fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else if (y_46_im <= 5.4e-158) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.45e+75) {
tmp = ((y_46_re * x_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(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -2.1e+118) tmp = t_0; elseif (y_46_im <= -2.5e-114) tmp = Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); elseif (y_46_im <= 5.4e-158) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.45e+75) tmp = Float64(Float64(Float64(y_46_re * x_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[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.1e+118], t$95$0, If[LessEqual[y$46$im, -2.5e-114], N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.4e-158], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.45e+75], N[(N[(N[(y$46$re * x$46$im), $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{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2.1 \cdot 10^{+118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -2.5 \cdot 10^{-114}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{elif}\;y.im \leq 5.4 \cdot 10^{-158}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.45 \cdot 10^{+75}:\\
\;\;\;\;\frac{y.re \cdot x.im - 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.im < -2.1e118 or 1.4499999999999999e75 < y.im Initial program 41.3%
Taylor expanded in y.re around 0 66.6%
+-commutative66.6%
mul-1-neg66.6%
unsub-neg66.6%
unpow266.6%
associate-/r*69.1%
div-sub69.1%
*-commutative69.1%
associate-/l*80.4%
Simplified80.4%
clear-num82.8%
un-div-inv82.8%
Applied egg-rr82.8%
if -2.1e118 < y.im < -2.49999999999999995e-114Initial program 82.8%
fmm-def82.8%
distribute-rgt-neg-out82.8%
+-commutative82.8%
fma-define82.8%
Simplified82.8%
if -2.49999999999999995e-114 < y.im < 5.3999999999999997e-158Initial program 71.0%
div-sub64.0%
*-commutative64.0%
add-sqr-sqrt64.0%
times-frac66.4%
fmm-def66.4%
hypot-define66.4%
hypot-define88.8%
associate-/l*88.9%
add-sqr-sqrt88.9%
pow288.9%
hypot-define88.9%
Applied egg-rr88.9%
Taylor expanded in y.re around inf 95.5%
mul-1-neg95.5%
unsub-neg95.5%
*-commutative95.5%
Simplified95.5%
if 5.3999999999999997e-158 < y.im < 1.4499999999999999e75Initial program 88.1%
Final simplification88.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (- (/ y.re (/ y.im x.im)) x.re) y.im)))
(if (<= y.im -1.9e+118)
t_1
(if (<= y.im -1.45e-114)
t_0
(if (<= y.im 1.65e-158)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.8e+75) 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 = ((y_46_re * x_46_im) - (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)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -1.9e+118) {
tmp = t_1;
} else if (y_46_im <= -1.45e-114) {
tmp = t_0;
} else if (y_46_im <= 1.65e-158) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.8e+75) {
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 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((y_46re / (y_46im / x_46im)) - x_46re) / y_46im
if (y_46im <= (-1.9d+118)) then
tmp = t_1
else if (y_46im <= (-1.45d-114)) then
tmp = t_0
else if (y_46im <= 1.65d-158) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46im <= 1.8d+75) 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 = ((y_46_re * x_46_im) - (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)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -1.9e+118) {
tmp = t_1;
} else if (y_46_im <= -1.45e-114) {
tmp = t_0;
} else if (y_46_im <= 1.65e-158) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.8e+75) {
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 = ((y_46_re * x_46_im) - (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)) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -1.9e+118: tmp = t_1 elif y_46_im <= -1.45e-114: tmp = t_0 elif y_46_im <= 1.65e-158: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 1.8e+75: 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(y_46_re * x_46_im) - 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 / Float64(y_46_im / x_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -1.9e+118) tmp = t_1; elseif (y_46_im <= -1.45e-114) tmp = t_0; elseif (y_46_im <= 1.65e-158) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.8e+75) 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 = ((y_46_re * x_46_im) - (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)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -1.9e+118) tmp = t_1; elseif (y_46_im <= -1.45e-114) tmp = t_0; elseif (y_46_im <= 1.65e-158) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 1.8e+75) 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[(y$46$re * x$46$im), $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 / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.9e+118], t$95$1, If[LessEqual[y$46$im, -1.45e-114], t$95$0, If[LessEqual[y$46$im, 1.65e-158], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+75], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.9 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.45 \cdot 10^{-114}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{-158}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.90000000000000008e118 or 1.8e75 < y.im Initial program 41.3%
Taylor expanded in y.re around 0 66.6%
+-commutative66.6%
mul-1-neg66.6%
unsub-neg66.6%
unpow266.6%
associate-/r*69.1%
div-sub69.1%
*-commutative69.1%
associate-/l*80.4%
Simplified80.4%
clear-num82.8%
un-div-inv82.8%
Applied egg-rr82.8%
if -1.90000000000000008e118 < y.im < -1.44999999999999998e-114 or 1.6500000000000001e-158 < y.im < 1.8e75Initial program 85.2%
if -1.44999999999999998e-114 < y.im < 1.6500000000000001e-158Initial program 71.0%
div-sub64.0%
*-commutative64.0%
add-sqr-sqrt64.0%
times-frac66.4%
fmm-def66.4%
hypot-define66.4%
hypot-define88.8%
associate-/l*88.9%
add-sqr-sqrt88.9%
pow288.9%
hypot-define88.9%
Applied egg-rr88.9%
Taylor expanded in y.re around inf 95.5%
mul-1-neg95.5%
unsub-neg95.5%
*-commutative95.5%
Simplified95.5%
Final simplification88.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5.6e-108)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.re 7.5e-113)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.re 1.05e-30)
(/ (* y.re x.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 3600.0)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(/ (- x.im (* 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_re <= -5.6e-108) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 7.5e-113) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.05e-30) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 3600.0) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_46re <= (-5.6d-108)) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46re <= 7.5d-113) then
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
else if (y_46re <= 1.05d-30) then
tmp = (y_46re * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46re <= 3600.0d0) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (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_re <= -5.6e-108) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 7.5e-113) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.05e-30) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 3600.0) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_re <= -5.6e-108: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_re <= 7.5e-113: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 1.05e-30: tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 3600.0: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (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_re <= -5.6e-108) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_re <= 7.5e-113) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 1.05e-30) tmp = Float64(Float64(y_46_re * x_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 3600.0) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * 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_re <= -5.6e-108) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_re <= 7.5e-113) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 1.05e-30) tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 3600.0) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (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[LessEqual[y$46$re, -5.6e-108], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 7.5e-113], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.05e-30], N[(N[(y$46$re * x$46$im), $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, 3600.0], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-108}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-30}:\\
\;\;\;\;\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 3600:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -5.6e-108Initial program 67.6%
div-sub67.6%
*-commutative67.6%
add-sqr-sqrt67.6%
times-frac70.4%
fmm-def70.4%
hypot-define70.4%
hypot-define89.6%
associate-/l*90.9%
add-sqr-sqrt90.9%
pow290.9%
hypot-define90.8%
Applied egg-rr90.8%
Taylor expanded in y.re around inf 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
if -5.6e-108 < y.re < 7.5000000000000002e-113Initial program 82.0%
Taylor expanded in y.re around 0 84.5%
+-commutative84.5%
mul-1-neg84.5%
unsub-neg84.5%
unpow284.5%
associate-/r*91.0%
div-sub93.5%
*-commutative93.5%
associate-/l*92.1%
Simplified92.1%
associate-*r/93.5%
Applied egg-rr93.5%
if 7.5000000000000002e-113 < y.re < 1.0500000000000001e-30Initial program 99.7%
Taylor expanded in x.im around inf 79.1%
*-commutative79.1%
Simplified79.1%
if 1.0500000000000001e-30 < y.re < 3600Initial program 43.7%
Taylor expanded in y.re around 0 86.0%
+-commutative86.0%
mul-1-neg86.0%
unsub-neg86.0%
unpow286.0%
associate-/r*86.2%
div-sub86.2%
*-commutative86.2%
associate-/l*86.0%
Simplified86.0%
clear-num86.0%
un-div-inv86.0%
Applied egg-rr86.0%
associate-/r/86.2%
Applied egg-rr86.2%
if 3600 < y.re Initial program 48.2%
div-sub48.2%
*-commutative48.2%
add-sqr-sqrt48.2%
times-frac52.8%
fmm-def52.8%
hypot-define52.8%
hypot-define80.8%
associate-/l*83.4%
add-sqr-sqrt83.4%
pow283.4%
hypot-define83.4%
Applied egg-rr83.4%
Taylor expanded in y.re around inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
*-commutative68.4%
Simplified68.4%
associate-/l*74.9%
Applied egg-rr74.9%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.2e+79) (not (<= y.im 4.7e+33))) (/ x.re (- y.im)) (/ (- x.im (* x.re (/ y.im 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.2e+79) || !(y_46_im <= 4.7e+33)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / 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.2d+79)) .or. (.not. (y_46im <= 4.7d+33))) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (x_46re * (y_46im / 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.2e+79) || !(y_46_im <= 4.7e+33)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / 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.2e+79) or not (y_46_im <= 4.7e+33): tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / 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.2e+79) || !(y_46_im <= 4.7e+33)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / 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.2e+79) || ~((y_46_im <= 4.7e+33))) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / 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.2e+79], N[Not[LessEqual[y$46$im, 4.7e+33]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+79} \lor \neg \left(y.im \leq 4.7 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.19999999999999993e79 or 4.6999999999999998e33 < y.im Initial program 52.0%
Taylor expanded in y.re around 0 67.0%
associate-*r/67.0%
neg-mul-167.0%
Simplified67.0%
if -1.19999999999999993e79 < y.im < 4.6999999999999998e33Initial program 76.5%
Taylor expanded in y.re around inf 75.6%
mul-1-neg75.6%
unsub-neg75.6%
unsub-neg75.6%
remove-double-neg75.6%
mul-1-neg75.6%
neg-mul-175.6%
mul-1-neg75.6%
distribute-lft-in75.6%
distribute-lft-in75.6%
mul-1-neg75.6%
unsub-neg75.6%
neg-mul-175.6%
mul-1-neg75.6%
remove-double-neg75.6%
associate-/l*76.5%
Simplified76.5%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.35e-105)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.re 3000.0)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(/ (- x.im (* 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_re <= -1.35e-105) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 3000.0) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_46re <= (-1.35d-105)) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46re <= 3000.0d0) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (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_re <= -1.35e-105) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 3000.0) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_re <= -1.35e-105: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_re <= 3000.0: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (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_re <= -1.35e-105) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_re <= 3000.0) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * 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_re <= -1.35e-105) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_re <= 3000.0) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (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[LessEqual[y$46$re, -1.35e-105], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 3000.0], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{-105}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 3000:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -1.34999999999999996e-105Initial program 67.6%
div-sub67.6%
*-commutative67.6%
add-sqr-sqrt67.6%
times-frac70.4%
fmm-def70.4%
hypot-define70.4%
hypot-define89.6%
associate-/l*90.9%
add-sqr-sqrt90.9%
pow290.9%
hypot-define90.8%
Applied egg-rr90.8%
Taylor expanded in y.re around inf 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
if -1.34999999999999996e-105 < y.re < 3e3Initial program 81.8%
Taylor expanded in y.re around 0 79.0%
+-commutative79.0%
mul-1-neg79.0%
unsub-neg79.0%
unpow279.0%
associate-/r*84.1%
div-sub86.2%
*-commutative86.2%
associate-/l*85.1%
Simplified85.1%
if 3e3 < y.re Initial program 48.2%
div-sub48.2%
*-commutative48.2%
add-sqr-sqrt48.2%
times-frac52.8%
fmm-def52.8%
hypot-define52.8%
hypot-define80.8%
associate-/l*83.4%
add-sqr-sqrt83.4%
pow283.4%
hypot-define83.4%
Applied egg-rr83.4%
Taylor expanded in y.re around inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
*-commutative68.4%
Simplified68.4%
associate-/l*74.9%
Applied egg-rr74.9%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.35e-105)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.re 2900.0)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(/ (- x.im (* 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_re <= -1.35e-105) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 2900.0) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_46re <= (-1.35d-105)) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46re <= 2900.0d0) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (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_re <= -1.35e-105) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 2900.0) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_re <= -1.35e-105: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_re <= 2900.0: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (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_re <= -1.35e-105) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_re <= 2900.0) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * 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_re <= -1.35e-105) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_re <= 2900.0) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (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[LessEqual[y$46$re, -1.35e-105], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 2900.0], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{-105}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 2900:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -1.34999999999999996e-105Initial program 67.6%
div-sub67.6%
*-commutative67.6%
add-sqr-sqrt67.6%
times-frac70.4%
fmm-def70.4%
hypot-define70.4%
hypot-define89.6%
associate-/l*90.9%
add-sqr-sqrt90.9%
pow290.9%
hypot-define90.8%
Applied egg-rr90.8%
Taylor expanded in y.re around inf 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
if -1.34999999999999996e-105 < y.re < 2900Initial program 81.8%
Taylor expanded in y.re around 0 79.0%
+-commutative79.0%
mul-1-neg79.0%
unsub-neg79.0%
unpow279.0%
associate-/r*84.1%
div-sub86.2%
*-commutative86.2%
associate-/l*85.1%
Simplified85.1%
clear-num85.0%
un-div-inv85.1%
Applied egg-rr85.1%
associate-/r/86.0%
Applied egg-rr86.0%
if 2900 < y.re Initial program 48.2%
div-sub48.2%
*-commutative48.2%
add-sqr-sqrt48.2%
times-frac52.8%
fmm-def52.8%
hypot-define52.8%
hypot-define80.8%
associate-/l*83.4%
add-sqr-sqrt83.4%
pow283.4%
hypot-define83.4%
Applied egg-rr83.4%
Taylor expanded in y.re around inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
*-commutative68.4%
Simplified68.4%
associate-/l*74.9%
Applied egg-rr74.9%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.9e-108)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.re 2800.0)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(/ (- x.im (* 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_re <= -2.9e-108) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 2800.0) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_46re <= (-2.9d-108)) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46re <= 2800.0d0) then
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
else
tmp = (x_46im - (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_re <= -2.9e-108) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_re <= 2800.0) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (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_re <= -2.9e-108: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_re <= 2800.0: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im else: tmp = (x_46_im - (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_re <= -2.9e-108) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_re <= 2800.0) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * 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_re <= -2.9e-108) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_re <= 2800.0) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; else tmp = (x_46_im - (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[LessEqual[y$46$re, -2.9e-108], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 2800.0], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.9 \cdot 10^{-108}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 2800:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -2.9000000000000001e-108Initial program 67.6%
div-sub67.6%
*-commutative67.6%
add-sqr-sqrt67.6%
times-frac70.4%
fmm-def70.4%
hypot-define70.4%
hypot-define89.6%
associate-/l*90.9%
add-sqr-sqrt90.9%
pow290.9%
hypot-define90.8%
Applied egg-rr90.8%
Taylor expanded in y.re around inf 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
if -2.9000000000000001e-108 < y.re < 2800Initial program 81.8%
Taylor expanded in y.re around 0 79.0%
+-commutative79.0%
mul-1-neg79.0%
unsub-neg79.0%
unpow279.0%
associate-/r*84.1%
div-sub86.2%
*-commutative86.2%
associate-/l*85.1%
Simplified85.1%
associate-*r/86.2%
Applied egg-rr86.2%
if 2800 < y.re Initial program 48.2%
div-sub48.2%
*-commutative48.2%
add-sqr-sqrt48.2%
times-frac52.8%
fmm-def52.8%
hypot-define52.8%
hypot-define80.8%
associate-/l*83.4%
add-sqr-sqrt83.4%
pow283.4%
hypot-define83.4%
Applied egg-rr83.4%
Taylor expanded in y.re around inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
*-commutative68.4%
Simplified68.4%
associate-/l*74.9%
Applied egg-rr74.9%
Final simplification79.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5.6e-108) (not (<= y.re 8.5e-124))) (/ 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 <= -5.6e-108) || !(y_46_re <= 8.5e-124)) {
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 <= (-5.6d-108)) .or. (.not. (y_46re <= 8.5d-124))) 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 <= -5.6e-108) || !(y_46_re <= 8.5e-124)) {
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 <= -5.6e-108) or not (y_46_re <= 8.5e-124): 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 <= -5.6e-108) || !(y_46_re <= 8.5e-124)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_re / Float64(-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 <= -5.6e-108) || ~((y_46_re <= 8.5e-124))) 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, -5.6e-108], N[Not[LessEqual[y$46$re, 8.5e-124]], $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 -5.6 \cdot 10^{-108} \lor \neg \left(y.re \leq 8.5 \cdot 10^{-124}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -5.6e-108 or 8.5000000000000002e-124 < y.re Initial program 61.7%
Taylor expanded in y.re around inf 60.0%
if -5.6e-108 < y.re < 8.5000000000000002e-124Initial program 81.5%
Taylor expanded in y.re around 0 71.2%
associate-*r/71.2%
neg-mul-171.2%
Simplified71.2%
Final simplification63.3%
(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 67.5%
Taylor expanded in y.re around inf 47.4%
Final simplification47.4%
herbie shell --seed 2024095
(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))))