
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -9e+75)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im -3.3e-64)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 6.4e-128)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.02e+43)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
(if (<= y.im 7.5e+125)
(* y.im (* (pow (hypot y.im y.re) -2.0) (- x.re)))
(if (<= y.im 3.5e+170)
(/ x.im y.re)
(/ (fma x.im (/ y.re y.im) (- x.re)) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -9e+75) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -3.3e-64) {
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 if (y_46_im <= 6.4e-128) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.02e+43) {
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 <= 7.5e+125) {
tmp = y_46_im * (pow(hypot(y_46_im, y_46_re), -2.0) * -x_46_re);
} else if (y_46_im <= 3.5e+170) {
tmp = x_46_im / y_46_re;
} else {
tmp = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -9e+75) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= -3.3e-64) 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))); elseif (y_46_im <= 6.4e-128) 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.02e+43) 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 <= 7.5e+125) tmp = Float64(y_46_im * Float64((hypot(y_46_im, y_46_re) ^ -2.0) * Float64(-x_46_re))); elseif (y_46_im <= 3.5e+170) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -9e+75], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -3.3e-64], 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], If[LessEqual[y$46$im, 6.4e-128], 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.02e+43], 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, 7.5e+125], N[(y$46$im * N[(N[Power[N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision], -2.0], $MachinePrecision] * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.5e+170], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9 \cdot 10^{+75}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -3.3 \cdot 10^{-64}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 6.4 \cdot 10^{-128}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{+43}:\\
\;\;\;\;\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 7.5 \cdot 10^{+125}:\\
\;\;\;\;y.im \cdot \left({\left(\mathsf{hypot}\left(y.im, y.re\right)\right)}^{-2} \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;y.im \leq 3.5 \cdot 10^{+170}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\end{array}
\end{array}
if y.im < -9.0000000000000007e75Initial program 32.7%
Taylor expanded in y.re around 0 83.8%
+-commutative83.8%
mul-1-neg83.8%
unsub-neg83.8%
unpow283.8%
associate-/r*85.8%
div-sub85.8%
*-commutative85.8%
associate-/l*89.7%
Simplified89.7%
if -9.0000000000000007e75 < y.im < -3.2999999999999999e-64Initial program 86.0%
if -3.2999999999999999e-64 < y.im < 6.3999999999999995e-128Initial program 66.6%
Taylor expanded in y.re around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
unsub-neg87.3%
remove-double-neg87.3%
mul-1-neg87.3%
neg-mul-187.3%
mul-1-neg87.3%
distribute-lft-in87.3%
distribute-lft-in87.3%
mul-1-neg87.3%
unsub-neg87.3%
neg-mul-187.3%
mul-1-neg87.3%
remove-double-neg87.3%
associate-/l*86.9%
Simplified86.9%
add-sqr-sqrt43.6%
sqrt-unprod54.7%
sqr-neg54.7%
sqrt-unprod37.1%
add-sqr-sqrt62.5%
associate-/l*62.6%
*-commutative62.6%
add-sqr-sqrt37.1%
sqrt-unprod55.0%
sqr-neg55.0%
sqrt-unprod43.8%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
if 6.3999999999999995e-128 < y.im < 1.02e43Initial program 85.6%
fma-neg85.6%
distribute-rgt-neg-out85.6%
+-commutative85.6%
fma-define85.6%
Simplified85.6%
if 1.02e43 < y.im < 7.5000000000000006e125Initial program 56.6%
fma-define56.7%
add-cube-cbrt56.1%
pow356.2%
add-sqr-sqrt56.2%
pow256.2%
fma-define56.2%
hypot-define56.2%
Applied egg-rr56.2%
Taylor expanded in x.im around 0 48.0%
mul-1-neg48.0%
associate-/l*77.9%
distribute-lft-neg-in77.9%
rem-square-sqrt77.9%
+-commutative77.9%
unpow277.9%
unpow277.9%
hypot-undefine77.9%
+-commutative77.9%
unpow277.9%
unpow277.9%
hypot-undefine78.0%
unpow278.0%
hypot-undefine77.9%
unpow277.9%
unpow277.9%
+-commutative77.9%
unpow277.9%
unpow277.9%
hypot-define78.0%
Simplified78.0%
distribute-lft-neg-out78.0%
neg-sub078.0%
*-commutative78.0%
add-sqr-sqrt27.6%
sqrt-unprod20.4%
sqr-neg20.4%
sqrt-unprod5.6%
add-sqr-sqrt6.6%
div-inv6.6%
associate-*l*6.6%
pow-flip6.6%
metadata-eval6.6%
add-sqr-sqrt5.6%
sqrt-unprod20.5%
sqr-neg20.5%
sqrt-unprod27.5%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
neg-sub078.1%
distribute-lft-neg-in78.1%
*-commutative78.1%
Simplified78.1%
if 7.5000000000000006e125 < y.im < 3.50000000000000005e170Initial program 0.0%
Taylor expanded in y.re around inf 100.0%
if 3.50000000000000005e170 < y.im Initial program 41.7%
Taylor expanded in y.re around 0 81.6%
+-commutative81.6%
mul-1-neg81.6%
unsub-neg81.6%
unpow281.6%
associate-/r*81.8%
div-sub81.8%
associate-/l*89.2%
fma-neg89.2%
Simplified89.2%
Final simplification87.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 (/ x.im y.im)) x.re) y.im)))
(if (<= y.im -3.1e+76)
t_1
(if (<= y.im -9e-66)
t_0
(if (<= y.im 2.15e-127)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 9e+42) 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 * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -3.1e+76) {
tmp = t_1;
} else if (y_46_im <= -9e-66) {
tmp = t_0;
} else if (y_46_im <= 2.15e-127) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 9e+42) {
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 * (x_46im / y_46im)) - x_46re) / y_46im
if (y_46im <= (-3.1d+76)) then
tmp = t_1
else if (y_46im <= (-9d-66)) then
tmp = t_0
else if (y_46im <= 2.15d-127) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46im <= 9d+42) 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 * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -3.1e+76) {
tmp = t_1;
} else if (y_46_im <= -9e-66) {
tmp = t_0;
} else if (y_46_im <= 2.15e-127) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 9e+42) {
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 * (x_46_im / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -3.1e+76: tmp = t_1 elif y_46_im <= -9e-66: tmp = t_0 elif y_46_im <= 2.15e-127: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 9e+42: 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(x_46_im / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -3.1e+76) tmp = t_1; elseif (y_46_im <= -9e-66) tmp = t_0; elseif (y_46_im <= 2.15e-127) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 9e+42) 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 * (x_46_im / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -3.1e+76) tmp = t_1; elseif (y_46_im <= -9e-66) tmp = t_0; elseif (y_46_im <= 2.15e-127) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 9e+42) 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[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -3.1e+76], t$95$1, If[LessEqual[y$46$im, -9e-66], t$95$0, If[LessEqual[y$46$im, 2.15e-127], 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, 9e+42], 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{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -3.1 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -9 \cdot 10^{-66}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.15 \cdot 10^{-127}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{+42}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3.10000000000000011e76 or 9.00000000000000025e42 < y.im Initial program 38.4%
Taylor expanded in y.re around 0 77.1%
+-commutative77.1%
mul-1-neg77.1%
unsub-neg77.1%
unpow277.1%
associate-/r*78.2%
div-sub78.2%
*-commutative78.2%
associate-/l*82.0%
Simplified82.0%
if -3.10000000000000011e76 < y.im < -8.9999999999999995e-66 or 2.14999999999999992e-127 < y.im < 9.00000000000000025e42Initial program 85.8%
if -8.9999999999999995e-66 < y.im < 2.14999999999999992e-127Initial program 66.6%
Taylor expanded in y.re around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
unsub-neg87.3%
remove-double-neg87.3%
mul-1-neg87.3%
neg-mul-187.3%
mul-1-neg87.3%
distribute-lft-in87.3%
distribute-lft-in87.3%
mul-1-neg87.3%
unsub-neg87.3%
neg-mul-187.3%
mul-1-neg87.3%
remove-double-neg87.3%
associate-/l*86.9%
Simplified86.9%
add-sqr-sqrt43.6%
sqrt-unprod54.7%
sqr-neg54.7%
sqrt-unprod37.1%
add-sqr-sqrt62.5%
associate-/l*62.6%
*-commutative62.6%
add-sqr-sqrt37.1%
sqrt-unprod55.0%
sqr-neg55.0%
sqrt-unprod43.8%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -600000000000.0)
t_0
(if (<= y.im 1.6e+41)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (or (<= y.im 7.5e+125) (not (<= y.im 3.5e+170)))
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 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -600000000000.0) {
tmp = t_0;
} else if (y_46_im <= 1.6e+41) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) {
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 = x_46re / -y_46im
if (y_46im <= (-600000000000.0d0)) then
tmp = t_0
else if (y_46im <= 1.6d+41) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if ((y_46im <= 7.5d+125) .or. (.not. (y_46im <= 3.5d+170))) 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 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -600000000000.0) {
tmp = t_0;
} else if (y_46_im <= 1.6e+41) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) {
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 = x_46_re / -y_46_im tmp = 0 if y_46_im <= -600000000000.0: tmp = t_0 elif y_46_im <= 1.6e+41: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif (y_46_im <= 7.5e+125) or not (y_46_im <= 3.5e+170): 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(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -600000000000.0) tmp = t_0; elseif (y_46_im <= 1.6e+41) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) 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 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -600000000000.0) tmp = t_0; elseif (y_46_im <= 1.6e+41) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif ((y_46_im <= 7.5e+125) || ~((y_46_im <= 3.5e+170))) 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[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -600000000000.0], t$95$0, If[LessEqual[y$46$im, 1.6e+41], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[Or[LessEqual[y$46$im, 7.5e+125], N[Not[LessEqual[y$46$im, 3.5e+170]], $MachinePrecision]], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -600000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+41}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+125} \lor \neg \left(y.im \leq 3.5 \cdot 10^{+170}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -6e11 or 1.60000000000000005e41 < y.im < 7.5000000000000006e125 or 3.50000000000000005e170 < y.im Initial program 46.8%
Taylor expanded in y.re around 0 78.1%
associate-*r/78.1%
neg-mul-178.1%
Simplified78.1%
if -6e11 < y.im < 1.60000000000000005e41Initial program 73.5%
Taylor expanded in y.re around inf 73.9%
mul-1-neg73.9%
unsub-neg73.9%
unsub-neg73.9%
remove-double-neg73.9%
mul-1-neg73.9%
neg-mul-173.9%
mul-1-neg73.9%
distribute-lft-in73.9%
distribute-lft-in73.9%
mul-1-neg73.9%
unsub-neg73.9%
neg-mul-173.9%
mul-1-neg73.9%
remove-double-neg73.9%
associate-/l*73.6%
Simplified73.6%
add-sqr-sqrt36.3%
sqrt-unprod47.6%
sqr-neg47.6%
sqrt-unprod31.1%
add-sqr-sqrt54.7%
associate-/l*54.7%
*-commutative54.7%
add-sqr-sqrt31.1%
sqrt-unprod47.8%
sqr-neg47.8%
sqrt-unprod36.5%
add-sqr-sqrt73.9%
Applied egg-rr73.9%
if 7.5000000000000006e125 < y.im < 3.50000000000000005e170Initial program 0.0%
Taylor expanded in y.re around inf 100.0%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -220000000000.0)
t_0
(if (<= y.im 1.9e+40)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (or (<= y.im 7.5e+125) (not (<= y.im 3.5e+170)))
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 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -220000000000.0) {
tmp = t_0;
} else if (y_46_im <= 1.9e+40) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) {
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 = x_46re / -y_46im
if (y_46im <= (-220000000000.0d0)) then
tmp = t_0
else if (y_46im <= 1.9d+40) then
tmp = (x_46im - (x_46re / (y_46re / y_46im))) / y_46re
else if ((y_46im <= 7.5d+125) .or. (.not. (y_46im <= 3.5d+170))) 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 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -220000000000.0) {
tmp = t_0;
} else if (y_46_im <= 1.9e+40) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) {
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 = x_46_re / -y_46_im tmp = 0 if y_46_im <= -220000000000.0: tmp = t_0 elif y_46_im <= 1.9e+40: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re elif (y_46_im <= 7.5e+125) or not (y_46_im <= 3.5e+170): 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(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -220000000000.0) tmp = t_0; elseif (y_46_im <= 1.9e+40) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) 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 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -220000000000.0) tmp = t_0; elseif (y_46_im <= 1.9e+40) tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; elseif ((y_46_im <= 7.5e+125) || ~((y_46_im <= 3.5e+170))) 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[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -220000000000.0], t$95$0, If[LessEqual[y$46$im, 1.9e+40], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[Or[LessEqual[y$46$im, 7.5e+125], N[Not[LessEqual[y$46$im, 3.5e+170]], $MachinePrecision]], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -220000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{+40}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+125} \lor \neg \left(y.im \leq 3.5 \cdot 10^{+170}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.2e11 or 1.90000000000000002e40 < y.im < 7.5000000000000006e125 or 3.50000000000000005e170 < y.im Initial program 46.8%
Taylor expanded in y.re around 0 78.1%
associate-*r/78.1%
neg-mul-178.1%
Simplified78.1%
if -2.2e11 < y.im < 1.90000000000000002e40Initial program 73.5%
Taylor expanded in y.re around inf 73.9%
mul-1-neg73.9%
unsub-neg73.9%
unsub-neg73.9%
remove-double-neg73.9%
mul-1-neg73.9%
neg-mul-173.9%
mul-1-neg73.9%
distribute-lft-in73.9%
distribute-lft-in73.9%
mul-1-neg73.9%
unsub-neg73.9%
neg-mul-173.9%
mul-1-neg73.9%
remove-double-neg73.9%
associate-/l*73.6%
Simplified73.6%
clear-num73.6%
un-div-inv73.7%
Applied egg-rr73.7%
if 7.5000000000000006e125 < y.im < 3.50000000000000005e170Initial program 0.0%
Taylor expanded in y.re around inf 100.0%
Final simplification76.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -750000000000.0)
t_0
(if (<= y.im 2.3e+41)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (or (<= y.im 7.5e+125) (not (<= y.im 3.5e+170)))
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 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -750000000000.0) {
tmp = t_0;
} else if (y_46_im <= 2.3e+41) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) {
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 = x_46re / -y_46im
if (y_46im <= (-750000000000.0d0)) then
tmp = t_0
else if (y_46im <= 2.3d+41) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if ((y_46im <= 7.5d+125) .or. (.not. (y_46im <= 3.5d+170))) 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 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -750000000000.0) {
tmp = t_0;
} else if (y_46_im <= 2.3e+41) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) {
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 = x_46_re / -y_46_im tmp = 0 if y_46_im <= -750000000000.0: tmp = t_0 elif y_46_im <= 2.3e+41: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif (y_46_im <= 7.5e+125) or not (y_46_im <= 3.5e+170): 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(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -750000000000.0) tmp = t_0; elseif (y_46_im <= 2.3e+41) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif ((y_46_im <= 7.5e+125) || !(y_46_im <= 3.5e+170)) 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 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -750000000000.0) tmp = t_0; elseif (y_46_im <= 2.3e+41) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif ((y_46_im <= 7.5e+125) || ~((y_46_im <= 3.5e+170))) 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[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -750000000000.0], t$95$0, If[LessEqual[y$46$im, 2.3e+41], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[Or[LessEqual[y$46$im, 7.5e+125], N[Not[LessEqual[y$46$im, 3.5e+170]], $MachinePrecision]], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -750000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{+41}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+125} \lor \neg \left(y.im \leq 3.5 \cdot 10^{+170}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -7.5e11 or 2.2999999999999998e41 < y.im < 7.5000000000000006e125 or 3.50000000000000005e170 < y.im Initial program 46.8%
Taylor expanded in y.re around 0 78.1%
associate-*r/78.1%
neg-mul-178.1%
Simplified78.1%
if -7.5e11 < y.im < 2.2999999999999998e41Initial program 73.5%
Taylor expanded in y.re around inf 73.9%
mul-1-neg73.9%
unsub-neg73.9%
unsub-neg73.9%
remove-double-neg73.9%
mul-1-neg73.9%
neg-mul-173.9%
mul-1-neg73.9%
distribute-lft-in73.9%
distribute-lft-in73.9%
mul-1-neg73.9%
unsub-neg73.9%
neg-mul-173.9%
mul-1-neg73.9%
remove-double-neg73.9%
associate-/l*73.6%
Simplified73.6%
if 7.5000000000000006e125 < y.im < 3.50000000000000005e170Initial program 0.0%
Taylor expanded in y.re around inf 100.0%
Final simplification76.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4.8e-20) (not (<= y.re 1.45e+40))) (/ (- x.im (* x.re (/ y.im y.re))) y.re) (/ (- (/ (* y.re x.im) y.im) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.8e-20) || !(y_46_re <= 1.45e+40)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-4.8d-20)) .or. (.not. (y_46re <= 1.45d+40))) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.8e-20) || !(y_46_re <= 1.45e+40)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -4.8e-20) or not (y_46_re <= 1.45e+40): tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.8e-20) || !(y_46_re <= 1.45e+40)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.8e-20) || ~((y_46_re <= 1.45e+40))) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.8e-20], N[Not[LessEqual[y$46$re, 1.45e+40]], $MachinePrecision]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-20} \lor \neg \left(y.re \leq 1.45 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -4.79999999999999986e-20 or 1.45000000000000009e40 < y.re Initial program 51.5%
Taylor expanded in y.re around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
unsub-neg74.8%
remove-double-neg74.8%
mul-1-neg74.8%
neg-mul-174.8%
mul-1-neg74.8%
distribute-lft-in74.8%
distribute-lft-in74.8%
mul-1-neg74.8%
unsub-neg74.8%
neg-mul-174.8%
mul-1-neg74.8%
remove-double-neg74.8%
associate-/l*77.2%
Simplified77.2%
if -4.79999999999999986e-20 < y.re < 1.45000000000000009e40Initial program 68.0%
Taylor expanded in y.re around 0 77.7%
+-commutative77.7%
mul-1-neg77.7%
unsub-neg77.7%
unpow277.7%
associate-/r*84.7%
div-sub84.7%
*-commutative84.7%
associate-/l*80.5%
Simplified80.5%
associate-*r/84.7%
Applied egg-rr84.7%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.3e-20) (not (<= y.re 1.95e+40))) (/ (- x.im (* x.re (/ y.im y.re))) y.re) (/ (- (* y.re (/ x.im y.im)) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.3e-20) || !(y_46_re <= 1.95e+40)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-2.3d-20)) .or. (.not. (y_46re <= 1.95d+40))) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.3e-20) || !(y_46_re <= 1.95e+40)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.3e-20) or not (y_46_re <= 1.95e+40): tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.3e-20) || !(y_46_re <= 1.95e+40)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.3e-20) || ~((y_46_re <= 1.95e+40))) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.3e-20], N[Not[LessEqual[y$46$re, 1.95e+40]], $MachinePrecision]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{-20} \lor \neg \left(y.re \leq 1.95 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.2999999999999999e-20 or 1.95e40 < y.re Initial program 51.5%
Taylor expanded in y.re around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
unsub-neg74.8%
remove-double-neg74.8%
mul-1-neg74.8%
neg-mul-174.8%
mul-1-neg74.8%
distribute-lft-in74.8%
distribute-lft-in74.8%
mul-1-neg74.8%
unsub-neg74.8%
neg-mul-174.8%
mul-1-neg74.8%
remove-double-neg74.8%
associate-/l*77.2%
Simplified77.2%
if -2.2999999999999999e-20 < y.re < 1.95e40Initial program 68.0%
Taylor expanded in y.re around 0 77.7%
+-commutative77.7%
mul-1-neg77.7%
unsub-neg77.7%
unpow277.7%
associate-/r*84.7%
div-sub84.7%
*-commutative84.7%
associate-/l*80.5%
Simplified80.5%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.5e-31) (not (<= y.re 6.2e+75))) (/ 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.5e-31) || !(y_46_re <= 6.2e+75)) {
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.5d-31)) .or. (.not. (y_46re <= 6.2d+75))) 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.5e-31) || !(y_46_re <= 6.2e+75)) {
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.5e-31) or not (y_46_re <= 6.2e+75): 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.5e-31) || !(y_46_re <= 6.2e+75)) 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.5e-31) || ~((y_46_re <= 6.2e+75))) 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.5e-31], N[Not[LessEqual[y$46$re, 6.2e+75]], $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.5 \cdot 10^{-31} \lor \neg \left(y.re \leq 6.2 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -1.49999999999999991e-31 or 6.2000000000000002e75 < y.re Initial program 48.9%
Taylor expanded in y.re around inf 68.5%
if -1.49999999999999991e-31 < y.re < 6.2000000000000002e75Initial program 69.1%
Taylor expanded in y.re around 0 63.8%
associate-*r/63.8%
neg-mul-163.8%
Simplified63.8%
Final simplification65.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.3e+195) (not (<= y.im 8e+172))) (/ x.re y.im) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.3e+195) || !(y_46_im <= 8e+172)) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-2.3d+195)) .or. (.not. (y_46im <= 8d+172))) then
tmp = x_46re / y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.3e+195) || !(y_46_im <= 8e+172)) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -2.3e+195) or not (y_46_im <= 8e+172): tmp = x_46_re / y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -2.3e+195) || !(y_46_im <= 8e+172)) tmp = Float64(x_46_re / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.3e+195) || ~((y_46_im <= 8e+172))) tmp = x_46_re / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.3e+195], N[Not[LessEqual[y$46$im, 8e+172]], $MachinePrecision]], N[(x$46$re / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.3 \cdot 10^{+195} \lor \neg \left(y.im \leq 8 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.3000000000000001e195 or 8.0000000000000007e172 < y.im Initial program 41.1%
fma-define41.1%
add-cube-cbrt41.1%
pow341.1%
add-sqr-sqrt41.1%
pow241.1%
fma-define41.1%
hypot-define41.1%
Applied egg-rr41.1%
Taylor expanded in x.im around 0 41.3%
mul-1-neg41.3%
associate-/l*42.7%
distribute-lft-neg-in42.7%
rem-square-sqrt42.7%
+-commutative42.7%
unpow242.7%
unpow242.7%
hypot-undefine42.7%
+-commutative42.7%
unpow242.7%
unpow242.7%
hypot-undefine42.7%
unpow242.7%
hypot-undefine42.7%
unpow242.7%
unpow242.7%
+-commutative42.7%
unpow242.7%
unpow242.7%
hypot-define42.7%
Simplified42.7%
Taylor expanded in y.im around inf 89.7%
un-div-inv90.0%
add-sqr-sqrt43.1%
sqrt-unprod51.4%
sqr-neg51.4%
sqrt-unprod17.0%
add-sqr-sqrt38.7%
Applied egg-rr38.7%
if -2.3000000000000001e195 < y.im < 8.0000000000000007e172Initial program 65.9%
Taylor expanded in y.re around inf 47.3%
Final simplification45.4%
(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 60.5%
Taylor expanded in y.re around inf 38.8%
herbie shell --seed 2024101
(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))))