
(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 9 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
(let* ((t_0 (- (* x.im y.re) (* x.re y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 2e+301)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(/ (- (* 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 t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+301) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+301) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+301: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 2e+301) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+301) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+301], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot y.re - x.re \cdot y.im\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 2.00000000000000011e301Initial program 78.9%
*-un-lft-identity78.9%
add-sqr-sqrt78.9%
times-frac78.9%
hypot-def78.9%
hypot-def95.1%
Applied egg-rr95.1%
if 2.00000000000000011e301 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 12.9%
Taylor expanded in y.re around 0 46.5%
+-commutative46.5%
mul-1-neg46.5%
unsub-neg46.5%
*-commutative46.5%
Simplified46.5%
*-commutative46.5%
*-un-lft-identity46.5%
pow246.5%
times-frac53.8%
Applied egg-rr53.8%
Taylor expanded in y.im around 0 46.5%
mul-1-neg46.5%
distribute-frac-neg46.5%
+-commutative46.5%
unpow246.5%
associate-/r*53.8%
rem-square-sqrt38.9%
associate-*r/38.9%
associate-*l/38.9%
distribute-frac-neg38.9%
unsub-neg38.9%
associate-*l/38.9%
associate-*r/38.9%
rem-square-sqrt53.8%
associate-*r/54.4%
div-sub56.7%
Simplified56.7%
Final simplification88.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -2.5e+44)
(/ (- (* y.im (/ x.re y.re)) x.im) (hypot y.re y.im))
(if (<= y.re -1.75e-105)
t_0
(if (<= y.re 3.5e-77)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 1.9e+64)
t_0
(* (/ 1.0 (hypot y.re y.im)) (- x.im (/ x.re (/ 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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.5e+44) {
tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -1.75e-105) {
tmp = t_0;
} else if (y_46_re <= 3.5e-77) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.9e+64) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im - (x_46_re / (y_46_re / y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.5e+44) {
tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -1.75e-105) {
tmp = t_0;
} else if (y_46_re <= 3.5e-77) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.9e+64) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im - (x_46_re / (y_46_re / y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -2.5e+44: tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / math.hypot(y_46_re, y_46_im) elif y_46_re <= -1.75e-105: tmp = t_0 elif y_46_re <= 3.5e-77: tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 1.9e+64: tmp = t_0 else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im - (x_46_re / (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(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))) tmp = 0.0 if (y_46_re <= -2.5e+44) tmp = Float64(Float64(Float64(y_46_im * Float64(x_46_re / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -1.75e-105) tmp = t_0; elseif (y_46_re <= 3.5e-77) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 1.9e+64) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -2.5e+44) tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im); elseif (y_46_re <= -1.75e-105) tmp = t_0; elseif (y_46_re <= 3.5e-77) tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 1.9e+64) tmp = t_0; else tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im - (x_46_re / (y_46_re / y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.5e+44], N[(N[(N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.75e-105], t$95$0, If[LessEqual[y$46$re, 3.5e-77], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.9e+64], t$95$0, N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -2.5 \cdot 10^{+44}:\\
\;\;\;\;\frac{y.im \cdot \frac{x.re}{y.re} - x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-105}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+64}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im - \frac{x.re}{\frac{y.re}{y.im}}\right)\\
\end{array}
\end{array}
if y.re < -2.4999999999999998e44Initial program 51.0%
*-un-lft-identity51.0%
add-sqr-sqrt51.0%
times-frac51.0%
hypot-def51.0%
hypot-def71.9%
Applied egg-rr71.9%
Taylor expanded in y.re around -inf 77.3%
+-commutative77.3%
neg-mul-177.3%
unsub-neg77.3%
associate-/l*77.5%
Simplified77.5%
sub-neg77.5%
distribute-lft-in77.5%
div-inv77.5%
clear-num78.4%
Applied egg-rr78.4%
distribute-lft-out78.4%
sub-neg78.4%
associate-*l/78.7%
*-lft-identity78.7%
associate-*r/77.6%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
if -2.4999999999999998e44 < y.re < -1.75e-105 or 3.50000000000000013e-77 < y.re < 1.9000000000000001e64Initial program 82.8%
if -1.75e-105 < y.re < 3.50000000000000013e-77Initial program 75.8%
Taylor expanded in y.re around 0 81.4%
+-commutative81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
*-commutative81.4%
*-un-lft-identity81.4%
pow281.4%
times-frac92.5%
Applied egg-rr92.5%
Taylor expanded in y.im around 0 81.4%
mul-1-neg81.4%
distribute-frac-neg81.4%
+-commutative81.4%
unpow281.4%
associate-/r*92.6%
rem-square-sqrt61.0%
associate-*r/61.0%
associate-*l/61.0%
distribute-frac-neg61.0%
unsub-neg61.0%
associate-*l/61.0%
associate-*r/61.0%
rem-square-sqrt92.6%
associate-*r/90.7%
div-sub91.7%
Simplified91.7%
Taylor expanded in x.im around 0 93.5%
if 1.9000000000000001e64 < y.re Initial program 50.9%
*-un-lft-identity50.9%
add-sqr-sqrt50.9%
times-frac50.9%
hypot-def50.9%
hypot-def68.3%
Applied egg-rr68.3%
Taylor expanded in y.re around inf 81.4%
mul-1-neg81.4%
unsub-neg81.4%
associate-/l*89.3%
Simplified89.3%
Final simplification87.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))))
(if (<= y.re -2.5e+44)
t_1
(if (<= y.re -4e-96)
t_0
(if (<= y.re 1.25e-76)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 3.1e+124) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
double tmp;
if (y_46_re <= -2.5e+44) {
tmp = t_1;
} else if (y_46_re <= -4e-96) {
tmp = t_0;
} else if (y_46_re <= 1.25e-76) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 3.1e+124) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46re) - (x_46re * (y_46im / (y_46re ** 2.0d0)))
if (y_46re <= (-2.5d+44)) then
tmp = t_1
else if (y_46re <= (-4d-96)) then
tmp = t_0
else if (y_46re <= 1.25d-76) then
tmp = (((x_46im * y_46re) / y_46im) - x_46re) / y_46im
else if (y_46re <= 3.1d+124) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im / Math.pow(y_46_re, 2.0)));
double tmp;
if (y_46_re <= -2.5e+44) {
tmp = t_1;
} else if (y_46_re <= -4e-96) {
tmp = t_0;
} else if (y_46_re <= 1.25e-76) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 3.1e+124) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im / math.pow(y_46_re, 2.0))) tmp = 0 if y_46_re <= -2.5e+44: tmp = t_1 elif y_46_re <= -4e-96: tmp = t_0 elif y_46_re <= 1.25e-76: tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 3.1e+124: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))) tmp = 0.0 if (y_46_re <= -2.5e+44) tmp = t_1; elseif (y_46_re <= -4e-96) tmp = t_0; elseif (y_46_re <= 1.25e-76) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 3.1e+124) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im / (y_46_re ^ 2.0))); tmp = 0.0; if (y_46_re <= -2.5e+44) tmp = t_1; elseif (y_46_re <= -4e-96) tmp = t_0; elseif (y_46_re <= 1.25e-76) tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 3.1e+124) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / 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$re, -2.5e+44], t$95$1, If[LessEqual[y$46$re, -4e-96], t$95$0, If[LessEqual[y$46$re, 1.25e-76], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 3.1e+124], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{if}\;y.re \leq -2.5 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -4 \cdot 10^{-96}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 3.1 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.4999999999999998e44 or 3.1000000000000002e124 < y.re Initial program 46.9%
*-un-lft-identity46.9%
add-sqr-sqrt46.9%
times-frac46.9%
hypot-def46.9%
hypot-def69.0%
Applied egg-rr69.0%
Taylor expanded in y.re around inf 73.8%
+-commutative73.8%
mul-1-neg73.8%
unsub-neg73.8%
*-lft-identity73.8%
times-frac76.3%
/-rgt-identity76.3%
Simplified76.3%
if -2.4999999999999998e44 < y.re < -3.9999999999999996e-96 or 1.2499999999999999e-76 < y.re < 3.1000000000000002e124Initial program 82.8%
if -3.9999999999999996e-96 < y.re < 1.2499999999999999e-76Initial program 75.8%
Taylor expanded in y.re around 0 81.4%
+-commutative81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
*-commutative81.4%
*-un-lft-identity81.4%
pow281.4%
times-frac92.5%
Applied egg-rr92.5%
Taylor expanded in y.im around 0 81.4%
mul-1-neg81.4%
distribute-frac-neg81.4%
+-commutative81.4%
unpow281.4%
associate-/r*92.6%
rem-square-sqrt61.0%
associate-*r/61.0%
associate-*l/61.0%
distribute-frac-neg61.0%
unsub-neg61.0%
associate-*l/61.0%
associate-*r/61.0%
rem-square-sqrt92.6%
associate-*r/90.7%
div-sub91.7%
Simplified91.7%
Taylor expanded in x.im around 0 93.5%
Final simplification84.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -2.3e+44)
(/ (- (* y.im (/ x.re y.re)) x.im) (hypot y.re y.im))
(if (<= y.re -1.75e-102)
t_0
(if (<= y.re 3.6e-77)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 9e+124)
t_0
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.3e+44) {
tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -1.75e-102) {
tmp = t_0;
} else if (y_46_re <= 3.6e-77) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 9e+124) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.3e+44) {
tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -1.75e-102) {
tmp = t_0;
} else if (y_46_re <= 3.6e-77) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 9e+124) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / Math.pow(y_46_re, 2.0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -2.3e+44: tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / math.hypot(y_46_re, y_46_im) elif y_46_re <= -1.75e-102: tmp = t_0 elif y_46_re <= 3.6e-77: tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 9e+124: tmp = t_0 else: tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / math.pow(y_46_re, 2.0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -2.3e+44) tmp = Float64(Float64(Float64(y_46_im * Float64(x_46_re / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -1.75e-102) tmp = t_0; elseif (y_46_re <= 3.6e-77) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 9e+124) tmp = t_0; else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -2.3e+44) tmp = ((y_46_im * (x_46_re / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im); elseif (y_46_re <= -1.75e-102) tmp = t_0; elseif (y_46_re <= 3.6e-77) tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 9e+124) tmp = t_0; else tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / (y_46_re ^ 2.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[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.3e+44], N[(N[(N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.75e-102], t$95$0, If[LessEqual[y$46$re, 3.6e-77], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 9e+124], t$95$0, 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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{+44}:\\
\;\;\;\;\frac{y.im \cdot \frac{x.re}{y.re} - x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-102}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\end{array}
\end{array}
if y.re < -2.30000000000000004e44Initial program 51.0%
*-un-lft-identity51.0%
add-sqr-sqrt51.0%
times-frac51.0%
hypot-def51.0%
hypot-def71.9%
Applied egg-rr71.9%
Taylor expanded in y.re around -inf 77.3%
+-commutative77.3%
neg-mul-177.3%
unsub-neg77.3%
associate-/l*77.5%
Simplified77.5%
sub-neg77.5%
distribute-lft-in77.5%
div-inv77.5%
clear-num78.4%
Applied egg-rr78.4%
distribute-lft-out78.4%
sub-neg78.4%
associate-*l/78.7%
*-lft-identity78.7%
associate-*r/77.6%
associate-*l/79.4%
*-commutative79.4%
Simplified79.4%
if -2.30000000000000004e44 < y.re < -1.74999999999999993e-102 or 3.6e-77 < y.re < 9.0000000000000008e124Initial program 82.8%
if -1.74999999999999993e-102 < y.re < 3.6e-77Initial program 75.8%
Taylor expanded in y.re around 0 81.4%
+-commutative81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
*-commutative81.4%
*-un-lft-identity81.4%
pow281.4%
times-frac92.5%
Applied egg-rr92.5%
Taylor expanded in y.im around 0 81.4%
mul-1-neg81.4%
distribute-frac-neg81.4%
+-commutative81.4%
unpow281.4%
associate-/r*92.6%
rem-square-sqrt61.0%
associate-*r/61.0%
associate-*l/61.0%
distribute-frac-neg61.0%
unsub-neg61.0%
associate-*l/61.0%
associate-*r/61.0%
rem-square-sqrt92.6%
associate-*r/90.7%
div-sub91.7%
Simplified91.7%
Taylor expanded in x.im around 0 93.5%
if 9.0000000000000008e124 < y.re Initial program 37.6%
*-un-lft-identity37.6%
add-sqr-sqrt37.5%
times-frac37.6%
hypot-def37.6%
hypot-def62.3%
Applied egg-rr62.3%
Taylor expanded in y.re around inf 76.6%
+-commutative76.6%
mul-1-neg76.6%
unsub-neg76.6%
*-lft-identity76.6%
times-frac80.8%
/-rgt-identity80.8%
Simplified80.8%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -2.9e+127)
(/ x.im y.re)
(if (<= y.re -3.2e-106)
t_0
(if (<= y.re 6.6e-78)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 7.8e+153) 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_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.9e+127) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -3.2e-106) {
tmp = t_0;
} else if (y_46_re <= 6.6e-78) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 7.8e+153) {
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_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-2.9d+127)) then
tmp = x_46im / y_46re
else if (y_46re <= (-3.2d-106)) then
tmp = t_0
else if (y_46re <= 6.6d-78) then
tmp = (((x_46im * y_46re) / y_46im) - x_46re) / y_46im
else if (y_46re <= 7.8d+153) 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_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.9e+127) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -3.2e-106) {
tmp = t_0;
} else if (y_46_re <= 6.6e-78) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 7.8e+153) {
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_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -2.9e+127: tmp = x_46_im / y_46_re elif y_46_re <= -3.2e-106: tmp = t_0 elif y_46_re <= 6.6e-78: tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 7.8e+153: 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(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))) tmp = 0.0 if (y_46_re <= -2.9e+127) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -3.2e-106) tmp = t_0; elseif (y_46_re <= 6.6e-78) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 7.8e+153) 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_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -2.9e+127) tmp = x_46_im / y_46_re; elseif (y_46_re <= -3.2e-106) tmp = t_0; elseif (y_46_re <= 6.6e-78) tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 7.8e+153) 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[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.9e+127], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -3.2e-106], t$95$0, If[LessEqual[y$46$re, 6.6e-78], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 7.8e+153], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -2.9 \cdot 10^{+127}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -3.2 \cdot 10^{-106}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -2.9000000000000002e127 or 7.79999999999999966e153 < y.re Initial program 33.3%
Taylor expanded in y.re around inf 74.8%
if -2.9000000000000002e127 < y.re < -3.2e-106 or 6.59999999999999963e-78 < y.re < 7.79999999999999966e153Initial program 79.9%
if -3.2e-106 < y.re < 6.59999999999999963e-78Initial program 75.8%
Taylor expanded in y.re around 0 81.4%
+-commutative81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
*-commutative81.4%
*-un-lft-identity81.4%
pow281.4%
times-frac92.5%
Applied egg-rr92.5%
Taylor expanded in y.im around 0 81.4%
mul-1-neg81.4%
distribute-frac-neg81.4%
+-commutative81.4%
unpow281.4%
associate-/r*92.6%
rem-square-sqrt61.0%
associate-*r/61.0%
associate-*l/61.0%
distribute-frac-neg61.0%
unsub-neg61.0%
associate-*l/61.0%
associate-*r/61.0%
rem-square-sqrt92.6%
associate-*r/90.7%
div-sub91.7%
Simplified91.7%
Taylor expanded in x.im around 0 93.5%
Final simplification84.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.35e+51) (not (<= y.re 4.8e+63))) (/ x.im y.re) (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.35e+51) || !(y_46_re <= 4.8e+63)) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-2.35d+51)) .or. (.not. (y_46re <= 4.8d+63))) then
tmp = x_46im / y_46re
else
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.35e+51) || !(y_46_re <= 4.8e+63)) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.35e+51) or not (y_46_re <= 4.8e+63): tmp = x_46_im / y_46_re else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.35e+51) || !(y_46_re <= 4.8e+63)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.35e+51) || ~((y_46_re <= 4.8e+63))) tmp = x_46_im / y_46_re; else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.35e+51], N[Not[LessEqual[y$46$re, 4.8e+63]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.35 \cdot 10^{+51} \lor \neg \left(y.re \leq 4.8 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.3500000000000001e51 or 4.8e63 < y.re Initial program 52.0%
Taylor expanded in y.re around inf 67.3%
if -2.3500000000000001e51 < y.re < 4.8e63Initial program 77.1%
Taylor expanded in y.re around 0 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
*-commutative71.7%
Simplified71.7%
*-commutative71.7%
*-un-lft-identity71.7%
pow271.7%
times-frac78.7%
Applied egg-rr78.7%
Taylor expanded in y.im around 0 71.7%
mul-1-neg71.7%
distribute-frac-neg71.7%
+-commutative71.7%
unpow271.7%
associate-/r*78.7%
rem-square-sqrt50.6%
associate-*r/50.6%
associate-*l/50.6%
distribute-frac-neg50.6%
unsub-neg50.6%
associate-*l/50.6%
associate-*r/50.6%
rem-square-sqrt78.7%
associate-*r/77.6%
div-sub78.9%
Simplified78.9%
Final simplification74.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.4e+51) (not (<= y.re 1.5e+61))) (/ x.im y.re) (/ (- (/ (* x.im y.re) y.im) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.4e+51) || !(y_46_re <= 1.5e+61)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-3.4d+51)) .or. (.not. (y_46re <= 1.5d+61))) then
tmp = x_46im / y_46re
else
tmp = (((x_46im * y_46re) / y_46im) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.4e+51) || !(y_46_re <= 1.5e+61)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.4e+51) or not (y_46_re <= 1.5e+61): tmp = x_46_im / y_46_re else: tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.4e+51) || !(y_46_re <= 1.5e+61)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.4e+51) || ~((y_46_re <= 1.5e+61))) tmp = x_46_im / y_46_re; else tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.4e+51], N[Not[LessEqual[y$46$re, 1.5e+61]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{+51} \lor \neg \left(y.re \leq 1.5 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -3.39999999999999984e51 or 1.5e61 < y.re Initial program 52.0%
Taylor expanded in y.re around inf 67.3%
if -3.39999999999999984e51 < y.re < 1.5e61Initial program 77.1%
Taylor expanded in y.re around 0 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
*-commutative71.7%
Simplified71.7%
*-commutative71.7%
*-un-lft-identity71.7%
pow271.7%
times-frac78.7%
Applied egg-rr78.7%
Taylor expanded in y.im around 0 71.7%
mul-1-neg71.7%
distribute-frac-neg71.7%
+-commutative71.7%
unpow271.7%
associate-/r*78.7%
rem-square-sqrt50.6%
associate-*r/50.6%
associate-*l/50.6%
distribute-frac-neg50.6%
unsub-neg50.6%
associate-*l/50.6%
associate-*r/50.6%
rem-square-sqrt78.7%
associate-*r/77.6%
div-sub78.9%
Simplified78.9%
Taylor expanded in x.im around 0 80.0%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.55) (not (<= y.re 9e+43))) (/ 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 <= -0.55) || !(y_46_re <= 9e+43)) {
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 <= (-0.55d0)) .or. (.not. (y_46re <= 9d+43))) 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 <= -0.55) || !(y_46_re <= 9e+43)) {
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 <= -0.55) or not (y_46_re <= 9e+43): 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 <= -0.55) || !(y_46_re <= 9e+43)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -0.55) || ~((y_46_re <= 9e+43))) 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, -0.55], N[Not[LessEqual[y$46$re, 9e+43]], $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 -0.55 \lor \neg \left(y.re \leq 9 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -0.55000000000000004 or 9e43 < y.re Initial program 54.2%
Taylor expanded in y.re around inf 63.8%
if -0.55000000000000004 < y.re < 9e43Initial program 78.0%
Taylor expanded in y.re around 0 63.2%
associate-*r/63.2%
neg-mul-163.2%
Simplified63.2%
Final simplification63.5%
(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 68.1%
Taylor expanded in y.re around inf 39.5%
Final simplification39.5%
herbie shell --seed 2024040
(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))))