
(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 16 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 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re 5e+27)
(* t_1 (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
t_1
(sin
(fabs
(fma (atan2 x.im x.re) y.re (* y.im (log (hypot 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(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= 5e+27) {
tmp = t_1 * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * sin(fabs(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * log(hypot(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 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= 5e+27) tmp = Float64(t_1 * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * sin(abs(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * log(hypot(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[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 5e+27], N[(t$95$1 * 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], N[(t$95$1 * N[Sin[N[Abs[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq 5 \cdot 10^{+27}:\\
\;\;\;\;t_1 \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(\left|\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\right)\\
\end{array}
\end{array}
if y.re < 4.99999999999999979e27Initial program 40.6%
Simplified84.6%
if 4.99999999999999979e27 < y.re Initial program 39.1%
Simplified60.9%
add-sqr-sqrt30.4%
sqrt-unprod26.1%
pow226.1%
fma-udef26.1%
*-commutative26.1%
*-commutative26.1%
fma-def26.1%
Applied egg-rr26.1%
unpow226.1%
rem-sqrt-square78.3%
fma-def78.3%
+-commutative78.3%
fma-def78.3%
hypot-def45.7%
unpow245.7%
unpow245.7%
+-commutative45.7%
unpow245.7%
unpow245.7%
hypot-def78.3%
Simplified78.3%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (log (hypot x.re x.im))))
(if (<= y.re 265000000000.0)
(*
(exp (- (* y.re t_1) t_0))
(sin (fma t_1 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin (* y.im (log (hypot 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 265000000000.0) {
tmp = exp(((y_46_re * t_1) - t_0)) * sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin((y_46_im * log(hypot(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(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 265000000000.0) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(Float64(y_46_im * log(hypot(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 265000000000.0], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[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$0), $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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 265000000000:\\
\;\;\;\;e^{y.re \cdot t_1 - t_0} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 2.65e11Initial program 40.4%
Simplified84.3%
if 2.65e11 < y.re Initial program 40.0%
Taylor expanded in y.re around 0 42.0%
unpow242.0%
unpow242.0%
hypot-def78.0%
Simplified78.0%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.im (log (hypot x.im x.re))))
(t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.im -1.75e+15)
(* t_2 (sin (fabs t_1)))
(if (<= y.im 4.5e-6)
(* (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))) (exp (* y.re t_0)))
(* t_2 (sin 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 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_2 = 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)));
double tmp;
if (y_46_im <= -1.75e+15) {
tmp = t_2 * sin(fabs(t_1));
} else if (y_46_im <= 4.5e-6) {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((y_46_re * t_0));
} else {
tmp = t_2 * sin(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 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_2 = 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))) tmp = 0.0 if (y_46_im <= -1.75e+15) tmp = Float64(t_2 * sin(abs(t_1))); elseif (y_46_im <= 4.5e-6) tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(y_46_re * t_0))); else tmp = Float64(t_2 * sin(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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$im, -1.75e+15], N[(t$95$2 * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.5e-6], 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[Exp[N[(y$46$re * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := 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{if}\;y.im \leq -1.75 \cdot 10^{+15}:\\
\;\;\;\;t_2 \cdot \sin \left(\left|t_1\right|\right)\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{y.re \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin t_1\\
\end{array}
\end{array}
if y.im < -1.75e15Initial program 37.2%
Taylor expanded in y.re around 0 37.2%
unpow237.2%
unpow237.2%
hypot-def55.1%
Simplified55.1%
add-sqr-sqrt21.1%
sqrt-unprod29.9%
pow229.9%
Applied egg-rr29.9%
unpow229.9%
rem-sqrt-square65.6%
Simplified65.6%
if -1.75e15 < y.im < 4.50000000000000011e-6Initial program 38.9%
Simplified89.8%
expm1-log1p-u87.7%
expm1-udef87.7%
*-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in y.im around 0 86.4%
if 4.50000000000000011e-6 < y.im Initial program 46.9%
Taylor expanded in y.re around 0 50.3%
unpow250.3%
unpow250.3%
hypot-def71.2%
Simplified71.2%
Final simplification78.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_2 (log (hypot x.re x.im))))
(if (<= y.im -480000.0)
(* t_1 (sin t_0))
(if (<= y.im 8e-5)
(* (sin (fma t_2 y.im t_0)) (exp (* y.re t_2)))
(* t_1 (sin (* y.im (log (hypot 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 = 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)));
double t_2 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_im <= -480000.0) {
tmp = t_1 * sin(t_0);
} else if (y_46_im <= 8e-5) {
tmp = sin(fma(t_2, y_46_im, t_0)) * exp((y_46_re * t_2));
} else {
tmp = t_1 * sin((y_46_im * log(hypot(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 = 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))) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_im <= -480000.0) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_im <= 8e-5) tmp = Float64(sin(fma(t_2, y_46_im, t_0)) * exp(Float64(y_46_re * t_2))); else tmp = Float64(t_1 * sin(Float64(y_46_im * log(hypot(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]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -480000.0], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8e-5], N[(N[Sin[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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 := 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}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -480000:\\
\;\;\;\;t_1 \cdot \sin t_0\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{-5}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_2, y.im, t_0\right)\right) \cdot e^{y.re \cdot t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.im < -4.8e5Initial program 38.7%
Taylor expanded in y.im around 0 62.0%
if -4.8e5 < y.im < 8.00000000000000065e-5Initial program 38.3%
Simplified89.6%
expm1-log1p-u88.9%
expm1-udef88.9%
*-commutative88.9%
Applied egg-rr88.9%
Taylor expanded in y.im around 0 87.5%
if 8.00000000000000065e-5 < y.im Initial program 46.9%
Taylor expanded in y.re around 0 50.3%
unpow250.3%
unpow250.3%
hypot-def71.2%
Simplified71.2%
Final simplification77.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1 (sin (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -8.2e-85)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.re 0.39)
(/ t_1 (pow (exp y.im) (atan2 x.im x.re)))
(* 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 = 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)));
double t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -8.2e-85) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 0.39) {
tmp = t_1 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * 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.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -8.2e-85) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 0.39) {
tmp = t_1 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_1 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -8.2e-85: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 0.39: tmp = t_1 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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))) t_1 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -8.2e-85) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 0.39) tmp = Float64(t_1 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(t_0 * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) 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))); t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -8.2e-85) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 0.39) tmp = t_1 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0 * 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[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]}, Block[{t$95$1 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-85], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.39], N[(t$95$1 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-85}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 0.39:\\
\;\;\;\;\frac{t_1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot t_1\\
\end{array}
\end{array}
if y.re < -8.19999999999999987e-85Initial program 38.8%
Taylor expanded in y.im around 0 80.2%
if -8.19999999999999987e-85 < y.re < 0.39000000000000001Initial program 41.5%
exp-diff41.5%
+-rgt-identity41.5%
+-rgt-identity41.5%
exp-to-pow41.5%
hypot-def41.5%
*-commutative41.5%
exp-prod41.5%
fma-def41.5%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.re around 0 34.6%
unpow234.6%
unpow234.6%
hypot-def65.8%
*-commutative65.8%
exp-prod65.6%
Simplified65.6%
if 0.39000000000000001 < y.re Initial program 40.0%
Taylor expanded in y.re around 0 42.0%
unpow242.0%
unpow242.0%
hypot-def78.0%
Simplified78.0%
Final simplification72.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1 (* y.im (log (hypot x.im x.re)))))
(if (<= y.re -8e-85)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.re 5.2)
(/ (sin t_1) (pow (exp y.im) (atan2 x.im x.re)))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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)));
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -8e-85) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.2) {
tmp = sin(t_1) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -8e-85) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.2) {
tmp = Math.sin(t_1) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_1 = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -8e-85: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 5.2: tmp = math.sin(t_1) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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))) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -8e-85) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 5.2) tmp = Float64(sin(t_1) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(t_1 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) 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))); t_1 = y_46_im * log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_re <= -8e-85) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 5.2) tmp = sin(t_1) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_1 * 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[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]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -8e-85], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.2], N[(N[Sin[t$95$1], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -8 \cdot 10^{-85}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 5.2:\\
\;\;\;\;\frac{\sin t_1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot t_0\\
\end{array}
\end{array}
if y.re < -7.9999999999999998e-85Initial program 38.8%
Taylor expanded in y.im around 0 80.2%
if -7.9999999999999998e-85 < y.re < 5.20000000000000018Initial program 41.5%
exp-diff41.5%
+-rgt-identity41.5%
+-rgt-identity41.5%
exp-to-pow41.5%
hypot-def41.5%
*-commutative41.5%
exp-prod41.5%
fma-def41.5%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.re around 0 34.6%
unpow234.6%
unpow234.6%
hypot-def65.8%
*-commutative65.8%
exp-prod65.6%
Simplified65.6%
if 5.20000000000000018 < y.re Initial program 40.0%
Taylor expanded in y.re around 0 42.0%
unpow242.0%
unpow242.0%
hypot-def78.0%
Simplified78.0%
Taylor expanded in y.im around 0 72.0%
unpow272.0%
unpow272.0%
hypot-def76.0%
Simplified76.0%
Final simplification72.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -8.2e-85)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(if (<= y.re 8.6e-8)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(* (sin (fabs t_0)) (pow (hypot x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -8.2e-85) {
tmp = 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))) * sin(t_0);
} else if (y_46_re <= 8.6e-8) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = sin(fabs(t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -8.2e-85) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(t_0);
} else if (y_46_re <= 8.6e-8) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -8.2e-85: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(t_0) elif y_46_re <= 8.6e-8: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = math.sin(math.fabs(t_0)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -8.2e-85) 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(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); elseif (y_46_re <= 8.6e-8) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(sin(abs(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -8.2e-85) tmp = 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))) * sin(t_0); elseif (y_46_re <= 8.6e-8) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = sin(abs(t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-85], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.6e-8], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-85}:\\
\;\;\;\;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} \cdot \sin t_0\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -8.19999999999999987e-85Initial program 38.8%
Taylor expanded in y.im around 0 80.2%
if -8.19999999999999987e-85 < y.re < 8.6000000000000002e-8Initial program 40.9%
exp-diff40.9%
+-rgt-identity40.9%
+-rgt-identity40.9%
exp-to-pow40.9%
hypot-def40.9%
*-commutative40.9%
exp-prod40.9%
fma-def40.9%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in y.re around 0 35.3%
unpow235.3%
unpow235.3%
hypot-def67.2%
*-commutative67.2%
exp-prod67.0%
Simplified67.0%
if 8.6000000000000002e-8 < y.re Initial program 41.4%
exp-diff30.1%
+-rgt-identity30.1%
+-rgt-identity30.1%
exp-to-pow30.1%
hypot-def30.1%
*-commutative30.1%
exp-prod28.2%
fma-def28.2%
hypot-def50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in y.im around 0 53.0%
*-commutative53.0%
unpow253.0%
unpow253.0%
hypot-def54.8%
Simplified54.8%
add-sqr-sqrt32.1%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
Applied egg-rr32.4%
unpow232.4%
rem-sqrt-square66.4%
Simplified66.4%
Final simplification71.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.im x.re) y.re)))
(if (<= y.re -4.5e-26)
(* (sin t_0) t_1)
(if (<= y.re 9.2e-10)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(* (sin (fabs 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);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.5e-26) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 9.2e-10) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = sin(fabs(t_0)) * 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_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -4.5e-26) {
tmp = Math.sin(t_0) * t_1;
} else if (y_46_re <= 9.2e-10) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = Math.sin(Math.abs(t_0)) * 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_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -4.5e-26: tmp = math.sin(t_0) * t_1 elif y_46_re <= 9.2e-10: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = math.sin(math.fabs(t_0)) * 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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -4.5e-26) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 9.2e-10) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(sin(abs(t_0)) * 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_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -4.5e-26) tmp = sin(t_0) * t_1; elseif (y_46_re <= 9.2e-10) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = sin(abs(t_0)) * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e-26], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 9.2e-10], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * t$95$1), $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.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-26}:\\
\;\;\;\;\sin t_0 \cdot t_1\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot t_1\\
\end{array}
\end{array}
if y.re < -4.4999999999999999e-26Initial program 35.5%
exp-diff25.0%
+-rgt-identity25.0%
+-rgt-identity25.0%
exp-to-pow25.0%
hypot-def25.0%
*-commutative25.0%
exp-prod25.0%
fma-def25.0%
hypot-def68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in y.im around 0 76.6%
*-commutative76.6%
unpow276.6%
unpow276.6%
hypot-def79.1%
Simplified79.1%
if -4.4999999999999999e-26 < y.re < 9.20000000000000028e-10Initial program 42.7%
exp-diff42.7%
+-rgt-identity42.7%
+-rgt-identity42.7%
exp-to-pow42.7%
hypot-def42.7%
*-commutative42.7%
exp-prod42.7%
fma-def42.7%
hypot-def84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y.re around 0 34.5%
unpow234.5%
unpow234.5%
hypot-def65.7%
*-commutative65.7%
exp-prod65.5%
Simplified65.5%
if 9.20000000000000028e-10 < y.re Initial program 41.4%
exp-diff30.1%
+-rgt-identity30.1%
+-rgt-identity30.1%
exp-to-pow30.1%
hypot-def30.1%
*-commutative30.1%
exp-prod28.2%
fma-def28.2%
hypot-def50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in y.im around 0 53.0%
*-commutative53.0%
unpow253.0%
unpow253.0%
hypot-def54.8%
Simplified54.8%
add-sqr-sqrt32.1%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
Applied egg-rr32.4%
unpow232.4%
rem-sqrt-square66.4%
Simplified66.4%
Final simplification69.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re 1.02e-168)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(/
(sin (* y.im (log x.re)))
(exp (- (* (atan2 x.im x.re) y.im) (* y.re (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 <= 1.02e-168) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = sin((y_46_im * log(x_46_re))) / exp(((atan2(x_46_im, x_46_re) * y_46_im) - (y_46_re * log(x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 1.02e-168) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.sin((y_46_im * Math.log(x_46_re))) / Math.exp(((Math.atan2(x_46_im, x_46_re) * y_46_im) - (y_46_re * 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 <= 1.02e-168: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.sin((y_46_im * math.log(x_46_re))) / math.exp(((math.atan2(x_46_im, x_46_re) * y_46_im) - (y_46_re * 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 <= 1.02e-168) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(sin(Float64(y_46_im * log(x_46_re))) / exp(Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) - Float64(y_46_re * 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 <= 1.02e-168) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = sin((y_46_im * log(x_46_re))) / exp(((atan2(x_46_im, x_46_re) * y_46_im) - (y_46_re * 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, 1.02e-168], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] - N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 1.02 \cdot 10^{-168}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log x.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log x.re}}\\
\end{array}
\end{array}
if x.re < 1.01999999999999999e-168Initial program 42.6%
exp-diff36.9%
+-rgt-identity36.9%
+-rgt-identity36.9%
exp-to-pow36.9%
hypot-def36.9%
*-commutative36.9%
exp-prod36.9%
fma-def36.9%
hypot-def73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in y.im around 0 42.7%
*-commutative42.7%
unpow242.7%
unpow242.7%
hypot-def48.6%
Simplified48.6%
if 1.01999999999999999e-168 < x.re Initial program 36.7%
exp-diff31.7%
+-rgt-identity31.7%
+-rgt-identity31.7%
exp-to-pow31.7%
hypot-def31.7%
*-commutative31.7%
exp-prod30.7%
fma-def30.7%
hypot-def72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in x.re around inf 59.8%
associate-/l*59.8%
+-commutative59.8%
mul-1-neg59.8%
unsub-neg59.8%
*-commutative59.8%
log-rec59.8%
*-commutative59.8%
*-commutative59.8%
div-exp65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y.re around 0 64.1%
sin-neg64.1%
mul-1-neg64.1%
sin-neg64.1%
remove-double-neg64.1%
Simplified64.1%
Final simplification54.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1)))
(if (<= y.im -1.6e-103)
(* t_2 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
(if (<= y.im -2e-228)
(* t_1 t_0)
(if (<= y.im 7.5e+74)
(* t_2 t_0)
(* (log (exp t_2)) (pow 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double tmp;
if (y_46_im <= -1.6e-103) {
tmp = t_2 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else if (y_46_im <= -2e-228) {
tmp = t_1 * t_0;
} else if (y_46_im <= 7.5e+74) {
tmp = t_2 * t_0;
} else {
tmp = log(exp(t_2)) * pow(x_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (y_46_im <= -1.6e-103) {
tmp = t_2 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else if (y_46_im <= -2e-228) {
tmp = t_1 * t_0;
} else if (y_46_im <= 7.5e+74) {
tmp = t_2 * t_0;
} else {
tmp = Math.log(Math.exp(t_2)) * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if y_46_im <= -1.6e-103: tmp = t_2 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) elif y_46_im <= -2e-228: tmp = t_1 * t_0 elif y_46_im <= 7.5e+74: tmp = t_2 * t_0 else: tmp = math.log(math.exp(t_2)) * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) tmp = 0.0 if (y_46_im <= -1.6e-103) tmp = Float64(t_2 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); elseif (y_46_im <= -2e-228) tmp = Float64(t_1 * t_0); elseif (y_46_im <= 7.5e+74) tmp = Float64(t_2 * t_0); else tmp = Float64(log(exp(t_2)) * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (y_46_im <= -1.6e-103) tmp = t_2 * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); elseif (y_46_im <= -2e-228) tmp = t_1 * t_0; elseif (y_46_im <= 7.5e+74) tmp = t_2 * t_0; else tmp = log(exp(t_2)) * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e-103], N[(t$95$2 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2e-228], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 7.5e+74], N[(t$95$2 * t$95$0), $MachinePrecision], N[(N[Log[N[Exp[t$95$2], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{-103}:\\
\;\;\;\;t_2 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq -2 \cdot 10^{-228}:\\
\;\;\;\;t_1 \cdot t_0\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+74}:\\
\;\;\;\;t_2 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{t_2}\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.59999999999999988e-103Initial program 37.7%
exp-diff28.9%
+-rgt-identity28.9%
+-rgt-identity28.9%
exp-to-pow29.0%
hypot-def29.0%
*-commutative29.0%
exp-prod27.7%
fma-def27.7%
hypot-def60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in y.im around 0 39.0%
*-commutative39.0%
+-commutative39.0%
unpow239.0%
unpow239.0%
Simplified39.0%
if -1.59999999999999988e-103 < y.im < -2.00000000000000007e-228Initial program 28.0%
exp-diff28.0%
+-rgt-identity28.0%
+-rgt-identity28.0%
exp-to-pow28.0%
hypot-def28.0%
*-commutative28.0%
exp-prod28.0%
fma-def28.0%
hypot-def84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in y.im around 0 48.0%
*-commutative48.0%
unpow248.0%
unpow248.0%
hypot-def51.4%
Simplified51.4%
Taylor expanded in y.re around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -2.00000000000000007e-228 < y.im < 7.5e74Initial program 44.8%
exp-diff43.8%
+-rgt-identity43.8%
+-rgt-identity43.8%
exp-to-pow43.8%
hypot-def43.8%
*-commutative43.8%
exp-prod43.8%
fma-def43.8%
hypot-def87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.im around 0 46.5%
*-commutative46.5%
unpow246.5%
unpow246.5%
hypot-def59.6%
Simplified59.6%
if 7.5e74 < y.im Initial program 43.9%
exp-diff30.9%
+-rgt-identity30.9%
+-rgt-identity30.9%
exp-to-pow30.9%
hypot-def30.9%
*-commutative30.9%
exp-prod30.9%
fma-def30.9%
hypot-def54.8%
*-commutative54.8%
Simplified54.8%
Taylor expanded in y.im around 0 31.9%
*-commutative31.9%
unpow231.9%
unpow231.9%
hypot-def28.0%
Simplified28.0%
Taylor expanded in x.re around 0 27.6%
*-commutative27.6%
Simplified27.6%
add-log-exp48.1%
Applied egg-rr48.1%
Final simplification51.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.im x.re) y.re))) (if (<= y.re 5e+27) (* (sin t_0) t_1) (* (sin (fabs 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);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= 5e+27) {
tmp = sin(t_0) * t_1;
} else {
tmp = sin(fabs(t_0)) * 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_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= 5e+27) {
tmp = Math.sin(t_0) * t_1;
} else {
tmp = Math.sin(Math.abs(t_0)) * 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_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= 5e+27: tmp = math.sin(t_0) * t_1 else: tmp = math.sin(math.fabs(t_0)) * 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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= 5e+27) tmp = Float64(sin(t_0) * t_1); else tmp = Float64(sin(abs(t_0)) * 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_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= 5e+27) tmp = sin(t_0) * t_1; else tmp = sin(abs(t_0)) * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, 5e+27], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * t$95$1), $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.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq 5 \cdot 10^{+27}:\\
\;\;\;\;\sin t_0 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot t_1\\
\end{array}
\end{array}
if y.re < 4.99999999999999979e27Initial program 40.6%
exp-diff36.8%
+-rgt-identity36.8%
+-rgt-identity36.8%
exp-to-pow36.8%
hypot-def36.8%
*-commutative36.8%
exp-prod36.3%
fma-def36.3%
hypot-def78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around 0 39.9%
*-commutative39.9%
unpow239.9%
unpow239.9%
hypot-def44.9%
Simplified44.9%
if 4.99999999999999979e27 < y.re Initial program 39.1%
exp-diff26.1%
+-rgt-identity26.1%
+-rgt-identity26.1%
exp-to-pow26.1%
hypot-def26.1%
*-commutative26.1%
exp-prod26.1%
fma-def26.1%
hypot-def45.7%
*-commutative45.7%
Simplified45.7%
Taylor expanded in y.im around 0 50.1%
*-commutative50.1%
unpow250.1%
unpow250.1%
hypot-def50.1%
Simplified50.1%
add-sqr-sqrt28.3%
sqrt-unprod28.3%
pow228.3%
*-commutative28.3%
Applied egg-rr28.3%
unpow228.3%
rem-sqrt-square67.5%
Simplified67.5%
Final simplification49.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re 1.65e+30)
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(* (sin (fabs t_0)) (pow 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 tmp;
if (y_46_re <= 1.65e+30) {
tmp = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = sin(fabs(t_0)) * pow(x_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= 1.65e+30) {
tmp = Math.sin(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(x_46_im, y_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) tmp = 0 if y_46_re <= 1.65e+30: tmp = math.sin(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.sin(math.fabs(t_0)) * math.pow(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)) tmp = 0.0 if (y_46_re <= 1.65e+30) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(sin(abs(t_0)) * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= 1.65e+30) tmp = sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = sin(abs(t_0)) * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, 1.65e+30], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq 1.65 \cdot 10^{+30}:\\
\;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < 1.65000000000000013e30Initial program 40.6%
exp-diff36.8%
+-rgt-identity36.8%
+-rgt-identity36.8%
exp-to-pow36.8%
hypot-def36.8%
*-commutative36.8%
exp-prod36.3%
fma-def36.3%
hypot-def78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around 0 39.9%
*-commutative39.9%
unpow239.9%
unpow239.9%
hypot-def44.9%
Simplified44.9%
if 1.65000000000000013e30 < y.re Initial program 39.1%
exp-diff26.1%
+-rgt-identity26.1%
+-rgt-identity26.1%
exp-to-pow26.1%
hypot-def26.1%
*-commutative26.1%
exp-prod26.1%
fma-def26.1%
hypot-def45.7%
*-commutative45.7%
Simplified45.7%
Taylor expanded in y.im around 0 50.1%
*-commutative50.1%
unpow250.1%
unpow250.1%
hypot-def50.1%
Simplified50.1%
Taylor expanded in x.re around 0 44.0%
*-commutative44.0%
Simplified44.0%
add-sqr-sqrt26.4%
sqrt-unprod26.3%
pow226.3%
Applied egg-rr26.3%
*-commutative26.3%
unpow226.3%
rem-sqrt-square59.2%
Simplified59.2%
Final simplification47.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= x.re -2.7e+124) (not (<= x.re 2.2e-11)))
(* t_0 (pow x.re y.re))
(* t_0 (pow 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((x_46_re <= -2.7e+124) || !(x_46_re <= 2.2e-11)) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if ((x_46re <= (-2.7d+124)) .or. (.not. (x_46re <= 2.2d-11))) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((x_46_re <= -2.7e+124) || !(x_46_re <= 2.2e-11)) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (x_46_re <= -2.7e+124) or not (x_46_re <= 2.2e-11): tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((x_46_re <= -2.7e+124) || !(x_46_re <= 2.2e-11)) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_0 * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((x_46_re <= -2.7e+124) || ~((x_46_re <= 2.2e-11))) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x$46$re, -2.7e+124], N[Not[LessEqual[x$46$re, 2.2e-11]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -2.7 \cdot 10^{+124} \lor \neg \left(x.re \leq 2.2 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.69999999999999978e124 or 2.2000000000000002e-11 < x.re Initial program 18.6%
exp-diff18.6%
+-rgt-identity18.6%
+-rgt-identity18.6%
exp-to-pow18.6%
hypot-def18.6%
*-commutative18.6%
exp-prod17.6%
fma-def17.6%
hypot-def73.5%
*-commutative73.5%
Simplified73.5%
Taylor expanded in y.im around 0 39.9%
*-commutative39.9%
unpow239.9%
unpow239.9%
hypot-def43.6%
Simplified43.6%
Taylor expanded in x.im around 0 36.8%
*-commutative36.8%
Simplified36.8%
if -2.69999999999999978e124 < x.re < 2.2000000000000002e-11Initial program 54.0%
exp-diff45.1%
+-rgt-identity45.1%
+-rgt-identity45.1%
exp-to-pow45.2%
hypot-def45.2%
*-commutative45.2%
exp-prod45.1%
fma-def45.1%
hypot-def72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in y.im around 0 42.9%
*-commutative42.9%
unpow242.9%
unpow242.9%
hypot-def47.3%
Simplified47.3%
Taylor expanded in x.re around 0 40.0%
*-commutative40.0%
Simplified40.0%
Final simplification38.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * atan2(x_46_im, x_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
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)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_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)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (hypot(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) tmp = (y_46_re * atan2(x_46_im, x_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 40.3%
exp-diff34.9%
+-rgt-identity34.9%
+-rgt-identity34.9%
exp-to-pow34.9%
hypot-def34.9%
*-commutative34.9%
exp-prod34.5%
fma-def34.5%
hypot-def72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in y.im around 0 41.7%
*-commutative41.7%
unpow241.7%
unpow241.7%
hypot-def45.8%
Simplified45.8%
Taylor expanded in y.re around 0 43.9%
*-commutative43.9%
Simplified43.9%
Final simplification43.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.im 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_im, y_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, 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_im, 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_im ^ 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_im ^ 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$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 40.3%
exp-diff34.9%
+-rgt-identity34.9%
+-rgt-identity34.9%
exp-to-pow34.9%
hypot-def34.9%
*-commutative34.9%
exp-prod34.5%
fma-def34.5%
hypot-def72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in y.im around 0 41.7%
*-commutative41.7%
unpow241.7%
unpow241.7%
hypot-def45.8%
Simplified45.8%
Taylor expanded in x.re around 0 32.3%
*-commutative32.3%
Simplified32.3%
Final simplification32.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (pow x.im y.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)) * pow(x_46_im, y_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = (y_46re * atan2(x_46im, x_46re)) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(x_46_im, y_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)) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (x_46_im ^ y_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)) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 40.3%
exp-diff34.9%
+-rgt-identity34.9%
+-rgt-identity34.9%
exp-to-pow34.9%
hypot-def34.9%
*-commutative34.9%
exp-prod34.5%
fma-def34.5%
hypot-def72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in y.im around 0 41.7%
*-commutative41.7%
unpow241.7%
unpow241.7%
hypot-def45.8%
Simplified45.8%
Taylor expanded in x.re around 0 32.3%
*-commutative32.3%
Simplified32.3%
Taylor expanded in y.re around 0 31.9%
*-commutative31.9%
Simplified31.9%
Final simplification31.9%
herbie shell --seed 2023173
(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)))))