
(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 13 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 (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(t_2 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (cbrt t_1)))
(if (<= x.re -1.16e-259)
(* t_2 (sin t_1))
(if (<= x.re 1.1e-116)
(* t_2 (sin (* t_3 (pow (pow (cbrt t_3) 2.0) 3.0))))
(* t_2 (sin (pow t_3 3.0)))))))
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 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = cbrt(t_1);
double tmp;
if (x_46_re <= -1.16e-259) {
tmp = t_2 * sin(t_1);
} else if (x_46_re <= 1.1e-116) {
tmp = t_2 * sin((t_3 * pow(pow(cbrt(t_3), 2.0), 3.0)));
} else {
tmp = t_2 * sin(pow(t_3, 3.0));
}
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 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = cbrt(t_1) tmp = 0.0 if (x_46_re <= -1.16e-259) tmp = Float64(t_2 * sin(t_1)); elseif (x_46_re <= 1.1e-116) tmp = Float64(t_2 * sin(Float64(t_3 * ((cbrt(t_3) ^ 2.0) ^ 3.0)))); else tmp = Float64(t_2 * sin((t_3 ^ 3.0))); 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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[Power[t$95$1, 1/3], $MachinePrecision]}, If[LessEqual[x$46$re, -1.16e-259], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.1e-116], N[(t$95$2 * N[Sin[N[(t$95$3 * N[Power[N[Power[N[Power[t$95$3, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[t$95$3, 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \sqrt[3]{t_1}\\
\mathbf{if}\;x.re \leq -1.16 \cdot 10^{-259}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{elif}\;x.re \leq 1.1 \cdot 10^{-116}:\\
\;\;\;\;t_2 \cdot \sin \left(t_3 \cdot {\left({\left(\sqrt[3]{t_3}\right)}^{2}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({t_3}^{3}\right)\\
\end{array}
\end{array}
if x.re < -1.16e-259Initial program 44.9%
hypot-def44.9%
fma-def44.9%
hypot-def87.2%
*-commutative87.2%
Simplified87.2%
if -1.16e-259 < x.re < 1.10000000000000005e-116Initial program 42.7%
hypot-def42.7%
fma-def42.7%
hypot-def72.9%
*-commutative72.9%
Simplified72.9%
fma-udef72.9%
hypot-udef42.7%
*-commutative42.7%
add-cube-cbrt48.8%
pow345.5%
hypot-udef75.5%
*-commutative75.5%
fma-udef75.5%
*-commutative75.5%
Applied egg-rr75.5%
add-cube-cbrt80.3%
cube-prod85.1%
pow285.1%
pow386.8%
add-cube-cbrt83.9%
Applied egg-rr83.9%
if 1.10000000000000005e-116 < x.re Initial program 47.2%
hypot-def47.2%
fma-def47.2%
hypot-def81.9%
*-commutative81.9%
Simplified81.9%
fma-udef81.9%
hypot-udef47.2%
*-commutative47.2%
add-cube-cbrt49.0%
pow349.3%
hypot-udef85.3%
*-commutative85.3%
fma-udef85.3%
*-commutative85.3%
Applied egg-rr85.3%
Final simplification85.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(t_2 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 5.4e-278)
(* t_2 (sin t_1))
(* t_2 (sin (pow (cbrt t_1) 3.0))))))
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 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 5.4e-278) {
tmp = t_2 * sin(t_1);
} else {
tmp = t_2 * sin(pow(cbrt(t_1), 3.0));
}
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 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 5.4e-278) tmp = Float64(t_2 * sin(t_1)); else tmp = Float64(t_2 * sin((cbrt(t_1) ^ 3.0))); 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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[x$46$re, 5.4e-278], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 5.4 \cdot 10^{-278}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < 5.4000000000000003e-278Initial program 44.2%
hypot-def44.2%
fma-def44.2%
hypot-def85.5%
*-commutative85.5%
Simplified85.5%
if 5.4000000000000003e-278 < x.re Initial program 46.1%
hypot-def46.1%
fma-def46.1%
hypot-def78.4%
*-commutative78.4%
Simplified78.4%
fma-udef78.4%
hypot-udef46.1%
*-commutative46.1%
add-cube-cbrt50.5%
pow348.9%
hypot-udef82.1%
*-commutative82.1%
fma-udef82.1%
*-commutative82.1%
Applied egg-rr82.1%
Final simplification83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* 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));
return exp(((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))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, 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(fma(t_0, 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_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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[(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)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \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}
Initial program 45.1%
hypot-def45.1%
fma-def45.1%
hypot-def82.3%
*-commutative82.3%
Simplified82.3%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -8.5e-90)
t_1
(if (<= y.im 6e-159)
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))
(if (<= y.im 7.5e+176)
t_1
(*
y.re
(* (atan2 x.im x.re) (pow (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 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -8.5e-90) {
tmp = t_1;
} else if (y_46_im <= 6e-159) {
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);
} else if (y_46_im <= 7.5e+176) {
tmp = t_1;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(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)) t_1 = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -8.5e-90) tmp = t_1; elseif (y_46_im <= 6e-159) 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)); elseif (y_46_im <= 7.5e+176) tmp = t_1; else 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))))); 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[(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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e-90], t$95$1, If[LessEqual[y$46$im, 6e-159], 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], If[LessEqual[y$46$im, 7.5e+176], t$95$1, 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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -8.5 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 6 \cdot 10^{-159}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+176}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;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)\\
\end{array}
\end{array}
if y.im < -8.5000000000000001e-90 or 6.00000000000000018e-159 < y.im < 7.499999999999999e176Initial program 42.3%
hypot-def42.3%
fma-def42.3%
hypot-def81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.im around inf 43.9%
unpow243.9%
unpow243.9%
hypot-def83.8%
Simplified83.8%
if -8.5000000000000001e-90 < y.im < 6.00000000000000018e-159Initial program 49.4%
exp-diff49.4%
exp-to-pow49.4%
hypot-def49.4%
*-commutative49.4%
exp-prod49.4%
fma-def49.4%
hypot-def85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y.im around 0 85.4%
if 7.499999999999999e176 < y.im Initial program 43.5%
Taylor expanded in y.im around 0 65.6%
Taylor expanded in x.re around inf 52.2%
Taylor expanded in y.re around 0 83.0%
*-commutative83.0%
distribute-rgt-neg-in83.0%
mul-1-neg83.0%
exp-prod87.0%
mul-1-neg87.0%
Simplified87.0%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -35000000.0)
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(if (<= y.im 480.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.re x.im) y.re))
(*
y.re
(* (atan2 x.im x.re) (pow (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 tmp;
if (y_46_im <= -35000000.0) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 480.0) {
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);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -35000000.0) 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(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_im <= 480.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else 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))))); 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, -35000000.0], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 480.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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -35000000:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.im \leq 480:\\
\;\;\;\;\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.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;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)\\
\end{array}
\end{array}
if y.im < -3.5e7Initial program 42.0%
Taylor expanded in y.im around 0 59.5%
*-commutative59.5%
expm1-log1p-u45.2%
Applied egg-rr45.2%
Taylor expanded in y.re around 0 67.6%
if -3.5e7 < y.im < 480Initial program 45.7%
exp-diff45.7%
exp-to-pow45.7%
hypot-def45.7%
*-commutative45.7%
exp-prod45.7%
fma-def45.8%
hypot-def86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in y.im around 0 84.5%
if 480 < y.im Initial program 46.0%
Taylor expanded in y.im around 0 66.9%
Taylor expanded in x.re around inf 36.6%
Taylor expanded in y.re around 0 68.7%
*-commutative68.7%
distribute-rgt-neg-in68.7%
mul-1-neg68.7%
exp-prod70.1%
mul-1-neg70.1%
Simplified70.1%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* y.im (log x.re)))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(*
t_0
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2))))
(t_4 (exp (- (* y.re (log x.re)) t_2))))
(if (<= x.re -3.25e-81)
(* (exp (- (* y.re (log (- x.re))) t_2)) (sin t_0))
(if (<= x.re 2.46e-259)
t_3
(if (<= x.re 1.2e-114)
(* (sin (* y.im (log (hypot x.im x.re)))) t_4)
(if (<= x.re 5.5)
t_3
(if (<= x.re 1e+127)
(* t_4 (sin (+ t_0 t_1)))
(* t_4 (sin 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 = y_46_im * log(x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = exp(((y_46_re * log(x_46_re)) - t_2));
double tmp;
if (x_46_re <= -3.25e-81) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_2)) * sin(t_0);
} else if (x_46_re <= 2.46e-259) {
tmp = t_3;
} else if (x_46_re <= 1.2e-114) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4;
} else if (x_46_re <= 5.5) {
tmp = t_3;
} else if (x_46_re <= 1e+127) {
tmp = t_4 * sin((t_0 + t_1));
} else {
tmp = t_4 * sin(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 = y_46_im * Math.log(x_46_re);
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = Math.exp(((y_46_re * Math.log(x_46_re)) - t_2));
double tmp;
if (x_46_re <= -3.25e-81) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_2)) * Math.sin(t_0);
} else if (x_46_re <= 2.46e-259) {
tmp = t_3;
} else if (x_46_re <= 1.2e-114) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_4;
} else if (x_46_re <= 5.5) {
tmp = t_3;
} else if (x_46_re <= 1e+127) {
tmp = t_4 * Math.sin((t_0 + t_1));
} else {
tmp = t_4 * Math.sin(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 = y_46_im * math.log(x_46_re) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im t_3 = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) t_4 = math.exp(((y_46_re * math.log(x_46_re)) - t_2)) tmp = 0 if x_46_re <= -3.25e-81: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_2)) * math.sin(t_0) elif x_46_re <= 2.46e-259: tmp = t_3 elif x_46_re <= 1.2e-114: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_4 elif x_46_re <= 5.5: tmp = t_3 elif x_46_re <= 1e+127: tmp = t_4 * math.sin((t_0 + t_1)) else: tmp = t_4 * math.sin(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(y_46_im * log(x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = 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))))) - t_2))) t_4 = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_2)) tmp = 0.0 if (x_46_re <= -3.25e-81) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_2)) * sin(t_0)); elseif (x_46_re <= 2.46e-259) tmp = t_3; elseif (x_46_re <= 1.2e-114) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4); elseif (x_46_re <= 5.5) tmp = t_3; elseif (x_46_re <= 1e+127) tmp = Float64(t_4 * sin(Float64(t_0 + t_1))); else tmp = Float64(t_4 * sin(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 = y_46_im * log(x_46_re); t_2 = atan2(x_46_im, x_46_re) * y_46_im; t_3 = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)); t_4 = exp(((y_46_re * log(x_46_re)) - t_2)); tmp = 0.0; if (x_46_re <= -3.25e-81) tmp = exp(((y_46_re * log(-x_46_re)) - t_2)) * sin(t_0); elseif (x_46_re <= 2.46e-259) tmp = t_3; elseif (x_46_re <= 1.2e-114) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4; elseif (x_46_re <= 5.5) tmp = t_3; elseif (x_46_re <= 1e+127) tmp = t_4 * sin((t_0 + t_1)); else tmp = t_4 * sin(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[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[(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] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -3.25e-81], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.46e-259], t$95$3, If[LessEqual[x$46$re, 1.2e-114], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[x$46$re, 5.5], t$95$3, If[LessEqual[x$46$re, 1e+127], N[(t$95$4 * N[Sin[N[(t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \log x.re\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_2}\\
t_4 := e^{y.re \cdot \log x.re - t_2}\\
\mathbf{if}\;x.re \leq -3.25 \cdot 10^{-81}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t_2} \cdot \sin t_0\\
\mathbf{elif}\;x.re \leq 2.46 \cdot 10^{-259}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.re \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_4\\
\mathbf{elif}\;x.re \leq 5.5:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x.re \leq 10^{+127}:\\
\;\;\;\;t_4 \cdot \sin \left(t_0 + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \sin t_1\\
\end{array}
\end{array}
if x.re < -3.2500000000000001e-81Initial program 37.7%
Taylor expanded in y.im around 0 52.1%
Taylor expanded in x.re around -inf 65.2%
mul-1-neg65.2%
Simplified65.2%
if -3.2500000000000001e-81 < x.re < 2.4600000000000001e-259 or 1.2000000000000001e-114 < x.re < 5.5Initial program 54.7%
Taylor expanded in y.im around 0 61.9%
*-commutative61.9%
expm1-log1p-u41.7%
Applied egg-rr41.7%
Taylor expanded in y.re around 0 67.9%
if 2.4600000000000001e-259 < x.re < 1.2000000000000001e-114Initial program 47.4%
Taylor expanded in x.re around inf 44.2%
Taylor expanded in y.re around 0 44.3%
unpow244.3%
unpow244.3%
hypot-def62.2%
Simplified62.2%
if 5.5 < x.re < 9.99999999999999955e126Initial program 78.3%
Taylor expanded in x.re around inf 78.3%
Taylor expanded in x.re around inf 86.4%
if 9.99999999999999955e126 < x.re Initial program 9.6%
Taylor expanded in x.re around inf 9.6%
Taylor expanded in x.re around inf 74.6%
Taylor expanded in y.re around 0 80.6%
Final simplification70.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -1.2e-82)
(* (exp (- (* y.re (log (- x.re))) t_1)) (sin t_0))
(if (<= x.re 1.14e-257)
(*
t_0
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (- (* y.re (log 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 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -1.2e-82) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_1)) * sin(t_0);
} else if (x_46_re <= 1.14e-257) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_re)) - 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.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -1.2e-82) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_1)) * Math.sin(t_0);
} else if (x_46_re <= 1.14e-257) {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp(((y_46_re * Math.log(x_46_re)) - 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.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_re <= -1.2e-82: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_1)) * math.sin(t_0) elif x_46_re <= 1.14e-257: tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) else: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp(((y_46_re * math.log(x_46_re)) - 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(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_re <= -1.2e-82) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_1)) * sin(t_0)); elseif (x_46_re <= 1.14e-257) 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))))) - t_1))); else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(x_46_re)) - 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 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_re <= -1.2e-82) tmp = exp(((y_46_re * log(-x_46_re)) - t_1)) * sin(t_0); elseif (x_46_re <= 1.14e-257) tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_re)) - 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$re, -1.2e-82], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.14e-257], 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] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -1.2 \cdot 10^{-82}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t_1} \cdot \sin t_0\\
\mathbf{elif}\;x.re \leq 1.14 \cdot 10^{-257}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.re - t_1}\\
\end{array}
\end{array}
if x.re < -1.20000000000000004e-82Initial program 37.7%
Taylor expanded in y.im around 0 52.1%
Taylor expanded in x.re around -inf 65.2%
mul-1-neg65.2%
Simplified65.2%
if -1.20000000000000004e-82 < x.re < 1.14e-257Initial program 50.7%
Taylor expanded in y.im around 0 61.4%
*-commutative61.4%
expm1-log1p-u38.3%
Applied egg-rr38.3%
Taylor expanded in y.re around 0 66.0%
if 1.14e-257 < x.re Initial program 47.3%
Taylor expanded in x.re around inf 45.5%
Taylor expanded in y.re around 0 42.9%
unpow242.9%
unpow242.9%
hypot-def71.2%
Simplified71.2%
Final simplification68.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -3.4e-81)
(* (exp (- (* y.re (log (- x.re))) t_1)) (sin t_0))
(if (<= x.re 5.5)
(*
t_0
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(* (exp (- (* y.re (log x.re)) t_1)) (sin (* y.im (log 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 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -3.4e-81) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_1)) * sin(t_0);
} else if (x_46_re <= 5.5) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - t_1)) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = atan2(x_46im, x_46re) * y_46im
if (x_46re <= (-3.4d-81)) then
tmp = exp(((y_46re * log(-x_46re)) - t_1)) * sin(t_0)
else if (x_46re <= 5.5d0) then
tmp = t_0 * exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_1))
else
tmp = exp(((y_46re * log(x_46re)) - t_1)) * sin((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -3.4e-81) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_1)) * Math.sin(t_0);
} else if (x_46_re <= 5.5) {
tmp = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_1)) * Math.sin((y_46_im * Math.log(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.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_re <= -3.4e-81: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_1)) * math.sin(t_0) elif x_46_re <= 5.5: tmp = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) else: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_1)) * math.sin((y_46_im * math.log(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 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_re <= -3.4e-81) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_1)) * sin(t_0)); elseif (x_46_re <= 5.5) 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))))) - t_1))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_1)) * sin(Float64(y_46_im * log(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 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_re <= -3.4e-81) tmp = exp(((y_46_re * log(-x_46_re)) - t_1)) * sin(t_0); elseif (x_46_re <= 5.5) tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); else tmp = exp(((y_46_re * log(x_46_re)) - t_1)) * sin((y_46_im * log(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$re, -3.4e-81], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5.5], 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] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t_1} \cdot \sin t_0\\
\mathbf{elif}\;x.re \leq 5.5:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t_1} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -3.3999999999999999e-81Initial program 37.7%
Taylor expanded in y.im around 0 52.1%
Taylor expanded in x.re around -inf 65.2%
mul-1-neg65.2%
Simplified65.2%
if -3.3999999999999999e-81 < x.re < 5.5Initial program 52.8%
Taylor expanded in y.im around 0 59.1%
*-commutative59.1%
expm1-log1p-u40.6%
Applied egg-rr40.6%
Taylor expanded in y.re around 0 62.6%
if 5.5 < x.re Initial program 40.6%
Taylor expanded in x.re around inf 40.6%
Taylor expanded in x.re around inf 79.9%
Taylor expanded in y.re around 0 76.7%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -4.5e-219)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 2.4e-293)
(* (exp (- (* y.re (log x.re)) t_0)) (sin (* y.im (log x.re))))
(* t_1 (exp (- (* y.re (log x.im)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -4.5e-219) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 2.4e-293) {
tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin((y_46_im * log(x_46_re)));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-4.5d-219)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 2.4d-293) then
tmp = exp(((y_46re * log(x_46re)) - t_0)) * sin((y_46im * log(x_46re)))
else
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -4.5e-219) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 2.4e-293) {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0)) * Math.sin((y_46_im * Math.log(x_46_re)));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -4.5e-219: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 2.4e-293: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) * math.sin((y_46_im * math.log(x_46_re))) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -4.5e-219) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 2.4e-293) tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) * sin(Float64(y_46_im * log(x_46_re)))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -4.5e-219) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 2.4e-293) tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin((y_46_im * log(x_46_re))); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4.5e-219], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.4e-293], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -4.5 \cdot 10^{-219}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 2.4 \cdot 10^{-293}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t_0} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -4.50000000000000014e-219Initial program 45.4%
Taylor expanded in y.im around 0 57.6%
Taylor expanded in x.im around -inf 60.4%
mul-1-neg60.4%
Simplified60.4%
if -4.50000000000000014e-219 < x.im < 2.3999999999999999e-293Initial program 37.9%
Taylor expanded in x.re around inf 27.5%
Taylor expanded in x.re around inf 38.9%
Taylor expanded in y.re around 0 44.2%
if 2.3999999999999999e-293 < x.im Initial program 45.9%
Taylor expanded in y.im around 0 56.8%
Taylor expanded in x.re around 0 58.4%
Final simplification58.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -5e-311)
(* (exp (- (* y.re (log (- x.re))) t_0)) (sin (* y.re (atan2 x.im x.re))))
(* (exp (- (* y.re (log x.re)) t_0)) (sin (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -5e-311) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46re <= (-5d-311)) then
tmp = exp(((y_46re * log(-x_46re)) - t_0)) * sin((y_46re * atan2(x_46im, x_46re)))
else
tmp = exp(((y_46re * log(x_46re)) - t_0)) * sin((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -5e-311) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0)) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_re <= -5e-311: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_re <= -5e-311) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) * sin(Float64(y_46_im * log(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 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_re <= -5e-311) tmp = exp(((y_46_re * log(-x_46_re)) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin((y_46_im * log(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$re, -5e-311], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-311}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t_0} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -5.00000000000023e-311Initial program 44.6%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in x.re around -inf 58.5%
mul-1-neg58.5%
Simplified58.5%
if -5.00000000000023e-311 < x.re Initial program 45.7%
Taylor expanded in x.re around inf 42.6%
Taylor expanded in x.re around inf 64.5%
Taylor expanded in y.re around 0 61.5%
Final simplification60.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re 2.6e-285)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(*
(exp (- (* y.re (log x.re)) (* (atan2 x.im x.re) y.im)))
(sin (* y.im (log x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 2.6e-285) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= 2.6d-285) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
else
tmp = exp(((y_46re * log(x_46re)) - (atan2(x_46im, x_46re) * y_46im))) * sin((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 2.6e-285) {
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.exp(((y_46_re * Math.log(x_46_re)) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 2.6e-285: 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.exp(((y_46_re * math.log(x_46_re)) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 2.6e-285) 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(exp(Float64(Float64(y_46_re * log(x_46_re)) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(x_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 (x_46_re <= 2.6e-285) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = exp(((y_46_re * log(x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 2.6e-285], 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[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 2.6 \cdot 10^{-285}:\\
\;\;\;\;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}:\\
\;\;\;\;e^{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 2.6000000000000002e-285Initial program 43.7%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in x.re around inf 1.6%
Taylor expanded in y.re around 0 46.0%
*-commutative46.0%
distribute-rgt-neg-in46.0%
Simplified46.0%
if 2.6000000000000002e-285 < x.re Initial program 46.7%
Taylor expanded in x.re around inf 43.4%
Taylor expanded in x.re around inf 66.4%
Taylor expanded in y.re around 0 63.2%
Final simplification54.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.22e+29) (not (<= y.re 8.2e+53))) (* (sin (* y.re (atan2 x.im x.re))) (pow 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_re <= -1.22e+29) || !(y_46_re <= 8.2e+53)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(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;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.22d+29)) .or. (.not. (y_46re <= 8.2d+53))) then
tmp = sin((y_46re * atan2(x_46im, x_46re))) * (x_46re ** y_46re)
else
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.22e+29) || !(y_46_re <= 8.2e+53)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(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_re <= -1.22e+29) or not (y_46_re <= 8.2e+53): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(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_re <= -1.22e+29) || !(y_46_re <= 8.2e+53)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (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_re <= -1.22e+29) || ~((y_46_re <= 8.2e+53))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (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[Or[LessEqual[y$46$re, -1.22e+29], N[Not[LessEqual[y$46$re, 8.2e+53]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, 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.re \leq -1.22 \cdot 10^{+29} \lor \neg \left(y.re \leq 8.2 \cdot 10^{+53}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{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.re < -1.22e29 or 8.20000000000000037e53 < y.re Initial program 38.5%
Taylor expanded in y.im around 0 71.8%
Taylor expanded in x.re around inf 33.6%
Taylor expanded in y.im around 0 53.5%
if -1.22e29 < y.re < 8.20000000000000037e53Initial program 50.7%
Taylor expanded in y.im around 0 41.6%
Taylor expanded in x.re around inf 17.7%
Taylor expanded in y.re around 0 52.9%
*-commutative52.9%
distribute-rgt-neg-in52.9%
Simplified52.9%
Final simplification53.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.re y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(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
code = sin((y_46re * atan2(x_46im, x_46re))) * (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) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}
\end{array}
Initial program 45.1%
Taylor expanded in y.im around 0 55.4%
Taylor expanded in x.re around inf 24.9%
Taylor expanded in y.im around 0 28.0%
Final simplification28.0%
herbie shell --seed 2023283
(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)))))