
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 15 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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 (log (hypot x.re x.im))))
(if (<= y.im -1.65e+66)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_im <= -1.65e+66) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_im <= -1.65e+66) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.65e+66], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -1.65 \cdot 10^{+66}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -1.6500000000000001e66Initial program 30.4%
Taylor expanded in y.im around 0 67.6%
Taylor expanded in y.re around 0 87.0%
*-commutative87.0%
distribute-rgt-neg-in87.0%
exp-prod87.1%
Simplified87.1%
if -1.6500000000000001e66 < y.im Initial program 41.5%
cancel-sign-sub-inv41.5%
fma-def41.5%
hypot-def41.5%
distribute-lft-neg-in41.5%
distribute-rgt-neg-out41.5%
fma-def41.5%
hypot-def82.1%
*-commutative82.1%
Simplified82.1%
Final simplification83.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re)))) (t_1 (log (hypot x.re x.im))))
(if (<= x.im 1.38e-12)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_1 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im)))
(+ (* y.re (* (atan2 x.im x.re) (cos t_0))) (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 t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (x_46_im <= 1.38e-12) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))) * ((y_46_re * (atan2(x_46_im, x_46_re) * cos(t_0))) + 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))) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (x_46_im <= 1.38e-12) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * Float64(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * cos(t_0))) + sin(t_0))); end return 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]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 1.38e-12], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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] * N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sin[t$95$0], $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)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;x.im \leq 1.38 \cdot 10^{-12}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \cos t_0\right) + \sin t_0\right)\\
\end{array}
\end{array}
if x.im < 1.37999999999999998e-12Initial program 43.5%
cancel-sign-sub-inv43.5%
fma-def43.5%
hypot-def43.5%
distribute-lft-neg-in43.5%
distribute-rgt-neg-out43.5%
fma-def43.5%
hypot-def84.2%
*-commutative84.2%
Simplified84.2%
if 1.37999999999999998e-12 < x.im Initial program 29.7%
Taylor expanded in y.re around 0 35.1%
+-commutative35.1%
*-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def35.1%
unpow235.1%
unpow235.1%
hypot-def62.6%
Simplified62.6%
Taylor expanded in x.re around 0 78.6%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -1.2e+37)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 5.5e+19)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im))))
(* (fabs (sin t_0)) (exp (* (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) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.2e+37) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 5.5e+19) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = fabs(sin(t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1.2e+37) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 5.5e+19) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(abs(sin(t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.2e+37], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.5e+19], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Sin[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+37}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 5.5 \cdot 10^{+19}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\left|\sin t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -1.2e37Initial program 30.9%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
exp-prod82.0%
Simplified82.0%
if -1.2e37 < y.im < 5.5e19Initial program 44.3%
exp-diff42.2%
exp-to-pow42.2%
hypot-def42.2%
*-commutative42.2%
exp-prod42.2%
fma-def42.2%
hypot-def82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.im around 0 86.5%
if 5.5e19 < y.im Initial program 36.0%
Taylor expanded in y.im around 0 56.4%
add-sqr-sqrt27.6%
sqrt-unprod49.5%
pow249.5%
Applied egg-rr49.5%
unpow249.5%
rem-sqrt-square56.4%
Simplified56.4%
Taylor expanded in y.re around 0 71.6%
*-commutative71.6%
distribute-lft-neg-in71.6%
Simplified71.6%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -6.5e+19)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 205000000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(* (fabs (sin t_0)) (exp (* (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) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -6.5e+19) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 205000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = fabs(sin(t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -6.5e+19) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 205000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(abs(sin(t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.5e+19], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 205000000000.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Sin[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+19}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 205000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\left|\sin t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -6.5e19Initial program 31.0%
Taylor expanded in y.im around 0 67.4%
Taylor expanded in y.re around 0 77.8%
*-commutative77.8%
distribute-rgt-neg-in77.8%
exp-prod79.5%
Simplified79.5%
if -6.5e19 < y.im < 2.05e11Initial program 44.0%
exp-diff42.6%
exp-to-pow42.6%
hypot-def42.6%
*-commutative42.6%
exp-prod42.6%
fma-def42.6%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in y.im around 0 67.5%
unpow267.5%
unpow267.5%
hypot-def85.9%
Simplified85.9%
if 2.05e11 < y.im Initial program 37.5%
Taylor expanded in y.im around 0 56.9%
add-sqr-sqrt29.4%
sqrt-unprod51.9%
pow251.9%
Applied egg-rr51.9%
unpow251.9%
rem-sqrt-square58.6%
Simplified58.6%
Taylor expanded in y.re around 0 71.4%
*-commutative71.4%
distribute-lft-neg-in71.4%
Simplified71.4%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1
(*
(sin (* y.im (log (hypot x.im x.re))))
(/
(pow (hypot x.re x.im) y.re)
(+ 1.0 (* (atan2 x.im x.re) y.im))))))
(if (<= y.im -8.5e+24)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -4e-247)
t_1
(if (<= y.im 1.4e-150)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.im 170000000000.0)
t_1
(* (fabs t_0) (exp (* (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) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= -8.5e+24) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -4e-247) {
tmp = t_1;
} else if (y_46_im <= 1.4e-150) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 170000000000.0) {
tmp = t_1;
} else {
tmp = fabs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= -8.5e+24) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -4e-247) {
tmp = t_1;
} else if (y_46_im <= 1.4e-150) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 170000000000.0) {
tmp = t_1;
} else {
tmp = Math.abs(t_0) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if y_46_im <= -8.5e+24: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))) elif y_46_im <= -4e-247: tmp = t_1 elif y_46_im <= 1.4e-150: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_im <= 170000000000.0: tmp = t_1 else: tmp = math.fabs(t_0) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))) tmp = 0.0 if (y_46_im <= -8.5e+24) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= -4e-247) tmp = t_1; elseif (y_46_im <= 1.4e-150) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 170000000000.0) tmp = t_1; else tmp = Float64(abs(t_0) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (y_46_im <= -8.5e+24) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= -4e-247) tmp = t_1; elseif (y_46_im <= 1.4e-150) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 170000000000.0) tmp = t_1; else tmp = abs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e+24], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -4e-247], t$95$1, If[LessEqual[y$46$im, 1.4e-150], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 170000000000.0], t$95$1, N[(N[Abs[t$95$0], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -8.5 \cdot 10^{+24}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq -4 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{-150}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 170000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left|t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -8.49999999999999959e24Initial program 31.0%
Taylor expanded in y.im around 0 67.4%
Taylor expanded in y.re around 0 77.8%
*-commutative77.8%
distribute-rgt-neg-in77.8%
exp-prod79.5%
Simplified79.5%
if -8.49999999999999959e24 < y.im < -4.0000000000000001e-247 or 1.39999999999999998e-150 < y.im < 1.7e11Initial program 44.6%
exp-diff42.5%
exp-to-pow42.5%
hypot-def42.5%
*-commutative42.5%
exp-prod42.5%
fma-def42.5%
hypot-def79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.im around 0 82.9%
Taylor expanded in y.re around 0 45.4%
unpow245.4%
unpow245.4%
hypot-def79.3%
Simplified79.3%
if -4.0000000000000001e-247 < y.im < 1.39999999999999998e-150Initial program 42.8%
Taylor expanded in y.im around 0 65.0%
Taylor expanded in y.im around 0 65.0%
unpow265.0%
unpow265.0%
hypot-def83.4%
Simplified83.4%
if 1.7e11 < y.im Initial program 37.5%
Taylor expanded in y.im around 0 56.9%
add-sqr-sqrt29.4%
sqrt-unprod51.9%
pow251.9%
Applied egg-rr51.9%
unpow251.9%
rem-sqrt-square58.6%
Simplified58.6%
Taylor expanded in y.re around 0 71.4%
*-commutative71.4%
distribute-lft-neg-in71.4%
Simplified71.4%
Final simplification78.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im))))
(t_1 (* t_0 (sin (* (- y.im) (log (/ -1.0 x.re))))))
(t_2 (sin (* y.re (atan2 x.im x.re))))
(t_3 (fabs t_2))
(t_4 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -2.9e+36)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -1.7e-65)
(* t_0 t_2)
(if (<= y.im -1.66e-112)
t_1
(if (<= y.im 5e-115)
(* t_2 t_4)
(if (<= y.im 2.8e-81)
t_1
(if (<= y.im 8.6e+18)
(* t_3 t_4)
(* t_3 (exp (* (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) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im));
double t_1 = t_0 * sin((-y_46_im * log((-1.0 / x_46_re))));
double t_2 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_3 = fabs(t_2);
double t_4 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -2.9e+36) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -1.7e-65) {
tmp = t_0 * t_2;
} else if (y_46_im <= -1.66e-112) {
tmp = t_1;
} else if (y_46_im <= 5e-115) {
tmp = t_2 * t_4;
} else if (y_46_im <= 2.8e-81) {
tmp = t_1;
} else if (y_46_im <= 8.6e+18) {
tmp = t_3 * t_4;
} else {
tmp = t_3 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im));
double t_1 = t_0 * Math.sin((-y_46_im * Math.log((-1.0 / x_46_re))));
double t_2 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_3 = Math.abs(t_2);
double t_4 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -2.9e+36) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -1.7e-65) {
tmp = t_0 * t_2;
} else if (y_46_im <= -1.66e-112) {
tmp = t_1;
} else if (y_46_im <= 5e-115) {
tmp = t_2 * t_4;
} else if (y_46_im <= 2.8e-81) {
tmp = t_1;
} else if (y_46_im <= 8.6e+18) {
tmp = t_3 * t_4;
} else {
tmp = t_3 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im)) t_1 = t_0 * math.sin((-y_46_im * math.log((-1.0 / x_46_re)))) t_2 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_3 = math.fabs(t_2) t_4 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_im <= -2.9e+36: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))) elif y_46_im <= -1.7e-65: tmp = t_0 * t_2 elif y_46_im <= -1.66e-112: tmp = t_1 elif y_46_im <= 5e-115: tmp = t_2 * t_4 elif y_46_im <= 2.8e-81: tmp = t_1 elif y_46_im <= 8.6e+18: tmp = t_3 * t_4 else: tmp = t_3 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = Float64(t_0 * sin(Float64(Float64(-y_46_im) * log(Float64(-1.0 / x_46_re))))) t_2 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_3 = abs(t_2) t_4 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -2.9e+36) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= -1.7e-65) tmp = Float64(t_0 * t_2); elseif (y_46_im <= -1.66e-112) tmp = t_1; elseif (y_46_im <= 5e-115) tmp = Float64(t_2 * t_4); elseif (y_46_im <= 2.8e-81) tmp = t_1; elseif (y_46_im <= 8.6e+18) tmp = Float64(t_3 * t_4); else tmp = Float64(t_3 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)); t_1 = t_0 * sin((-y_46_im * log((-1.0 / x_46_re)))); t_2 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_3 = abs(t_2); t_4 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_im <= -2.9e+36) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= -1.7e-65) tmp = t_0 * t_2; elseif (y_46_im <= -1.66e-112) tmp = t_1; elseif (y_46_im <= 5e-115) tmp = t_2 * t_4; elseif (y_46_im <= 2.8e-81) tmp = t_1; elseif (y_46_im <= 8.6e+18) tmp = t_3 * t_4; else tmp = t_3 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Sin[N[((-y$46$im) * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -2.9e+36], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.7e-65], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, -1.66e-112], t$95$1, If[LessEqual[y$46$im, 5e-115], N[(t$95$2 * t$95$4), $MachinePrecision], If[LessEqual[y$46$im, 2.8e-81], t$95$1, If[LessEqual[y$46$im, 8.6e+18], N[(t$95$3 * t$95$4), $MachinePrecision], N[(t$95$3 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := t_0 \cdot \sin \left(\left(-y.im\right) \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_3 := \left|t_2\right|\\
t_4 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -2.9 \cdot 10^{+36}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-65}:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{elif}\;y.im \leq -1.66 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{-115}:\\
\;\;\;\;t_2 \cdot t_4\\
\mathbf{elif}\;y.im \leq 2.8 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{+18}:\\
\;\;\;\;t_3 \cdot t_4\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -2.9e36Initial program 30.9%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
exp-prod82.0%
Simplified82.0%
if -2.9e36 < y.im < -1.69999999999999993e-65Initial program 60.8%
exp-diff52.1%
exp-to-pow52.1%
hypot-def52.1%
*-commutative52.1%
exp-prod52.1%
fma-def52.1%
hypot-def78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around 0 87.1%
add-sqr-sqrt87.1%
unpow287.1%
*-commutative87.1%
fma-def87.1%
add-cube-cbrt78.2%
Applied egg-rr78.2%
Taylor expanded in y.im around 0 66.8%
if -1.69999999999999993e-65 < y.im < -1.6600000000000001e-112 or 5.0000000000000003e-115 < y.im < 2.7999999999999999e-81Initial program 47.4%
exp-diff47.4%
exp-to-pow47.4%
hypot-def47.4%
*-commutative47.4%
exp-prod47.4%
fma-def47.5%
hypot-def76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in y.im around 0 76.0%
Taylor expanded in x.re around -inf 66.4%
+-commutative66.4%
mul-1-neg66.4%
unsub-neg66.4%
Simplified66.4%
Taylor expanded in y.re around 0 79.8%
if -1.6600000000000001e-112 < y.im < 5.0000000000000003e-115Initial program 41.3%
Taylor expanded in y.im around 0 57.1%
Taylor expanded in y.im around 0 57.1%
unpow257.1%
unpow257.1%
hypot-def68.9%
Simplified68.9%
if 2.7999999999999999e-81 < y.im < 8.6e18Initial program 34.8%
Taylor expanded in y.im around 0 48.7%
add-sqr-sqrt26.8%
sqrt-unprod61.8%
pow261.8%
Applied egg-rr61.8%
unpow261.8%
rem-sqrt-square62.0%
Simplified62.0%
Taylor expanded in y.im around 0 62.0%
unpow262.0%
unpow262.0%
hypot-def62.3%
Simplified62.3%
if 8.6e18 < y.im Initial program 36.0%
Taylor expanded in y.im around 0 56.4%
add-sqr-sqrt27.6%
sqrt-unprod49.5%
pow249.5%
Applied egg-rr49.5%
unpow249.5%
rem-sqrt-square56.4%
Simplified56.4%
Taylor expanded in y.re around 0 71.6%
*-commutative71.6%
distribute-lft-neg-in71.6%
Simplified71.6%
Final simplification72.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im -9e+35)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 2.25e+20)
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
t_0)
(* (fabs t_0) (exp (* (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) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -9e+35) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 2.25e+20) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else {
tmp = fabs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -9e+35) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 2.25e+20) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else {
tmp = Math.abs(t_0) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -9e+35: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 2.25e+20: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0 else: tmp = math.fabs(t_0) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -9e+35) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 2.25e+20) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); else tmp = Float64(abs(t_0) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -9e+35) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 2.25e+20) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * t_0; else tmp = abs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -9e+35], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.25e+20], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{+35}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 2.25 \cdot 10^{+20}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\left|t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -8.9999999999999993e35Initial program 30.9%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
exp-prod82.0%
Simplified82.0%
if -8.9999999999999993e35 < y.im < 2.25e20Initial program 44.3%
exp-diff42.2%
exp-to-pow42.2%
hypot-def42.2%
*-commutative42.2%
exp-prod42.2%
fma-def42.2%
hypot-def82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.im around 0 86.5%
add-sqr-sqrt86.5%
unpow286.5%
*-commutative86.5%
fma-def86.5%
add-cube-cbrt86.6%
Applied egg-rr86.6%
Taylor expanded in y.im around 0 60.5%
if 2.25e20 < y.im Initial program 36.0%
Taylor expanded in y.im around 0 56.4%
add-sqr-sqrt27.6%
sqrt-unprod49.5%
pow249.5%
Applied egg-rr49.5%
unpow249.5%
rem-sqrt-square56.4%
Simplified56.4%
Taylor expanded in y.re around 0 71.6%
*-commutative71.6%
distribute-lft-neg-in71.6%
Simplified71.6%
Final simplification67.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im -2e+36)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 380000000000.0)
(* t_0 (pow (hypot x.im x.re) y.re))
(* (fabs t_0) (exp (* (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) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -2e+36) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 380000000000.0) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = fabs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -2e+36) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 380000000000.0) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.abs(t_0) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -2e+36: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 380000000000.0: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.fabs(t_0) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -2e+36) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 380000000000.0) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(abs(t_0) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -2e+36) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 380000000000.0) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = abs(t_0) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2e+36], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 380000000000.0], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+36}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 380000000000:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\left|t_0\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.im < -2.00000000000000008e36Initial program 30.9%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
exp-prod82.0%
Simplified82.0%
if -2.00000000000000008e36 < y.im < 3.8e11Initial program 43.8%
Taylor expanded in y.im around 0 51.6%
Taylor expanded in y.im around 0 51.6%
unpow251.6%
unpow251.6%
hypot-def58.2%
Simplified58.2%
if 3.8e11 < y.im Initial program 37.5%
Taylor expanded in y.im around 0 56.9%
add-sqr-sqrt29.4%
sqrt-unprod51.9%
pow251.9%
Applied egg-rr51.9%
unpow251.9%
rem-sqrt-square58.6%
Simplified58.6%
Taylor expanded in y.re around 0 71.4%
*-commutative71.4%
distribute-lft-neg-in71.4%
Simplified71.4%
Final simplification66.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.6e+36) (not (<= y.im 7.8e+21))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot 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 tmp;
if ((y_46_im <= -3.6e+36) || !(y_46_im <= 7.8e+21)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
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 <= -3.6e+36) || !(y_46_im <= 7.8e+21)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), 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 <= -3.6e+36) or not (y_46_im <= 7.8e+21): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_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 ((y_46_im <= -3.6e+36) || !(y_46_im <= 7.8e+21)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ 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 <= -3.6e+36) || ~((y_46_im <= 7.8e+21))) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ 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, -3.6e+36], N[Not[LessEqual[y$46$im, 7.8e+21]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.6 \cdot 10^{+36} \lor \neg \left(y.im \leq 7.8 \cdot 10^{+21}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -3.5999999999999997e36 or 7.8e21 < y.im Initial program 33.5%
Taylor expanded in y.im around 0 62.6%
Taylor expanded in y.re around 0 75.7%
*-commutative75.7%
distribute-lft-neg-in75.7%
Simplified75.7%
if -3.5999999999999997e36 < y.im < 7.8e21Initial program 44.3%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.im around 0 52.0%
unpow252.0%
unpow252.0%
hypot-def58.4%
Simplified58.4%
Final simplification66.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.45e+37)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 5.2e+20)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(* y.re (* (atan2 x.im x.re) (exp (* (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) {
double tmp;
if (y_46_im <= -1.45e+37) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 5.2e+20) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.45e+37) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 5.2e+20) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -1.45e+37: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 5.2e+20: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -1.45e+37) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 5.2e+20) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -1.45e+37) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 5.2e+20) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.45e+37], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.2e+20], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.45 \cdot 10^{+37}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{+20}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.im < -1.44999999999999989e37Initial program 30.9%
Taylor expanded in y.im around 0 69.3%
Taylor expanded in y.re around 0 81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
exp-prod82.0%
Simplified82.0%
if -1.44999999999999989e37 < y.im < 5.2e20Initial program 44.3%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.im around 0 52.0%
unpow252.0%
unpow252.0%
hypot-def58.4%
Simplified58.4%
if 5.2e20 < y.im Initial program 36.0%
Taylor expanded in y.im around 0 56.4%
Taylor expanded in y.re around 0 69.9%
*-commutative69.9%
distribute-lft-neg-in69.9%
Simplified69.9%
Final simplification66.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.8e+29) (not (<= y.im 6e+18))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (log1p (expm1 (* y.re (atan2 x.im x.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+29) || !(y_46_im <= 6e+18)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
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+29) || !(y_46_im <= 6e+18)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = Math.log1p(Math.expm1((y_46_re * Math.atan2(x_46_im, x_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+29) or not (y_46_im <= 6e+18): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) else: tmp = math.log1p(math.expm1((y_46_re * math.atan2(x_46_im, x_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+29) || !(y_46_im <= 6e+18)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.8e+29], N[Not[LessEqual[y$46$im, 6e+18]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.8 \cdot 10^{+29} \lor \neg \left(y.im \leq 6 \cdot 10^{+18}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -2.8e29 or 6e18 < y.im Initial program 33.2%
Taylor expanded in y.im around 0 62.1%
Taylor expanded in y.re around 0 75.0%
*-commutative75.0%
distribute-lft-neg-in75.0%
Simplified75.0%
if -2.8e29 < y.im < 6e18Initial program 44.6%
Taylor expanded in y.im around 0 52.3%
Taylor expanded in y.re around 0 16.7%
*-commutative16.7%
distribute-lft-neg-in16.7%
Simplified16.7%
Taylor expanded in y.im around 0 16.2%
log1p-expm1-u32.1%
Applied egg-rr32.1%
Final simplification51.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (expm1 (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -95000.0) (not (<= y.im 9.5e-38)))
(log (+ 1.0 t_0))
(log1p t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = expm1((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -95000.0) || !(y_46_im <= 9.5e-38)) {
tmp = log((1.0 + t_0));
} else {
tmp = log1p(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 = Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -95000.0) || !(y_46_im <= 9.5e-38)) {
tmp = Math.log((1.0 + t_0));
} else {
tmp = Math.log1p(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -95000.0) or not (y_46_im <= 9.5e-38): tmp = math.log((1.0 + t_0)) else: tmp = math.log1p(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = expm1(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -95000.0) || !(y_46_im <= 9.5e-38)) tmp = log(Float64(1.0 + t_0)); else tmp = log1p(t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -95000.0], N[Not[LessEqual[y$46$im, 9.5e-38]], $MachinePrecision]], N[Log[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision], N[Log[1 + t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -95000 \lor \neg \left(y.im \leq 9.5 \cdot 10^{-38}\right):\\
\;\;\;\;\log \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t_0\right)\\
\end{array}
\end{array}
if y.im < -95000 or 9.5000000000000009e-38 < y.im Initial program 35.2%
Taylor expanded in y.im around 0 60.1%
Taylor expanded in y.re around 0 66.2%
*-commutative66.2%
distribute-lft-neg-in66.2%
Simplified66.2%
Taylor expanded in y.im around 0 6.3%
*-commutative6.3%
log1p-expm1-u21.7%
log1p-udef46.3%
*-commutative46.3%
Applied egg-rr46.3%
if -95000 < y.im < 9.5000000000000009e-38Initial program 44.2%
Taylor expanded in y.im around 0 53.0%
Taylor expanded in y.re around 0 17.4%
*-commutative17.4%
distribute-lft-neg-in17.4%
Simplified17.4%
Taylor expanded in y.im around 0 17.4%
log1p-expm1-u31.9%
Applied egg-rr31.9%
Final simplification39.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re)))) (if (<= y.im 4000.0) (log1p (expm1 t_0)) (cbrt (pow t_0 3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 4000.0) {
tmp = log1p(expm1(t_0));
} else {
tmp = cbrt(pow(t_0, 3.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_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= 4000.0) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= 4000.0) tmp = log1p(expm1(t_0)); else tmp = cbrt((t_0 ^ 3.0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, 4000.0], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq 4000:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\end{array}
\end{array}
if y.im < 4e3Initial program 40.2%
Taylor expanded in y.im around 0 56.5%
Taylor expanded in y.re around 0 35.4%
*-commutative35.4%
distribute-lft-neg-in35.4%
Simplified35.4%
Taylor expanded in y.im around 0 13.3%
log1p-expm1-u30.0%
Applied egg-rr30.0%
if 4e3 < y.im Initial program 37.3%
Taylor expanded in y.im around 0 57.4%
Taylor expanded in y.re around 0 65.1%
*-commutative65.1%
distribute-lft-neg-in65.1%
Simplified65.1%
Taylor expanded in y.im around 0 6.4%
*-commutative6.4%
add-cbrt-cube35.1%
pow335.1%
*-commutative35.1%
Applied egg-rr35.1%
Final simplification31.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log1p (expm1 (* y.re (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log1p(Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.log1p(math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 39.5%
Taylor expanded in y.im around 0 56.7%
Taylor expanded in y.re around 0 42.9%
*-commutative42.9%
distribute-lft-neg-in42.9%
Simplified42.9%
Taylor expanded in y.im around 0 11.6%
log1p-expm1-u26.6%
Applied egg-rr26.6%
Final simplification26.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_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 = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 39.5%
Taylor expanded in y.im around 0 56.7%
Taylor expanded in y.re around 0 42.9%
*-commutative42.9%
distribute-lft-neg-in42.9%
Simplified42.9%
Taylor expanded in y.im around 0 11.6%
Final simplification11.6%
herbie shell --seed 2023333
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))