
(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 19 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 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_4 (log (hypot x.re x.im))))
(if (<= y.re -3.7e-6)
(* t_3 t_2)
(if (<= y.re 5e-231)
(*
(sin (fma t_4 y.im t_1))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 9500000000.0)
(*
(pow (exp y.im) (- (atan2 x.im x.re)))
(+ t_2 (* t_4 (* y.im (cos t_1)))))
(if (<= y.re 2.8e+46)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_4 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -3.7e-6) {
tmp = t_3 * t_2;
} else if (y_46_re <= 5e-231) {
tmp = sin(fma(t_4, y_46_im, t_1)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 9500000000.0) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re)) * (t_2 + (t_4 * (y_46_im * cos(t_1))));
} else if (y_46_re <= 2.8e+46) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) t_4 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -3.7e-6) tmp = Float64(t_3 * t_2); elseif (y_46_re <= 5e-231) tmp = Float64(sin(fma(t_4, y_46_im, t_1)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 9500000000.0) tmp = Float64((exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * Float64(t_2 + Float64(t_4 * Float64(y_46_im * cos(t_1))))); elseif (y_46_re <= 2.8e+46) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); else tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(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[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.7e-6], N[(t$95$3 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 5e-231], N[(N[Sin[N[(t$95$4 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * 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]), $MachinePrecision], If[LessEqual[y$46$re, 9500000000.0], N[(N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[(t$95$2 + N[(t$95$4 * N[(y$46$im * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.8e+46], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
t_4 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -3.7 \cdot 10^{-6}:\\
\;\;\;\;t\_3 \cdot t\_2\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-231}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_4, y.im, t\_1\right)\right) \cdot \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}}}\\
\mathbf{elif}\;y.re \leq 9500000000:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(t\_2 + t\_4 \cdot \left(y.im \cdot \cos t\_1\right)\right)\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{+46}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -3.7000000000000002e-6Initial program 39.4%
Taylor expanded in y.im around 0 88.8%
if -3.7000000000000002e-6 < y.re < 5.00000000000000023e-231Initial program 46.2%
exp-diff46.2%
exp-to-pow46.2%
hypot-define46.2%
*-commutative46.2%
exp-prod46.2%
fma-define46.2%
hypot-define88.6%
*-commutative88.6%
Simplified88.6%
if 5.00000000000000023e-231 < y.re < 9.5e9Initial program 36.9%
exp-diff34.7%
exp-to-pow34.7%
hypot-define34.7%
*-commutative34.7%
exp-prod34.7%
fma-define34.7%
hypot-define69.5%
*-commutative69.5%
Simplified69.5%
Taylor expanded in y.re around 0 70.1%
rec-exp70.1%
distribute-rgt-neg-in70.1%
exp-prod69.7%
Simplified69.7%
Taylor expanded in y.im around 0 48.3%
+-commutative48.3%
associate-*r*48.3%
+-commutative48.3%
unpow248.3%
unpow248.3%
hypot-undefine79.0%
Simplified79.0%
if 9.5e9 < y.re < 2.80000000000000018e46Initial program 66.7%
Taylor expanded in y.im around 0 100.0%
Taylor expanded in x.im around -inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if 2.80000000000000018e46 < y.re Initial program 41.7%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine72.9%
Simplified72.9%
Final simplification84.2%
(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.0%
fma-neg42.0%
hypot-define42.0%
distribute-rgt-neg-out42.0%
fma-define42.0%
hypot-define83.6%
*-commutative83.6%
Simplified83.6%
Final simplification83.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))
(t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -3.7e-6)
(* t_2 t_1)
(if (<= y.re 4.2e-230)
(* (sin (fma t_3 y.im t_0)) (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 510.0)
(*
(pow (exp y.im) (- (atan2 x.im x.re)))
(+ t_1 (* t_3 (* y.im (cos t_0)))))
(* t_2 (sin (* y.im (log (hypot x.im x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
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 t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -3.7e-6) {
tmp = t_2 * t_1;
} else if (y_46_re <= 4.2e-230) {
tmp = sin(fma(t_3, y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 510.0) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re)) * (t_1 + (t_3 * (y_46_im * cos(t_0))));
} else {
tmp = t_2 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) 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))) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -3.7e-6) tmp = Float64(t_2 * t_1); elseif (y_46_re <= 4.2e-230) tmp = Float64(sin(fma(t_3, y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 510.0) tmp = Float64((exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * Float64(t_1 + Float64(t_3 * Float64(y_46_im * cos(t_0))))); else tmp = Float64(t_2 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $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]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.7e-6], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 4.2e-230], N[(N[Sin[N[(t$95$3 * 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, 510.0], N[(N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[(t$95$1 + N[(t$95$3 * N[(y$46$im * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
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}\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -3.7 \cdot 10^{-6}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 4.2 \cdot 10^{-230}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_3, 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 510:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(t\_1 + t\_3 \cdot \left(y.im \cdot \cos t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -3.7000000000000002e-6Initial program 39.4%
Taylor expanded in y.im around 0 88.8%
if -3.7000000000000002e-6 < y.re < 4.1999999999999997e-230Initial program 46.2%
exp-diff46.2%
exp-to-pow46.2%
hypot-define46.2%
*-commutative46.2%
exp-prod46.2%
fma-define46.2%
hypot-define88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in y.re around 0 87.2%
rec-exp87.2%
distribute-lft-neg-in87.2%
Simplified87.2%
if 4.1999999999999997e-230 < y.re < 510Initial program 35.5%
exp-diff35.5%
exp-to-pow35.5%
hypot-define35.5%
*-commutative35.5%
exp-prod35.5%
fma-define35.5%
hypot-define71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in y.re around 0 69.5%
rec-exp69.5%
distribute-rgt-neg-in69.5%
exp-prod69.1%
Simplified69.1%
Taylor expanded in y.im around 0 47.1%
+-commutative47.1%
associate-*r*47.1%
+-commutative47.1%
unpow247.1%
unpow247.1%
hypot-undefine78.5%
Simplified78.5%
if 510 < y.re Initial program 44.2%
Taylor expanded in y.re around 0 40.4%
unpow240.4%
unpow240.4%
hypot-undefine73.1%
Simplified73.1%
Final simplification83.3%
(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))))
(if (<= y.im -1.1e+55)
(* t_0 (sin (fabs (* t_1 y.im))))
(if (<= y.im 7.4e+42)
(*
(sin (fma t_1 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.im x.re) y.re))
(* t_0 (sin (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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 tmp;
if (y_46_im <= -1.1e+55) {
tmp = t_0 * sin(fabs((t_1 * y_46_im)));
} else if (y_46_im <= 7.4e+42) {
tmp = sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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)) tmp = 0.0 if (y_46_im <= -1.1e+55) tmp = Float64(t_0 * sin(abs(Float64(t_1 * y_46_im)))); elseif (y_46_im <= 7.4e+42) tmp = Float64(sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[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]}, If[LessEqual[y$46$im, -1.1e+55], N[(t$95$0 * N[Sin[N[Abs[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.4e+42], 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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)\\
\mathbf{if}\;y.im \leq -1.1 \cdot 10^{+55}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left|t\_1 \cdot y.im\right|\right)\\
\mathbf{elif}\;y.im \leq 7.4 \cdot 10^{+42}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.im < -1.10000000000000005e55Initial program 40.8%
add-sqr-sqrt16.3%
sqrt-unprod22.4%
pow222.4%
*-commutative22.4%
hypot-define38.9%
Applied egg-rr38.9%
unpow238.9%
rem-sqrt-square73.7%
hypot-undefine46.9%
unpow246.9%
unpow246.9%
+-commutative46.9%
unpow246.9%
unpow246.9%
hypot-undefine73.7%
Simplified73.7%
Taylor expanded in y.re around 0 44.9%
fabs-mul44.9%
+-commutative44.9%
unpow244.9%
unpow244.9%
hypot-undefine69.6%
fabs-mul69.6%
Simplified69.6%
if -1.10000000000000005e55 < y.im < 7.39999999999999993e42Initial program 48.3%
exp-diff46.3%
exp-to-pow46.3%
hypot-define46.3%
*-commutative46.3%
exp-prod44.9%
fma-define44.9%
hypot-define86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in y.im around 0 63.9%
unpow263.9%
unpow263.9%
hypot-undefine87.4%
Simplified87.4%
if 7.39999999999999993e42 < y.im Initial program 28.6%
Taylor expanded in y.re around 0 27.0%
unpow227.0%
unpow227.0%
hypot-undefine65.4%
Simplified65.4%
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
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -3.7e-6)
(* t_1 (sin t_0))
(if (<= y.re 0.18)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (sin (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -3.7e-6) {
tmp = t_1 * sin(t_0);
} else if (y_46_re <= 0.18) {
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 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -3.7e-6) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_re <= 0.18) 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 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.7e-6], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.18], 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[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -3.7 \cdot 10^{-6}:\\
\;\;\;\;t\_1 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 0.18:\\
\;\;\;\;\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 \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -3.7000000000000002e-6Initial program 39.4%
Taylor expanded in y.im around 0 88.8%
if -3.7000000000000002e-6 < y.re < 0.17999999999999999Initial program 43.2%
exp-diff43.2%
exp-to-pow43.2%
hypot-define43.2%
*-commutative43.2%
exp-prod43.2%
fma-define43.2%
hypot-define83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in y.re around 0 82.5%
rec-exp82.5%
distribute-lft-neg-in82.5%
Simplified82.5%
if 0.17999999999999999 < y.re Initial program 42.6%
Taylor expanded in y.re around 0 38.9%
unpow238.9%
unpow238.9%
hypot-undefine70.4%
Simplified70.4%
Final simplification81.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin (fma (log (hypot x.re x.im)) y.im t_0))))
(if (<= y.re -3.7e-6)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(if (<= y.re 11000.0)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(* 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
double tmp;
if (y_46_re <= -3.7e-6) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else if (y_46_re <= 11000.0) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) tmp = 0.0 if (y_46_re <= -3.7e-6) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); elseif (y_46_re <= 11000.0) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ 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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.7e-6], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 11000.0], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
\mathbf{if}\;y.re \leq -3.7 \cdot 10^{-6}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 11000:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.7000000000000002e-6Initial program 39.4%
Taylor expanded in y.im around 0 88.8%
if -3.7000000000000002e-6 < y.re < 11000Initial program 43.0%
exp-diff42.3%
exp-to-pow42.3%
hypot-define42.3%
*-commutative42.3%
exp-prod42.2%
fma-define42.3%
hypot-define82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in y.re around 0 81.4%
rec-exp81.4%
distribute-lft-neg-in81.4%
Simplified81.4%
if 11000 < y.re Initial program 43.1%
exp-diff35.3%
exp-to-pow35.3%
hypot-define35.3%
*-commutative35.3%
exp-prod33.3%
fma-define33.3%
hypot-define52.9%
*-commutative52.9%
Simplified52.9%
Taylor expanded in y.im around 0 66.8%
unpow266.8%
unpow266.8%
hypot-undefine66.8%
Simplified66.8%
Final simplification80.5%
(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 -3.6e+17) (not (<= y.im 5.2e+15)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -3.6e+17) || !(y_46_im <= 5.2e+15)) {
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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -3.6e+17) || !(y_46_im <= 5.2e+15)) 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(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ 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]}, If[Or[LessEqual[y$46$im, -3.6e+17], N[Not[LessEqual[y$46$im, 5.2e+15]], $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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -3.6 \cdot 10^{+17} \lor \neg \left(y.im \leq 5.2 \cdot 10^{+15}\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}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -3.6e17 or 5.2e15 < y.im Initial program 36.4%
Taylor expanded in y.im around 0 64.7%
if -3.6e17 < y.im < 5.2e15Initial program 47.1%
exp-diff45.6%
exp-to-pow45.6%
hypot-define45.6%
*-commutative45.6%
exp-prod44.9%
fma-define44.9%
hypot-define89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y.im around 0 65.1%
unpow265.1%
unpow265.1%
hypot-undefine90.0%
Simplified90.0%
Final simplification78.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (exp (- (* y.re (log x.im)) t_0)))
(t_4 (* t_2 t_3))
(t_5 (* t_3 (sin (* (log (hypot x.re x.im)) y.im)))))
(if (<= x.im -1e-310)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 1.6e-207)
t_5
(if (<= x.im 3.15e-21)
t_4
(if (<= x.im 530000000.0)
t_5
(if (<= x.im 1.8e+46)
(*
(pow (exp y.im) (- (atan2 x.im x.re)))
(sin (+ t_1 (* y.im (log x.im)))))
(if (<= x.im 2.4e+74) t_4 t_5))))))))
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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = exp(((y_46_re * log(x_46_im)) - t_0));
double t_4 = t_2 * t_3;
double t_5 = t_3 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.6e-207) {
tmp = t_5;
} else if (x_46_im <= 3.15e-21) {
tmp = t_4;
} else if (x_46_im <= 530000000.0) {
tmp = t_5;
} else if (x_46_im <= 1.8e+46) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re)) * sin((t_1 + (y_46_im * log(x_46_im))));
} else if (x_46_im <= 2.4e+74) {
tmp = t_4;
} else {
tmp = t_5;
}
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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double t_3 = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
double t_4 = t_2 * t_3;
double t_5 = t_3 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.6e-207) {
tmp = t_5;
} else if (x_46_im <= 3.15e-21) {
tmp = t_4;
} else if (x_46_im <= 530000000.0) {
tmp = t_5;
} else if (x_46_im <= 1.8e+46) {
tmp = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re)) * Math.sin((t_1 + (y_46_im * Math.log(x_46_im))));
} else if (x_46_im <= 2.4e+74) {
tmp = t_4;
} else {
tmp = t_5;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) t_3 = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) t_4 = t_2 * t_3 t_5 = t_3 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0 if x_46_im <= -1e-310: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 1.6e-207: tmp = t_5 elif x_46_im <= 3.15e-21: tmp = t_4 elif x_46_im <= 530000000.0: tmp = t_5 elif x_46_im <= 1.8e+46: tmp = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) * math.sin((t_1 + (y_46_im * math.log(x_46_im)))) elif x_46_im <= 2.4e+74: tmp = t_4 else: tmp = t_5 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) t_4 = Float64(t_2 * t_3) t_5 = Float64(t_3 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) tmp = 0.0 if (x_46_im <= -1e-310) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 1.6e-207) tmp = t_5; elseif (x_46_im <= 3.15e-21) tmp = t_4; elseif (x_46_im <= 530000000.0) tmp = t_5; elseif (x_46_im <= 1.8e+46) tmp = Float64((exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_im))))); elseif (x_46_im <= 2.4e+74) tmp = t_4; else tmp = t_5; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); t_3 = exp(((y_46_re * log(x_46_im)) - t_0)); t_4 = t_2 * t_3; t_5 = t_3 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); tmp = 0.0; if (x_46_im <= -1e-310) tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 1.6e-207) tmp = t_5; elseif (x_46_im <= 3.15e-21) tmp = t_4; elseif (x_46_im <= 530000000.0) tmp = t_5; elseif (x_46_im <= 1.8e+46) tmp = (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)) * sin((t_1 + (y_46_im * log(x_46_im)))); elseif (x_46_im <= 2.4e+74) tmp = t_4; else tmp = t_5; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(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[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1e-310], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.6e-207], t$95$5, If[LessEqual[x$46$im, 3.15e-21], t$95$4, If[LessEqual[x$46$im, 530000000.0], t$95$5, If[LessEqual[x$46$im, 1.8e+46], N[(N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.4e+74], t$95$4, t$95$5]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := e^{y.re \cdot \log x.im - t\_0}\\
t_4 := t\_2 \cdot t\_3\\
t_5 := t\_3 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 1.6 \cdot 10^{-207}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x.im \leq 3.15 \cdot 10^{-21}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x.im \leq 530000000:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x.im \leq 1.8 \cdot 10^{+46}:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \left(t\_1 + y.im \cdot \log x.im\right)\\
\mathbf{elif}\;x.im \leq 2.4 \cdot 10^{+74}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if x.im < -9.999999999999969e-311Initial program 35.1%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in x.im around -inf 63.1%
mul-1-neg63.1%
Simplified63.1%
if -9.999999999999969e-311 < x.im < 1.6000000000000002e-207 or 3.15e-21 < x.im < 5.3e8 or 2.40000000000000008e74 < x.im Initial program 39.9%
add-sqr-sqrt19.5%
sqrt-unprod25.4%
pow225.4%
*-commutative25.4%
hypot-define40.0%
Applied egg-rr40.0%
unpow240.0%
rem-sqrt-square58.5%
hypot-undefine34.6%
unpow234.6%
unpow234.6%
+-commutative34.6%
unpow234.6%
unpow234.6%
hypot-undefine58.5%
Simplified58.5%
Taylor expanded in y.re around 0 31.4%
fabs-mul31.4%
+-commutative31.4%
unpow231.4%
unpow231.4%
hypot-undefine57.6%
fabs-mul57.6%
Simplified57.6%
Taylor expanded in x.re around 0 59.9%
*-un-lft-identity59.9%
*-commutative59.9%
add-sqr-sqrt41.6%
fabs-sqr41.6%
add-sqr-sqrt75.2%
Applied egg-rr75.2%
if 1.6000000000000002e-207 < x.im < 3.15e-21 or 1.7999999999999999e46 < x.im < 2.40000000000000008e74Initial program 59.1%
Taylor expanded in y.im around 0 66.5%
Taylor expanded in x.re around 0 61.1%
if 5.3e8 < x.im < 1.7999999999999999e46Initial program 55.4%
exp-diff55.4%
exp-to-pow55.4%
hypot-define55.4%
*-commutative55.4%
exp-prod55.4%
fma-define55.4%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.re around 0 77.6%
rec-exp77.6%
distribute-rgt-neg-in77.6%
exp-prod77.6%
Simplified77.6%
Taylor expanded in x.re around 0 88.7%
Final simplification67.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)))
(if (<= y.re -6.5e-101)
t_3
(if (<= y.re 1.3e-244)
(* (sin (fma (log (hypot x.re x.im)) y.im t_1)) (- 1.0 t_0))
(if (<= y.re 0.12)
(* t_2 (pow (exp y.im) (- (atan2 x.im x.re))))
t_3)))))
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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
double tmp;
if (y_46_re <= -6.5e-101) {
tmp = t_3;
} else if (y_46_re <= 1.3e-244) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (1.0 - t_0);
} else if (y_46_re <= 0.12) {
tmp = t_2 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = t_3;
}
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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_2) tmp = 0.0 if (y_46_re <= -6.5e-101) tmp = t_3; elseif (y_46_re <= 1.3e-244) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * Float64(1.0 - t_0)); elseif (y_46_re <= 0.12) tmp = Float64(t_2 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = t_3; 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[(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[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -6.5e-101], t$95$3, If[LessEqual[y$46$re, 1.3e-244], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.12], N[(t$95$2 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_2\\
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{-101}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-244}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot \left(1 - t\_0\right)\\
\mathbf{elif}\;y.re \leq 0.12:\\
\;\;\;\;t\_2 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.re < -6.4999999999999996e-101 or 0.12 < y.re Initial program 42.1%
Taylor expanded in y.im around 0 74.1%
if -6.4999999999999996e-101 < y.re < 1.3000000000000001e-244Initial program 45.6%
exp-diff45.6%
exp-to-pow45.6%
hypot-define45.6%
*-commutative45.6%
exp-prod45.5%
fma-define45.6%
hypot-define88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in y.re around 0 89.0%
rec-exp89.0%
distribute-rgt-neg-in89.0%
exp-prod88.9%
Simplified88.9%
Taylor expanded in y.im around 0 58.5%
mul-1-neg58.5%
unsub-neg58.5%
*-commutative58.5%
Simplified58.5%
if 1.3000000000000001e-244 < y.re < 0.12Initial program 36.3%
exp-diff36.3%
exp-to-pow36.3%
hypot-define36.3%
*-commutative36.3%
exp-prod36.3%
fma-define36.3%
hypot-define74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y.re around 0 73.3%
rec-exp73.3%
distribute-rgt-neg-in73.3%
exp-prod72.9%
Simplified72.9%
add-cbrt-cube33.0%
pow333.0%
fma-undefine33.0%
*-commutative33.0%
*-commutative33.0%
fma-define33.0%
Applied egg-rr33.0%
Taylor expanded in y.im around 0 71.2%
Final simplification69.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2 (exp (- (* y.re (log x.im)) t_0))))
(if (<= x.im -1e-310)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (or (<= x.im 2e+99) (not (<= x.im 1.55e+234)))
(* t_1 t_2)
(* t_2 (sin (fabs (* y.im (log x.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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((y_46_re * log(x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if ((x_46_im <= 2e+99) || !(x_46_im <= 1.55e+234)) {
tmp = t_1 * t_2;
} else {
tmp = t_2 * sin(fabs((y_46_im * log(x_46_im))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
t_2 = exp(((y_46re * log(x_46im)) - t_0))
if (x_46im <= (-1d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else if ((x_46im <= 2d+99) .or. (.not. (x_46im <= 1.55d+234))) then
tmp = t_1 * t_2
else
tmp = t_2 * sin(abs((y_46im * log(x_46im))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if ((x_46_im <= 2e+99) || !(x_46_im <= 1.55e+234)) {
tmp = t_1 * t_2;
} else {
tmp = t_2 * Math.sin(Math.abs((y_46_im * Math.log(x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) tmp = 0 if x_46_im <= -1e-310: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif (x_46_im <= 2e+99) or not (x_46_im <= 1.55e+234): tmp = t_1 * t_2 else: tmp = t_2 * math.sin(math.fabs((y_46_im * math.log(x_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 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) tmp = 0.0 if (x_46_im <= -1e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif ((x_46_im <= 2e+99) || !(x_46_im <= 1.55e+234)) tmp = Float64(t_1 * t_2); else tmp = Float64(t_2 * sin(abs(Float64(y_46_im * log(x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = exp(((y_46_re * log(x_46_im)) - t_0)); tmp = 0.0; if (x_46_im <= -1e-310) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif ((x_46_im <= 2e+99) || ~((x_46_im <= 1.55e+234))) tmp = t_1 * t_2; else tmp = t_2 * sin(abs((y_46_im * log(x_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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1e-310], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$im, 2e+99], N[Not[LessEqual[x$46$im, 1.55e+234]], $MachinePrecision]], N[(t$95$1 * t$95$2), $MachinePrecision], N[(t$95$2 * N[Sin[N[Abs[N[(y$46$im * N[Log[x$46$im], $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 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{y.re \cdot \log x.im - t\_0}\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 2 \cdot 10^{+99} \lor \neg \left(x.im \leq 1.55 \cdot 10^{+234}\right):\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left|y.im \cdot \log x.im\right|\right)\\
\end{array}
\end{array}
if x.im < -9.999999999999969e-311Initial program 35.1%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in x.im around -inf 63.1%
mul-1-neg63.1%
Simplified63.1%
if -9.999999999999969e-311 < x.im < 1.9999999999999999e99 or 1.54999999999999995e234 < x.im Initial program 54.1%
Taylor expanded in y.im around 0 59.0%
Taylor expanded in x.re around 0 58.1%
if 1.9999999999999999e99 < x.im < 1.54999999999999995e234Initial program 28.5%
add-sqr-sqrt18.4%
sqrt-unprod15.9%
pow215.9%
*-commutative15.9%
hypot-define29.8%
Applied egg-rr29.8%
unpow229.8%
rem-sqrt-square53.6%
hypot-undefine29.1%
unpow229.1%
unpow229.1%
+-commutative29.1%
unpow229.1%
unpow229.1%
hypot-undefine53.6%
Simplified53.6%
Taylor expanded in y.re around 0 29.1%
fabs-mul29.1%
+-commutative29.1%
unpow229.1%
unpow229.1%
hypot-undefine61.5%
fabs-mul61.5%
Simplified61.5%
Taylor expanded in x.re around 0 71.7%
Taylor expanded in x.re around 0 71.7%
Final simplification62.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -205.0) (not (<= y.im 520000000.0))) (* (sin (* y.re (atan2 x.im x.re))) (pow (exp y.im) (- (atan2 x.im x.re)))) (sin (fma y.re (atan2 x.im x.re) (* (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 tmp;
if ((y_46_im <= -205.0) || !(y_46_im <= 520000000.0)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(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) tmp = 0.0 if ((y_46_im <= -205.0) || !(y_46_im <= 520000000.0)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -205.0], N[Not[LessEqual[y$46$im, 520000000.0]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -205 \lor \neg \left(y.im \leq 520000000\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\\
\end{array}
\end{array}
if y.im < -205 or 5.2e8 < y.im Initial program 36.8%
exp-diff28.0%
exp-to-pow28.0%
hypot-define28.0%
*-commutative28.0%
exp-prod26.4%
fma-define26.4%
hypot-define53.2%
*-commutative53.2%
Simplified53.2%
Taylor expanded in y.re around 0 58.5%
rec-exp58.5%
distribute-rgt-neg-in58.5%
exp-prod59.1%
Simplified59.1%
add-cbrt-cube12.3%
pow312.3%
fma-undefine12.3%
*-commutative12.3%
*-commutative12.3%
fma-define12.3%
Applied egg-rr12.3%
Taylor expanded in y.im around 0 59.6%
if -205 < y.im < 5.2e8Initial program 47.0%
exp-diff45.5%
exp-to-pow45.5%
hypot-define45.5%
*-commutative45.5%
exp-prod45.5%
fma-define45.5%
hypot-define90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in y.re around 0 53.5%
rec-exp53.5%
distribute-rgt-neg-in53.5%
exp-prod53.5%
Simplified53.5%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in y.im around inf 26.9%
+-commutative26.9%
+-commutative26.9%
unpow226.9%
unpow226.9%
hypot-undefine52.0%
fma-undefine52.0%
Simplified52.0%
Final simplification55.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -1e-310)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(* t_1 (exp (- (* y.re (log x.im)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-1d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -1e-310: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -1e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -1e-310) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1e-310], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -9.999999999999969e-311Initial program 35.1%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in x.im around -inf 63.1%
mul-1-neg63.1%
Simplified63.1%
if -9.999999999999969e-311 < x.im Initial program 47.4%
Taylor expanded in y.im around 0 55.6%
Taylor expanded in x.re around 0 57.6%
Final simplification60.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (sin (fma y.re (atan2 x.im x.re) (* (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) {
return sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log(hypot(x_46_re, x_46_im)) * y_46_im)));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)
\end{array}
Initial program 42.0%
exp-diff37.0%
exp-to-pow37.0%
hypot-define37.0%
*-commutative37.0%
exp-prod36.2%
fma-define36.2%
hypot-define72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in y.re around 0 55.9%
rec-exp55.9%
distribute-rgt-neg-in55.9%
exp-prod56.2%
Simplified56.2%
Taylor expanded in y.im around 0 28.1%
Taylor expanded in y.im around inf 14.4%
+-commutative14.4%
+-commutative14.4%
unpow214.4%
unpow214.4%
hypot-undefine28.1%
fma-undefine28.1%
Simplified28.1%
Final simplification28.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -1e-308)
(sin (- t_0 (* y.im (log (/ -1.0 x.re)))))
(sin (fma y.im (log x.re) 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 tmp;
if (x_46_re <= -1e-308) {
tmp = sin((t_0 - (y_46_im * log((-1.0 / x_46_re)))));
} else {
tmp = sin(fma(y_46_im, log(x_46_re), 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)) tmp = 0.0 if (x_46_re <= -1e-308) tmp = sin(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_re))))); else tmp = sin(fma(y_46_im, log(x_46_re), 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]}, If[LessEqual[x$46$re, -1e-308], N[Sin[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{-308}:\\
\;\;\;\;\sin \left(t\_0 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right)\\
\end{array}
\end{array}
if x.re < -9.9999999999999991e-309Initial program 42.2%
exp-diff37.3%
exp-to-pow37.3%
hypot-define37.3%
*-commutative37.3%
exp-prod37.3%
fma-define37.3%
hypot-define76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in y.re around 0 60.1%
rec-exp60.1%
distribute-rgt-neg-in60.1%
exp-prod60.1%
Simplified60.1%
Taylor expanded in y.im around 0 31.1%
Taylor expanded in x.re around -inf 24.0%
+-commutative24.0%
mul-1-neg24.0%
unsub-neg24.0%
Simplified24.0%
if -9.9999999999999991e-309 < x.re Initial program 41.9%
exp-diff36.6%
exp-to-pow36.6%
hypot-define36.6%
*-commutative36.6%
exp-prod35.1%
fma-define35.1%
hypot-define68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y.re around 0 52.1%
rec-exp52.1%
distribute-rgt-neg-in52.1%
exp-prod52.7%
Simplified52.7%
Taylor expanded in y.im around 0 25.3%
Taylor expanded in x.im around 0 19.8%
fma-define19.8%
Simplified19.8%
Final simplification21.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im -4.6e-114)
(sin (- t_0 (* y.im (log (/ -1.0 x.im)))))
(if (<= x.im 5.4e-24) (sin t_0) (sin (+ t_0 (* y.im (log x.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 (x_46_im <= -4.6e-114) {
tmp = sin((t_0 - (y_46_im * log((-1.0 / x_46_im)))));
} else if (x_46_im <= 5.4e-24) {
tmp = sin(t_0);
} else {
tmp = sin((t_0 + (y_46_im * log(x_46_im))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (x_46im <= (-4.6d-114)) then
tmp = sin((t_0 - (y_46im * log(((-1.0d0) / x_46im)))))
else if (x_46im <= 5.4d-24) then
tmp = sin(t_0)
else
tmp = sin((t_0 + (y_46im * log(x_46im))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4.6e-114) {
tmp = Math.sin((t_0 - (y_46_im * Math.log((-1.0 / x_46_im)))));
} else if (x_46_im <= 5.4e-24) {
tmp = Math.sin(t_0);
} else {
tmp = Math.sin((t_0 + (y_46_im * Math.log(x_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 x_46_im <= -4.6e-114: tmp = math.sin((t_0 - (y_46_im * math.log((-1.0 / x_46_im))))) elif x_46_im <= 5.4e-24: tmp = math.sin(t_0) else: tmp = math.sin((t_0 + (y_46_im * math.log(x_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 (x_46_im <= -4.6e-114) tmp = sin(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_im))))); elseif (x_46_im <= 5.4e-24) tmp = sin(t_0); else tmp = sin(Float64(t_0 + Float64(y_46_im * log(x_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 (x_46_im <= -4.6e-114) tmp = sin((t_0 - (y_46_im * log((-1.0 / x_46_im))))); elseif (x_46_im <= 5.4e-24) tmp = sin(t_0); else tmp = sin((t_0 + (y_46_im * log(x_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[LessEqual[x$46$im, -4.6e-114], N[Sin[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 5.4e-24], N[Sin[t$95$0], $MachinePrecision], N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[x$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}\;x.im \leq -4.6 \cdot 10^{-114}:\\
\;\;\;\;\sin \left(t\_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
\mathbf{elif}\;x.im \leq 5.4 \cdot 10^{-24}:\\
\;\;\;\;\sin t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -4.5999999999999999e-114Initial program 39.4%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod34.5%
fma-define34.5%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.re around 0 53.0%
rec-exp53.0%
distribute-rgt-neg-in53.0%
exp-prod53.9%
Simplified53.9%
Taylor expanded in y.im around 0 25.6%
Taylor expanded in x.im around -inf 22.4%
+-commutative22.4%
mul-1-neg22.4%
unsub-neg22.4%
Simplified22.4%
if -4.5999999999999999e-114 < x.im < 5.40000000000000014e-24Initial program 45.6%
exp-diff42.3%
exp-to-pow42.3%
hypot-define42.3%
*-commutative42.3%
exp-prod41.2%
fma-define41.3%
hypot-define76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.re around 0 52.8%
rec-exp52.8%
distribute-rgt-neg-in52.8%
exp-prod52.8%
Simplified52.8%
Taylor expanded in y.im around 0 28.4%
Taylor expanded in x.re around 0 9.4%
Taylor expanded in y.im around 0 19.2%
if 5.40000000000000014e-24 < x.im Initial program 40.6%
exp-diff32.2%
exp-to-pow32.2%
hypot-define32.2%
*-commutative32.2%
exp-prod32.2%
fma-define32.2%
hypot-define69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in y.re around 0 62.3%
rec-exp62.3%
distribute-rgt-neg-in62.3%
exp-prod62.3%
Simplified62.3%
Taylor expanded in y.im around 0 30.1%
Taylor expanded in x.re around 0 27.2%
Final simplification22.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -1e-308)
(sin (- t_0 (* y.im (log (/ -1.0 x.re)))))
(sin (+ t_0 (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1e-308) {
tmp = sin((t_0 - (y_46_im * log((-1.0 / x_46_re)))));
} else {
tmp = sin((t_0 + (y_46_im * log(x_46_re))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (x_46re <= (-1d-308)) then
tmp = sin((t_0 - (y_46im * log(((-1.0d0) / x_46re)))))
else
tmp = sin((t_0 + (y_46im * log(x_46re))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1e-308) {
tmp = Math.sin((t_0 - (y_46_im * Math.log((-1.0 / x_46_re)))));
} else {
tmp = Math.sin((t_0 + (y_46_im * Math.log(x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -1e-308: tmp = math.sin((t_0 - (y_46_im * math.log((-1.0 / x_46_re))))) else: tmp = math.sin((t_0 + (y_46_im * math.log(x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -1e-308) tmp = sin(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_re))))); else tmp = sin(Float64(t_0 + Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -1e-308) tmp = sin((t_0 - (y_46_im * log((-1.0 / x_46_re))))); else tmp = sin((t_0 + (y_46_im * log(x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1e-308], N[Sin[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{-308}:\\
\;\;\;\;\sin \left(t\_0 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -9.9999999999999991e-309Initial program 42.2%
exp-diff37.3%
exp-to-pow37.3%
hypot-define37.3%
*-commutative37.3%
exp-prod37.3%
fma-define37.3%
hypot-define76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in y.re around 0 60.1%
rec-exp60.1%
distribute-rgt-neg-in60.1%
exp-prod60.1%
Simplified60.1%
Taylor expanded in y.im around 0 31.1%
Taylor expanded in x.re around -inf 24.0%
+-commutative24.0%
mul-1-neg24.0%
unsub-neg24.0%
Simplified24.0%
if -9.9999999999999991e-309 < x.re Initial program 41.9%
exp-diff36.6%
exp-to-pow36.6%
hypot-define36.6%
*-commutative36.6%
exp-prod35.1%
fma-define35.1%
hypot-define68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y.re around 0 52.1%
rec-exp52.1%
distribute-rgt-neg-in52.1%
exp-prod52.7%
Simplified52.7%
Taylor expanded in y.im around 0 25.3%
Taylor expanded in x.im around 0 19.8%
Final simplification21.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re)))) (if (<= x.im 4.9e-25) (sin t_0) (sin (+ t_0 (* y.im (log x.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 (x_46_im <= 4.9e-25) {
tmp = sin(t_0);
} else {
tmp = sin((t_0 + (y_46_im * log(x_46_im))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (x_46im <= 4.9d-25) then
tmp = sin(t_0)
else
tmp = sin((t_0 + (y_46im * log(x_46im))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= 4.9e-25) {
tmp = Math.sin(t_0);
} else {
tmp = Math.sin((t_0 + (y_46_im * Math.log(x_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 x_46_im <= 4.9e-25: tmp = math.sin(t_0) else: tmp = math.sin((t_0 + (y_46_im * math.log(x_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 (x_46_im <= 4.9e-25) tmp = sin(t_0); else tmp = sin(Float64(t_0 + Float64(y_46_im * log(x_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 (x_46_im <= 4.9e-25) tmp = sin(t_0); else tmp = sin((t_0 + (y_46_im * log(x_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[LessEqual[x$46$im, 4.9e-25], N[Sin[t$95$0], $MachinePrecision], N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[x$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}\;x.im \leq 4.9 \cdot 10^{-25}:\\
\;\;\;\;\sin t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < 4.8999999999999999e-25Initial program 42.7%
exp-diff39.2%
exp-to-pow39.2%
hypot-define39.2%
*-commutative39.2%
exp-prod38.1%
fma-define38.1%
hypot-define73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in y.re around 0 52.9%
rec-exp52.9%
distribute-rgt-neg-in52.9%
exp-prod53.3%
Simplified53.3%
Taylor expanded in y.im around 0 27.1%
Taylor expanded in x.re around 0 5.0%
Taylor expanded in y.im around 0 17.3%
if 4.8999999999999999e-25 < x.im Initial program 40.6%
exp-diff32.2%
exp-to-pow32.2%
hypot-define32.2%
*-commutative32.2%
exp-prod32.2%
fma-define32.2%
hypot-define69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in y.re around 0 62.3%
rec-exp62.3%
distribute-rgt-neg-in62.3%
exp-prod62.3%
Simplified62.3%
Taylor expanded in y.im around 0 30.1%
Taylor expanded in x.re around 0 27.2%
Final simplification20.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (sin (* y.re (atan2 x.im x.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = sin((y_46re * atan2(x_46im, x_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return sin(Float64(y_46_re * atan(x_46_im, x_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
\end{array}
Initial program 42.0%
exp-diff37.0%
exp-to-pow37.0%
hypot-define37.0%
*-commutative37.0%
exp-prod36.2%
fma-define36.2%
hypot-define72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in y.re around 0 55.9%
rec-exp55.9%
distribute-rgt-neg-in55.9%
exp-prod56.2%
Simplified56.2%
Taylor expanded in y.im around 0 28.1%
Taylor expanded in x.re around 0 12.2%
Taylor expanded in y.im around 0 16.8%
Final simplification16.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (sin (* y.im (log x.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_im * 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 = sin((y_46im * 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 Math.sin((y_46_im * Math.log(x_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_im * math.log(x_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return sin(Float64(y_46_im * log(x_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_im * log(x_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.im \cdot \log x.im\right)
\end{array}
Initial program 42.0%
exp-diff37.0%
exp-to-pow37.0%
hypot-define37.0%
*-commutative37.0%
exp-prod36.2%
fma-define36.2%
hypot-define72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in y.re around 0 55.9%
rec-exp55.9%
distribute-rgt-neg-in55.9%
exp-prod56.2%
Simplified56.2%
Taylor expanded in y.im around 0 28.1%
Taylor expanded in x.re around 0 12.2%
Taylor expanded in y.re around 0 6.0%
Final simplification6.0%
herbie shell --seed 2024044
(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)))))