
(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 22 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 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (cbrt (* t_1 y.im)))
(t_3 (cbrt (fma y.im t_1 t_0)))
(t_4 (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= x.re 2.4e-284)
(* t_4 (sin (* t_3 (pow (pow (cbrt t_3) 2.0) 3.0))))
(* t_4 (sin (fma (pow t_2 2.0) t_2 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = cbrt((t_1 * y_46_im));
double t_3 = cbrt(fma(y_46_im, t_1, t_0));
double t_4 = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (x_46_re <= 2.4e-284) {
tmp = t_4 * sin((t_3 * pow(pow(cbrt(t_3), 2.0), 3.0)));
} else {
tmp = t_4 * sin(fma(pow(t_2, 2.0), t_2, t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = cbrt(Float64(t_1 * y_46_im)) t_3 = cbrt(fma(y_46_im, t_1, t_0)) t_4 = exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (x_46_re <= 2.4e-284) tmp = Float64(t_4 * sin(Float64(t_3 * ((cbrt(t_3) ^ 2.0) ^ 3.0)))); else tmp = Float64(t_4 * sin(fma((t_2 ^ 2.0), t_2, t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t$95$1 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 2.4e-284], N[(t$95$4 * 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$4 * N[Sin[N[(N[Power[t$95$2, 2.0], $MachinePrecision] * t$95$2 + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \sqrt[3]{t\_1 \cdot y.im}\\
t_3 := \sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_0\right)}\\
t_4 := e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;x.re \leq 2.4 \cdot 10^{-284}:\\
\;\;\;\;t\_4 \cdot \sin \left(t\_3 \cdot {\left({\left(\sqrt[3]{t\_3}\right)}^{2}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4 \cdot \sin \left(\mathsf{fma}\left({t\_2}^{2}, t\_2, t\_0\right)\right)\\
\end{array}
\end{array}
if x.re < 2.40000000000000003e-284Initial program 44.7%
fma-neg44.7%
hypot-define44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define82.8%
*-commutative82.8%
Simplified82.8%
add-cube-cbrt82.3%
pow381.6%
fma-undefine81.6%
*-commutative81.6%
*-commutative81.6%
fma-define81.6%
Applied egg-rr81.6%
add-cube-cbrt79.7%
unpow-prod-down83.0%
pow283.7%
pow383.0%
add-cube-cbrt87.1%
Applied egg-rr87.1%
if 2.40000000000000003e-284 < x.re Initial program 36.7%
fma-neg36.7%
hypot-define36.7%
distribute-rgt-neg-out36.7%
fma-define36.7%
hypot-define86.0%
*-commutative86.0%
Simplified86.0%
add-cube-cbrt84.9%
pow383.7%
fma-undefine83.7%
*-commutative83.7%
*-commutative83.7%
fma-define83.7%
Applied egg-rr83.7%
rem-cube-cbrt86.0%
hypot-undefine36.7%
+-commutative36.7%
hypot-undefine86.0%
*-commutative86.0%
fma-undefine86.0%
add-cube-cbrt87.2%
fma-define87.2%
Applied egg-rr87.2%
Final simplification87.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (cbrt (* t_0 y.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma (pow t_1 2.0) t_1 (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = cbrt((t_0 * y_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(pow(t_1, 2.0), t_1, (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)) t_1 = cbrt(Float64(t_0 * y_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma((t_1 ^ 2.0), t_1, 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]}, Block[{t$95$1 = N[Power[N[(t$95$0 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Power[t$95$1, 2.0], $MachinePrecision] * t$95$1 + 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)\\
t_1 := \sqrt[3]{t\_0 \cdot y.im}\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left({t\_1}^{2}, t\_1, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 41.4%
fma-neg41.4%
hypot-define41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define84.1%
*-commutative84.1%
Simplified84.1%
add-cube-cbrt83.4%
pow382.5%
fma-undefine82.5%
*-commutative82.5%
*-commutative82.5%
fma-define82.5%
Applied egg-rr82.5%
rem-cube-cbrt84.1%
hypot-undefine41.4%
+-commutative41.4%
hypot-undefine84.1%
*-commutative84.1%
fma-undefine84.1%
add-cube-cbrt85.2%
fma-define85.2%
Applied egg-rr85.2%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.im -8.2e-5)
(* t_1 (sin (pow (cbrt (* t_0 y.im)) 3.0)))
(if (<= y.im 4.7e+17)
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(exp (+ (* t_0 y.re) (* (atan2 x.im x.re) y.im))))
(* t_1 (sin (* y.im (+ t_0 (* y.re (/ (atan2 x.im x.re) y.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -8.2e-5) {
tmp = t_1 * sin(pow(cbrt((t_0 * y_46_im)), 3.0));
} else if (y_46_im <= 4.7e+17) {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp(((t_0 * y_46_re) + (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_1 * sin((y_46_im * (t_0 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_im <= -8.2e-5) tmp = Float64(t_1 * sin((cbrt(Float64(t_0 * y_46_im)) ^ 3.0))); elseif (y_46_im <= 4.7e+17) tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(Float64(t_0 * y_46_re) + Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(t_1 * sin(Float64(y_46_im * Float64(t_0 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -8.2e-5], N[(t$95$1 * N[Sin[N[Power[N[Power[N[(t$95$0 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.7e+17], 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[(N[(t$95$0 * y$46$re), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(y$46$im * N[(t$95$0 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $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^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{-5}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_0 \cdot y.im}\right)}^{3}\right)\\
\mathbf{elif}\;y.im \leq 4.7 \cdot 10^{+17}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{t\_0 \cdot y.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(y.im \cdot \left(t\_0 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\end{array}
\end{array}
if y.im < -8.20000000000000009e-5Initial program 34.0%
fma-neg34.0%
hypot-define34.0%
distribute-rgt-neg-out34.0%
fma-define34.0%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
add-cube-cbrt74.5%
pow372.3%
fma-undefine72.3%
*-commutative72.3%
*-commutative72.3%
fma-define72.3%
Applied egg-rr72.3%
Taylor expanded in y.im around inf 37.5%
+-commutative37.5%
unpow237.5%
unpow237.5%
hypot-undefine77.6%
Simplified77.6%
if -8.20000000000000009e-5 < y.im < 4.7e17Initial program 48.3%
fma-neg48.3%
hypot-define48.3%
distribute-rgt-neg-out48.3%
fma-define48.3%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
fma-undefine89.2%
hypot-define67.5%
*-commutative67.5%
hypot-define89.2%
*-commutative89.2%
add-sqr-sqrt44.3%
sqrt-unprod88.9%
sqr-neg88.9%
sqrt-unprod44.7%
add-sqr-sqrt88.9%
Applied egg-rr88.9%
if 4.7e17 < y.im Initial program 28.9%
fma-neg28.9%
hypot-define28.9%
distribute-rgt-neg-out28.9%
fma-define28.9%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
add-cube-cbrt78.5%
pow374.4%
fma-undefine74.4%
*-commutative74.4%
*-commutative74.4%
fma-define74.4%
Applied egg-rr74.4%
Taylor expanded in y.im around inf 28.9%
+-commutative28.9%
unpow228.9%
unpow228.9%
hypot-undefine78.4%
associate-/l*80.4%
Simplified80.4%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
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(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
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[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 41.4%
fma-neg41.4%
hypot-define41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define84.1%
*-commutative84.1%
Simplified84.1%
Final simplification84.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2
(*
(exp (- (pow (cbrt (* t_1 y.re)) 3.0) (* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.re -8.8e-8)
t_2
(if (<= y.re 140.0)
(* (sin (fma t_1 y.im t_0)) (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 7e+212)
t_2
(pow
(pow (* (pow (hypot x.re x.im) y.re) (sin t_0)) 3.0)
0.3333333333333333))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp((pow(cbrt((t_1 * y_46_re)), 3.0) - (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_re <= -8.8e-8) {
tmp = t_2;
} else if (y_46_re <= 140.0) {
tmp = sin(fma(t_1, y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 7e+212) {
tmp = t_2;
} else {
tmp = pow(pow((pow(hypot(x_46_re, x_46_im), y_46_re) * sin(t_0)), 3.0), 0.3333333333333333);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(exp(Float64((cbrt(Float64(t_1 * y_46_re)) ^ 3.0) - 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_re <= -8.8e-8) tmp = t_2; elseif (y_46_re <= 140.0) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 7e+212) tmp = t_2; else tmp = (Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(t_0)) ^ 3.0) ^ 0.3333333333333333; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[Power[N[Power[N[(t$95$1 * y$46$re), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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$re, -8.8e-8], t$95$2, If[LessEqual[y$46$re, 140.0], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7e+212], t$95$2, N[Power[N[Power[N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{{\left(\sqrt[3]{t\_1 \cdot y.re}\right)}^{3} - \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.re \leq -8.8 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 140:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{+212}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left({\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin t\_0\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -8.7999999999999994e-8 or 140 < y.re < 6.99999999999999974e212Initial program 35.2%
Taylor expanded in y.re around 0 39.0%
unpow239.0%
unpow239.0%
hypot-undefine76.3%
Simplified76.3%
add-cube-cbrt76.3%
pow376.3%
*-commutative76.3%
hypot-define81.2%
Applied egg-rr81.2%
if -8.7999999999999994e-8 < y.re < 140Initial program 45.7%
fma-neg45.7%
hypot-define45.7%
distribute-rgt-neg-out45.7%
fma-define45.7%
hypot-define89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y.re around 0 86.4%
neg-mul-186.4%
*-commutative86.4%
distribute-rgt-neg-in86.4%
Simplified86.4%
if 6.99999999999999974e212 < y.re Initial program 45.8%
exp-diff33.3%
exp-to-pow33.3%
hypot-define33.3%
*-commutative33.3%
exp-prod33.3%
fma-define33.3%
hypot-define45.8%
*-commutative45.8%
Simplified45.8%
Taylor expanded in y.im around 0 75.1%
unpow275.1%
unpow275.1%
hypot-undefine75.1%
Simplified75.1%
add-cbrt-cube75.1%
pow1/383.4%
pow383.4%
*-commutative83.4%
add-sqr-sqrt83.4%
sqrt-unprod83.4%
hypot-undefine83.4%
hypot-undefine83.4%
add-sqr-sqrt83.4%
+-commutative83.4%
hypot-undefine83.4%
Applied egg-rr83.4%
Final simplification84.0%
(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)))
(t_2 (* t_1 y.re)))
(if (<= y.im -8.2e-5)
(*
(exp (- (pow (cbrt t_2) 3.0) t_0))
(sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.im 4.7e+17)
(* (sin (fma t_1 y.im (* y.re (atan2 x.im x.re)))) (exp (+ t_2 t_0)))
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (* y.im (+ t_1 (* y.re (/ (atan2 x.im x.re) y.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = t_1 * y_46_re;
double tmp;
if (y_46_im <= -8.2e-5) {
tmp = exp((pow(cbrt(t_2), 3.0) - t_0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 4.7e+17) {
tmp = sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((t_2 + t_0));
} else {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin((y_46_im * (t_1 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(t_1 * y_46_re) tmp = 0.0 if (y_46_im <= -8.2e-5) tmp = Float64(exp(Float64((cbrt(t_2) ^ 3.0) - t_0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_im <= 4.7e+17) tmp = Float64(sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(t_2 + t_0))); else tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(Float64(y_46_im * Float64(t_1 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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]}, Block[{t$95$2 = N[(t$95$1 * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -8.2e-5], N[(N[Exp[N[(N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $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], If[LessEqual[y$46$im, 4.7e+17], N[(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] * N[Exp[N[(t$95$2 + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[(t$95$1 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $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)\\
t_2 := t\_1 \cdot y.re\\
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{-5}:\\
\;\;\;\;e^{{\left(\sqrt[3]{t\_2}\right)}^{3} - t\_0} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 4.7 \cdot 10^{+17}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{t\_2 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(y.im \cdot \left(t\_1 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\end{array}
\end{array}
if y.im < -8.20000000000000009e-5Initial program 34.0%
Taylor expanded in y.re around 0 35.7%
unpow235.7%
unpow235.7%
hypot-undefine62.8%
Simplified62.8%
add-cube-cbrt62.8%
pow362.8%
*-commutative62.8%
hypot-define73.6%
Applied egg-rr73.6%
if -8.20000000000000009e-5 < y.im < 4.7e17Initial program 48.3%
fma-neg48.3%
hypot-define48.3%
distribute-rgt-neg-out48.3%
fma-define48.3%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
fma-undefine89.2%
hypot-define67.5%
*-commutative67.5%
hypot-define89.2%
*-commutative89.2%
add-sqr-sqrt44.3%
sqrt-unprod88.9%
sqr-neg88.9%
sqrt-unprod44.7%
add-sqr-sqrt88.9%
Applied egg-rr88.9%
if 4.7e17 < y.im Initial program 28.9%
fma-neg28.9%
hypot-define28.9%
distribute-rgt-neg-out28.9%
fma-define28.9%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
add-cube-cbrt78.5%
pow374.4%
fma-undefine74.4%
*-commutative74.4%
*-commutative74.4%
fma-define74.4%
Applied egg-rr74.4%
Taylor expanded in y.im around inf 28.9%
+-commutative28.9%
unpow228.9%
unpow228.9%
hypot-undefine78.4%
associate-/l*80.4%
Simplified80.4%
Final simplification83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.re -0.036)
(*
(exp (- (pow (cbrt (* t_1 y.re)) 3.0) (* (atan2 x.im x.re) y.im)))
(sin (* y.im t_0)))
(if (<= y.re 5.2e-138)
(* t_2 (sin (* y.im (+ t_1 (/ y.re (/ y.im (atan2 x.im x.re)))))))
(* t_2 (sin (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_re <= -0.036) {
tmp = exp((pow(cbrt((t_1 * y_46_re)), 3.0) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * t_0));
} else if (y_46_re <= 5.2e-138) {
tmp = t_2 * sin((y_46_im * (t_1 + (y_46_re / (y_46_im / atan2(x_46_im, x_46_re))))));
} else {
tmp = t_2 * sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_re <= -0.036) tmp = Float64(exp(Float64((cbrt(Float64(t_1 * y_46_re)) ^ 3.0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * t_0))); elseif (y_46_re <= 5.2e-138) tmp = Float64(t_2 * sin(Float64(y_46_im * Float64(t_1 + Float64(y_46_re / Float64(y_46_im / atan(x_46_im, x_46_re))))))); else tmp = Float64(t_2 * sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.036], N[(N[Exp[N[(N[Power[N[Power[N[(t$95$1 * y$46$re), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.2e-138], N[(t$95$2 * N[Sin[N[(y$46$im * N[(t$95$1 + N[(y$46$re / N[(y$46$im / N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.re \leq -0.036:\\
\;\;\;\;e^{{\left(\sqrt[3]{t\_1 \cdot y.re}\right)}^{3} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{-138}:\\
\;\;\;\;t\_2 \cdot \sin \left(y.im \cdot \left(t\_1 + \frac{y.re}{\frac{y.im}{\tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -0.0359999999999999973Initial program 36.2%
Taylor expanded in y.re around 0 39.7%
unpow239.7%
unpow239.7%
hypot-undefine88.0%
Simplified88.0%
add-cube-cbrt88.0%
pow388.0%
*-commutative88.0%
hypot-define90.1%
Applied egg-rr90.1%
if -0.0359999999999999973 < y.re < 5.2e-138Initial program 48.5%
fma-neg48.5%
hypot-define48.5%
distribute-rgt-neg-out48.5%
fma-define48.5%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
add-cube-cbrt87.8%
pow386.7%
fma-undefine86.7%
*-commutative86.7%
*-commutative86.7%
fma-define86.7%
Applied egg-rr86.7%
Taylor expanded in y.im around inf 48.5%
+-commutative48.5%
unpow248.5%
unpow248.5%
hypot-undefine88.5%
associate-/l*87.5%
Simplified87.5%
clear-num87.5%
un-div-inv88.6%
Applied egg-rr88.6%
if 5.2e-138 < y.re Initial program 37.8%
fma-neg37.8%
hypot-define37.8%
distribute-rgt-neg-out37.8%
fma-define37.8%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.re around inf 37.8%
+-commutative37.8%
associate-/l*39.0%
unpow239.0%
unpow239.0%
hypot-undefine77.8%
Simplified77.8%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* t_0 y.re))
(t_2 (* (atan2 x.im x.re) y.im)))
(if (or (<= y.im -8.2e-5) (not (<= y.im 4.6e+15)))
(*
(exp (- (pow (cbrt t_1) 3.0) t_2))
(sin (* y.im (log (hypot x.im x.re)))))
(* (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))) (exp (+ t_1 t_2))))))
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 = t_0 * y_46_re;
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if ((y_46_im <= -8.2e-5) || !(y_46_im <= 4.6e+15)) {
tmp = exp((pow(cbrt(t_1), 3.0) - t_2)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((t_1 + t_2));
}
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(t_0 * y_46_re) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if ((y_46_im <= -8.2e-5) || !(y_46_im <= 4.6e+15)) tmp = Float64(exp(Float64((cbrt(t_1) ^ 3.0) - t_2)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(t_1 + t_2))); 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$re), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -8.2e-5], N[Not[LessEqual[y$46$im, 4.6e+15]], $MachinePrecision]], N[(N[Exp[N[(N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision] - t$95$2), $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], 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[(t$95$1 + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := t\_0 \cdot y.re\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{-5} \lor \neg \left(y.im \leq 4.6 \cdot 10^{+15}\right):\\
\;\;\;\;e^{{\left(\sqrt[3]{t\_1}\right)}^{3} - t\_2} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{t\_1 + t\_2}\\
\end{array}
\end{array}
if y.im < -8.20000000000000009e-5 or 4.6e15 < y.im Initial program 31.3%
Taylor expanded in y.re around 0 33.2%
unpow233.2%
unpow233.2%
hypot-undefine60.9%
Simplified60.9%
add-cube-cbrt60.9%
pow360.9%
*-commutative60.9%
hypot-define76.1%
Applied egg-rr76.1%
if -8.20000000000000009e-5 < y.im < 4.6e15Initial program 48.6%
fma-neg48.6%
hypot-define48.6%
distribute-rgt-neg-out48.6%
fma-define48.6%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
fma-undefine89.1%
hypot-define67.3%
*-commutative67.3%
hypot-define89.1%
*-commutative89.1%
add-sqr-sqrt44.6%
sqrt-unprod88.8%
sqr-neg88.8%
sqrt-unprod44.3%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (exp y.im) (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (* t_2 (/ (pow (hypot x.re x.im) y.re) t_0))))
(if (<= y.re -8.8e-8)
(* (fabs t_2) (pow (hypot x.im x.re) y.re))
(if (<= y.re -1.7e-152)
t_3
(if (<= y.re 1.08e-193)
(/ (sin (* y.im (log (hypot x.im x.re)))) t_0)
(if (<= y.re 5.8e+43)
t_3
(if (<= y.re 6.6e+104)
(* (sin (pow (cbrt t_1) 3.0)) (pow x.im y.re))
(if (<= y.re 6.3e+124)
(* (pow x.im y.re) (sin (fabs t_1)))
(*
t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(exp(y_46_im), atan2(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = t_2 * (pow(hypot(x_46_re, x_46_im), y_46_re) / t_0);
double tmp;
if (y_46_re <= -8.8e-8) {
tmp = fabs(t_2) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -1.7e-152) {
tmp = t_3;
} else if (y_46_re <= 1.08e-193) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / t_0;
} else if (y_46_re <= 5.8e+43) {
tmp = t_3;
} else if (y_46_re <= 6.6e+104) {
tmp = sin(pow(cbrt(t_1), 3.0)) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 6.3e+124) {
tmp = pow(x_46_im, y_46_re) * sin(fabs(t_1));
} else {
tmp = 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)));
}
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.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double t_3 = t_2 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / t_0);
double tmp;
if (y_46_re <= -8.8e-8) {
tmp = Math.abs(t_2) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -1.7e-152) {
tmp = t_3;
} else if (y_46_re <= 1.08e-193) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / t_0;
} else if (y_46_re <= 5.8e+43) {
tmp = t_3;
} else if (y_46_re <= 6.6e+104) {
tmp = Math.sin(Math.pow(Math.cbrt(t_1), 3.0)) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 6.3e+124) {
tmp = Math.pow(x_46_im, y_46_re) * Math.sin(Math.abs(t_1));
} else {
tmp = t_2 * 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)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(y_46_im) ^ atan(x_46_im, x_46_re) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(t_2 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / t_0)) tmp = 0.0 if (y_46_re <= -8.8e-8) tmp = Float64(abs(t_2) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= -1.7e-152) tmp = t_3; elseif (y_46_re <= 1.08e-193) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / t_0); elseif (y_46_re <= 5.8e+43) tmp = t_3; elseif (y_46_re <= 6.6e+104) tmp = Float64(sin((cbrt(t_1) ^ 3.0)) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 6.3e+124) tmp = Float64((x_46_im ^ y_46_re) * sin(abs(t_1))); else tmp = Float64(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)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -8.8e-8], N[(N[Abs[t$95$2], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.7e-152], t$95$3, If[LessEqual[y$46$re, 1.08e-193], 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$0), $MachinePrecision], If[LessEqual[y$46$re, 5.8e+43], t$95$3, If[LessEqual[y$46$re, 6.6e+104], N[(N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.3e+124], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := t\_2 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_0}\\
\mathbf{if}\;y.re \leq -8.8 \cdot 10^{-8}:\\
\;\;\;\;\left|t\_2\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq -1.7 \cdot 10^{-152}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-193}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{t\_0}\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{+43}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{+104}:\\
\;\;\;\;\sin \left({\left(\sqrt[3]{t\_1}\right)}^{3}\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.3 \cdot 10^{+124}:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin \left(\left|t\_1\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \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}\\
\end{array}
\end{array}
if y.re < -8.7999999999999994e-8Initial program 35.6%
exp-diff30.5%
exp-to-pow30.5%
hypot-define30.5%
*-commutative30.5%
exp-prod30.5%
fma-define30.5%
hypot-define66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in y.im around 0 84.9%
unpow284.9%
unpow284.9%
hypot-undefine84.9%
Simplified84.9%
add-sqr-sqrt23.9%
sqrt-unprod66.4%
pow266.4%
*-commutative66.4%
Applied egg-rr86.6%
*-commutative66.4%
unpow266.4%
rem-sqrt-square66.4%
Simplified86.6%
if -8.7999999999999994e-8 < y.re < -1.69999999999999992e-152 or 1.08e-193 < y.re < 5.8000000000000004e43Initial program 38.6%
exp-diff38.6%
exp-to-pow38.6%
hypot-define38.6%
*-commutative38.6%
exp-prod38.6%
fma-define38.6%
hypot-define87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y.im around 0 76.5%
if -1.69999999999999992e-152 < y.re < 1.08e-193Initial program 51.9%
exp-diff51.9%
exp-to-pow51.9%
hypot-define51.9%
*-commutative51.9%
exp-prod51.7%
fma-define51.7%
hypot-define84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in y.re around 0 45.5%
unpow245.5%
unpow245.5%
hypot-undefine77.4%
exp-prod77.2%
Simplified77.2%
if 5.8000000000000004e43 < y.re < 6.59999999999999969e104Initial program 33.3%
exp-diff33.3%
exp-to-pow33.3%
hypot-define33.3%
*-commutative33.3%
exp-prod26.7%
fma-define26.7%
hypot-define40.0%
*-commutative40.0%
Simplified40.0%
Taylor expanded in y.im around 0 47.0%
unpow247.0%
unpow247.0%
hypot-undefine47.0%
Simplified47.0%
Taylor expanded in x.re around 0 47.2%
*-commutative47.2%
add-cube-cbrt60.5%
pow367.2%
Applied egg-rr67.2%
if 6.59999999999999969e104 < y.re < 6.29999999999999964e124Initial program 37.5%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.im around 0 75.0%
unpow275.0%
unpow275.0%
hypot-undefine75.0%
Simplified75.0%
Taylor expanded in x.re around 0 75.0%
*-commutative75.0%
add-sqr-sqrt37.5%
sqrt-unprod100.0%
pow2100.0%
Applied egg-rr100.0%
*-commutative100.0%
unpow2100.0%
rem-sqrt-square100.0%
Simplified100.0%
if 6.29999999999999964e124 < y.re Initial program 43.9%
Taylor expanded in y.im around 0 73.2%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= y.re -6.3e-9)
(* (fabs t_1) (pow (hypot x.im x.re) y.re))
(if (<= y.re 3.5e+50)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(*
t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -6.3e-9) {
tmp = fabs(t_1) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 3.5e+50) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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)));
}
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 = sin(t_0) tmp = 0.0 if (y_46_re <= -6.3e-9) tmp = Float64(abs(t_1) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 3.5e+50) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(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)))); 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[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -6.3e-9], N[(N[Abs[t$95$1], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e+50], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.re \leq -6.3 \cdot 10^{-9}:\\
\;\;\;\;\left|t\_1\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+50}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \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}\\
\end{array}
\end{array}
if y.re < -6.3000000000000002e-9Initial program 35.0%
exp-diff30.0%
exp-to-pow30.0%
hypot-define30.0%
*-commutative30.0%
exp-prod30.0%
fma-define30.0%
hypot-define67.1%
*-commutative67.1%
Simplified67.1%
Taylor expanded in y.im around 0 83.5%
unpow283.5%
unpow283.5%
hypot-undefine85.1%
Simplified85.1%
add-sqr-sqrt23.5%
sqrt-unprod65.3%
pow265.3%
*-commutative65.3%
Applied egg-rr86.8%
*-commutative65.3%
unpow265.3%
rem-sqrt-square65.3%
Simplified86.8%
if -6.3000000000000002e-9 < y.re < 3.50000000000000006e50Initial program 43.4%
fma-neg43.4%
hypot-define43.4%
distribute-rgt-neg-out43.4%
fma-define43.4%
hypot-define86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in y.re around 0 83.3%
neg-mul-183.3%
*-commutative83.3%
distribute-rgt-neg-in83.3%
Simplified83.3%
if 3.50000000000000006e50 < y.re Initial program 43.3%
Taylor expanded in y.im around 0 71.7%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -6.3e-24)
(* (sin (* y.re (atan2 x.im x.re))) t_0)
(if (<= y.re 5.5e-138)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(* t_0 (sin (* (sqrt y.re) (* (atan2 x.im x.re) (sqrt 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 tmp;
if (y_46_re <= -6.3e-24) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 5.5e-138) {
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 = t_0 * sin((sqrt(y_46_re) * (atan2(x_46_im, x_46_re) * sqrt(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 tmp;
if (y_46_re <= -6.3e-24) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 5.5e-138) {
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 = t_0 * Math.sin((Math.sqrt(y_46_re) * (Math.atan2(x_46_im, x_46_re) * Math.sqrt(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) tmp = 0 if y_46_re <= -6.3e-24: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 elif y_46_re <= 5.5e-138: 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 = t_0 * math.sin((math.sqrt(y_46_re) * (math.atan2(x_46_im, x_46_re) * math.sqrt(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 tmp = 0.0 if (y_46_re <= -6.3e-24) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); elseif (y_46_re <= 5.5e-138) 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(t_0 * sin(Float64(sqrt(y_46_re) * Float64(atan(x_46_im, x_46_re) * sqrt(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; tmp = 0.0; if (y_46_re <= -6.3e-24) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_0; elseif (y_46_re <= 5.5e-138) 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 = t_0 * sin((sqrt(y_46_re) * (atan2(x_46_im, x_46_re) * sqrt(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]}, If[LessEqual[y$46$re, -6.3e-24], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 5.5e-138], 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[(t$95$0 * N[Sin[N[(N[Sqrt[y$46$re], $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Sqrt[y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -6.3 \cdot 10^{-24}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{-138}:\\
\;\;\;\;\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}:\\
\;\;\;\;t\_0 \cdot \sin \left(\sqrt{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt{y.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -6.29999999999999979e-24Initial program 35.4%
exp-diff30.8%
exp-to-pow30.8%
hypot-define30.8%
*-commutative30.8%
exp-prod30.8%
fma-define30.8%
hypot-define68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in y.im around 0 78.8%
unpow278.8%
unpow278.8%
hypot-undefine83.2%
Simplified83.2%
if -6.29999999999999979e-24 < y.re < 5.5000000000000003e-138Initial program 50.1%
exp-diff50.1%
exp-to-pow50.1%
hypot-define50.1%
*-commutative50.1%
exp-prod49.9%
fma-define49.9%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.re around 0 39.5%
unpow239.5%
unpow239.5%
hypot-undefine72.6%
exp-prod72.5%
Simplified72.5%
if 5.5000000000000003e-138 < y.re Initial program 37.8%
exp-diff34.0%
exp-to-pow34.0%
hypot-define34.0%
*-commutative34.0%
exp-prod33.0%
fma-define33.0%
hypot-define65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in y.im around 0 56.3%
unpow256.3%
unpow256.3%
hypot-undefine63.5%
Simplified63.5%
*-commutative63.5%
add-cbrt-cube29.1%
pow329.1%
Applied egg-rr29.1%
rem-cbrt-cube63.5%
add-sqr-sqrt62.5%
associate-*r*64.4%
Applied egg-rr64.4%
Final simplification72.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -2.1e-29) (not (<= y.re 5.5e-138)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(/
(sin (* y.im (log (hypot 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 tmp;
if ((y_46_re <= -2.1e-29) || !(y_46_re <= 5.5e-138)) {
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(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.1e-29) || !(y_46_re <= 5.5e-138)) {
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(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.1e-29) or not (y_46_re <= 5.5e-138): 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(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.1e-29) || !(y_46_re <= 5.5e-138)) 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(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.1e-29) || ~((y_46_re <= 5.5e-138))) 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(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.1e-29], N[Not[LessEqual[y$46$re, 5.5e-138]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-29} \lor \neg \left(y.re \leq 5.5 \cdot 10^{-138}\right):\\
\;\;\;\;\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 \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -2.09999999999999989e-29 or 5.5000000000000003e-138 < y.re Initial program 36.9%
exp-diff32.7%
exp-to-pow32.7%
hypot-define32.7%
*-commutative32.7%
exp-prod32.1%
fma-define32.1%
hypot-define66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in y.im around 0 65.0%
unpow265.0%
unpow265.0%
hypot-undefine71.1%
Simplified71.1%
if -2.09999999999999989e-29 < y.re < 5.5000000000000003e-138Initial program 50.1%
exp-diff50.1%
exp-to-pow50.1%
hypot-define50.1%
*-commutative50.1%
exp-prod49.9%
fma-define49.9%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.re around 0 39.5%
unpow239.5%
unpow239.5%
hypot-undefine72.6%
exp-prod72.5%
Simplified72.5%
Final simplification71.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -235.0) (not (<= y.im 5e+16)))
(log (pow (exp t_0) (pow x.im y.re)))
(* 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -235.0) || !(y_46_im <= 5e+16)) {
tmp = log(pow(exp(t_0), pow(x_46_im, y_46_re)));
} else {
tmp = 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 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -235.0) || !(y_46_im <= 5e+16)) {
tmp = Math.log(Math.pow(Math.exp(t_0), Math.pow(x_46_im, y_46_re)));
} else {
tmp = 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 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -235.0) or not (y_46_im <= 5e+16): tmp = math.log(math.pow(math.exp(t_0), math.pow(x_46_im, y_46_re))) else: tmp = 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 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -235.0) || !(y_46_im <= 5e+16)) tmp = log((exp(t_0) ^ (x_46_im ^ y_46_re))); else tmp = Float64(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 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_im <= -235.0) || ~((y_46_im <= 5e+16))) tmp = log((exp(t_0) ^ (x_46_im ^ y_46_re))); else tmp = 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -235.0], N[Not[LessEqual[y$46$im, 5e+16]], $MachinePrecision]], N[Log[N[Power[N[Exp[t$95$0], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(t$95$0 * 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 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -235 \lor \neg \left(y.im \leq 5 \cdot 10^{+16}\right):\\
\;\;\;\;\log \left({\left(e^{t\_0}\right)}^{\left({x.im}^{y.re}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -235 or 5e16 < y.im Initial program 31.3%
exp-diff24.7%
exp-to-pow24.7%
hypot-define24.7%
*-commutative24.7%
exp-prod23.7%
fma-define23.7%
hypot-define53.3%
*-commutative53.3%
Simplified53.3%
Taylor expanded in y.im around 0 45.6%
unpow245.6%
unpow245.6%
hypot-undefine37.7%
Simplified37.7%
Taylor expanded in x.re around 0 31.0%
add-log-exp37.2%
exp-prod54.5%
*-commutative54.5%
Applied egg-rr54.5%
if -235 < y.im < 5e16Initial program 48.6%
exp-diff48.6%
exp-to-pow48.6%
hypot-define48.6%
*-commutative48.6%
exp-prod48.6%
fma-define48.6%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 52.9%
unpow252.9%
unpow252.9%
hypot-undefine63.5%
Simplified63.5%
Final simplification59.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))) (t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -4.6e+40)
(* t_1 (exp (* y.re (- t_0))))
(if (<= x.im -2.5e-200)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(* (- y.im) t_0))
(* t_1 (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 = log((-1.0 / x_46_im));
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -4.6e+40) {
tmp = t_1 * exp((y_46_re * -t_0));
} else if (x_46_im <= -2.5e-200) {
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))) * (-y_46_im * t_0);
} else {
tmp = t_1 * 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 = Math.log((-1.0 / x_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.6e+40) {
tmp = t_1 * Math.exp((y_46_re * -t_0));
} else if (x_46_im <= -2.5e-200) {
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))) * (-y_46_im * t_0);
} else {
tmp = t_1 * 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 = math.log((-1.0 / x_46_im)) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -4.6e+40: tmp = t_1 * math.exp((y_46_re * -t_0)) elif x_46_im <= -2.5e-200: 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))) * (-y_46_im * t_0) else: tmp = t_1 * 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 = log(Float64(-1.0 / x_46_im)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -4.6e+40) tmp = Float64(t_1 * exp(Float64(y_46_re * Float64(-t_0)))); elseif (x_46_im <= -2.5e-200) 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))) * Float64(Float64(-y_46_im) * t_0)); else tmp = Float64(t_1 * (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 = log((-1.0 / x_46_im)); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -4.6e+40) tmp = t_1 * exp((y_46_re * -t_0)); elseif (x_46_im <= -2.5e-200) 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))) * (-y_46_im * t_0); else tmp = t_1 * (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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $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.6e+40], N[(t$95$1 * N[Exp[N[(y$46$re * (-t$95$0)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -2.5e-200], 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[((-y$46$im) * t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 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 := \log \left(\frac{-1}{x.im}\right)\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -4.6 \cdot 10^{+40}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \left(-t\_0\right)}\\
\mathbf{elif}\;x.im \leq -2.5 \cdot 10^{-200}:\\
\;\;\;\;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 \left(\left(-y.im\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if x.im < -4.59999999999999987e40Initial program 25.3%
exp-diff25.3%
exp-to-pow25.3%
hypot-define25.3%
*-commutative25.3%
exp-prod25.3%
fma-define25.3%
hypot-define84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in y.im around 0 55.4%
unpow255.4%
unpow255.4%
hypot-undefine62.4%
Simplified62.4%
Taylor expanded in x.im around -inf 62.4%
*-commutative62.4%
mul-1-neg62.4%
Simplified62.4%
if -4.59999999999999987e40 < x.im < -2.49999999999999996e-200Initial program 58.2%
Taylor expanded in y.re around 0 58.6%
unpow258.6%
unpow258.6%
hypot-undefine68.1%
Simplified68.1%
Taylor expanded in x.im around -inf 63.2%
mul-1-neg63.2%
Simplified63.2%
Taylor expanded in y.im around 0 65.1%
neg-mul-165.1%
distribute-lft-neg-in65.1%
Simplified65.1%
if -2.49999999999999996e-200 < x.im Initial program 41.6%
exp-diff38.8%
exp-to-pow38.8%
hypot-define38.8%
*-commutative38.8%
exp-prod38.7%
fma-define38.7%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 50.6%
unpow250.6%
unpow250.6%
hypot-undefine52.3%
Simplified52.3%
Final simplification57.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.2e-152) (not (<= y.re 1.6e-221)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(exp (- (* y.re (log (- x.re))) (* (atan2 x.im x.re) y.im)))
(sin (* (- y.im) (log (/ -1.0 x.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.2e-152) || !(y_46_re <= 1.6e-221)) {
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 = exp(((y_46_re * log(-x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((-y_46_im * log((-1.0 / x_46_im))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.2e-152) || !(y_46_re <= 1.6e-221)) {
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.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((-1.0 / x_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.2e-152) or not (y_46_re <= 1.6e-221): 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.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((-1.0 / x_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.2e-152) || !(y_46_re <= 1.6e-221)) 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(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(-y_46_im) * log(Float64(-1.0 / x_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.2e-152) || ~((y_46_re <= 1.6e-221))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); 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((-1.0 / x_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.2e-152], N[Not[LessEqual[y$46$re, 1.6e-221]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 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[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{-152} \lor \neg \left(y.re \leq 1.6 \cdot 10^{-221}\right):\\
\;\;\;\;\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}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left(-y.im\right) \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
\end{array}
\end{array}
if y.re < -1.2e-152 or 1.60000000000000008e-221 < y.re Initial program 40.0%
exp-diff36.6%
exp-to-pow36.6%
hypot-define36.6%
*-commutative36.6%
exp-prod36.1%
fma-define36.1%
hypot-define71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in y.im around 0 59.7%
unpow259.7%
unpow259.7%
hypot-undefine64.6%
Simplified64.6%
if -1.2e-152 < y.re < 1.60000000000000008e-221Initial program 47.2%
Taylor expanded in y.re around 0 43.7%
unpow243.7%
unpow243.7%
hypot-undefine52.5%
Simplified52.5%
Taylor expanded in x.im around -inf 24.8%
mul-1-neg24.8%
Simplified24.8%
Taylor expanded in x.re around -inf 24.2%
mul-1-neg24.2%
Simplified24.2%
Final simplification56.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im 1.08e+52)
(* t_0 (pow (hypot x.im x.re) y.re))
(* (pow x.im y.re) (log (exp t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 1.08e+52) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_im, y_46_re) * log(exp(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.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 1.08e+52) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re) * Math.log(Math.exp(t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= 1.08e+52: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(x_46_im, y_46_re) * math.log(math.exp(t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= 1.08e+52) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((x_46_im ^ y_46_re) * log(exp(t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= 1.08e+52) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = (x_46_im ^ y_46_re) * log(exp(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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 1.08e+52], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq 1.08 \cdot 10^{+52}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \log \left(e^{t\_0}\right)\\
\end{array}
\end{array}
if y.im < 1.07999999999999997e52Initial program 44.5%
exp-diff41.7%
exp-to-pow41.7%
hypot-define41.7%
*-commutative41.7%
exp-prod41.7%
fma-define41.7%
hypot-define78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around 0 52.2%
unpow252.2%
unpow252.2%
hypot-undefine57.0%
Simplified57.0%
if 1.07999999999999997e52 < y.im Initial program 25.9%
exp-diff23.6%
exp-to-pow23.6%
hypot-define23.6%
*-commutative23.6%
exp-prod21.0%
fma-define21.0%
hypot-define51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in y.im around 0 38.5%
unpow238.5%
unpow238.5%
hypot-undefine32.1%
Simplified32.1%
Taylor expanded in x.re around 0 26.9%
add-log-exp42.2%
*-commutative42.2%
Applied egg-rr42.2%
Final simplification54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.re -13.5)
(* (fabs t_0) (pow x.im y.re))
(if (<= y.re 9.2e+18)
(* y.re (* (atan2 x.im x.re) (+ (* y.re (log (hypot x.im x.re))) 1.0)))
(* 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 (y_46_re <= -13.5) {
tmp = fabs(t_0) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 9.2e+18) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * ((y_46_re * log(hypot(x_46_im, x_46_re))) + 1.0));
} else {
tmp = 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 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -13.5) {
tmp = Math.abs(t_0) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 9.2e+18) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * ((y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))) + 1.0));
} 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 y_46_re <= -13.5: tmp = math.fabs(t_0) * math.pow(x_46_im, y_46_re) elif y_46_re <= 9.2e+18: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * ((y_46_re * math.log(math.hypot(x_46_im, x_46_re))) + 1.0)) 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 (y_46_re <= -13.5) tmp = Float64(abs(t_0) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 9.2e+18) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(Float64(y_46_re * log(hypot(x_46_im, x_46_re))) + 1.0))); 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 (y_46_re <= -13.5) tmp = abs(t_0) * (x_46_im ^ y_46_re); elseif (y_46_re <= 9.2e+18) tmp = y_46_re * (atan2(x_46_im, x_46_re) * ((y_46_re * log(hypot(x_46_im, x_46_re))) + 1.0)); 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[LessEqual[y$46$re, -13.5], N[(N[Abs[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.2e+18], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $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}\;y.re \leq -13.5:\\
\;\;\;\;\left|t\_0\right| \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{+18}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -13.5Initial program 38.2%
exp-diff32.7%
exp-to-pow32.7%
hypot-define32.7%
*-commutative32.7%
exp-prod32.7%
fma-define32.7%
hypot-define67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in y.im around 0 87.3%
unpow287.3%
unpow287.3%
hypot-undefine87.3%
Simplified87.3%
Taylor expanded in x.re around 0 69.3%
add-sqr-sqrt25.6%
sqrt-unprod71.1%
pow271.1%
*-commutative71.1%
Applied egg-rr71.1%
*-commutative71.1%
unpow271.1%
rem-sqrt-square71.1%
Simplified71.1%
if -13.5 < y.re < 9.2e18Initial program 44.1%
exp-diff44.1%
exp-to-pow44.1%
hypot-define44.1%
*-commutative44.1%
exp-prod44.0%
fma-define44.0%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 26.6%
unpow226.6%
unpow226.6%
hypot-undefine32.2%
Simplified32.2%
Taylor expanded in y.re around 0 19.4%
associate-*r*19.4%
+-commutative19.4%
unpow219.4%
unpow219.4%
hypot-undefine29.1%
*-commutative29.1%
distribute-lft1-in29.1%
Simplified29.1%
if 9.2e18 < y.re Initial program 38.8%
exp-diff32.8%
exp-to-pow32.8%
hypot-define32.8%
*-commutative32.8%
exp-prod31.3%
fma-define31.3%
hypot-define55.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in y.im around 0 65.8%
unpow265.8%
unpow265.8%
hypot-undefine65.8%
Simplified65.8%
Taylor expanded in x.re around 0 65.9%
Final simplification47.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((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 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);
}
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(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(sin(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 = sin((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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 41.4%
exp-diff38.7%
exp-to-pow38.7%
hypot-define38.7%
*-commutative38.7%
exp-prod38.3%
fma-define38.3%
hypot-define74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in y.im around 0 49.9%
unpow249.9%
unpow249.9%
hypot-undefine52.8%
Simplified52.8%
Final simplification52.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -13.5) (not (<= y.re 9.2e+18))) (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (* y.re (* (atan2 x.im x.re) (+ (* y.re (log (hypot x.im x.re))) 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -13.5) || !(y_46_re <= 9.2e+18)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * ((y_46_re * log(hypot(x_46_im, x_46_re))) + 1.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -13.5) || !(y_46_re <= 9.2e+18)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * ((y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))) + 1.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -13.5) or not (y_46_re <= 9.2e+18): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * ((y_46_re * math.log(math.hypot(x_46_im, x_46_re))) + 1.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -13.5) || !(y_46_re <= 9.2e+18)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(Float64(y_46_re * log(hypot(x_46_im, x_46_re))) + 1.0))); 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 <= -13.5) || ~((y_46_re <= 9.2e+18))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * ((y_46_re * log(hypot(x_46_im, x_46_re))) + 1.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -13.5], N[Not[LessEqual[y$46$re, 9.2e+18]], $MachinePrecision]], 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], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -13.5 \lor \neg \left(y.re \leq 9.2 \cdot 10^{+18}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + 1\right)\right)\\
\end{array}
\end{array}
if y.re < -13.5 or 9.2e18 < y.re Initial program 38.5%
exp-diff32.8%
exp-to-pow32.8%
hypot-define32.8%
*-commutative32.8%
exp-prod32.0%
fma-define32.0%
hypot-define60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in y.im around 0 75.5%
unpow275.5%
unpow275.5%
hypot-undefine75.5%
Simplified75.5%
Taylor expanded in x.re around 0 67.4%
if -13.5 < y.re < 9.2e18Initial program 44.1%
exp-diff44.1%
exp-to-pow44.1%
hypot-define44.1%
*-commutative44.1%
exp-prod44.0%
fma-define44.0%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 26.6%
unpow226.6%
unpow226.6%
hypot-undefine32.2%
Simplified32.2%
Taylor expanded in y.re around 0 19.4%
associate-*r*19.4%
+-commutative19.4%
unpow219.4%
unpow219.4%
hypot-undefine29.1%
*-commutative29.1%
distribute-lft1-in29.1%
Simplified29.1%
Final simplification47.4%
(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 -5e+59) (not (<= x.re 5.8e-148)))
(* 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 <= -5e+59) || !(x_46_re <= 5.8e-148)) {
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 <= (-5d+59)) .or. (.not. (x_46re <= 5.8d-148))) 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 <= -5e+59) || !(x_46_re <= 5.8e-148)) {
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 <= -5e+59) or not (x_46_re <= 5.8e-148): 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 <= -5e+59) || !(x_46_re <= 5.8e-148)) 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 <= -5e+59) || ~((x_46_re <= 5.8e-148))) 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, -5e+59], N[Not[LessEqual[x$46$re, 5.8e-148]], $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 -5 \cdot 10^{+59} \lor \neg \left(x.re \leq 5.8 \cdot 10^{-148}\right):\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.re < -4.9999999999999997e59 or 5.7999999999999997e-148 < x.re Initial program 27.7%
exp-diff27.7%
exp-to-pow27.7%
hypot-define27.7%
*-commutative27.7%
exp-prod26.9%
fma-define26.9%
hypot-define76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in y.im around 0 45.9%
unpow245.9%
unpow245.9%
hypot-undefine51.7%
Simplified51.7%
Taylor expanded in x.im around 0 41.6%
if -4.9999999999999997e59 < x.re < 5.7999999999999997e-148Initial program 56.5%
exp-diff50.7%
exp-to-pow50.7%
hypot-define50.7%
*-commutative50.7%
exp-prod50.7%
fma-define50.7%
hypot-define72.0%
*-commutative72.0%
Simplified72.0%
Taylor expanded in y.im around 0 54.2%
unpow254.2%
unpow254.2%
hypot-undefine54.1%
Simplified54.1%
Taylor expanded in x.re around 0 45.0%
Final simplification43.2%
(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 41.4%
exp-diff38.7%
exp-to-pow38.7%
hypot-define38.7%
*-commutative38.7%
exp-prod38.3%
fma-define38.3%
hypot-define74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in y.im around 0 49.9%
unpow249.9%
unpow249.9%
hypot-undefine52.8%
Simplified52.8%
Taylor expanded in x.re around 0 38.2%
Final simplification38.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (+ 1.0 (* y.re (log x.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * log(x_46_im))));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * (atan2(x_46im, x_46re) * (1.0d0 + (y_46re * log(x_46im))))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (Math.atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * Math.log(x_46_im))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * (math.atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * math.log(x_46_im))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(1.0 + Float64(y_46_re * log(x_46_im))))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * log(x_46_im)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 + N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 + y.re \cdot \log x.im\right)\right)
\end{array}
Initial program 41.4%
exp-diff38.7%
exp-to-pow38.7%
hypot-define38.7%
*-commutative38.7%
exp-prod38.3%
fma-define38.3%
hypot-define74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in y.im around 0 49.9%
unpow249.9%
unpow249.9%
hypot-undefine52.8%
Simplified52.8%
Taylor expanded in x.re around 0 38.2%
Taylor expanded in y.re around 0 8.7%
+-commutative8.7%
*-lft-identity8.7%
associate-*r*8.7%
remove-double-neg8.7%
log-rec8.7%
distribute-rgt-neg-in8.7%
mul-1-neg8.7%
distribute-rgt-out8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
log-rec8.7%
remove-double-neg8.7%
Simplified8.7%
Final simplification8.7%
herbie shell --seed 2024050
(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)))))