
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * 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
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
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 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\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
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * 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
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
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 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re)))))
(if (<= x.im -1020000000.0)
(*
(exp (- (* (atan2 x.im x.re) (- y.im)) (* (log (/ -1.0 x.im)) y.re)))
(cos t_0))
(*
(exp (- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))
(- 1.0 (* (atan2 x.im x.re) (* y.re (sin t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (x_46_im <= -1020000000.0) {
tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (log((-1.0 / x_46_im)) * y_46_re))) * cos(t_0);
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))) * (1.0 - (atan2(x_46_im, x_46_re) * (y_46_re * sin(t_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 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (x_46_im <= -1020000000.0) {
tmp = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (Math.log((-1.0 / x_46_im)) * y_46_re))) * Math.cos(t_0);
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * (1.0 - (Math.atan2(x_46_im, x_46_re) * (y_46_re * Math.sin(t_0))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if x_46_im <= -1020000000.0: tmp = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (math.log((-1.0 / x_46_im)) * y_46_re))) * math.cos(t_0) else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * (1.0 - (math.atan2(x_46_im, x_46_re) * (y_46_re * math.sin(t_0)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -1020000000.0) tmp = Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(log(Float64(-1.0 / x_46_im)) * y_46_re))) * cos(t_0)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * Float64(1.0 - Float64(atan(x_46_im, x_46_re) * Float64(y_46_re * sin(t_0))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (x_46_im <= -1020000000.0) tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (log((-1.0 / x_46_im)) * y_46_re))) * cos(t_0); else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))) * (1.0 - (atan2(x_46_im, x_46_re) * (y_46_re * sin(t_0)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1020000000.0], N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;x.im \leq -1020000000:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - \log \left(\frac{-1}{x.im}\right) \cdot y.re} \cdot \cos t_0\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot \sin t_0\right)\right)\\
\end{array}
\end{array}
if x.im < -1.02e9Initial program 40.8%
Simplified81.7%
Taylor expanded in x.im around -inf 81.0%
mul-1-neg81.0%
*-commutative81.0%
distribute-rgt-neg-in81.0%
Simplified81.0%
Taylor expanded in y.re around 0 41.5%
+-commutative41.5%
unpow241.5%
unpow241.5%
hypot-def89.4%
hypot-def41.5%
unpow241.5%
unpow241.5%
+-commutative41.5%
unpow241.5%
unpow241.5%
hypot-def89.4%
Simplified89.4%
if -1.02e9 < x.im Initial program 40.7%
Simplified78.6%
log1p-expm1-u74.9%
*-commutative74.9%
Applied egg-rr74.9%
Taylor expanded in y.re around 0 40.2%
mul-1-neg40.2%
unsub-neg40.2%
Simplified77.1%
Taylor expanded in y.im around 0 79.0%
log1p-expm1-u82.7%
*-commutative82.7%
Applied egg-rr82.7%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (/ -1.0 x.im)) y.re))
(t_1 (cos (* y.im (log (hypot x.im x.re)))))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3 (* (exp (- (* (atan2 x.im x.re) (- y.im)) t_0)) t_1)))
(if (<= x.im -2.6e+26)
t_3
(if (<= x.im -2.1e-153)
(*
t_1
(exp (- (- (/ (* y.re (* x.re (* x.re 0.5))) (* x.im x.im)) t_0) t_2)))
(if (<= x.im -1.3e-295)
t_3
(if (<= x.im 6e+72)
(exp (- (* y.re (log (sqrt (+ (* x.im x.im) (* x.re x.re))))) t_2))
(*
(cos (+ (* y.im (log x.im)) (* y.re (atan2 x.im x.re))))
(exp (- (* y.re (log x.im)) t_2)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_im)) * y_46_re;
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * t_1;
double tmp;
if (x_46_im <= -2.6e+26) {
tmp = t_3;
} else if (x_46_im <= -2.1e-153) {
tmp = t_1 * exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_2));
} else if (x_46_im <= -1.3e-295) {
tmp = t_3;
} else if (x_46_im <= 6e+72) {
tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_2));
} else {
tmp = cos(((y_46_im * log(x_46_im)) + (y_46_re * atan2(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_im)) - t_2));
}
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 = Math.log((-1.0 / x_46_im)) * y_46_re;
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * t_1;
double tmp;
if (x_46_im <= -2.6e+26) {
tmp = t_3;
} else if (x_46_im <= -2.1e-153) {
tmp = t_1 * Math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_2));
} else if (x_46_im <= -1.3e-295) {
tmp = t_3;
} else if (x_46_im <= 6e+72) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_2));
} else {
tmp = Math.cos(((y_46_im * Math.log(x_46_im)) + (y_46_re * Math.atan2(x_46_im, x_46_re)))) * Math.exp(((y_46_re * Math.log(x_46_im)) - t_2));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_im)) * y_46_re t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im t_3 = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * t_1 tmp = 0 if x_46_im <= -2.6e+26: tmp = t_3 elif x_46_im <= -2.1e-153: tmp = t_1 * math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_2)) elif x_46_im <= -1.3e-295: tmp = t_3 elif x_46_im <= 6e+72: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_2)) else: tmp = math.cos(((y_46_im * math.log(x_46_im)) + (y_46_re * math.atan2(x_46_im, x_46_re)))) * math.exp(((y_46_re * math.log(x_46_im)) - t_2)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(log(Float64(-1.0 / x_46_im)) * y_46_re) t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - t_0)) * t_1) tmp = 0.0 if (x_46_im <= -2.6e+26) tmp = t_3; elseif (x_46_im <= -2.1e-153) tmp = Float64(t_1 * exp(Float64(Float64(Float64(Float64(y_46_re * Float64(x_46_re * Float64(x_46_re * 0.5))) / Float64(x_46_im * x_46_im)) - t_0) - t_2))); elseif (x_46_im <= -1.3e-295) tmp = t_3; elseif (x_46_im <= 6e+72) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re))))) - t_2)); else tmp = Float64(cos(Float64(Float64(y_46_im * log(x_46_im)) + Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_2))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)) * y_46_re; t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_2 = atan2(x_46_im, x_46_re) * y_46_im; t_3 = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * t_1; tmp = 0.0; if (x_46_im <= -2.6e+26) tmp = t_3; elseif (x_46_im <= -2.1e-153) tmp = t_1 * exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_2)); elseif (x_46_im <= -1.3e-295) tmp = t_3; elseif (x_46_im <= 6e+72) tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_2)); else tmp = cos(((y_46_im * log(x_46_im)) + (y_46_re * atan2(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_im)) - t_2)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[x$46$im, -2.6e+26], t$95$3, If[LessEqual[x$46$im, -2.1e-153], N[(t$95$1 * N[Exp[N[(N[(N[(N[(y$46$re * N[(x$46$re * N[(x$46$re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -1.3e-295], t$95$3, If[LessEqual[x$46$im, 6e+72], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right) \cdot y.re\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - t_0} \cdot t_1\\
\mathbf{if}\;x.im \leq -2.6 \cdot 10^{+26}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq -2.1 \cdot 10^{-153}:\\
\;\;\;\;t_1 \cdot e^{\left(\frac{y.re \cdot \left(x.re \cdot \left(x.re \cdot 0.5\right)\right)}{x.im \cdot x.im} - t_0\right) - t_2}\\
\mathbf{elif}\;x.im \leq -1.3 \cdot 10^{-295}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.im \leq 6 \cdot 10^{+72}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - t_2}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - t_2}\\
\end{array}
\end{array}
if x.im < -2.60000000000000002e26 or -2.10000000000000004e-153 < x.im < -1.29999999999999993e-295Initial program 34.7%
Simplified82.1%
Taylor expanded in x.im around -inf 80.3%
mul-1-neg80.3%
*-commutative80.3%
distribute-rgt-neg-in80.3%
Simplified80.3%
Taylor expanded in y.re around 0 35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def87.7%
hypot-def35.1%
unpow235.1%
unpow235.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def87.7%
Simplified87.7%
if -2.60000000000000002e26 < x.im < -2.10000000000000004e-153Initial program 61.8%
Simplified79.5%
Taylor expanded in x.im around -inf 73.9%
+-commutative73.9%
mul-1-neg73.9%
unsub-neg73.9%
associate-*r/73.9%
unpow273.9%
associate-*r*73.9%
unpow273.9%
associate-*r*73.9%
Simplified73.9%
Taylor expanded in y.re around 0 61.8%
+-commutative47.3%
unpow247.3%
unpow247.3%
hypot-def59.2%
hypot-def47.3%
unpow247.3%
unpow247.3%
+-commutative47.3%
unpow247.3%
unpow247.3%
hypot-def59.2%
Simplified76.8%
if -1.29999999999999993e-295 < x.im < 6.00000000000000006e72Initial program 53.2%
Taylor expanded in y.im around 0 71.0%
Taylor expanded in y.re around 0 75.3%
if 6.00000000000000006e72 < x.im Initial program 22.8%
Taylor expanded in x.re around 0 67.3%
Taylor expanded in x.re around 0 86.0%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (/ -1.0 x.im)) y.re))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2
(*
(exp (- (* (atan2 x.im x.re) (- y.im)) t_0))
(cos (* y.im (log (hypot x.im x.re))))))
(t_3 (* y.re (atan2 x.im x.re))))
(if (<= x.im -2.8e-47)
t_2
(if (<= x.im -4e-159)
(*
(exp (- (- (/ (* y.re (* x.re (* x.re 0.5))) (* x.im x.im)) t_0) t_1))
(cos t_3))
(if (<= x.im -4.6e-302)
t_2
(if (<= x.im 4e+69)
(exp (- (* y.re (log (sqrt (+ (* x.im x.im) (* x.re x.re))))) t_1))
(*
(cos (+ (* y.im (log x.im)) t_3))
(exp (- (* y.re (log x.im)) t_1)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_im)) * y_46_re;
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_3 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -2.8e-47) {
tmp = t_2;
} else if (x_46_im <= -4e-159) {
tmp = exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * cos(t_3);
} else if (x_46_im <= -4.6e-302) {
tmp = t_2;
} else if (x_46_im <= 4e+69) {
tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1));
} else {
tmp = cos(((y_46_im * log(x_46_im)) + t_3)) * exp(((y_46_re * log(x_46_im)) - t_1));
}
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 = Math.log((-1.0 / x_46_im)) * y_46_re;
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_3 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -2.8e-47) {
tmp = t_2;
} else if (x_46_im <= -4e-159) {
tmp = Math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * Math.cos(t_3);
} else if (x_46_im <= -4.6e-302) {
tmp = t_2;
} else if (x_46_im <= 4e+69) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1));
} else {
tmp = Math.cos(((y_46_im * Math.log(x_46_im)) + t_3)) * Math.exp(((y_46_re * Math.log(x_46_im)) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_im)) * y_46_re t_1 = math.atan2(x_46_im, x_46_re) * y_46_im t_2 = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_3 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -2.8e-47: tmp = t_2 elif x_46_im <= -4e-159: tmp = math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * math.cos(t_3) elif x_46_im <= -4.6e-302: tmp = t_2 elif x_46_im <= 4e+69: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1)) else: tmp = math.cos(((y_46_im * math.log(x_46_im)) + t_3)) * math.exp(((y_46_re * math.log(x_46_im)) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(log(Float64(-1.0 / x_46_im)) * y_46_re) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - t_0)) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) t_3 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -2.8e-47) tmp = t_2; elseif (x_46_im <= -4e-159) tmp = Float64(exp(Float64(Float64(Float64(Float64(y_46_re * Float64(x_46_re * Float64(x_46_re * 0.5))) / Float64(x_46_im * x_46_im)) - t_0) - t_1)) * cos(t_3)); elseif (x_46_im <= -4.6e-302) tmp = t_2; elseif (x_46_im <= 4e+69) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re))))) - t_1)); else tmp = Float64(cos(Float64(Float64(y_46_im * log(x_46_im)) + t_3)) * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)) * y_46_re; t_1 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_3 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -2.8e-47) tmp = t_2; elseif (x_46_im <= -4e-159) tmp = exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * cos(t_3); elseif (x_46_im <= -4.6e-302) tmp = t_2; elseif (x_46_im <= 4e+69) tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1)); else tmp = cos(((y_46_im * log(x_46_im)) + t_3)) * exp(((y_46_re * log(x_46_im)) - 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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.8e-47], t$95$2, If[LessEqual[x$46$im, -4e-159], N[(N[Exp[N[(N[(N[(N[(y$46$re * N[(x$46$re * N[(x$46$re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -4.6e-302], t$95$2, If[LessEqual[x$46$im, 4e+69], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right) \cdot y.re\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - t_0} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -2.8 \cdot 10^{-47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq -4 \cdot 10^{-159}:\\
\;\;\;\;e^{\left(\frac{y.re \cdot \left(x.re \cdot \left(x.re \cdot 0.5\right)\right)}{x.im \cdot x.im} - t_0\right) - t_1} \cdot \cos t_3\\
\mathbf{elif}\;x.im \leq -4.6 \cdot 10^{-302}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq 4 \cdot 10^{+69}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - t_1}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im + t_3\right) \cdot e^{y.re \cdot \log x.im - t_1}\\
\end{array}
\end{array}
if x.im < -2.79999999999999993e-47 or -3.99999999999999995e-159 < x.im < -4.60000000000000004e-302Initial program 39.4%
Simplified81.7%
Taylor expanded in x.im around -inf 81.1%
mul-1-neg81.1%
*-commutative81.1%
distribute-rgt-neg-in81.1%
Simplified81.1%
Taylor expanded in y.re around 0 39.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-def88.8%
hypot-def39.7%
unpow239.7%
unpow239.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-def88.8%
Simplified88.8%
if -2.79999999999999993e-47 < x.im < -3.99999999999999995e-159Initial program 52.0%
Simplified80.1%
Taylor expanded in x.im around -inf 68.5%
+-commutative68.5%
mul-1-neg68.5%
unsub-neg68.5%
associate-*r/68.5%
unpow268.5%
associate-*r*68.5%
unpow268.5%
associate-*r*68.5%
Simplified68.5%
Taylor expanded in y.im around 0 64.6%
if -4.60000000000000004e-302 < x.im < 4.0000000000000003e69Initial program 53.2%
Taylor expanded in y.im around 0 71.0%
Taylor expanded in y.re around 0 75.3%
if 4.0000000000000003e69 < x.im Initial program 22.8%
Taylor expanded in x.re around 0 67.3%
Taylor expanded in x.re around 0 86.0%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (/ -1.0 x.im)) y.re))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2
(*
(exp (- (* (atan2 x.im x.re) (- y.im)) t_0))
(cos (* y.im (log (hypot x.im x.re)))))))
(if (<= x.im -6.8e-37)
t_2
(if (<= x.im -2.7e-157)
(*
(exp (- (- (/ (* y.re (* x.re (* x.re 0.5))) (* x.im x.im)) t_0) t_1))
(cos (* y.re (atan2 x.im x.re))))
(if (<= x.im -6e-309)
t_2
(if (<= x.im 0.00125)
(exp (- (* y.re (log (sqrt (+ (* x.im x.im) (* x.re x.re))))) t_1))
(exp (- (* y.re (log x.im)) t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_im)) * y_46_re;
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_im <= -6.8e-37) {
tmp = t_2;
} else if (x_46_im <= -2.7e-157) {
tmp = exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (x_46_im <= -6e-309) {
tmp = t_2;
} else if (x_46_im <= 0.00125) {
tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_1));
}
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 = Math.log((-1.0 / x_46_im)) * y_46_re;
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_im <= -6.8e-37) {
tmp = t_2;
} else if (x_46_im <= -2.7e-157) {
tmp = Math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (x_46_im <= -6e-309) {
tmp = t_2;
} else if (x_46_im <= 0.00125) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_im)) * y_46_re t_1 = math.atan2(x_46_im, x_46_re) * y_46_im t_2 = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if x_46_im <= -6.8e-37: tmp = t_2 elif x_46_im <= -2.7e-157: tmp = math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif x_46_im <= -6e-309: tmp = t_2 elif x_46_im <= 0.00125: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(log(Float64(-1.0 / x_46_im)) * y_46_re) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - t_0)) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (x_46_im <= -6.8e-37) tmp = t_2; elseif (x_46_im <= -2.7e-157) tmp = Float64(exp(Float64(Float64(Float64(Float64(y_46_re * Float64(x_46_re * Float64(x_46_re * 0.5))) / Float64(x_46_im * x_46_im)) - t_0) - t_1)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (x_46_im <= -6e-309) tmp = t_2; elseif (x_46_im <= 0.00125) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re))))) - t_1)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)) * y_46_re; t_1 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - t_0)) * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (x_46_im <= -6.8e-37) tmp = t_2; elseif (x_46_im <= -2.7e-157) tmp = exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - t_0) - t_1)) * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (x_46_im <= -6e-309) tmp = t_2; elseif (x_46_im <= 0.00125) tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_1)); else tmp = exp(((y_46_re * log(x_46_im)) - 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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -6.8e-37], t$95$2, If[LessEqual[x$46$im, -2.7e-157], N[(N[Exp[N[(N[(N[(N[(y$46$re * N[(x$46$re * N[(x$46$re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -6e-309], t$95$2, If[LessEqual[x$46$im, 0.00125], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right) \cdot y.re\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - t_0} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;x.im \leq -6.8 \cdot 10^{-37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq -2.7 \cdot 10^{-157}:\\
\;\;\;\;e^{\left(\frac{y.re \cdot \left(x.re \cdot \left(x.re \cdot 0.5\right)\right)}{x.im \cdot x.im} - t_0\right) - t_1} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;x.im \leq -6 \cdot 10^{-309}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq 0.00125:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - t_1}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_1}\\
\end{array}
\end{array}
if x.im < -6.80000000000000037e-37 or -2.7e-157 < x.im < -6.000000000000001e-309Initial program 39.4%
Simplified81.7%
Taylor expanded in x.im around -inf 81.1%
mul-1-neg81.1%
*-commutative81.1%
distribute-rgt-neg-in81.1%
Simplified81.1%
Taylor expanded in y.re around 0 39.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-def88.8%
hypot-def39.7%
unpow239.7%
unpow239.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-def88.8%
Simplified88.8%
if -6.80000000000000037e-37 < x.im < -2.7e-157Initial program 52.0%
Simplified80.1%
Taylor expanded in x.im around -inf 68.5%
+-commutative68.5%
mul-1-neg68.5%
unsub-neg68.5%
associate-*r/68.5%
unpow268.5%
associate-*r*68.5%
unpow268.5%
associate-*r*68.5%
Simplified68.5%
Taylor expanded in y.im around 0 64.6%
if -6.000000000000001e-309 < x.im < 0.00125000000000000003Initial program 51.2%
Taylor expanded in y.im around 0 69.0%
Taylor expanded in y.re around 0 70.7%
if 0.00125000000000000003 < x.im Initial program 29.4%
Taylor expanded in y.im around 0 63.8%
Taylor expanded in y.re around 0 68.2%
Taylor expanded in x.re around 0 86.8%
*-commutative86.8%
Simplified86.8%
Final simplification81.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* y.re (log (- x.im))) t_0))))
(if (<= x.im -7e+56)
t_1
(if (<= x.im -1.06e-157)
(*
(exp
(-
(-
(/ (* y.re (* x.re (* x.re 0.5))) (* x.im x.im))
(* (log (/ -1.0 x.im)) y.re))
t_0))
(cos (* y.re (atan2 x.im x.re))))
(if (<= x.im -2e-308)
t_1
(if (<= x.im 0.002)
(exp (- (* y.re (log (sqrt (+ (* x.im x.im) (* x.re x.re))))) t_0))
(exp (- (* y.re (log x.im)) t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((y_46_re * log(-x_46_im)) - t_0));
double tmp;
if (x_46_im <= -7e+56) {
tmp = t_1;
} else if (x_46_im <= -1.06e-157) {
tmp = exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - (log((-1.0 / x_46_im)) * y_46_re)) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (x_46_im <= -2e-308) {
tmp = t_1;
} else if (x_46_im <= 0.002) {
tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = exp(((y_46re * log(-x_46im)) - t_0))
if (x_46im <= (-7d+56)) then
tmp = t_1
else if (x_46im <= (-1.06d-157)) then
tmp = exp(((((y_46re * (x_46re * (x_46re * 0.5d0))) / (x_46im * x_46im)) - (log(((-1.0d0) / x_46im)) * y_46re)) - t_0)) * cos((y_46re * atan2(x_46im, x_46re)))
else if (x_46im <= (-2d-308)) then
tmp = t_1
else if (x_46im <= 0.002d0) then
tmp = exp(((y_46re * log(sqrt(((x_46im * x_46im) + (x_46re * x_46re))))) - t_0))
else
tmp = exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
double tmp;
if (x_46_im <= -7e+56) {
tmp = t_1;
} else if (x_46_im <= -1.06e-157) {
tmp = Math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - (Math.log((-1.0 / x_46_im)) * y_46_re)) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (x_46_im <= -2e-308) {
tmp = t_1;
} else if (x_46_im <= 0.002) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) tmp = 0 if x_46_im <= -7e+56: tmp = t_1 elif x_46_im <= -1.06e-157: tmp = math.exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - (math.log((-1.0 / x_46_im)) * y_46_re)) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif x_46_im <= -2e-308: tmp = t_1 elif x_46_im <= 0.002: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)) tmp = 0.0 if (x_46_im <= -7e+56) tmp = t_1; elseif (x_46_im <= -1.06e-157) tmp = Float64(exp(Float64(Float64(Float64(Float64(y_46_re * Float64(x_46_re * Float64(x_46_re * 0.5))) / Float64(x_46_im * x_46_im)) - Float64(log(Float64(-1.0 / x_46_im)) * y_46_re)) - t_0)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (x_46_im <= -2e-308) tmp = t_1; elseif (x_46_im <= 0.002) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re))))) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = exp(((y_46_re * log(-x_46_im)) - t_0)); tmp = 0.0; if (x_46_im <= -7e+56) tmp = t_1; elseif (x_46_im <= -1.06e-157) tmp = exp(((((y_46_re * (x_46_re * (x_46_re * 0.5))) / (x_46_im * x_46_im)) - (log((-1.0 / x_46_im)) * y_46_re)) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (x_46_im <= -2e-308) tmp = t_1; elseif (x_46_im <= 0.002) tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0)); else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -7e+56], t$95$1, If[LessEqual[x$46$im, -1.06e-157], N[(N[Exp[N[(N[(N[(N[(y$46$re * N[(x$46$re * N[(x$46$re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] - N[(N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -2e-308], t$95$1, If[LessEqual[x$46$im, 0.002], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{if}\;x.im \leq -7 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -1.06 \cdot 10^{-157}:\\
\;\;\;\;e^{\left(\frac{y.re \cdot \left(x.re \cdot \left(x.re \cdot 0.5\right)\right)}{x.im \cdot x.im} - \log \left(\frac{-1}{x.im}\right) \cdot y.re\right) - t_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;x.im \leq -2 \cdot 10^{-308}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 0.002:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -6.99999999999999999e56 or -1.06e-157 < x.im < -1.9999999999999998e-308Initial program 31.0%
Taylor expanded in y.im around 0 48.4%
Taylor expanded in y.re around 0 56.8%
Taylor expanded in x.im around -inf 82.5%
mul-1-neg82.5%
Simplified82.5%
if -6.99999999999999999e56 < x.im < -1.06e-157Initial program 62.2%
Simplified82.3%
Taylor expanded in x.im around -inf 73.7%
+-commutative73.7%
mul-1-neg73.7%
unsub-neg73.7%
associate-*r/73.7%
unpow273.7%
associate-*r*73.7%
unpow273.7%
associate-*r*73.7%
Simplified73.7%
Taylor expanded in y.im around 0 73.8%
if -1.9999999999999998e-308 < x.im < 2e-3Initial program 51.2%
Taylor expanded in y.im around 0 69.0%
Taylor expanded in y.re around 0 70.7%
if 2e-3 < x.im Initial program 29.4%
Taylor expanded in y.im around 0 63.8%
Taylor expanded in y.re around 0 68.2%
Taylor expanded in x.re around 0 86.8%
*-commutative86.8%
Simplified86.8%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -3.2e-300)
(exp (- (* y.re (log (- x.im))) t_0))
(if (<= x.im 0.00017)
(exp (- (* y.re (log (sqrt (+ (* x.im x.im) (* x.re x.re))))) t_0))
(exp (- (* y.re (log x.im)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -3.2e-300) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 0.00017) {
tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46im <= (-3.2d-300)) then
tmp = exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 0.00017d0) then
tmp = exp(((y_46re * log(sqrt(((x_46im * x_46im) + (x_46re * x_46re))))) - t_0))
else
tmp = exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -3.2e-300) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 0.00017) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -3.2e-300: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 0.00017: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -3.2e-300) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); elseif (x_46_im <= 0.00017) tmp = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re))))) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -3.2e-300) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 0.00017) tmp = exp(((y_46_re * log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re))))) - t_0)); else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -3.2e-300], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 0.00017], N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -3.2 \cdot 10^{-300}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 0.00017:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -3.20000000000000021e-300Initial program 41.9%
Taylor expanded in y.im around 0 57.3%
Taylor expanded in y.re around 0 60.4%
Taylor expanded in x.im around -inf 75.6%
mul-1-neg75.6%
Simplified75.6%
if -3.20000000000000021e-300 < x.im < 1.7e-4Initial program 51.2%
Taylor expanded in y.im around 0 69.0%
Taylor expanded in y.re around 0 70.7%
if 1.7e-4 < x.im Initial program 29.4%
Taylor expanded in y.im around 0 63.8%
Taylor expanded in y.re around 0 68.2%
Taylor expanded in x.re around 0 86.8%
*-commutative86.8%
Simplified86.8%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -5e-310)
(exp (- (* y.re (log (- x.im))) t_0))
(exp (- (* y.re (log x.im)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -5e-310) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46im <= (-5d-310)) then
tmp = exp(((y_46re * log(-x_46im)) - t_0))
else
tmp = exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -5e-310) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -5e-310: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -5e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -5e-310) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -5e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -4.999999999999985e-310Initial program 41.9%
Taylor expanded in y.im around 0 57.3%
Taylor expanded in y.re around 0 60.4%
Taylor expanded in x.im around -inf 75.6%
mul-1-neg75.6%
Simplified75.6%
if -4.999999999999985e-310 < x.im Initial program 39.5%
Taylor expanded in y.im around 0 66.2%
Taylor expanded in y.re around 0 69.3%
Taylor expanded in x.re around 0 74.1%
*-commutative74.1%
Simplified74.1%
Final simplification74.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -9e-309)
(exp (- (* y.re (log x.im)) t_0))
(exp (- (* y.re (log x.re)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -9e-309) {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46re <= (-9d-309)) then
tmp = exp(((y_46re * log(x_46im)) - t_0))
else
tmp = exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -9e-309) {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_re <= -9e-309: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_re <= -9e-309) tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_re <= -9e-309) tmp = exp(((y_46_re * log(x_46_im)) - t_0)); else tmp = exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$re, -9e-309], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -9 \cdot 10^{-309}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -9.0000000000000021e-309Initial program 46.1%
Taylor expanded in y.im around 0 63.7%
Taylor expanded in y.re around 0 65.1%
Taylor expanded in x.re around 0 40.5%
*-commutative40.5%
Simplified40.5%
if -9.0000000000000021e-309 < x.re Initial program 34.1%
Taylor expanded in y.im around 0 59.2%
Taylor expanded in y.re around 0 64.4%
Taylor expanded in x.im around 0 67.1%
*-commutative67.1%
Simplified67.1%
Final simplification52.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * 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 = exp(((y_46re * log(x_46im)) - (atan2(x_46im, x_46re) * 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 Math.exp(((y_46_re * Math.log(x_46_im)) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp(((y_46_re * math.log(x_46_im)) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(atan(x_46_im, x_46_re) * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 40.7%
Taylor expanded in y.im around 0 61.7%
Taylor expanded in y.re around 0 64.8%
Taylor expanded in x.re around 0 36.8%
*-commutative36.8%
Simplified36.8%
Final simplification36.8%
herbie shell --seed 2023268
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))