
(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 14 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)) (/ -1.0 (* (hypot y.im y.re) (/ (/ (hypot y.im y.re) y.im) x.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)), (-1.0 / (hypot(y_46_im, y_46_re) * ((hypot(y_46_im, y_46_re) / y_46_im) / x_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(-1.0 / Float64(hypot(y_46_im, y_46_re) * Float64(Float64(hypot(y_46_im, y_46_re) / y_46_im) / x_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[(-1.0 / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] * N[(N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision] / x$46$re), $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)}, \frac{-1}{\mathsf{hypot}\left(y.im, y.re\right) \cdot \frac{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{y.im}}{x.re}}\right)
\end{array}
Initial program 59.8%
div-sub58.8%
*-commutative58.8%
fma-define58.8%
add-sqr-sqrt58.8%
times-frac60.7%
fma-neg60.7%
fma-define60.7%
hypot-define60.7%
fma-define60.7%
hypot-define74.4%
associate-/l*77.5%
fma-define77.5%
add-sqr-sqrt77.5%
pow277.5%
Applied egg-rr77.5%
*-un-lft-identity77.5%
unpow277.5%
times-frac96.8%
hypot-undefine77.5%
+-commutative77.5%
hypot-define96.8%
hypot-undefine77.5%
+-commutative77.5%
hypot-define96.8%
Applied egg-rr96.8%
associate-*r*97.8%
clear-num97.8%
un-div-inv97.9%
un-div-inv98.0%
Applied egg-rr98.0%
clear-num97.8%
inv-pow97.8%
Applied egg-rr97.8%
unpow-197.8%
associate-/r/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ y.re (hypot y.re y.im)))
(t_1 (/ x.im (hypot y.re y.im)))
(t_2 (fma t_0 t_1 (* x.re (/ y.im (- (pow (hypot y.re y.im) 2.0)))))))
(if (<= y.im -2.8e+84)
(fma t_0 t_1 (* x.re (/ -1.0 y.im)))
(if (<= y.im -5e-305)
t_2
(if (<= y.im 5.3e-191)
(fma t_0 t_1 (* x.re (* (/ y.im (hypot y.im y.re)) (/ -1.0 y.re))))
(if (<= y.im 2e+150)
t_2
(fma
t_0
(/ x.im y.im)
(/
(/ x.re (hypot y.im y.re))
(/ (hypot y.im y.re) (- y.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re / hypot(y_46_re, y_46_im);
double t_1 = x_46_im / hypot(y_46_re, y_46_im);
double t_2 = fma(t_0, t_1, (x_46_re * (y_46_im / -pow(hypot(y_46_re, y_46_im), 2.0))));
double tmp;
if (y_46_im <= -2.8e+84) {
tmp = fma(t_0, t_1, (x_46_re * (-1.0 / y_46_im)));
} else if (y_46_im <= -5e-305) {
tmp = t_2;
} else if (y_46_im <= 5.3e-191) {
tmp = fma(t_0, t_1, (x_46_re * ((y_46_im / hypot(y_46_im, y_46_re)) * (-1.0 / y_46_re))));
} else if (y_46_im <= 2e+150) {
tmp = t_2;
} else {
tmp = fma(t_0, (x_46_im / y_46_im), ((x_46_re / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / -y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re / hypot(y_46_re, y_46_im)) t_1 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_2 = fma(t_0, t_1, Float64(x_46_re * Float64(y_46_im / Float64(-(hypot(y_46_re, y_46_im) ^ 2.0))))) tmp = 0.0 if (y_46_im <= -2.8e+84) tmp = fma(t_0, t_1, Float64(x_46_re * Float64(-1.0 / y_46_im))); elseif (y_46_im <= -5e-305) tmp = t_2; elseif (y_46_im <= 5.3e-191) tmp = fma(t_0, t_1, Float64(x_46_re * Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(-1.0 / y_46_re)))); elseif (y_46_im <= 2e+150) tmp = t_2; else tmp = fma(t_0, Float64(x_46_im / y_46_im), Float64(Float64(x_46_re / hypot(y_46_im, y_46_re)) / Float64(hypot(y_46_im, y_46_re) / Float64(-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[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1 + N[(x$46$re * N[(y$46$im / (-N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.8e+84], N[(t$95$0 * t$95$1 + N[(x$46$re * N[(-1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -5e-305], t$95$2, If[LessEqual[y$46$im, 5.3e-191], N[(t$95$0 * t$95$1 + N[(x$46$re * N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2e+150], t$95$2, N[(t$95$0 * N[(x$46$im / y$46$im), $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]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := \mathsf{fma}\left(t\_0, t\_1, x.re \cdot \frac{y.im}{-{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
\mathbf{if}\;y.im \leq -2.8 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_1, x.re \cdot \frac{-1}{y.im}\right)\\
\mathbf{elif}\;y.im \leq -5 \cdot 10^{-305}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 5.3 \cdot 10^{-191}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_1, x.re \cdot \left(\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{-1}{y.re}\right)\right)\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+150}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, \frac{x.im}{y.im}, \frac{\frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{-y.im}}\right)\\
\end{array}
\end{array}
if y.im < -2.79999999999999982e84Initial program 50.9%
div-sub50.9%
*-commutative50.9%
fma-define50.9%
add-sqr-sqrt50.9%
times-frac51.3%
fma-neg51.3%
fma-define51.3%
hypot-define51.3%
fma-define51.3%
hypot-define68.6%
associate-/l*75.8%
fma-define75.8%
add-sqr-sqrt75.8%
pow275.8%
Applied egg-rr75.8%
Taylor expanded in y.im around inf 99.8%
if -2.79999999999999982e84 < y.im < -4.99999999999999985e-305 or 5.29999999999999985e-191 < y.im < 1.99999999999999996e150Initial program 76.3%
div-sub75.4%
*-commutative75.4%
fma-define75.4%
add-sqr-sqrt75.4%
times-frac78.6%
fma-neg78.6%
fma-define78.6%
hypot-define78.6%
fma-define78.6%
hypot-define90.6%
associate-/l*92.7%
fma-define92.7%
add-sqr-sqrt92.7%
pow292.7%
Applied egg-rr92.7%
if -4.99999999999999985e-305 < y.im < 5.29999999999999985e-191Initial program 71.9%
div-sub66.6%
*-commutative66.6%
fma-define66.6%
add-sqr-sqrt66.6%
times-frac68.5%
fma-neg68.5%
fma-define68.5%
hypot-define68.5%
fma-define68.5%
hypot-define80.0%
associate-/l*80.2%
fma-define80.2%
add-sqr-sqrt80.2%
pow280.2%
Applied egg-rr80.2%
*-un-lft-identity80.2%
unpow280.2%
times-frac99.9%
hypot-undefine80.2%
+-commutative80.2%
hypot-define99.9%
hypot-undefine80.2%
+-commutative80.2%
hypot-define99.9%
Applied egg-rr99.9%
Taylor expanded in y.im around 0 99.9%
if 1.99999999999999996e150 < y.im Initial program 21.7%
div-sub21.7%
*-commutative21.7%
fma-define21.7%
add-sqr-sqrt21.7%
times-frac21.8%
fma-neg21.8%
fma-define21.8%
hypot-define21.8%
fma-define21.8%
hypot-define37.7%
associate-/l*40.9%
fma-define40.9%
add-sqr-sqrt40.9%
pow240.9%
Applied egg-rr40.9%
*-un-lft-identity40.9%
unpow240.9%
times-frac95.3%
hypot-undefine40.9%
+-commutative40.9%
hypot-define95.3%
hypot-undefine40.9%
+-commutative40.9%
hypot-define95.3%
Applied egg-rr95.3%
associate-*r*99.5%
clear-num99.5%
un-div-inv99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y.re around 0 91.2%
Final simplification94.3%
(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 (hypot y.im y.re)) (/ (hypot y.im y.re) (- y.im)))))
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 / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / -y_46_im)));
}
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(Float64(x_46_re / hypot(y_46_im, y_46_re)) / Float64(hypot(y_46_im, y_46_re) / Float64(-y_46_im)))) 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[(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]
\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)}, \frac{\frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{-y.im}}\right)
\end{array}
Initial program 59.8%
div-sub58.8%
*-commutative58.8%
fma-define58.8%
add-sqr-sqrt58.8%
times-frac60.7%
fma-neg60.7%
fma-define60.7%
hypot-define60.7%
fma-define60.7%
hypot-define74.4%
associate-/l*77.5%
fma-define77.5%
add-sqr-sqrt77.5%
pow277.5%
Applied egg-rr77.5%
*-un-lft-identity77.5%
unpow277.5%
times-frac96.8%
hypot-undefine77.5%
+-commutative77.5%
hypot-define96.8%
hypot-undefine77.5%
+-commutative77.5%
hypot-define96.8%
Applied egg-rr96.8%
associate-*r*97.8%
clear-num97.8%
un-div-inv97.9%
un-div-inv98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ y.re (hypot y.re y.im)))
(t_1 (/ x.im (hypot y.re y.im)))
(t_2 (fma t_0 t_1 (* x.re (/ -1.0 y.im)))))
(if (<= y.im -1850000000.0)
t_2
(if (<= y.im 3.5e-263)
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))
(if (<= y.im 3e-173)
(fma t_0 t_1 (/ (/ x.re y.re) (/ (hypot y.im y.re) (- y.im))))
(if (<= y.im 1.65e+35)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re / hypot(y_46_re, y_46_im);
double t_1 = x_46_im / hypot(y_46_re, y_46_im);
double t_2 = fma(t_0, t_1, (x_46_re * (-1.0 / y_46_im)));
double tmp;
if (y_46_im <= -1850000000.0) {
tmp = t_2;
} else if (y_46_im <= 3.5e-263) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 3e-173) {
tmp = fma(t_0, t_1, ((x_46_re / y_46_re) / (hypot(y_46_im, y_46_re) / -y_46_im)));
} else if (y_46_im <= 1.65e+35) {
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 {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re / hypot(y_46_re, y_46_im)) t_1 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_2 = fma(t_0, t_1, Float64(x_46_re * Float64(-1.0 / y_46_im))) tmp = 0.0 if (y_46_im <= -1850000000.0) tmp = t_2; elseif (y_46_im <= 3.5e-263) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 3e-173) tmp = fma(t_0, t_1, Float64(Float64(x_46_re / y_46_re) / Float64(hypot(y_46_im, y_46_re) / Float64(-y_46_im)))); elseif (y_46_im <= 1.65e+35) 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))); else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1 + N[(x$46$re * N[(-1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1850000000.0], t$95$2, If[LessEqual[y$46$im, 3.5e-263], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3e-173], N[(t$95$0 * t$95$1 + N[(N[(x$46$re / y$46$re), $MachinePrecision] / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / (-y$46$im)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.65e+35], 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], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := \mathsf{fma}\left(t\_0, t\_1, x.re \cdot \frac{-1}{y.im}\right)\\
\mathbf{if}\;y.im \leq -1850000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 3.5 \cdot 10^{-263}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 3 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_1, \frac{\frac{x.re}{y.re}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{-y.im}}\right)\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{+35}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -1.85e9 or 1.6500000000000001e35 < y.im Initial program 41.5%
div-sub41.5%
*-commutative41.5%
fma-define41.5%
add-sqr-sqrt41.5%
times-frac44.0%
fma-neg44.0%
fma-define44.0%
hypot-define44.0%
fma-define44.0%
hypot-define60.6%
associate-/l*66.0%
fma-define66.0%
add-sqr-sqrt66.0%
pow266.0%
Applied egg-rr66.0%
Taylor expanded in y.im around inf 90.8%
if -1.85e9 < y.im < 3.49999999999999969e-263Initial program 79.6%
Taylor expanded in y.re around inf 87.7%
+-commutative87.7%
mul-1-neg87.7%
unsub-neg87.7%
associate-/l*87.7%
Simplified87.7%
if 3.49999999999999969e-263 < y.im < 3.0000000000000001e-173Initial program 67.7%
div-sub60.4%
*-commutative60.4%
fma-define60.4%
add-sqr-sqrt60.4%
times-frac60.7%
fma-neg60.7%
fma-define60.7%
hypot-define60.8%
fma-define60.8%
hypot-define68.8%
associate-/l*69.1%
fma-define69.1%
add-sqr-sqrt69.1%
pow269.1%
Applied egg-rr69.1%
*-un-lft-identity69.1%
unpow269.1%
times-frac99.8%
hypot-undefine69.1%
+-commutative69.1%
hypot-define99.8%
hypot-undefine69.1%
+-commutative69.1%
hypot-define99.8%
Applied egg-rr99.8%
associate-*r*99.8%
clear-num99.8%
un-div-inv99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y.im around 0 94.6%
if 3.0000000000000001e-173 < y.im < 1.6500000000000001e35Initial program 79.4%
fma-neg79.4%
distribute-rgt-neg-out79.4%
+-commutative79.4%
fma-define79.4%
Simplified79.4%
Final simplification88.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (hypot y.im y.re) (- y.im)))
(t_1 (/ y.re (hypot y.re y.im)))
(t_2 (/ x.im (hypot y.re y.im))))
(if (<= y.re -5.5e-125)
(fma t_1 (/ (- x.im) y.re) (/ (/ x.re (hypot y.im y.re)) t_0))
(if (<= y.re 7.4e+77)
(fma t_1 t_2 (* x.re (/ -1.0 y.im)))
(fma t_1 t_2 (/ (/ x.re y.re) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = hypot(y_46_im, y_46_re) / -y_46_im;
double t_1 = y_46_re / hypot(y_46_re, y_46_im);
double t_2 = x_46_im / hypot(y_46_re, y_46_im);
double tmp;
if (y_46_re <= -5.5e-125) {
tmp = fma(t_1, (-x_46_im / y_46_re), ((x_46_re / hypot(y_46_im, y_46_re)) / t_0));
} else if (y_46_re <= 7.4e+77) {
tmp = fma(t_1, t_2, (x_46_re * (-1.0 / y_46_im)));
} else {
tmp = fma(t_1, t_2, ((x_46_re / y_46_re) / t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(hypot(y_46_im, y_46_re) / Float64(-y_46_im)) t_1 = Float64(y_46_re / hypot(y_46_re, y_46_im)) t_2 = Float64(x_46_im / hypot(y_46_re, y_46_im)) tmp = 0.0 if (y_46_re <= -5.5e-125) tmp = fma(t_1, Float64(Float64(-x_46_im) / y_46_re), Float64(Float64(x_46_re / hypot(y_46_im, y_46_re)) / t_0)); elseif (y_46_re <= 7.4e+77) tmp = fma(t_1, t_2, Float64(x_46_re * Float64(-1.0 / y_46_im))); else tmp = fma(t_1, t_2, Float64(Float64(x_46_re / y_46_re) / 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[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / (-y$46$im)), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.5e-125], N[(t$95$1 * 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] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.4e+77], N[(t$95$1 * t$95$2 + N[(x$46$re * N[(-1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$2 + N[(N[(x$46$re / y$46$re), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{hypot}\left(y.im, y.re\right)}{-y.im}\\
t_1 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.re \leq -5.5 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{-x.im}{y.re}, \frac{\frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{t\_0}\right)\\
\mathbf{elif}\;y.re \leq 7.4 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_2, x.re \cdot \frac{-1}{y.im}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_2, \frac{\frac{x.re}{y.re}}{t\_0}\right)\\
\end{array}
\end{array}
if y.re < -5.4999999999999997e-125Initial program 66.4%
div-sub66.4%
*-commutative66.4%
fma-define66.4%
add-sqr-sqrt66.4%
times-frac69.0%
fma-neg69.0%
fma-define69.0%
hypot-define69.0%
fma-define69.0%
hypot-define83.5%
associate-/l*85.7%
fma-define85.7%
add-sqr-sqrt85.7%
pow285.7%
Applied egg-rr85.7%
*-un-lft-identity85.7%
unpow285.7%
times-frac96.3%
hypot-undefine85.7%
+-commutative85.7%
hypot-define96.3%
hypot-undefine85.7%
+-commutative85.7%
hypot-define96.3%
Applied egg-rr96.3%
associate-*r*99.8%
clear-num99.8%
un-div-inv99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around -inf 89.3%
associate-*r/89.3%
neg-mul-189.3%
Simplified89.3%
if -5.4999999999999997e-125 < y.re < 7.3999999999999999e77Initial program 63.1%
div-sub60.9%
*-commutative60.9%
fma-define60.9%
add-sqr-sqrt60.9%
times-frac60.1%
fma-neg60.1%
fma-define60.1%
hypot-define60.1%
fma-define60.1%
hypot-define63.5%
associate-/l*68.5%
fma-define68.5%
add-sqr-sqrt68.5%
pow268.5%
Applied egg-rr68.5%
Taylor expanded in y.im around inf 86.6%
if 7.3999999999999999e77 < y.re Initial program 38.1%
div-sub38.1%
*-commutative38.1%
fma-define38.1%
add-sqr-sqrt38.1%
times-frac44.9%
fma-neg44.9%
fma-define44.9%
hypot-define44.9%
fma-define44.9%
hypot-define81.1%
associate-/l*81.5%
fma-define81.5%
add-sqr-sqrt81.5%
pow281.5%
Applied egg-rr81.5%
*-un-lft-identity81.5%
unpow281.5%
times-frac94.8%
hypot-undefine81.5%
+-commutative81.5%
hypot-define94.8%
hypot-undefine81.5%
+-commutative81.5%
hypot-define94.8%
Applied egg-rr94.8%
associate-*r*99.7%
clear-num99.7%
un-div-inv99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y.im around 0 88.1%
Final simplification87.9%
(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))
(* x.re (/ -1.0 y.im)))))
(if (<= y.im -550000.0)
t_0
(if (<= y.im 3.9e-255)
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))
(if (<= y.im 6.8e+41)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re * (-1.0 / y_46_im)));
double tmp;
if (y_46_im <= -550000.0) {
tmp = t_0;
} else if (y_46_im <= 3.9e-255) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 6.8e+41) {
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 {
tmp = t_0;
}
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(x_46_re * Float64(-1.0 / y_46_im))) tmp = 0.0 if (y_46_im <= -550000.0) tmp = t_0; elseif (y_46_im <= 3.9e-255) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 6.8e+41) 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))); 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[(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[(-1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -550000.0], t$95$0, If[LessEqual[y$46$im, 3.9e-255], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.8e+41], 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], t$95$0]]]]
\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)}, x.re \cdot \frac{-1}{y.im}\right)\\
\mathbf{if}\;y.im \leq -550000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3.9 \cdot 10^{-255}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 6.8 \cdot 10^{+41}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -5.5e5 or 6.79999999999999996e41 < y.im Initial program 41.5%
div-sub41.5%
*-commutative41.5%
fma-define41.5%
add-sqr-sqrt41.5%
times-frac44.0%
fma-neg44.0%
fma-define44.0%
hypot-define44.0%
fma-define44.0%
hypot-define60.6%
associate-/l*66.0%
fma-define66.0%
add-sqr-sqrt66.0%
pow266.0%
Applied egg-rr66.0%
Taylor expanded in y.im around inf 90.8%
if -5.5e5 < y.im < 3.9000000000000001e-255Initial program 78.3%
Taylor expanded in y.re around inf 87.9%
+-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
associate-/l*87.9%
Simplified87.9%
if 3.9000000000000001e-255 < y.im < 6.79999999999999996e41Initial program 77.3%
fma-neg77.4%
distribute-rgt-neg-out77.4%
+-commutative77.4%
fma-define77.4%
Simplified77.4%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (/ (/ y.re y.im) (/ y.im x.im)) (/ x.re y.im))))
(if (<= y.im -3.4e+69)
t_0
(if (<= y.im 3e-251)
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))
(if (<= y.im 9.8e+132)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -3.4e+69) {
tmp = t_0;
} else if (y_46_im <= 3e-251) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 9.8e+132) {
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 {
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 / y_46_im) / Float64(y_46_im / x_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -3.4e+69) tmp = t_0; elseif (y_46_im <= 3e-251) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 9.8e+132) 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))); 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 / y$46$im), $MachinePrecision] / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.4e+69], t$95$0, If[LessEqual[y$46$im, 3e-251], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.8e+132], 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], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -3.4 \cdot 10^{+69}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3 \cdot 10^{-251}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 9.8 \cdot 10^{+132}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -3.39999999999999986e69 or 9.8000000000000003e132 < y.im Initial program 35.3%
Taylor expanded in y.re around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
associate-/l*75.0%
Simplified75.0%
*-un-lft-identity75.0%
pow275.0%
times-frac80.4%
Applied egg-rr80.4%
associate-*r*82.4%
clear-num82.5%
un-div-inv82.5%
un-div-inv82.5%
Applied egg-rr82.5%
if -3.39999999999999986e69 < y.im < 2.9999999999999999e-251Initial program 76.3%
Taylor expanded in y.re around inf 84.9%
+-commutative84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-/l*84.9%
Simplified84.9%
if 2.9999999999999999e-251 < y.im < 9.8000000000000003e132Initial program 76.2%
fma-neg76.2%
distribute-rgt-neg-out76.2%
+-commutative76.2%
fma-define76.2%
Simplified76.2%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (/ (/ y.re y.im) (/ y.im x.im)) (/ x.re y.im))))
(if (<= y.im -3.8e+68)
t_0
(if (<= y.im 2.6e-250)
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))
(if (<= y.im 8.5e+132)
(/ (- (* 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) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -3.8e+68) {
tmp = t_0;
} else if (y_46_im <= 2.6e-250) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 8.5e+132) {
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;
}
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) :: tmp
t_0 = ((y_46re / y_46im) / (y_46im / x_46im)) - (x_46re / y_46im)
if (y_46im <= (-3.8d+68)) then
tmp = t_0
else if (y_46im <= 2.6d-250) then
tmp = (x_46im / y_46re) - (x_46re * (y_46im / (y_46re ** 2.0d0)))
else if (y_46im <= 8.5d+132) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = t_0
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 / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -3.8e+68) {
tmp = t_0;
} else if (y_46_im <= 2.6e-250) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / Math.pow(y_46_re, 2.0)));
} else if (y_46_im <= 8.5e+132) {
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;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -3.8e+68: tmp = t_0 elif y_46_im <= 2.6e-250: tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / math.pow(y_46_re, 2.0))) elif y_46_im <= 8.5e+132: 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 / y_46_im) / Float64(y_46_im / x_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -3.8e+68) tmp = t_0; elseif (y_46_im <= 2.6e-250) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 8.5e+132) 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
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -3.8e+68) tmp = t_0; elseif (y_46_im <= 2.6e-250) tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / (y_46_re ^ 2.0))); elseif (y_46_im <= 8.5e+132) 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; 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 / y$46$im), $MachinePrecision] / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.8e+68], t$95$0, If[LessEqual[y$46$im, 2.6e-250], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.5e+132], 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}{y.im}}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+68}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.6 \cdot 10^{-250}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 8.5 \cdot 10^{+132}:\\
\;\;\;\;\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 < -3.8000000000000001e68 or 8.49999999999999969e132 < y.im Initial program 35.3%
Taylor expanded in y.re around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
associate-/l*75.0%
Simplified75.0%
*-un-lft-identity75.0%
pow275.0%
times-frac80.4%
Applied egg-rr80.4%
associate-*r*82.4%
clear-num82.5%
un-div-inv82.5%
un-div-inv82.5%
Applied egg-rr82.5%
if -3.8000000000000001e68 < y.im < 2.60000000000000008e-250Initial program 76.3%
Taylor expanded in y.re around inf 84.9%
+-commutative84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-/l*84.9%
Simplified84.9%
if 2.60000000000000008e-250 < y.im < 8.49999999999999969e132Initial program 76.2%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -2.3e+63)
(and (not (<= y.re -2.5e+22))
(or (<= y.re -33000.0) (not (<= y.re 1.65e+78)))))
(/ x.im y.re)
(- (/ (/ y.re y.im) (/ y.im x.im)) (/ x.re y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.3e+63) || (!(y_46_re <= -2.5e+22) && ((y_46_re <= -33000.0) || !(y_46_re <= 1.65e+78)))) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-2.3d+63)) .or. (.not. (y_46re <= (-2.5d+22))) .and. (y_46re <= (-33000.0d0)) .or. (.not. (y_46re <= 1.65d+78))) then
tmp = x_46im / y_46re
else
tmp = ((y_46re / y_46im) / (y_46im / x_46im)) - (x_46re / y_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.3e+63) || (!(y_46_re <= -2.5e+22) && ((y_46_re <= -33000.0) || !(y_46_re <= 1.65e+78)))) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.3e+63) or (not (y_46_re <= -2.5e+22) and ((y_46_re <= -33000.0) or not (y_46_re <= 1.65e+78))): tmp = x_46_im / y_46_re else: tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.3e+63) || (!(y_46_re <= -2.5e+22) && ((y_46_re <= -33000.0) || !(y_46_re <= 1.65e+78)))) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(Float64(y_46_re / y_46_im) / Float64(y_46_im / x_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) tmp = 0.0; if ((y_46_re <= -2.3e+63) || (~((y_46_re <= -2.5e+22)) && ((y_46_re <= -33000.0) || ~((y_46_re <= 1.65e+78))))) tmp = x_46_im / y_46_re; else tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.3e+63], And[N[Not[LessEqual[y$46$re, -2.5e+22]], $MachinePrecision], Or[LessEqual[y$46$re, -33000.0], N[Not[LessEqual[y$46$re, 1.65e+78]], $MachinePrecision]]]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{+63} \lor \neg \left(y.re \leq -2.5 \cdot 10^{+22}\right) \land \left(y.re \leq -33000 \lor \neg \left(y.re \leq 1.65 \cdot 10^{+78}\right)\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re}{y.im}}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.29999999999999993e63 or -2.4999999999999998e22 < y.re < -33000 or 1.65e78 < y.re Initial program 48.6%
Taylor expanded in y.re around inf 74.0%
if -2.29999999999999993e63 < y.re < -2.4999999999999998e22 or -33000 < y.re < 1.65e78Initial program 67.7%
Taylor expanded in y.re around 0 71.1%
+-commutative71.1%
mul-1-neg71.1%
unsub-neg71.1%
*-commutative71.1%
associate-/l*68.6%
Simplified68.6%
*-un-lft-identity68.6%
pow268.6%
times-frac72.9%
Applied egg-rr72.9%
associate-*r*76.3%
clear-num76.3%
un-div-inv76.9%
un-div-inv76.9%
Applied egg-rr76.9%
Final simplification75.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (/ (/ y.re y.im) (/ y.im x.im)) (/ x.re y.im))))
(if (<= y.re -4.5e+63)
(/ x.im y.re)
(if (<= y.re -2.7e+22)
t_0
(if (<= y.re -0.0052)
(/ (* y.re x.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 7.8e+77) t_0 (/ x.im y.re)))))))
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) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_re <= -4.5e+63) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -2.7e+22) {
tmp = t_0;
} else if (y_46_re <= -0.0052) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 7.8e+77) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = ((y_46re / y_46im) / (y_46im / x_46im)) - (x_46re / y_46im)
if (y_46re <= (-4.5d+63)) then
tmp = x_46im / y_46re
else if (y_46re <= (-2.7d+22)) then
tmp = t_0
else if (y_46re <= (-0.0052d0)) then
tmp = (y_46re * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46re <= 7.8d+77) then
tmp = t_0
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 t_0 = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_re <= -4.5e+63) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -2.7e+22) {
tmp = t_0;
} else if (y_46_re <= -0.0052) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 7.8e+77) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_re <= -4.5e+63: tmp = x_46_im / y_46_re elif y_46_re <= -2.7e+22: tmp = t_0 elif y_46_re <= -0.0052: tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 7.8e+77: tmp = t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re / y_46_im) / Float64(y_46_im / x_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_re <= -4.5e+63) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -2.7e+22) tmp = t_0; elseif (y_46_re <= -0.0052) 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 <= 7.8e+77) tmp = t_0; 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) t_0 = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_re <= -4.5e+63) tmp = x_46_im / y_46_re; elseif (y_46_re <= -2.7e+22) tmp = t_0; elseif (y_46_re <= -0.0052) tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 7.8e+77) tmp = t_0; 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_] := Block[{t$95$0 = N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e+63], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -2.7e+22], t$95$0, If[LessEqual[y$46$re, -0.0052], 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, 7.8e+77], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{+63}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -2.7 \cdot 10^{+22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -0.0052:\\
\;\;\;\;\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -4.50000000000000017e63 or 7.7999999999999995e77 < y.re Initial program 46.1%
Taylor expanded in y.re around inf 72.7%
if -4.50000000000000017e63 < y.re < -2.7000000000000002e22 or -0.0051999999999999998 < y.re < 7.7999999999999995e77Initial program 68.0%
Taylor expanded in y.re around 0 71.4%
+-commutative71.4%
mul-1-neg71.4%
unsub-neg71.4%
*-commutative71.4%
associate-/l*68.8%
Simplified68.8%
*-un-lft-identity68.8%
pow268.8%
times-frac73.2%
Applied egg-rr73.2%
associate-*r*76.6%
clear-num76.6%
un-div-inv77.3%
un-div-inv77.3%
Applied egg-rr77.3%
if -2.7000000000000002e22 < y.re < -0.0051999999999999998Initial program 85.7%
Taylor expanded in x.im around inf 86.7%
*-commutative86.7%
Simplified86.7%
Final simplification75.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.re -6.2e+59)
(/ x.im y.re)
(if (<= y.re -2.6e+22)
(/ (* y.im (- x.re)) t_0)
(if (<= y.re -0.0019)
(/ (* y.re x.im) t_0)
(if (<= y.re 1.25e+78)
(- (/ (/ y.re y.im) (/ y.im x.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 t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_re <= -6.2e+59) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -2.6e+22) {
tmp = (y_46_im * -x_46_re) / t_0;
} else if (y_46_re <= -0.0019) {
tmp = (y_46_re * x_46_im) / t_0;
} else if (y_46_re <= 1.25e+78) {
tmp = ((y_46_re / y_46_im) / (y_46_im / x_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) :: t_0
real(8) :: tmp
t_0 = (y_46re * y_46re) + (y_46im * y_46im)
if (y_46re <= (-6.2d+59)) then
tmp = x_46im / y_46re
else if (y_46re <= (-2.6d+22)) then
tmp = (y_46im * -x_46re) / t_0
else if (y_46re <= (-0.0019d0)) then
tmp = (y_46re * x_46im) / t_0
else if (y_46re <= 1.25d+78) then
tmp = ((y_46re / y_46im) / (y_46im / x_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 t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_re <= -6.2e+59) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -2.6e+22) {
tmp = (y_46_im * -x_46_re) / t_0;
} else if (y_46_re <= -0.0019) {
tmp = (y_46_re * x_46_im) / t_0;
} else if (y_46_re <= 1.25e+78) {
tmp = ((y_46_re / y_46_im) / (y_46_im / x_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): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) tmp = 0 if y_46_re <= -6.2e+59: tmp = x_46_im / y_46_re elif y_46_re <= -2.6e+22: tmp = (y_46_im * -x_46_re) / t_0 elif y_46_re <= -0.0019: tmp = (y_46_re * x_46_im) / t_0 elif y_46_re <= 1.25e+78: tmp = ((y_46_re / y_46_im) / (y_46_im / x_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) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_re <= -6.2e+59) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -2.6e+22) tmp = Float64(Float64(y_46_im * Float64(-x_46_re)) / t_0); elseif (y_46_re <= -0.0019) tmp = Float64(Float64(y_46_re * x_46_im) / t_0); elseif (y_46_re <= 1.25e+78) tmp = Float64(Float64(Float64(y_46_re / y_46_im) / Float64(y_46_im / x_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) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); tmp = 0.0; if (y_46_re <= -6.2e+59) tmp = x_46_im / y_46_re; elseif (y_46_re <= -2.6e+22) tmp = (y_46_im * -x_46_re) / t_0; elseif (y_46_re <= -0.0019) tmp = (y_46_re * x_46_im) / t_0; elseif (y_46_re <= 1.25e+78) tmp = ((y_46_re / y_46_im) / (y_46_im / x_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_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -6.2e+59], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -2.6e+22], N[(N[(y$46$im * (-x$46$re)), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -0.0019], N[(N[(y$46$re * x$46$im), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+78], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] / N[(y$46$im / x$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}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{+59}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -2.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{y.im \cdot \left(-x.re\right)}{t\_0}\\
\mathbf{elif}\;y.re \leq -0.0019:\\
\;\;\;\;\frac{y.re \cdot x.im}{t\_0}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{y.re}{y.im}}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -6.20000000000000029e59 or 1.24999999999999996e78 < y.re Initial program 46.1%
Taylor expanded in y.re around inf 72.7%
if -6.20000000000000029e59 < y.re < -2.6e22Initial program 90.3%
Taylor expanded in x.im around 0 70.8%
associate-*r*70.8%
neg-mul-170.8%
Simplified70.8%
if -2.6e22 < y.re < -0.0019Initial program 85.7%
Taylor expanded in x.im around inf 86.7%
*-commutative86.7%
Simplified86.7%
if -0.0019 < y.re < 1.24999999999999996e78Initial program 66.3%
Taylor expanded in y.re around 0 72.0%
+-commutative72.0%
mul-1-neg72.0%
unsub-neg72.0%
*-commutative72.0%
associate-/l*69.3%
Simplified69.3%
*-un-lft-identity69.3%
pow269.3%
times-frac74.0%
Applied egg-rr74.0%
associate-*r*77.7%
clear-num77.7%
un-div-inv78.4%
un-div-inv78.4%
Applied egg-rr78.4%
Final simplification76.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.85e+116) (not (<= y.im 8.5e+132))) (- (/ (/ y.re y.im) (/ y.im x.im)) (/ x.re y.im)) (/ (- (* y.re x.im) (* y.im x.re)) (+ (* 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) {
double tmp;
if ((y_46_im <= -1.85e+116) || !(y_46_im <= 8.5e+132)) {
tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
} else {
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));
}
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.85d+116)) .or. (.not. (y_46im <= 8.5d+132))) then
tmp = ((y_46re / y_46im) / (y_46im / x_46im)) - (x_46re / y_46im)
else
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.85e+116) || !(y_46_im <= 8.5e+132)) {
tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im);
} else {
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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.85e+116) or not (y_46_im <= 8.5e+132): tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im) else: 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.85e+116) || !(y_46_im <= 8.5e+132)) tmp = Float64(Float64(Float64(y_46_re / y_46_im) / Float64(y_46_im / x_46_im)) - Float64(x_46_re / y_46_im)); else 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))); 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.85e+116) || ~((y_46_im <= 8.5e+132))) tmp = ((y_46_re / y_46_im) / (y_46_im / x_46_im)) - (x_46_re / y_46_im); else 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)); 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.85e+116], N[Not[LessEqual[y$46$im, 8.5e+132]], $MachinePrecision]], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.85 \cdot 10^{+116} \lor \neg \left(y.im \leq 8.5 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{\frac{y.re}{y.im}}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\end{array}
\end{array}
if y.im < -1.8500000000000001e116 or 8.49999999999999969e132 < y.im Initial program 29.5%
Taylor expanded in y.re around 0 73.9%
+-commutative73.9%
mul-1-neg73.9%
unsub-neg73.9%
*-commutative73.9%
associate-/l*74.3%
Simplified74.3%
*-un-lft-identity74.3%
pow274.3%
times-frac80.3%
Applied egg-rr80.3%
associate-*r*82.6%
clear-num82.6%
un-div-inv82.6%
un-div-inv82.6%
Applied egg-rr82.6%
if -1.8500000000000001e116 < y.im < 8.49999999999999969e132Initial program 77.0%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.7e-35) (not (<= y.re 1.25e+78))) (/ x.im y.re) (/ x.re (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.7e-35) || !(y_46_re <= 1.25e+78)) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_re / -y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.7d-35)) .or. (.not. (y_46re <= 1.25d+78))) then
tmp = x_46im / y_46re
else
tmp = x_46re / -y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.7e-35) || !(y_46_re <= 1.25e+78)) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_re / -y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.7e-35) or not (y_46_re <= 1.25e+78): tmp = x_46_im / y_46_re else: tmp = x_46_re / -y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.7e-35) || !(y_46_re <= 1.25e+78)) 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 <= -1.7e-35) || ~((y_46_re <= 1.25e+78))) tmp = x_46_im / y_46_re; else tmp = x_46_re / -y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.7e-35], N[Not[LessEqual[y$46$re, 1.25e+78]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$re / (-y$46$im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{-35} \lor \neg \left(y.re \leq 1.25 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -1.7000000000000001e-35 or 1.24999999999999996e78 < y.re Initial program 54.5%
Taylor expanded in y.re around inf 66.0%
if -1.7000000000000001e-35 < y.re < 1.24999999999999996e78Initial program 65.0%
Taylor expanded in y.re around 0 69.3%
associate-*r/69.3%
neg-mul-169.3%
Simplified69.3%
Final simplification67.6%
(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 59.8%
Taylor expanded in y.re around inf 43.1%
Final simplification43.1%
herbie shell --seed 2024052
(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))))