
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
2e+300)
(/
(/ (- (fma x.re y.im (* x.im (- y.re)))) (hypot y.im y.re))
(hypot y.im y.re))
(- (/ x.im y.re) (/ (* y.im (/ x.re y.re)) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+300) {
tmp = (-fma(x_46_re, y_46_im, (x_46_im * -y_46_re)) / hypot(y_46_im, y_46_re)) / hypot(y_46_im, y_46_re);
} else {
tmp = (x_46_im / y_46_re) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (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))) <= 2e+300) tmp = Float64(Float64(Float64(-fma(x_46_re, y_46_im, Float64(x_46_im * Float64(-y_46_re)))) / hypot(y_46_im, y_46_re)) / hypot(y_46_im, y_46_re)); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(y_46_im * Float64(x_46_re / y_46_re)) / y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[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], 2e+300], N[(N[((-N[(x$46$re * y$46$im + N[(x$46$im * (-y$46$re)), $MachinePrecision]), $MachinePrecision]) / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq 2 \cdot 10^{+300}:\\
\;\;\;\;\frac{\frac{-\mathsf{fma}\left(x.re, y.im, x.im \cdot \left(-y.re\right)\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\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.0000000000000001e300Initial program 75.5%
frac-2neg75.5%
div-inv75.5%
Applied egg-rr75.5%
*-commutative75.5%
neg-mul-175.5%
associate-/r*75.5%
metadata-eval75.5%
Simplified75.5%
associate-*r/75.5%
unpow275.5%
associate-/r*96.3%
fma-neg96.3%
distribute-rgt-neg-in96.3%
hypot-udef75.7%
+-commutative75.7%
hypot-def96.3%
hypot-udef75.7%
+-commutative75.7%
hypot-def96.3%
Applied egg-rr96.3%
if 2.0000000000000001e300 < (/.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.0%
Taylor expanded in y.re around inf 49.9%
*-un-lft-identity49.9%
metadata-eval49.9%
unpow249.9%
times-frac56.9%
metadata-eval56.9%
Applied egg-rr56.9%
*-commutative56.9%
div-inv56.8%
associate-/l*66.5%
associate-/r/66.6%
Applied egg-rr66.6%
Final simplification89.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (/ x.im y.re) (/ (* y.im (/ x.re y.re)) y.re))))
(if (<= y.re -3.35e+84)
t_0
(if (<= y.re -3e-170)
(/ (fma x.im y.re (* x.re (- y.im))) (fma y.re y.re (* y.im y.im)))
(if (<= y.re 7.8e-185)
(/ (- x.re) y.im)
(if (<= y.re 5.2e+43)
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im / y_46_re) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re);
double tmp;
if (y_46_re <= -3.35e+84) {
tmp = t_0;
} else if (y_46_re <= -3e-170) {
tmp = fma(x_46_im, y_46_re, (x_46_re * -y_46_im)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else if (y_46_re <= 7.8e-185) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 5.2e+43) {
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));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(y_46_im * Float64(x_46_re / y_46_re)) / y_46_re)) tmp = 0.0 if (y_46_re <= -3.35e+84) tmp = t_0; elseif (y_46_re <= -3e-170) tmp = Float64(fma(x_46_im, y_46_re, Float64(x_46_re * Float64(-y_46_im))) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); elseif (y_46_re <= 7.8e-185) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 5.2e+43) tmp = 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))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.35e+84], t$95$0, If[LessEqual[y$46$re, -3e-170], N[(N[(x$46$im * y$46$re + N[(x$46$re * (-y$46$im)), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.8e-185], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 5.2e+43], 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], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{y.re} - \frac{y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -3.35 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq -3 \cdot 10^{-170}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, x.re \cdot \left(-y.im\right)\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-185}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -3.3500000000000002e84 or 5.20000000000000042e43 < y.re Initial program 35.6%
Taylor expanded in y.re around inf 74.2%
*-un-lft-identity74.2%
metadata-eval74.2%
unpow274.2%
times-frac81.9%
metadata-eval81.9%
Applied egg-rr81.9%
*-commutative81.9%
div-inv81.9%
associate-/l*87.0%
associate-/r/88.0%
Applied egg-rr88.0%
if -3.3500000000000002e84 < y.re < -3.00000000000000013e-170Initial program 87.5%
fma-neg87.5%
distribute-rgt-neg-out87.5%
fma-def87.5%
Simplified87.5%
if -3.00000000000000013e-170 < y.re < 7.7999999999999999e-185Initial program 56.5%
Taylor expanded in y.re around 0 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
if 7.7999999999999999e-185 < y.re < 5.20000000000000042e43Initial program 82.2%
Final simplification85.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))))
(t_1 (- (/ x.im y.re) (/ (* y.im (/ x.re y.re)) y.re))))
(if (<= y.re -5.2e+83)
t_1
(if (<= y.re -8e-165)
t_0
(if (<= y.re 1.85e-184)
(/ (- x.re) y.im)
(if (<= y.re 4.25e+43) 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) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re);
double tmp;
if (y_46_re <= -5.2e+83) {
tmp = t_1;
} else if (y_46_re <= -8e-165) {
tmp = t_0;
} else if (y_46_re <= 1.85e-184) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 4.25e+43) {
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) - ((y_46im * (x_46re / y_46re)) / y_46re)
if (y_46re <= (-5.2d+83)) then
tmp = t_1
else if (y_46re <= (-8d-165)) then
tmp = t_0
else if (y_46re <= 1.85d-184) then
tmp = -x_46re / y_46im
else if (y_46re <= 4.25d+43) 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) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re);
double tmp;
if (y_46_re <= -5.2e+83) {
tmp = t_1;
} else if (y_46_re <= -8e-165) {
tmp = t_0;
} else if (y_46_re <= 1.85e-184) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 4.25e+43) {
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) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re) tmp = 0 if y_46_re <= -5.2e+83: tmp = t_1 elif y_46_re <= -8e-165: tmp = t_0 elif y_46_re <= 1.85e-184: tmp = -x_46_re / y_46_im elif y_46_re <= 4.25e+43: 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(Float64(y_46_im * Float64(x_46_re / y_46_re)) / y_46_re)) tmp = 0.0 if (y_46_re <= -5.2e+83) tmp = t_1; elseif (y_46_re <= -8e-165) tmp = t_0; elseif (y_46_re <= 1.85e-184) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 4.25e+43) 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) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re); tmp = 0.0; if (y_46_re <= -5.2e+83) tmp = t_1; elseif (y_46_re <= -8e-165) tmp = t_0; elseif (y_46_re <= 1.85e-184) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 4.25e+43) 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[(N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.2e+83], t$95$1, If[LessEqual[y$46$re, -8e-165], t$95$0, If[LessEqual[y$46$re, 1.85e-184], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 4.25e+43], 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} - \frac{y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -5.2 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -8 \cdot 10^{-165}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-184}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 4.25 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -5.2000000000000002e83 or 4.25e43 < y.re Initial program 35.6%
Taylor expanded in y.re around inf 74.2%
*-un-lft-identity74.2%
metadata-eval74.2%
unpow274.2%
times-frac81.9%
metadata-eval81.9%
Applied egg-rr81.9%
*-commutative81.9%
div-inv81.9%
associate-/l*87.0%
associate-/r/88.0%
Applied egg-rr88.0%
if -5.2000000000000002e83 < y.re < -8.0000000000000001e-165 or 1.8499999999999999e-184 < y.re < 4.25e43Initial program 85.0%
if -8.0000000000000001e-165 < y.re < 1.8499999999999999e-184Initial program 56.5%
Taylor expanded in y.re around 0 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im y.re) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -4.6e+94)
(/ x.im y.re)
(if (<= y.re -3.2e-86)
t_0
(if (<= y.re 6.6e-67)
(/ (- x.re) y.im)
(if (<= y.re 2.4e+42) 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) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -4.6e+94) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -3.2e-86) {
tmp = t_0;
} else if (y_46_re <= 6.6e-67) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 2.4e+42) {
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) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-4.6d+94)) then
tmp = x_46im / y_46re
else if (y_46re <= (-3.2d-86)) then
tmp = t_0
else if (y_46re <= 6.6d-67) then
tmp = -x_46re / y_46im
else if (y_46re <= 2.4d+42) 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) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -4.6e+94) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -3.2e-86) {
tmp = t_0;
} else if (y_46_re <= 6.6e-67) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 2.4e+42) {
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) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -4.6e+94: tmp = x_46_im / y_46_re elif y_46_re <= -3.2e-86: tmp = t_0 elif y_46_re <= 6.6e-67: tmp = -x_46_re / y_46_im elif y_46_re <= 2.4e+42: 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(x_46_im * y_46_re) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -4.6e+94) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -3.2e-86) tmp = t_0; elseif (y_46_re <= 6.6e-67) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 2.4e+42) 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) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -4.6e+94) tmp = x_46_im / y_46_re; elseif (y_46_re <= -3.2e-86) tmp = t_0; elseif (y_46_re <= 6.6e-67) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 2.4e+42) 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[(x$46$im * y$46$re), $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, -4.6e+94], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -3.2e-86], t$95$0, If[LessEqual[y$46$re, 6.6e-67], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.4e+42], 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}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -4.6 \cdot 10^{+94}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -3.2 \cdot 10^{-86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{-67}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+42}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -4.5999999999999999e94 or 2.3999999999999999e42 < y.re Initial program 35.0%
Taylor expanded in y.re around inf 73.5%
if -4.5999999999999999e94 < y.re < -3.20000000000000006e-86 or 6.6000000000000003e-67 < y.re < 2.3999999999999999e42Initial program 90.3%
Taylor expanded in x.im around inf 66.7%
*-commutative66.7%
Simplified66.7%
if -3.20000000000000006e-86 < y.re < 6.6000000000000003e-67Initial program 66.4%
Taylor expanded in y.re around 0 70.7%
associate-*r/70.7%
neg-mul-170.7%
Simplified70.7%
Final simplification70.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im y.re) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (/ x.im y.re) (* (/ x.re y.re) (/ y.im y.re)))))
(if (<= y.re -24000.0)
t_1
(if (<= y.re -2.5e-87)
t_0
(if (<= y.re 1.85e-67)
(/ (- x.re) y.im)
(if (<= y.re 4.3e+36) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re));
double tmp;
if (y_46_re <= -24000.0) {
tmp = t_1;
} else if (y_46_re <= -2.5e-87) {
tmp = t_0;
} else if (y_46_re <= 1.85e-67) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 4.3e+36) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46im * y_46re) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46re) - ((x_46re / y_46re) * (y_46im / y_46re))
if (y_46re <= (-24000.0d0)) then
tmp = t_1
else if (y_46re <= (-2.5d-87)) then
tmp = t_0
else if (y_46re <= 1.85d-67) then
tmp = -x_46re / y_46im
else if (y_46re <= 4.3d+36) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re));
double tmp;
if (y_46_re <= -24000.0) {
tmp = t_1;
} else if (y_46_re <= -2.5e-87) {
tmp = t_0;
} else if (y_46_re <= 1.85e-67) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 4.3e+36) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re)) tmp = 0 if y_46_re <= -24000.0: tmp = t_1 elif y_46_re <= -2.5e-87: tmp = t_0 elif y_46_re <= 1.85e-67: tmp = -x_46_re / y_46_im elif y_46_re <= 4.3e+36: 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(x_46_im * y_46_re) / 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(Float64(x_46_re / y_46_re) * Float64(y_46_im / y_46_re))) tmp = 0.0 if (y_46_re <= -24000.0) tmp = t_1; elseif (y_46_re <= -2.5e-87) tmp = t_0; elseif (y_46_re <= 1.85e-67) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 4.3e+36) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re)); tmp = 0.0; if (y_46_re <= -24000.0) tmp = t_1; elseif (y_46_re <= -2.5e-87) tmp = t_0; elseif (y_46_re <= 1.85e-67) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 4.3e+36) 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[(x$46$im * y$46$re), $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[(N[(x$46$re / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -24000.0], t$95$1, If[LessEqual[y$46$re, -2.5e-87], t$95$0, If[LessEqual[y$46$re, 1.85e-67], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 4.3e+36], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - \frac{x.re}{y.re} \cdot \frac{y.im}{y.re}\\
\mathbf{if}\;y.re \leq -24000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -2.5 \cdot 10^{-87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-67}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+36}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -24000 or 4.30000000000000005e36 < y.re Initial program 45.2%
Taylor expanded in y.re around inf 75.1%
*-commutative75.1%
unpow275.1%
times-frac86.4%
Applied egg-rr86.4%
if -24000 < y.re < -2.50000000000000021e-87 or 1.85e-67 < y.re < 4.30000000000000005e36Initial program 88.3%
Taylor expanded in x.im around inf 68.5%
*-commutative68.5%
Simplified68.5%
if -2.50000000000000021e-87 < y.re < 1.85e-67Initial program 66.4%
Taylor expanded in y.re around 0 70.7%
associate-*r/70.7%
neg-mul-170.7%
Simplified70.7%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im y.re) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (/ x.im y.re) (/ (* y.im (/ x.re y.re)) y.re))))
(if (<= y.re -9000.0)
t_1
(if (<= y.re -6.5e-84)
t_0
(if (<= y.re 1.16e-66)
(/ (- x.re) y.im)
(if (<= y.re 2.6e+38) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re);
double tmp;
if (y_46_re <= -9000.0) {
tmp = t_1;
} else if (y_46_re <= -6.5e-84) {
tmp = t_0;
} else if (y_46_re <= 1.16e-66) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 2.6e+38) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46im * y_46re) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46re) - ((y_46im * (x_46re / y_46re)) / y_46re)
if (y_46re <= (-9000.0d0)) then
tmp = t_1
else if (y_46re <= (-6.5d-84)) then
tmp = t_0
else if (y_46re <= 1.16d-66) then
tmp = -x_46re / y_46im
else if (y_46re <= 2.6d+38) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re);
double tmp;
if (y_46_re <= -9000.0) {
tmp = t_1;
} else if (y_46_re <= -6.5e-84) {
tmp = t_0;
} else if (y_46_re <= 1.16e-66) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 2.6e+38) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_re) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re) tmp = 0 if y_46_re <= -9000.0: tmp = t_1 elif y_46_re <= -6.5e-84: tmp = t_0 elif y_46_re <= 1.16e-66: tmp = -x_46_re / y_46_im elif y_46_re <= 2.6e+38: 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(x_46_im * y_46_re) / 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(Float64(y_46_im * Float64(x_46_re / y_46_re)) / y_46_re)) tmp = 0.0 if (y_46_re <= -9000.0) tmp = t_1; elseif (y_46_re <= -6.5e-84) tmp = t_0; elseif (y_46_re <= 1.16e-66) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 2.6e+38) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_re) - ((y_46_im * (x_46_re / y_46_re)) / y_46_re); tmp = 0.0; if (y_46_re <= -9000.0) tmp = t_1; elseif (y_46_re <= -6.5e-84) tmp = t_0; elseif (y_46_re <= 1.16e-66) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 2.6e+38) 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[(x$46$im * y$46$re), $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[(N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9000.0], t$95$1, If[LessEqual[y$46$re, -6.5e-84], t$95$0, If[LessEqual[y$46$re, 1.16e-66], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.6e+38], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - \frac{y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -9000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.16 \cdot 10^{-66}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{+38}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -9e3 or 2.5999999999999999e38 < y.re Initial program 45.2%
Taylor expanded in y.re around inf 75.1%
*-un-lft-identity75.1%
metadata-eval75.1%
unpow275.1%
times-frac81.5%
metadata-eval81.5%
Applied egg-rr81.5%
*-commutative81.5%
div-inv81.5%
associate-/l*85.8%
associate-/r/86.6%
Applied egg-rr86.6%
if -9e3 < y.re < -6.50000000000000022e-84 or 1.16000000000000002e-66 < y.re < 2.5999999999999999e38Initial program 88.3%
Taylor expanded in x.im around inf 68.5%
*-commutative68.5%
Simplified68.5%
if -6.50000000000000022e-84 < y.re < 1.16000000000000002e-66Initial program 66.4%
Taylor expanded in y.re around 0 70.7%
associate-*r/70.7%
neg-mul-170.7%
Simplified70.7%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.08e+86) (not (<= y.im 5.3e+22))) (/ (- x.re) y.im) (+ (/ x.im y.re) (* (/ (* x.re y.im) y.re) (/ -1.0 y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.08e+86) || !(y_46_im <= 5.3e+22)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im / y_46_re) + (((x_46_re * y_46_im) / y_46_re) * (-1.0 / y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.08d+86)) .or. (.not. (y_46im <= 5.3d+22))) then
tmp = -x_46re / y_46im
else
tmp = (x_46im / y_46re) + (((x_46re * y_46im) / y_46re) * ((-1.0d0) / y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.08e+86) || !(y_46_im <= 5.3e+22)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im / y_46_re) + (((x_46_re * y_46_im) / y_46_re) * (-1.0 / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.08e+86) or not (y_46_im <= 5.3e+22): tmp = -x_46_re / y_46_im else: tmp = (x_46_im / y_46_re) + (((x_46_re * y_46_im) / y_46_re) * (-1.0 / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.08e+86) || !(y_46_im <= 5.3e+22)) tmp = Float64(Float64(-x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im / y_46_re) + Float64(Float64(Float64(x_46_re * y_46_im) / y_46_re) * Float64(-1.0 / y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.08e+86) || ~((y_46_im <= 5.3e+22))) tmp = -x_46_re / y_46_im; else tmp = (x_46_im / y_46_re) + (((x_46_re * y_46_im) / y_46_re) * (-1.0 / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.08e+86], N[Not[LessEqual[y$46$im, 5.3e+22]], $MachinePrecision]], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] + N[(N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision] * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.08 \cdot 10^{+86} \lor \neg \left(y.im \leq 5.3 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} + \frac{x.re \cdot y.im}{y.re} \cdot \frac{-1}{y.re}\\
\end{array}
\end{array}
if y.im < -1.07999999999999993e86 or 5.2999999999999998e22 < y.im Initial program 40.4%
Taylor expanded in y.re around 0 68.0%
associate-*r/68.0%
neg-mul-168.0%
Simplified68.0%
if -1.07999999999999993e86 < y.im < 5.2999999999999998e22Initial program 72.0%
Taylor expanded in y.re around inf 72.3%
*-un-lft-identity72.3%
metadata-eval72.3%
unpow272.3%
times-frac78.9%
metadata-eval78.9%
Applied egg-rr78.9%
Final simplification74.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.5e-85) (not (<= y.re 3e-41))) (/ 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 <= -2.5e-85) || !(y_46_re <= 3e-41)) {
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 <= (-2.5d-85)) .or. (.not. (y_46re <= 3d-41))) 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 <= -2.5e-85) || !(y_46_re <= 3e-41)) {
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 <= -2.5e-85) or not (y_46_re <= 3e-41): 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 <= -2.5e-85) || !(y_46_re <= 3e-41)) 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 <= -2.5e-85) || ~((y_46_re <= 3e-41))) 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, -2.5e-85], N[Not[LessEqual[y$46$re, 3e-41]], $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 -2.5 \cdot 10^{-85} \lor \neg \left(y.re \leq 3 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.5000000000000001e-85 or 2.99999999999999989e-41 < y.re Initial program 55.3%
Taylor expanded in y.re around inf 64.1%
if -2.5000000000000001e-85 < y.re < 2.99999999999999989e-41Initial program 67.7%
Taylor expanded in y.re around 0 69.0%
associate-*r/69.0%
neg-mul-169.0%
Simplified69.0%
Final simplification66.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -2.8e+196) (/ 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.8e+196) {
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.8d+196)) 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.8e+196) {
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.8e+196: 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.8e+196) 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.8e+196) 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[LessEqual[y$46$im, -2.8e+196], 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.8 \cdot 10^{+196}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.8000000000000002e196Initial program 30.0%
frac-2neg30.0%
div-inv30.0%
Applied egg-rr30.0%
*-commutative30.0%
neg-mul-130.0%
associate-/r*30.0%
metadata-eval30.0%
Simplified30.0%
associate-*r/30.0%
unpow230.0%
associate-/r*63.5%
fma-neg63.5%
distribute-rgt-neg-in63.5%
hypot-udef30.0%
+-commutative30.0%
hypot-def63.5%
hypot-udef30.0%
+-commutative30.0%
hypot-def63.5%
Applied egg-rr63.5%
Taylor expanded in y.im around -inf 94.4%
*-commutative94.4%
associate-*r/94.4%
mul-1-neg94.4%
*-commutative94.4%
distribute-rgt-neg-out94.4%
Simplified94.4%
Taylor expanded in y.re around 0 29.8%
if -2.8000000000000002e196 < y.im Initial program 62.4%
Taylor expanded in y.re around inf 46.2%
Final simplification45.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.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_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_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_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_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_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 60.4%
frac-2neg60.4%
div-inv60.3%
Applied egg-rr60.3%
*-commutative60.3%
neg-mul-160.3%
associate-/r*60.3%
metadata-eval60.3%
Simplified60.3%
associate-*r/60.4%
unpow260.4%
associate-/r*77.5%
fma-neg77.5%
distribute-rgt-neg-in77.5%
hypot-udef60.5%
+-commutative60.5%
hypot-def77.5%
hypot-udef60.5%
+-commutative60.5%
hypot-def77.5%
Applied egg-rr77.5%
Taylor expanded in y.im around -inf 24.0%
*-commutative24.0%
associate-*r/24.0%
mul-1-neg24.0%
*-commutative24.0%
distribute-rgt-neg-out24.0%
Simplified24.0%
Taylor expanded in y.re around -inf 7.7%
Final simplification7.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 60.4%
Taylor expanded in y.re around inf 43.6%
Final simplification43.6%
herbie shell --seed 2023305
(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))))