
(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 14 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
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* y.im t_1)))
(if (<= y.re -1.4e-7)
(* t_0 (sin (fabs t_2)))
(if (<= y.re 1.02e+71)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(sin (* y.im (+ t_1 (* y.re (/ (atan2 x.im x.re) y.im))))))
(if (<= y.re 1.9e+232)
(* t_0 (sin t_2))
(* (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) {
double t_0 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = y_46_im * t_1;
double tmp;
if (y_46_re <= -1.4e-7) {
tmp = t_0 * sin(fabs(t_2));
} else if (y_46_re <= 1.02e+71) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), 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)))));
} else if (y_46_re <= 1.9e+232) {
tmp = t_0 * sin(t_2);
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * 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 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(y_46_im * t_1) tmp = 0.0 if (y_46_re <= -1.4e-7) tmp = Float64(t_0 * sin(abs(t_2))); elseif (y_46_re <= 1.02e+71) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), 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)))))); elseif (y_46_re <= 1.9e+232) tmp = Float64(t_0 * sin(t_2)); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -1.4e-7], N[(t$95$0 * N[Sin[N[Abs[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.02e+71], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * 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], If[LessEqual[y$46$re, 1.9e+232], N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $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]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := y.im \cdot t\_1\\
\mathbf{if}\;y.re \leq -1.4 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left|t\_2\right|\right)\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+71}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), 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)\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+232}:\\
\;\;\;\;t\_0 \cdot \sin t\_2\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.4000000000000001e-7Initial program 38.9%
add-sqr-sqrt16.7%
sqrt-unprod31.9%
pow231.9%
*-commutative31.9%
hypot-define66.7%
Applied egg-rr66.7%
unpow266.7%
rem-sqrt-square80.7%
hypot-undefine41.7%
unpow241.7%
unpow241.7%
+-commutative41.7%
unpow241.7%
unpow241.7%
hypot-undefine80.7%
Simplified80.7%
Taylor expanded in y.re around 0 44.4%
unpow244.4%
unpow244.4%
hypot-undefine82.1%
Simplified82.1%
if -1.4000000000000001e-7 < y.re < 1.02000000000000003e71Initial program 43.8%
cancel-sign-sub-inv43.8%
fma-define43.8%
hypot-define43.8%
distribute-lft-neg-in43.8%
distribute-rgt-neg-out43.8%
fma-define43.8%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.re around inf 33.2%
+-commutative33.2%
associate-/l*32.4%
unpow232.4%
unpow232.4%
hypot-undefine67.8%
Simplified67.8%
Taylor expanded in y.im around inf 43.8%
unpow243.8%
unpow243.8%
hypot-undefine89.1%
associate-/l*89.1%
Simplified89.1%
if 1.02000000000000003e71 < y.re < 1.9e232Initial program 45.9%
Taylor expanded in y.re around 0 56.8%
unpow256.8%
unpow256.8%
hypot-undefine78.4%
Simplified78.4%
if 1.9e232 < y.re Initial program 40.0%
Taylor expanded in y.im around 0 80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in x.re around 0 80.1%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1 (log (hypot x.re x.im)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (log (hypot x.im x.re))))
(if (<= y.re 5e+76)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_1 y.im t_2)))
(if (<= y.re 2.8e+180)
(* t_0 (sin (* y.im t_3)))
(* t_0 (+ (* t_3 (* y.im (cos t_2))) (sin t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= 5e+76) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_1, y_46_im, t_2));
} else if (y_46_re <= 2.8e+180) {
tmp = t_0 * sin((y_46_im * t_3));
} else {
tmp = t_0 * ((t_3 * (y_46_im * cos(t_2))) + sin(t_2));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= 5e+76) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_1, y_46_im, t_2))); elseif (y_46_re <= 2.8e+180) tmp = Float64(t_0 * sin(Float64(y_46_im * t_3))); else tmp = Float64(t_0 * Float64(Float64(t_3 * Float64(y_46_im * cos(t_2))) + sin(t_2))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 5e+76], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.8e+180], N[(t$95$0 * N[Sin[N[(y$46$im * t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(t$95$3 * N[(y$46$im * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq 5 \cdot 10^{+76}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_1, y.im, t\_2\right)\right)\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{+180}:\\
\;\;\;\;t\_0 \cdot \sin \left(y.im \cdot t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_3 \cdot \left(y.im \cdot \cos t\_2\right) + \sin t\_2\right)\\
\end{array}
\end{array}
if y.re < 4.99999999999999991e76Initial program 42.1%
cancel-sign-sub-inv42.1%
fma-define42.1%
hypot-define42.1%
distribute-lft-neg-in42.1%
distribute-rgt-neg-out42.1%
fma-define42.1%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
if 4.99999999999999991e76 < y.re < 2.80000000000000012e180Initial program 52.2%
Taylor expanded in y.re around 0 65.2%
unpow265.2%
unpow265.2%
hypot-undefine91.3%
Simplified91.3%
if 2.80000000000000012e180 < y.re Initial program 37.9%
Taylor expanded in y.im around 0 62.1%
+-commutative62.1%
associate-*r*62.1%
unpow262.1%
unpow262.1%
hypot-undefine75.9%
Simplified75.9%
Final simplification85.0%
(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 42.5%
cancel-sign-sub-inv42.5%
fma-define42.5%
hypot-define42.5%
distribute-lft-neg-in42.5%
distribute-rgt-neg-out42.5%
fma-define42.5%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_2 (log (hypot x.im x.re)))
(t_3 (* y.im t_2)))
(if (<= y.re -1.4e-7)
(* t_1 (sin (fabs t_3)))
(if (<= y.re 3.6e-15)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(sin (* y.im (+ t_2 (/ t_0 y.im)))))
(if (<= y.re 2.3e+230)
(* t_1 (sin t_3))
(* (sin t_0) (pow x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = y_46_im * t_2;
double tmp;
if (y_46_re <= -1.4e-7) {
tmp = t_1 * sin(fabs(t_3));
} else if (y_46_re <= 3.6e-15) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin((y_46_im * (t_2 + (t_0 / y_46_im))));
} else if (y_46_re <= 2.3e+230) {
tmp = t_1 * sin(t_3);
} else {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_3 = y_46_im * t_2;
double tmp;
if (y_46_re <= -1.4e-7) {
tmp = t_1 * Math.sin(Math.abs(t_3));
} else if (y_46_re <= 3.6e-15) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * (t_2 + (t_0 / y_46_im))));
} else if (y_46_re <= 2.3e+230) {
tmp = t_1 * Math.sin(t_3);
} else {
tmp = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_2 = math.log(math.hypot(x_46_im, x_46_re)) t_3 = y_46_im * t_2 tmp = 0 if y_46_re <= -1.4e-7: tmp = t_1 * math.sin(math.fabs(t_3)) elif y_46_re <= 3.6e-15: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * (t_2 + (t_0 / y_46_im)))) elif y_46_re <= 2.3e+230: tmp = t_1 * math.sin(t_3) else: tmp = math.sin(t_0) * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = log(hypot(x_46_im, x_46_re)) t_3 = Float64(y_46_im * t_2) tmp = 0.0 if (y_46_re <= -1.4e-7) tmp = Float64(t_1 * sin(abs(t_3))); elseif (y_46_re <= 3.6e-15) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * Float64(t_2 + Float64(t_0 / y_46_im))))); elseif (y_46_re <= 2.3e+230) tmp = Float64(t_1 * sin(t_3)); else tmp = Float64(sin(t_0) * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); 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))); t_2 = log(hypot(x_46_im, x_46_re)); t_3 = y_46_im * t_2; tmp = 0.0; if (y_46_re <= -1.4e-7) tmp = t_1 * sin(abs(t_3)); elseif (y_46_re <= 3.6e-15) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))) * sin((y_46_im * (t_2 + (t_0 / y_46_im)))); elseif (y_46_re <= 2.3e+230) tmp = t_1 * sin(t_3); else tmp = sin(t_0) * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -1.4e-7], N[(t$95$1 * N[Sin[N[Abs[t$95$3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-15], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[(t$95$2 + N[(t$95$0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.3e+230], N[(t$95$1 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := y.im \cdot t\_2\\
\mathbf{if}\;y.re \leq -1.4 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot \sin \left(\left|t\_3\right|\right)\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(y.im \cdot \left(t\_2 + \frac{t\_0}{y.im}\right)\right)\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{+230}:\\
\;\;\;\;t\_1 \cdot \sin t\_3\\
\mathbf{else}:\\
\;\;\;\;\sin t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.4000000000000001e-7Initial program 38.9%
add-sqr-sqrt16.7%
sqrt-unprod31.9%
pow231.9%
*-commutative31.9%
hypot-define66.7%
Applied egg-rr66.7%
unpow266.7%
rem-sqrt-square80.7%
hypot-undefine41.7%
unpow241.7%
unpow241.7%
+-commutative41.7%
unpow241.7%
unpow241.7%
hypot-undefine80.7%
Simplified80.7%
Taylor expanded in y.re around 0 44.4%
unpow244.4%
unpow244.4%
hypot-undefine82.1%
Simplified82.1%
if -1.4000000000000001e-7 < y.re < 3.6000000000000001e-15Initial program 44.6%
exp-diff44.6%
exp-to-pow44.6%
hypot-define44.6%
*-commutative44.6%
exp-prod44.6%
fma-define44.6%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y.im around inf 44.6%
unpow244.6%
unpow244.6%
hypot-undefine89.9%
Simplified89.9%
if 3.6000000000000001e-15 < y.re < 2.2999999999999998e230Initial program 43.5%
Taylor expanded in y.re around 0 52.2%
unpow252.2%
unpow252.2%
hypot-undefine74.0%
Simplified74.0%
if 2.2999999999999998e230 < y.re Initial program 40.0%
Taylor expanded in y.im around 0 80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in x.re around 0 80.1%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* y.im (log (hypot x.im x.re))))
(t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -1.4e-7)
(* t_2 (sin (fabs t_1)))
(if (<= y.re 3.6e-15)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 3.8e+231)
(* t_2 (sin t_1))
(* (sin t_0) (pow x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -1.4e-7) {
tmp = t_2 * sin(fabs(t_1));
} else if (y_46_re <= 3.6e-15) {
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 if (y_46_re <= 3.8e+231) {
tmp = t_2 * sin(t_1);
} else {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -1.4e-7) tmp = Float64(t_2 * sin(abs(t_1))); elseif (y_46_re <= 3.6e-15) 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)))); elseif (y_46_re <= 3.8e+231) tmp = Float64(t_2 * sin(t_1)); else tmp = Float64(sin(t_0) * (x_46_im ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.4e-7], N[(t$95$2 * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-15], 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], If[LessEqual[y$46$re, 3.8e+231], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.4 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left|t\_1\right|\right)\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-15}:\\
\;\;\;\;\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{elif}\;y.re \leq 3.8 \cdot 10^{+231}:\\
\;\;\;\;t\_2 \cdot \sin t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.4000000000000001e-7Initial program 38.9%
add-sqr-sqrt16.7%
sqrt-unprod31.9%
pow231.9%
*-commutative31.9%
hypot-define66.7%
Applied egg-rr66.7%
unpow266.7%
rem-sqrt-square80.7%
hypot-undefine41.7%
unpow241.7%
unpow241.7%
+-commutative41.7%
unpow241.7%
unpow241.7%
hypot-undefine80.7%
Simplified80.7%
Taylor expanded in y.re around 0 44.4%
unpow244.4%
unpow244.4%
hypot-undefine82.1%
Simplified82.1%
if -1.4000000000000001e-7 < y.re < 3.6000000000000001e-15Initial program 44.6%
exp-diff44.6%
exp-to-pow44.6%
hypot-define44.6%
*-commutative44.6%
exp-prod44.6%
fma-define44.6%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y.re around 0 89.5%
rec-exp89.5%
distribute-lft-neg-in89.5%
Simplified89.5%
if 3.6000000000000001e-15 < y.re < 3.8000000000000001e231Initial program 43.5%
Taylor expanded in y.re around 0 52.2%
unpow252.2%
unpow252.2%
hypot-undefine74.0%
Simplified74.0%
if 3.8000000000000001e231 < y.re Initial program 40.0%
Taylor expanded in y.im around 0 80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in x.re around 0 80.1%
Final simplification84.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.re -3.5e-8)
(* (pow (hypot x.im x.re) y.re) (sin (+ t_1 (* t_0 y.im))))
(if (<= y.re 3.6e-15)
(* (sin (fma t_0 y.im t_1)) (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 3.25e+233)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re)))))
(* (sin t_1) (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 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -3.5e-8) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_1 + (t_0 * y_46_im)));
} else if (y_46_re <= 3.6e-15) {
tmp = sin(fma(t_0, y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 3.25e+233) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = sin(t_1) * 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 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -3.5e-8) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_1 + Float64(t_0 * y_46_im)))); elseif (y_46_re <= 3.6e-15) tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 3.25e+233) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(sin(t_1) * (x_46_im ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e-8], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-15], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $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, 3.25e+233], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$1], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{-8}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_1 + t\_0 \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-15}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 3.25 \cdot 10^{+233}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t\_1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.50000000000000024e-8Initial program 38.9%
exp-diff30.6%
exp-to-pow30.6%
hypot-define30.6%
*-commutative30.6%
exp-prod30.6%
fma-define30.6%
hypot-define59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in y.im around 0 76.6%
unpow276.6%
unpow276.6%
hypot-undefine76.6%
Simplified76.6%
fma-undefine76.6%
hypot-define37.6%
*-commutative37.6%
+-commutative37.6%
*-commutative37.6%
hypot-define76.6%
Applied egg-rr76.6%
if -3.50000000000000024e-8 < y.re < 3.6000000000000001e-15Initial program 44.6%
exp-diff44.6%
exp-to-pow44.6%
hypot-define44.6%
*-commutative44.6%
exp-prod44.6%
fma-define44.6%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y.re around 0 89.5%
rec-exp89.5%
distribute-lft-neg-in89.5%
Simplified89.5%
if 3.6000000000000001e-15 < y.re < 3.25000000000000019e233Initial program 43.5%
Taylor expanded in y.re around 0 52.2%
unpow252.2%
unpow252.2%
hypot-undefine74.0%
Simplified74.0%
if 3.25000000000000019e233 < y.re Initial program 40.0%
Taylor expanded in y.im around 0 80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in x.re around 0 80.1%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1.4e-7)
(* (pow (hypot x.im x.re) y.re) (sin (+ t_1 (* t_0 y.im))))
(if (<= y.re 3.6e-15)
(* (sin (fma t_0 y.im t_1)) (exp (* (atan2 x.im x.re) (- y.im))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.4e-7) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_1 + (t_0 * y_46_im)));
} else if (y_46_re <= 3.6e-15) {
tmp = sin(fma(t_0, y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.4e-7) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_1 + Float64(t_0 * y_46_im)))); elseif (y_46_re <= 3.6e-15) tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.4e-7], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e-15], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.4 \cdot 10^{-7}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_1 + t\_0 \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-15}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_1\\
\end{array}
\end{array}
if y.re < -1.4000000000000001e-7Initial program 38.9%
exp-diff30.6%
exp-to-pow30.6%
hypot-define30.6%
*-commutative30.6%
exp-prod30.6%
fma-define30.6%
hypot-define59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in y.im around 0 76.6%
unpow276.6%
unpow276.6%
hypot-undefine76.6%
Simplified76.6%
fma-undefine76.6%
hypot-define37.6%
*-commutative37.6%
+-commutative37.6%
*-commutative37.6%
hypot-define76.6%
Applied egg-rr76.6%
if -1.4000000000000001e-7 < y.re < 3.6000000000000001e-15Initial program 44.6%
exp-diff44.6%
exp-to-pow44.6%
hypot-define44.6%
*-commutative44.6%
exp-prod44.6%
fma-define44.6%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y.re around 0 89.5%
rec-exp89.5%
distribute-lft-neg-in89.5%
Simplified89.5%
if 3.6000000000000001e-15 < y.re Initial program 42.6%
Taylor expanded in y.im around 0 67.3%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -950.0) (not (<= y.im 50.0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
(pow (hypot x.im x.re) y.re)
(sin (+ t_0 (* (log (hypot x.re x.im)) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -950.0) || !(y_46_im <= 50.0)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_0 + (log(hypot(x_46_re, x_46_im)) * 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -950.0) || !(y_46_im <= 50.0)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(t_0);
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((t_0 + (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_im <= -950.0) or not (y_46_im <= 50.0): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(t_0) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((t_0 + (math.log(math.hypot(x_46_re, x_46_im)) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -950.0) || !(y_46_im <= 50.0)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_0 + Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_im <= -950.0) || ~((y_46_im <= 50.0))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((t_0 + (log(hypot(x_46_re, x_46_im)) * y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -950.0], N[Not[LessEqual[y$46$im, 50.0]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $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}\\
\mathbf{if}\;y.im \leq -950 \lor \neg \left(y.im \leq 50\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_0 + \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.im < -950 or 50 < y.im Initial program 41.1%
Taylor expanded in y.im around 0 68.0%
if -950 < y.im < 50Initial program 43.8%
exp-diff43.8%
exp-to-pow43.8%
hypot-define43.8%
*-commutative43.8%
exp-prod43.8%
fma-define43.8%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 60.0%
unpow260.0%
unpow260.0%
hypot-undefine87.7%
Simplified87.7%
fma-undefine87.7%
hypot-define43.1%
*-commutative43.1%
+-commutative43.1%
*-commutative43.1%
hypot-define87.7%
Applied egg-rr87.7%
Final simplification78.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.im -1.7e+40)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 50.0)
(* t_0 (sin (+ t_1 (* (log (hypot x.re x.im)) y.im))))
(* t_0 (log (exp (sin t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.7e+40) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 50.0) {
tmp = t_0 * sin((t_1 + (log(hypot(x_46_re, x_46_im)) * y_46_im)));
} else {
tmp = t_0 * log(exp(sin(t_1)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -1.7e+40) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 50.0) {
tmp = t_0 * Math.sin((t_1 + (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)));
} else {
tmp = t_0 * Math.log(Math.exp(Math.sin(t_1)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -1.7e+40: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))) elif y_46_im <= 50.0: tmp = t_0 * math.sin((t_1 + (math.log(math.hypot(x_46_re, x_46_im)) * y_46_im))) else: tmp = t_0 * math.log(math.exp(math.sin(t_1))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1.7e+40) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 50.0) tmp = Float64(t_0 * sin(Float64(t_1 + Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)))); else tmp = Float64(t_0 * log(exp(sin(t_1)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -1.7e+40) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= 50.0) tmp = t_0 * sin((t_1 + (log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = t_0 * log(exp(sin(t_1))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+40], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 50.0], N[(t$95$0 * N[Sin[N[(t$95$1 + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Log[N[Exp[N[Sin[t$95$1], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+40}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 50:\\
\;\;\;\;t\_0 \cdot \sin \left(t\_1 + \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \log \left(e^{\sin t\_1}\right)\\
\end{array}
\end{array}
if y.im < -1.69999999999999994e40Initial program 44.4%
Taylor expanded in y.im around 0 61.4%
Taylor expanded in y.re around 0 61.4%
*-commutative61.4%
distribute-rgt-neg-in61.4%
mul-1-neg61.4%
exp-prod61.4%
mul-1-neg61.4%
Simplified61.4%
if -1.69999999999999994e40 < y.im < 50Initial program 43.7%
exp-diff42.2%
exp-to-pow42.2%
hypot-define42.2%
*-commutative42.2%
exp-prod42.2%
fma-define42.2%
hypot-define85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in y.im around 0 60.7%
unpow260.7%
unpow260.7%
hypot-undefine86.7%
Simplified86.7%
fma-undefine86.7%
hypot-define43.0%
*-commutative43.0%
+-commutative43.0%
*-commutative43.0%
hypot-define86.7%
Applied egg-rr86.7%
if 50 < y.im Initial program 38.5%
Taylor expanded in y.im around 0 72.5%
Taylor expanded in y.im around 0 54.7%
unpow254.7%
unpow254.7%
hypot-undefine44.7%
Simplified44.7%
add-log-exp63.5%
Applied egg-rr63.5%
Final simplification75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -32500000000.0)
(* (sin t_0) t_1)
(if (<= y.re 2.3e+94)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(* t_1 (sin (pow (cbrt t_0) 3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -32500000000.0) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 2.3e+94) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = t_1 * sin(pow(cbrt(t_0), 3.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -32500000000.0) {
tmp = Math.sin(t_0) * t_1;
} else if (y_46_re <= 2.3e+94) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = t_1 * Math.sin(Math.pow(Math.cbrt(t_0), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -32500000000.0) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 2.3e+94) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = Float64(t_1 * sin((cbrt(t_0) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -32500000000.0], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 2.3e+94], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -32500000000:\\
\;\;\;\;\sin t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{+94}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < -3.25e10Initial program 38.8%
Taylor expanded in y.im around 0 77.7%
Taylor expanded in y.im around 0 77.8%
unpow277.8%
unpow277.8%
hypot-undefine77.8%
Simplified77.8%
if -3.25e10 < y.re < 2.3e94Initial program 42.8%
Taylor expanded in y.im around 0 40.7%
Taylor expanded in y.re around 0 54.2%
*-commutative54.2%
distribute-rgt-neg-in54.2%
Simplified54.2%
if 2.3e94 < y.re Initial program 46.9%
Taylor expanded in y.im around 0 67.3%
Taylor expanded in y.im around 0 65.3%
unpow265.3%
unpow265.3%
hypot-undefine65.3%
Simplified65.3%
*-commutative65.3%
add-cube-cbrt69.4%
pow369.4%
*-commutative69.4%
Applied egg-rr69.4%
Final simplification63.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -32500000000.0) (not (<= y.re 2.7e+56))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -32500000000.0) || !(y_46_re <= 2.7e+56)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -32500000000.0) || !(y_46_re <= 2.7e+56)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -32500000000.0) or not (y_46_re <= 2.7e+56): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -32500000000.0) || !(y_46_re <= 2.7e+56)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -32500000000.0) || ~((y_46_re <= 2.7e+56))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -32500000000.0], N[Not[LessEqual[y$46$re, 2.7e+56]], $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[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -32500000000 \lor \neg \left(y.re \leq 2.7 \cdot 10^{+56}\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}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -3.25e10 or 2.7000000000000001e56 < y.re Initial program 40.8%
Taylor expanded in y.im around 0 73.4%
Taylor expanded in y.im around 0 72.6%
unpow272.6%
unpow272.6%
hypot-undefine72.6%
Simplified72.6%
if -3.25e10 < y.re < 2.7000000000000001e56Initial program 44.0%
Taylor expanded in y.im around 0 39.7%
Taylor expanded in y.re around 0 54.3%
*-commutative54.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
Final simplification62.9%
(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 -13000000000000.0)
(* t_0 (pow x.im y.re))
(if (<= y.re 2.3e+56)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(* t_0 (pow 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_re <= -13000000000000.0) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.3e+56) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = t_0 * pow(x_46_re, 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 (y_46re <= (-13000000000000.0d0)) then
tmp = t_0 * (x_46im ** y_46re)
else if (y_46re <= 2.3d+56) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
else
tmp = t_0 * (x_46re ** 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 (y_46_re <= -13000000000000.0) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.3e+56) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = t_0 * Math.pow(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_re <= -13000000000000.0: tmp = t_0 * math.pow(x_46_im, y_46_re) elif y_46_re <= 2.3e+56: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) else: tmp = t_0 * math.pow(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_re <= -13000000000000.0) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 2.3e+56) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = Float64(t_0 * (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_re <= -13000000000000.0) tmp = t_0 * (x_46_im ^ y_46_re); elseif (y_46_re <= 2.3e+56) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = t_0 * (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[LessEqual[y$46$re, -13000000000000.0], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.3e+56], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, 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 -13000000000000:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{+56}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.3e13Initial program 38.8%
Taylor expanded in y.im around 0 77.7%
Taylor expanded in y.im around 0 77.8%
unpow277.8%
unpow277.8%
hypot-undefine77.8%
Simplified77.8%
Taylor expanded in x.re around 0 62.9%
if -1.3e13 < y.re < 2.30000000000000015e56Initial program 44.0%
Taylor expanded in y.im around 0 39.7%
Taylor expanded in y.re around 0 54.3%
*-commutative54.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
if 2.30000000000000015e56 < y.re Initial program 43.4%
Taylor expanded in y.im around 0 67.9%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-undefine66.1%
Simplified66.1%
Taylor expanded in x.im around 0 60.7%
Final simplification57.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))) (if (<= x.re 0.00047) (* t_0 (pow x.im y.re)) (* t_0 (pow 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 (x_46_re <= 0.00047) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, 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 <= 0.00047d0) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * (x_46re ** 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 <= 0.00047) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * Math.pow(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 x_46_re <= 0.00047: tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * math.pow(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 (x_46_re <= 0.00047) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * (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 (x_46_re <= 0.00047) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * (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[LessEqual[x$46$re, 0.00047], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, 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 0.00047:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < 4.69999999999999986e-4Initial program 46.7%
Taylor expanded in y.im around 0 57.9%
Taylor expanded in y.im around 0 45.5%
unpow245.5%
unpow245.5%
hypot-undefine46.3%
Simplified46.3%
Taylor expanded in x.re around 0 37.2%
if 4.69999999999999986e-4 < x.re Initial program 27.2%
Taylor expanded in y.im around 0 46.6%
Taylor expanded in y.im around 0 44.9%
unpow244.9%
unpow244.9%
hypot-undefine47.3%
Simplified47.3%
Taylor expanded in x.im around 0 47.3%
Final simplification39.4%
(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 42.5%
Taylor expanded in y.im around 0 55.5%
Taylor expanded in y.im around 0 45.4%
unpow245.4%
unpow245.4%
hypot-undefine46.5%
Simplified46.5%
Taylor expanded in x.re around 0 36.6%
Final simplification36.6%
herbie shell --seed 2024075
(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)))))