
(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 18 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)))
(t_1 (sin (* y.im t_0)))
(t_2
(exp
(*
y.re
(- (log (hypot x.im x.re)) (* y.im (/ (atan2 x.im x.re) y.re)))))))
(if (<= y.im -3.3e-5)
(* t_2 (pow (cbrt t_1) 3.0))
(if (<= y.im 6.2e-62)
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re)))))
(* t_2 t_1)))))
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 t_1 = sin((y_46_im * t_0));
double t_2 = exp((y_46_re * (log(hypot(x_46_im, x_46_re)) - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re)))));
double tmp;
if (y_46_im <= -3.3e-5) {
tmp = t_2 * pow(cbrt(t_1), 3.0);
} else if (y_46_im <= 6.2e-62) {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = t_2 * t_1;
}
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)) t_1 = sin(Float64(y_46_im * t_0)) t_2 = exp(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) - Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re))))) tmp = 0.0 if (y_46_im <= -3.3e-5) tmp = Float64(t_2 * (cbrt(t_1) ^ 3.0)); elseif (y_46_im <= 6.2e-62) tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re))))); else tmp = Float64(t_2 * t_1); 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]}, Block[{t$95$1 = N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -3.3e-5], N[(t$95$2 * N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.2e-62], N[(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] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sin \left(y.im \cdot t\_0\right)\\
t_2 := e^{y.re \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)}\\
\mathbf{if}\;y.im \leq -3.3 \cdot 10^{-5}:\\
\;\;\;\;t\_2 \cdot {\left(\sqrt[3]{t\_1}\right)}^{3}\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{-62}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\end{array}
\end{array}
if y.im < -3.3000000000000003e-5Initial program 45.2%
cancel-sign-sub-inv45.2%
fma-define45.2%
hypot-define45.2%
distribute-lft-neg-in45.2%
distribute-rgt-neg-out45.2%
fma-define45.2%
hypot-define81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in y.re around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
unpow274.8%
unpow274.8%
hypot-undefine81.7%
associate-/l*81.7%
Simplified81.7%
*-commutative81.7%
add-cube-cbrt81.7%
pow381.7%
*-commutative81.7%
Applied egg-rr81.7%
Taylor expanded in y.re around 0 45.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine81.7%
Simplified81.7%
if -3.3000000000000003e-5 < y.im < 6.1999999999999999e-62Initial program 43.5%
exp-diff43.5%
exp-to-pow43.5%
hypot-define43.5%
*-commutative43.5%
exp-prod43.5%
fma-define43.5%
hypot-define92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in y.im around 0 92.4%
if 6.1999999999999999e-62 < y.im Initial program 43.5%
cancel-sign-sub-inv43.5%
fma-define43.5%
hypot-define43.5%
distribute-lft-neg-in43.5%
distribute-rgt-neg-out43.5%
fma-define43.5%
hypot-define77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in y.re around inf 62.5%
mul-1-neg62.5%
unsub-neg62.5%
unpow262.5%
unpow262.5%
hypot-undefine77.8%
associate-/l*77.8%
Simplified77.8%
Taylor expanded in y.re around 0 46.8%
+-commutative46.7%
unpow246.7%
unpow246.7%
hypot-undefine79.8%
Simplified80.0%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (* y.re (- (log (hypot x.im x.re)) (* y.im (/ (atan2 x.im x.re) y.re))))) (sin (fma (log (hypot x.re x.im)) 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) {
return exp((y_46_re * (log(hypot(x_46_im, x_46_re)) - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re))))) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(exp(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) - Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re))))) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, 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[(N[Exp[N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{y.re \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 44.0%
cancel-sign-sub-inv44.0%
fma-define44.0%
hypot-define44.0%
distribute-lft-neg-in44.0%
distribute-rgt-neg-out44.0%
fma-define44.0%
hypot-define84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in y.re around inf 68.2%
mul-1-neg68.2%
unsub-neg68.2%
unpow268.2%
unpow268.2%
hypot-undefine84.2%
associate-/l*84.2%
Simplified84.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -3.3e-5) (not (<= y.im 5.7e-62)))
(*
(exp
(*
y.re
(- (log (hypot x.im x.re)) (* y.im (/ (atan2 x.im x.re) y.re)))))
(sin (* y.im t_0)))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (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 <= -3.3e-5) || !(y_46_im <= 5.7e-62)) {
tmp = exp((y_46_re * (log(hypot(x_46_im, x_46_re)) - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re))))) * sin((y_46_im * t_0));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * 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 <= -3.3e-5) || !(y_46_im <= 5.7e-62)) tmp = Float64(exp(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) - Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re))))) * sin(Float64(y_46_im * t_0))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * 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[Or[LessEqual[y$46$im, -3.3e-5], N[Not[LessEqual[y$46$im, 5.7e-62]], $MachinePrecision]], N[(N[Exp[N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * 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 -3.3 \cdot 10^{-5} \lor \neg \left(y.im \leq 5.7 \cdot 10^{-62}\right):\\
\;\;\;\;e^{y.re \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -3.3000000000000003e-5 or 5.69999999999999988e-62 < y.im Initial program 44.2%
cancel-sign-sub-inv44.2%
fma-define44.2%
hypot-define44.2%
distribute-lft-neg-in44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in y.re around inf 67.9%
mul-1-neg67.9%
unsub-neg67.9%
unpow267.9%
unpow267.9%
hypot-undefine79.5%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in y.re around 0 46.1%
+-commutative46.1%
unpow246.1%
unpow246.1%
hypot-undefine80.6%
Simplified80.7%
if -3.3000000000000003e-5 < y.im < 5.69999999999999988e-62Initial program 43.5%
exp-diff43.5%
exp-to-pow43.5%
hypot-define43.5%
*-commutative43.5%
exp-prod43.5%
fma-define43.5%
hypot-define92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in y.im around 0 92.4%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -3e-13) (not (<= y.im 6e-62)))
(*
(exp
(*
y.re
(- (log (hypot x.im x.re)) (* y.im (/ (atan2 x.im x.re) y.re)))))
(sin (* y.im t_0)))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -3e-13) || !(y_46_im <= 6e-62)) {
tmp = exp((y_46_re * (log(hypot(x_46_im, x_46_re)) - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re))))) * sin((y_46_im * t_0));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_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 <= -3e-13) || !(y_46_im <= 6e-62)) tmp = Float64(exp(Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) - Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re))))) * sin(Float64(y_46_im * t_0))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_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[Or[LessEqual[y$46$im, -3e-13], N[Not[LessEqual[y$46$im, 6e-62]], $MachinePrecision]], N[(N[Exp[N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $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 -3 \cdot 10^{-13} \lor \neg \left(y.im \leq 6 \cdot 10^{-62}\right):\\
\;\;\;\;e^{y.re \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.99999999999999984e-13 or 6.0000000000000002e-62 < y.im Initial program 44.0%
cancel-sign-sub-inv44.0%
fma-define44.0%
hypot-define44.0%
distribute-lft-neg-in44.0%
distribute-rgt-neg-out44.0%
fma-define44.0%
hypot-define79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y.re around inf 67.9%
mul-1-neg67.9%
unsub-neg67.9%
unpow267.9%
unpow267.9%
hypot-undefine79.2%
associate-/l*79.2%
Simplified79.2%
Taylor expanded in y.re around 0 45.9%
+-commutative45.8%
unpow245.8%
unpow245.8%
hypot-undefine80.4%
Simplified80.5%
if -2.99999999999999984e-13 < y.im < 6.0000000000000002e-62Initial program 43.9%
exp-diff43.9%
exp-to-pow43.9%
hypot-define43.9%
*-commutative43.9%
exp-prod43.9%
fma-define43.9%
hypot-define93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in y.im around 0 93.2%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= y.re -40000.0)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(sin t_0))
(if (<= y.re 6.2e+69)
(* (sin (fma t_1 y.im t_0)) (exp (* y.im (- (atan2 x.im x.re)))))
(* (sin (* y.im t_1)) (pow (hypot x.re x.im) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -40000.0) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(t_0);
} else if (y_46_re <= 6.2e+69) {
tmp = sin(fma(t_1, y_46_im, t_0)) * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = sin((y_46_im * t_1)) * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -40000.0) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(t_0)); elseif (y_46_re <= 6.2e+69) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(sin(Float64(y_46_im * t_1)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); 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]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -40000.0], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+69], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -40000:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+69}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot t\_1\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -4e4Initial program 45.3%
Taylor expanded in y.im around 0 90.7%
if -4e4 < y.re < 6.1999999999999997e69Initial program 47.7%
cancel-sign-sub-inv47.7%
fma-define47.7%
hypot-define47.7%
distribute-lft-neg-in47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in y.re around inf 57.0%
mul-1-neg57.0%
unsub-neg57.0%
unpow257.0%
unpow257.0%
hypot-undefine88.0%
associate-/l*88.0%
Simplified88.0%
Taylor expanded in y.re around 0 82.7%
neg-mul-182.7%
distribute-lft-neg-in82.7%
Simplified82.7%
if 6.1999999999999997e69 < y.re Initial program 32.7%
exp-diff23.1%
exp-to-pow23.1%
hypot-define23.1%
*-commutative23.1%
exp-prod23.1%
fma-define23.1%
hypot-define51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in y.im around 0 61.6%
Taylor expanded in y.re around 0 28.9%
+-commutative32.7%
unpow232.7%
unpow232.7%
hypot-undefine73.1%
Simplified67.4%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* (sin (* y.im (log (hypot x.re x.im)))) t_1)))
(if (<= y.im -3.4e+30)
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(if (<= y.im -3.1e-180)
t_2
(if (<= y.im 1.45e-224)
(* t_1 (sin t_0))
(if (<= y.im 4600000000.0)
t_2
(pow
(pow (* t_0 (pow (exp (- y.im)) (atan2 x.im x.re))) 3.0)
0.3333333333333333)))))))
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 t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1;
double tmp;
if (y_46_im <= -3.4e+30) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_im <= -3.1e-180) {
tmp = t_2;
} else if (y_46_im <= 1.45e-224) {
tmp = t_1 * sin(t_0);
} else if (y_46_im <= 4600000000.0) {
tmp = t_2;
} else {
tmp = pow(pow((t_0 * pow(exp(-y_46_im), atan2(x_46_im, x_46_re))), 3.0), 0.3333333333333333);
}
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 t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * t_1;
double tmp;
if (y_46_im <= -3.4e+30) {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_im <= -3.1e-180) {
tmp = t_2;
} else if (y_46_im <= 1.45e-224) {
tmp = t_1 * Math.sin(t_0);
} else if (y_46_im <= 4600000000.0) {
tmp = t_2;
} else {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re))), 3.0), 0.3333333333333333);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * t_1 tmp = 0 if y_46_im <= -3.4e+30: tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_im <= -3.1e-180: tmp = t_2 elif y_46_im <= 1.45e-224: tmp = t_1 * math.sin(t_0) elif y_46_im <= 4600000000.0: tmp = t_2 else: tmp = math.pow(math.pow((t_0 * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))), 3.0), 0.3333333333333333) 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)) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1) tmp = 0.0 if (y_46_im <= -3.4e+30) tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_im <= -3.1e-180) tmp = t_2; elseif (y_46_im <= 1.45e-224) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_im <= 4600000000.0) tmp = t_2; else tmp = (Float64(t_0 * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re))) ^ 3.0) ^ 0.3333333333333333; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; t_2 = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1; tmp = 0.0; if (y_46_im <= -3.4e+30) tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_im <= -3.1e-180) tmp = t_2; elseif (y_46_im <= 1.45e-224) tmp = t_1 * sin(t_0); elseif (y_46_im <= 4600000000.0) tmp = t_2; else tmp = ((t_0 * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re))) ^ 3.0) ^ 0.3333333333333333; 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$im, -3.4e+30], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.1e-180], t$95$2, If[LessEqual[y$46$im, 1.45e-224], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4600000000.0], t$95$2, N[Power[N[Power[N[(t$95$0 * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot t\_1\\
\mathbf{if}\;y.im \leq -3.4 \cdot 10^{+30}:\\
\;\;\;\;t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.im \leq -3.1 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 1.45 \cdot 10^{-224}:\\
\;\;\;\;t\_1 \cdot \sin t\_0\\
\mathbf{elif}\;y.im \leq 4600000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.im < -3.4000000000000002e30Initial program 40.7%
Taylor expanded in y.im around 0 71.9%
Taylor expanded in y.re around 0 71.9%
if -3.4000000000000002e30 < y.im < -3.0999999999999999e-180 or 1.45e-224 < y.im < 4.6e9Initial program 45.7%
exp-diff43.4%
exp-to-pow43.4%
hypot-define43.4%
*-commutative43.4%
exp-prod41.9%
fma-define41.9%
hypot-define87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in y.im around 0 88.1%
Taylor expanded in y.re around 0 42.6%
+-commutative44.3%
unpow244.3%
unpow244.3%
hypot-undefine87.2%
Simplified85.1%
if -3.0999999999999999e-180 < y.im < 1.45e-224Initial program 45.8%
Taylor expanded in y.im around 0 60.3%
Taylor expanded in y.im around 0 60.3%
+-commutative60.3%
unpow260.3%
unpow260.3%
hypot-undefine73.9%
Simplified73.9%
if 4.6e9 < y.im Initial program 43.7%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 65.1%
*-commutative65.1%
distribute-lft-neg-in65.1%
Simplified65.1%
add-cbrt-cube65.1%
pow1/370.7%
pow370.7%
associate-*r*70.7%
exp-prod70.7%
Applied egg-rr70.7%
Final simplification76.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* (sin (* y.im (log (hypot x.re x.im)))) t_1)))
(if (<= y.im -3e+29)
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(if (<= y.im -5.5e-180)
t_2
(if (<= y.im 3e-225)
(* t_1 (sin t_0))
(if (<= y.im 7.4e+30)
t_2
(*
y.re
(* (atan2 x.im x.re) (exp (* y.im (- (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1;
double tmp;
if (y_46_im <= -3e+29) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_im <= -5.5e-180) {
tmp = t_2;
} else if (y_46_im <= 3e-225) {
tmp = t_1 * sin(t_0);
} else if (y_46_im <= 7.4e+30) {
tmp = t_2;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -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 t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * t_1;
double tmp;
if (y_46_im <= -3e+29) {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_im <= -5.5e-180) {
tmp = t_2;
} else if (y_46_im <= 3e-225) {
tmp = t_1 * Math.sin(t_0);
} else if (y_46_im <= 7.4e+30) {
tmp = t_2;
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * t_1 tmp = 0 if y_46_im <= -3e+29: tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_im <= -5.5e-180: tmp = t_2 elif y_46_im <= 3e-225: tmp = t_1 * math.sin(t_0) elif y_46_im <= 7.4e+30: tmp = t_2 else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1) tmp = 0.0 if (y_46_im <= -3e+29) tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_im <= -5.5e-180) tmp = t_2; elseif (y_46_im <= 3e-225) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_im <= 7.4e+30) tmp = t_2; else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; t_2 = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1; tmp = 0.0; if (y_46_im <= -3e+29) tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_im <= -5.5e-180) tmp = t_2; elseif (y_46_im <= 3e-225) tmp = t_1 * sin(t_0); elseif (y_46_im <= 7.4e+30) tmp = t_2; else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$im, -3e+29], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -5.5e-180], t$95$2, If[LessEqual[y$46$im, 3e-225], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.4e+30], t$95$2, N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot t\_1\\
\mathbf{if}\;y.im \leq -3 \cdot 10^{+29}:\\
\;\;\;\;t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.im \leq -5.5 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 3 \cdot 10^{-225}:\\
\;\;\;\;t\_1 \cdot \sin t\_0\\
\mathbf{elif}\;y.im \leq 7.4 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\end{array}
\end{array}
if y.im < -2.9999999999999999e29Initial program 40.7%
Taylor expanded in y.im around 0 71.9%
Taylor expanded in y.re around 0 71.9%
if -2.9999999999999999e29 < y.im < -5.50000000000000011e-180 or 3.00000000000000018e-225 < y.im < 7.40000000000000032e30Initial program 47.6%
exp-diff43.3%
exp-to-pow43.3%
hypot-define43.3%
*-commutative43.3%
exp-prod42.0%
fma-define42.0%
hypot-define85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y.im around 0 85.9%
Taylor expanded in y.re around 0 42.7%
+-commutative46.3%
unpow246.3%
unpow246.3%
hypot-undefine87.1%
Simplified83.1%
if -5.50000000000000011e-180 < y.im < 3.00000000000000018e-225Initial program 45.8%
Taylor expanded in y.im around 0 60.3%
Taylor expanded in y.im around 0 60.3%
+-commutative60.3%
unpow260.3%
unpow260.3%
hypot-undefine73.9%
Simplified73.9%
if 7.40000000000000032e30 < y.im Initial program 40.6%
Taylor expanded in y.im around 0 58.1%
Taylor expanded in y.re around 0 65.9%
*-commutative65.9%
distribute-lft-neg-in65.9%
Simplified65.9%
Final simplification74.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re)))))))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* (sin (* y.im (log (hypot x.re x.im)))) t_1)))
(if (<= y.im -4e+31)
t_0
(if (<= y.im -5e-180)
t_2
(if (<= y.im 2.9e-226)
(* t_1 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.im 9.8e+36) t_2 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_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1;
double tmp;
if (y_46_im <= -4e+31) {
tmp = t_0;
} else if (y_46_im <= -5e-180) {
tmp = t_2;
} else if (y_46_im <= 2.9e-226) {
tmp = t_1 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 9.8e+36) {
tmp = t_2;
} else {
tmp = 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_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * t_1;
double tmp;
if (y_46_im <= -4e+31) {
tmp = t_0;
} else if (y_46_im <= -5e-180) {
tmp = t_2;
} else if (y_46_im <= 2.9e-226) {
tmp = t_1 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 9.8e+36) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * t_1 tmp = 0 if y_46_im <= -4e+31: tmp = t_0 elif y_46_im <= -5e-180: tmp = t_2 elif y_46_im <= 2.9e-226: tmp = t_1 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_im <= 9.8e+36: tmp = t_2 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1) tmp = 0.0 if (y_46_im <= -4e+31) tmp = t_0; elseif (y_46_im <= -5e-180) tmp = t_2; elseif (y_46_im <= 2.9e-226) tmp = Float64(t_1 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 9.8e+36) tmp = t_2; else tmp = 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_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; t_2 = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * t_1; tmp = 0.0; if (y_46_im <= -4e+31) tmp = t_0; elseif (y_46_im <= -5e-180) tmp = t_2; elseif (y_46_im <= 2.9e-226) tmp = t_1 * sin((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_im <= 9.8e+36) tmp = t_2; else tmp = 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$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$im, -4e+31], t$95$0, If[LessEqual[y$46$im, -5e-180], t$95$2, If[LessEqual[y$46$im, 2.9e-226], N[(t$95$1 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.8e+36], t$95$2, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot t\_1\\
\mathbf{if}\;y.im \leq -4 \cdot 10^{+31}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -5 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-226}:\\
\;\;\;\;t\_1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.im \leq 9.8 \cdot 10^{+36}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -3.9999999999999999e31 or 9.79999999999999962e36 < y.im Initial program 40.7%
Taylor expanded in y.im around 0 64.7%
Taylor expanded in y.re around 0 65.6%
*-commutative65.6%
distribute-lft-neg-in65.6%
Simplified65.6%
if -3.9999999999999999e31 < y.im < -5.0000000000000001e-180 or 2.90000000000000002e-226 < y.im < 9.79999999999999962e36Initial program 47.6%
exp-diff43.3%
exp-to-pow43.3%
hypot-define43.3%
*-commutative43.3%
exp-prod42.0%
fma-define42.0%
hypot-define85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y.im around 0 85.9%
Taylor expanded in y.re around 0 42.7%
+-commutative46.3%
unpow246.3%
unpow246.3%
hypot-undefine87.1%
Simplified83.1%
if -5.0000000000000001e-180 < y.im < 2.90000000000000002e-226Initial program 45.8%
Taylor expanded in y.im around 0 60.3%
Taylor expanded in y.im around 0 60.3%
+-commutative60.3%
unpow260.3%
unpow260.3%
hypot-undefine73.9%
Simplified73.9%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (pow (hypot x.re x.im) y.re) (sin t_0))))
(if (<= y.re -3.4e-5)
t_1
(if (<= y.re -1.75e-180)
(* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re))))))
(if (<= y.re 6e-211)
(sin (* (log (hypot x.im x.re)) y.im))
(if (<= y.re 3.8e+16)
(* t_0 (pow (exp (- y.im)) (atan2 x.im x.re)))
t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(t_0);
double tmp;
if (y_46_re <= -3.4e-5) {
tmp = t_1;
} else if (y_46_re <= -1.75e-180) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 6e-211) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 3.8e+16) {
tmp = t_0 * pow(exp(-y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin(t_0);
double tmp;
if (y_46_re <= -3.4e-5) {
tmp = t_1;
} else if (y_46_re <= -1.75e-180) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 6e-211) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 3.8e+16) {
tmp = t_0 * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin(t_0) tmp = 0 if y_46_re <= -3.4e-5: tmp = t_1 elif y_46_re <= -1.75e-180: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 6e-211: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) elif y_46_re <= 3.8e+16: tmp = t_0 * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_1 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)) t_1 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(t_0)) tmp = 0.0 if (y_46_re <= -3.4e-5) tmp = t_1; elseif (y_46_re <= -1.75e-180) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 6e-211) tmp = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 3.8e+16) tmp = Float64(t_0 * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re))); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin(t_0); tmp = 0.0; if (y_46_re <= -3.4e-5) tmp = t_1; elseif (y_46_re <= -1.75e-180) 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_re <= 6e-211) tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 3.8e+16) tmp = t_0 * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e-5], t$95$1, If[LessEqual[y$46$re, -1.75e-180], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6e-211], N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 3.8e+16], N[(t$95$0 * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin t\_0\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-180}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{-211}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{+16}:\\
\;\;\;\;t\_0 \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -3.4e-5 or 3.8e16 < y.re Initial program 41.8%
Taylor expanded in y.im around 0 74.5%
Taylor expanded in y.im around 0 69.6%
+-commutative69.6%
unpow269.6%
unpow269.6%
hypot-undefine69.6%
Simplified69.6%
if -3.4e-5 < y.re < -1.75e-180Initial program 56.2%
Taylor expanded in y.im around 0 48.4%
Taylor expanded in y.re around 0 61.2%
*-commutative61.2%
distribute-lft-neg-in61.2%
Simplified61.2%
if -1.75e-180 < y.re < 6.00000000000000009e-211Initial program 48.9%
exp-diff48.9%
exp-to-pow48.9%
hypot-define48.9%
*-commutative48.9%
exp-prod47.3%
fma-define47.3%
hypot-define89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in y.im around 0 55.5%
Taylor expanded in y.re around 0 22.8%
unpow222.8%
unpow222.8%
hypot-undefine55.5%
Simplified55.5%
if 6.00000000000000009e-211 < y.re < 3.8e16Initial program 38.1%
Taylor expanded in y.im around 0 32.2%
Taylor expanded in y.re around 0 62.0%
*-commutative62.0%
distribute-lft-neg-in62.0%
Simplified62.0%
Taylor expanded in y.re around 0 62.0%
neg-mul-162.0%
distribute-lft-neg-in62.0%
exp-prod62.0%
*-commutative62.0%
associate-*l*62.0%
Simplified62.0%
Final simplification65.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re)))))))
(t_1
(* (pow (hypot x.re x.im) y.re) (sin (* y.re (atan2 x.im x.re))))))
(if (<= y.re -3.9e-13)
t_1
(if (<= y.re -1.75e-180)
t_0
(if (<= y.re 4.8e-210)
(sin (* (log (hypot x.im x.re)) y.im))
(if (<= y.re 3.9e+16) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -3.9e-13) {
tmp = t_1;
} else if (y_46_re <= -1.75e-180) {
tmp = t_0;
} else if (y_46_re <= 4.8e-210) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 3.9e+16) {
tmp = t_0;
} else {
tmp = 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 = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -3.9e-13) {
tmp = t_1;
} else if (y_46_re <= -1.75e-180) {
tmp = t_0;
} else if (y_46_re <= 4.8e-210) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 3.9e+16) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -3.9e-13: tmp = t_1 elif y_46_re <= -1.75e-180: tmp = t_0 elif y_46_re <= 4.8e-210: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) elif y_46_re <= 3.9e+16: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))) t_1 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -3.9e-13) tmp = t_1; elseif (y_46_re <= -1.75e-180) tmp = t_0; elseif (y_46_re <= 4.8e-210) tmp = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 3.9e+16) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); t_1 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -3.9e-13) tmp = t_1; elseif (y_46_re <= -1.75e-180) tmp = t_0; elseif (y_46_re <= 4.8e-210) tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 3.9e+16) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.9e-13], t$95$1, If[LessEqual[y$46$re, -1.75e-180], t$95$0, If[LessEqual[y$46$re, 4.8e-210], N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 3.9e+16], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -3.9 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-180}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{-210}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 3.9 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -3.90000000000000004e-13 or 3.9e16 < y.re Initial program 41.8%
Taylor expanded in y.im around 0 74.5%
Taylor expanded in y.im around 0 69.6%
+-commutative69.6%
unpow269.6%
unpow269.6%
hypot-undefine69.6%
Simplified69.6%
if -3.90000000000000004e-13 < y.re < -1.75e-180 or 4.80000000000000008e-210 < y.re < 3.9e16Initial program 45.4%
Taylor expanded in y.im around 0 38.7%
Taylor expanded in y.re around 0 61.7%
*-commutative61.7%
distribute-lft-neg-in61.7%
Simplified61.7%
if -1.75e-180 < y.re < 4.80000000000000008e-210Initial program 48.9%
exp-diff48.9%
exp-to-pow48.9%
hypot-define48.9%
*-commutative48.9%
exp-prod47.3%
fma-define47.3%
hypot-define89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in y.im around 0 55.5%
Taylor expanded in y.re around 0 22.8%
unpow222.8%
unpow222.8%
hypot-undefine55.5%
Simplified55.5%
Final simplification65.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im)))
(t_1
(* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re))))))))
(if (<= y.im -135000.0)
t_1
(if (<= y.im -7e-142)
t_0
(if (<= y.im 6e-225)
(log1p (expm1 (* y.re (atan2 x.im x.re))))
(if (<= y.im 36000.0) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -135000.0) {
tmp = t_1;
} else if (y_46_im <= -7e-142) {
tmp = t_0;
} else if (y_46_im <= 6e-225) {
tmp = log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
} else if (y_46_im <= 36000.0) {
tmp = t_0;
} else {
tmp = 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.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -135000.0) {
tmp = t_1;
} else if (y_46_im <= -7e-142) {
tmp = t_0;
} else if (y_46_im <= 6e-225) {
tmp = Math.log1p(Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_im <= 36000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -135000.0: tmp = t_1 elif y_46_im <= -7e-142: tmp = t_0 elif y_46_im <= 6e-225: tmp = math.log1p(math.expm1((y_46_re * math.atan2(x_46_im, x_46_re)))) elif y_46_im <= 36000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))) tmp = 0.0 if (y_46_im <= -135000.0) tmp = t_1; elseif (y_46_im <= -7e-142) tmp = t_0; elseif (y_46_im <= 6e-225) tmp = log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 36000.0) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -135000.0], t$95$1, If[LessEqual[y$46$im, -7e-142], t$95$0, If[LessEqual[y$46$im, 6e-225], N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 36000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
t_1 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{if}\;y.im \leq -135000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -7 \cdot 10^{-142}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 6 \cdot 10^{-225}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{elif}\;y.im \leq 36000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -135000 or 36000 < y.im Initial program 44.6%
Taylor expanded in y.im around 0 65.2%
Taylor expanded in y.re around 0 63.2%
*-commutative63.2%
distribute-lft-neg-in63.2%
Simplified63.2%
if -135000 < y.im < -7.00000000000000029e-142 or 6.00000000000000035e-225 < y.im < 36000Initial program 42.3%
exp-diff42.3%
exp-to-pow42.3%
hypot-define42.3%
*-commutative42.3%
exp-prod40.5%
fma-define40.5%
hypot-define88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in y.im around 0 87.7%
Taylor expanded in y.re around 0 20.3%
unpow220.3%
unpow220.3%
hypot-undefine41.7%
Simplified41.7%
if -7.00000000000000029e-142 < y.im < 6.00000000000000035e-225Initial program 44.5%
Taylor expanded in y.im around 0 58.4%
Taylor expanded in y.re around 0 29.0%
*-commutative29.0%
distribute-lft-neg-in29.0%
Simplified29.0%
Taylor expanded in y.im around 0 29.0%
log1p-expm1-u38.8%
Applied egg-rr38.8%
Final simplification52.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (+ (exp (log1p t_0)) -1.0)))
(if (<= y.re -6e+187)
(pow (pow t_0 3.0) 0.3333333333333333)
(if (<= y.re -3.2e-171)
t_1
(if (<= y.re 4.6e-147)
(sin (* (log (hypot x.im x.re)) y.im))
(if (<= y.re 1.2e-63) t_1 (log1p (expm1 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_re * atan2(x_46_im, x_46_re);
double t_1 = exp(log1p(t_0)) + -1.0;
double tmp;
if (y_46_re <= -6e+187) {
tmp = pow(pow(t_0, 3.0), 0.3333333333333333);
} else if (y_46_re <= -3.2e-171) {
tmp = t_1;
} else if (y_46_re <= 4.6e-147) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 1.2e-63) {
tmp = t_1;
} else {
tmp = log1p(expm1(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_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.exp(Math.log1p(t_0)) + -1.0;
double tmp;
if (y_46_re <= -6e+187) {
tmp = Math.pow(Math.pow(t_0, 3.0), 0.3333333333333333);
} else if (y_46_re <= -3.2e-171) {
tmp = t_1;
} else if (y_46_re <= 4.6e-147) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 1.2e-63) {
tmp = t_1;
} else {
tmp = Math.log1p(Math.expm1(t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.exp(math.log1p(t_0)) + -1.0 tmp = 0 if y_46_re <= -6e+187: tmp = math.pow(math.pow(t_0, 3.0), 0.3333333333333333) elif y_46_re <= -3.2e-171: tmp = t_1 elif y_46_re <= 4.6e-147: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) elif y_46_re <= 1.2e-63: tmp = t_1 else: tmp = math.log1p(math.expm1(t_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)) t_1 = Float64(exp(log1p(t_0)) + -1.0) tmp = 0.0 if (y_46_re <= -6e+187) tmp = (t_0 ^ 3.0) ^ 0.3333333333333333; elseif (y_46_re <= -3.2e-171) tmp = t_1; elseif (y_46_re <= 4.6e-147) tmp = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 1.2e-63) tmp = t_1; else tmp = log1p(expm1(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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[Log[1 + t$95$0], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -6e+187], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], If[LessEqual[y$46$re, -3.2e-171], t$95$1, If[LessEqual[y$46$re, 4.6e-147], N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.2e-63], t$95$1, N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\mathsf{log1p}\left(t\_0\right)} + -1\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+187}:\\
\;\;\;\;{\left({t\_0}^{3}\right)}^{0.3333333333333333}\\
\mathbf{elif}\;y.re \leq -3.2 \cdot 10^{-171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4.6 \cdot 10^{-147}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -5.9999999999999998e187Initial program 48.5%
Taylor expanded in y.im around 0 84.8%
Taylor expanded in y.re around 0 37.2%
*-commutative37.2%
distribute-lft-neg-in37.2%
Simplified37.2%
Taylor expanded in y.im around 0 4.8%
*-commutative4.8%
add-cbrt-cube13.1%
pow1/322.2%
pow322.2%
*-commutative22.2%
Applied egg-rr22.2%
if -5.9999999999999998e187 < y.re < -3.2000000000000001e-171 or 4.59999999999999981e-147 < y.re < 1.2e-63Initial program 48.4%
Taylor expanded in y.im around 0 69.9%
Taylor expanded in y.re around 0 56.2%
*-commutative56.2%
distribute-lft-neg-in56.2%
Simplified56.2%
Taylor expanded in y.im around 0 12.8%
*-commutative12.8%
expm1-log1p-u12.5%
expm1-undefine30.4%
*-commutative30.4%
Applied egg-rr30.4%
if -3.2000000000000001e-171 < y.re < 4.59999999999999981e-147Initial program 44.8%
exp-diff44.8%
exp-to-pow44.8%
hypot-define44.8%
*-commutative44.8%
exp-prod43.6%
fma-define43.6%
hypot-define90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y.im around 0 58.6%
Taylor expanded in y.re around 0 21.4%
unpow221.4%
unpow221.4%
hypot-undefine50.4%
Simplified50.4%
if 1.2e-63 < y.re Initial program 36.0%
Taylor expanded in y.im around 0 53.5%
Taylor expanded in y.re around 0 33.2%
*-commutative33.2%
distribute-lft-neg-in33.2%
Simplified33.2%
Taylor expanded in y.im around 0 8.7%
log1p-expm1-u27.4%
Applied egg-rr27.4%
Final simplification32.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (+ (exp (log1p t_1)) -1.0)))
(if (<= y.im -1.38e+29)
t_2
(if (<= y.im -4.8e-135)
t_0
(if (<= y.im 1.9e-225)
(log1p (expm1 t_1))
(if (<= y.im 2150000000000.0) t_0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(log1p(t_1)) + -1.0;
double tmp;
if (y_46_im <= -1.38e+29) {
tmp = t_2;
} else if (y_46_im <= -4.8e-135) {
tmp = t_0;
} else if (y_46_im <= 1.9e-225) {
tmp = log1p(expm1(t_1));
} else if (y_46_im <= 2150000000000.0) {
tmp = t_0;
} else {
tmp = 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.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.exp(Math.log1p(t_1)) + -1.0;
double tmp;
if (y_46_im <= -1.38e+29) {
tmp = t_2;
} else if (y_46_im <= -4.8e-135) {
tmp = t_0;
} else if (y_46_im <= 1.9e-225) {
tmp = Math.log1p(Math.expm1(t_1));
} else if (y_46_im <= 2150000000000.0) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.exp(math.log1p(t_1)) + -1.0 tmp = 0 if y_46_im <= -1.38e+29: tmp = t_2 elif y_46_im <= -4.8e-135: tmp = t_0 elif y_46_im <= 1.9e-225: tmp = math.log1p(math.expm1(t_1)) elif y_46_im <= 2150000000000.0: tmp = t_0 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(exp(log1p(t_1)) + -1.0) tmp = 0.0 if (y_46_im <= -1.38e+29) tmp = t_2; elseif (y_46_im <= -4.8e-135) tmp = t_0; elseif (y_46_im <= 1.9e-225) tmp = log1p(expm1(t_1)); elseif (y_46_im <= 2150000000000.0) tmp = t_0; else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[Log[1 + t$95$1], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[y$46$im, -1.38e+29], t$95$2, If[LessEqual[y$46$im, -4.8e-135], t$95$0, If[LessEqual[y$46$im, 1.9e-225], N[Log[1 + N[(Exp[t$95$1] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 2150000000000.0], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{\mathsf{log1p}\left(t\_1\right)} + -1\\
\mathbf{if}\;y.im \leq -1.38 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq -4.8 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{-225}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_1\right)\right)\\
\mathbf{elif}\;y.im \leq 2150000000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -1.38e29 or 2.15e12 < y.im Initial program 41.4%
Taylor expanded in y.im around 0 65.4%
Taylor expanded in y.re around 0 65.5%
*-commutative65.5%
distribute-lft-neg-in65.5%
Simplified65.5%
Taylor expanded in y.im around 0 5.2%
*-commutative5.2%
expm1-log1p-u4.8%
expm1-undefine28.3%
*-commutative28.3%
Applied egg-rr28.3%
if -1.38e29 < y.im < -4.7999999999999997e-135 or 1.9000000000000001e-225 < y.im < 2.15e12Initial program 47.7%
exp-diff45.2%
exp-to-pow45.2%
hypot-define45.2%
*-commutative45.2%
exp-prod43.6%
fma-define43.6%
hypot-define87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in y.im around 0 87.0%
Taylor expanded in y.re around 0 17.8%
unpow217.8%
unpow217.8%
hypot-undefine36.4%
Simplified36.4%
if -4.7999999999999997e-135 < y.im < 1.9000000000000001e-225Initial program 44.5%
Taylor expanded in y.im around 0 58.4%
Taylor expanded in y.re around 0 29.0%
*-commutative29.0%
distribute-lft-neg-in29.0%
Simplified29.0%
Taylor expanded in y.im around 0 29.0%
log1p-expm1-u38.8%
Applied egg-rr38.8%
Final simplification32.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log1p (expm1 t_1))))
(if (<= y.re -5.5e-50)
t_2
(if (<= y.re -5.5e-98)
t_0
(if (<= y.re -1.46e-173)
(cbrt (pow t_1 3.0))
(if (<= y.re 2.55e-174) t_0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log1p(expm1(t_1));
double tmp;
if (y_46_re <= -5.5e-50) {
tmp = t_2;
} else if (y_46_re <= -5.5e-98) {
tmp = t_0;
} else if (y_46_re <= -1.46e-173) {
tmp = cbrt(pow(t_1, 3.0));
} else if (y_46_re <= 2.55e-174) {
tmp = t_0;
} else {
tmp = 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.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.log1p(Math.expm1(t_1));
double tmp;
if (y_46_re <= -5.5e-50) {
tmp = t_2;
} else if (y_46_re <= -5.5e-98) {
tmp = t_0;
} else if (y_46_re <= -1.46e-173) {
tmp = Math.cbrt(Math.pow(t_1, 3.0));
} else if (y_46_re <= 2.55e-174) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log1p(expm1(t_1)) tmp = 0.0 if (y_46_re <= -5.5e-50) tmp = t_2; elseif (y_46_re <= -5.5e-98) tmp = t_0; elseif (y_46_re <= -1.46e-173) tmp = cbrt((t_1 ^ 3.0)); elseif (y_46_re <= 2.55e-174) tmp = t_0; else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[1 + N[(Exp[t$95$1] - 1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5.5e-50], t$95$2, If[LessEqual[y$46$re, -5.5e-98], t$95$0, If[LessEqual[y$46$re, -1.46e-173], N[Power[N[Power[t$95$1, 3.0], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[y$46$re, 2.55e-174], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \mathsf{log1p}\left(\mathsf{expm1}\left(t\_1\right)\right)\\
\mathbf{if}\;y.re \leq -5.5 \cdot 10^{-50}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -5.5 \cdot 10^{-98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.46 \cdot 10^{-173}:\\
\;\;\;\;\sqrt[3]{{t\_1}^{3}}\\
\mathbf{elif}\;y.re \leq 2.55 \cdot 10^{-174}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -5.49999999999999975e-50 or 2.55000000000000016e-174 < y.re Initial program 41.8%
Taylor expanded in y.im around 0 64.9%
Taylor expanded in y.re around 0 42.8%
*-commutative42.8%
distribute-lft-neg-in42.8%
Simplified42.8%
Taylor expanded in y.im around 0 11.1%
log1p-expm1-u21.3%
Applied egg-rr21.3%
if -5.49999999999999975e-50 < y.re < -5.4999999999999997e-98 or -1.46e-173 < y.re < 2.55000000000000016e-174Initial program 50.9%
exp-diff50.9%
exp-to-pow50.9%
hypot-define50.9%
*-commutative50.9%
exp-prod49.7%
fma-define49.7%
hypot-define91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y.im around 0 54.1%
Taylor expanded in y.re around 0 26.2%
unpow226.2%
unpow226.2%
hypot-undefine52.5%
Simplified52.5%
if -5.4999999999999997e-98 < y.re < -1.46e-173Initial program 44.4%
Taylor expanded in y.im around 0 67.9%
Taylor expanded in y.re around 0 78.3%
*-commutative78.3%
distribute-lft-neg-in78.3%
Simplified78.3%
add-cbrt-cube67.4%
pow367.4%
associate-*r*67.4%
exp-prod67.4%
Applied egg-rr67.4%
Taylor expanded in y.im around 0 67.6%
cube-prod67.6%
Simplified67.6%
Final simplification30.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -6.4e-52) (not (<= y.re 8.2e-176))) (log1p (expm1 (* y.re (atan2 x.im x.re)))) (sin (* (log (hypot 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_re <= -6.4e-52) || !(y_46_re <= 8.2e-176)) {
tmp = log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = sin((log(hypot(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_re <= -6.4e-52) || !(y_46_re <= 8.2e-176)) {
tmp = Math.log1p(Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.sin((Math.log(Math.hypot(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_re <= -6.4e-52) or not (y_46_re <= 8.2e-176): tmp = math.log1p(math.expm1((y_46_re * math.atan2(x_46_im, x_46_re)))) else: tmp = math.sin((math.log(math.hypot(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_re <= -6.4e-52) || !(y_46_re <= 8.2e-176)) tmp = log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -6.4e-52], N[Not[LessEqual[y$46$re, 8.2e-176]], $MachinePrecision]], N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6.4 \cdot 10^{-52} \lor \neg \left(y.re \leq 8.2 \cdot 10^{-176}\right):\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -6.4000000000000002e-52 or 8.2000000000000005e-176 < y.re Initial program 41.8%
Taylor expanded in y.im around 0 64.9%
Taylor expanded in y.re around 0 42.8%
*-commutative42.8%
distribute-lft-neg-in42.8%
Simplified42.8%
Taylor expanded in y.im around 0 11.1%
log1p-expm1-u21.3%
Applied egg-rr21.3%
if -6.4000000000000002e-52 < y.re < 8.2000000000000005e-176Initial program 50.0%
exp-diff50.0%
exp-to-pow50.0%
hypot-define50.0%
*-commutative50.0%
exp-prod49.0%
fma-define49.0%
hypot-define92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in y.im around 0 51.6%
Taylor expanded in y.re around 0 22.9%
unpow222.9%
unpow222.9%
hypot-undefine47.4%
Simplified47.4%
Final simplification28.1%
(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 44.0%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in y.re around 0 42.4%
*-commutative42.4%
distribute-lft-neg-in42.4%
Simplified42.4%
Taylor expanded in y.im around 0 10.5%
log1p-expm1-u18.0%
Applied egg-rr18.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (- 1.0 (* y.im (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) * (1.0 - (y_46_im * 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) * (1.0d0 - (y_46im * 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) * (1.0 - (y_46_im * 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) * (1.0 - (y_46_im * 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 * Float64(atan(x_46_im, x_46_re) * Float64(1.0 - Float64(y_46_im * 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) * (1.0 - (y_46_im * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 44.0%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in y.re around 0 42.4%
*-commutative42.4%
distribute-lft-neg-in42.4%
Simplified42.4%
Taylor expanded in y.im around 0 12.5%
neg-mul-112.5%
unsub-neg12.5%
Simplified12.5%
(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 44.0%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in y.re around 0 42.4%
*-commutative42.4%
distribute-lft-neg-in42.4%
Simplified42.4%
Taylor expanded in y.im around 0 10.5%
herbie shell --seed 2024085
(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)))))