
(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 18 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
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1 (log (hypot x.im x.re))))
(if (<= y.re -1.7)
(* t_0 (sin (* (fma y.im (/ t_1 y.re) (atan2 x.im x.re)) y.re)))
(if (<= y.re 1600000000000.0)
(*
(pow (hypot x.re x.im) y.re)
(*
(pow (exp (- y.im)) (atan2 x.im x.re))
(sin (fma (log (hypot x.re x.im)) y.im (* (atan2 x.im x.re) y.re)))))
(* t_0 (sin (* t_1 y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1.7) {
tmp = t_0 * sin((fma(y_46_im, (t_1 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else if (y_46_re <= 1600000000000.0) {
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(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (atan2(x_46_im, x_46_re) * y_46_re))));
} else {
tmp = t_0 * sin((t_1 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.7) tmp = Float64(t_0 * sin(Float64(fma(y_46_im, Float64(t_1 / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); elseif (y_46_re <= 1600000000000.0) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re))))); else tmp = Float64(t_0 * sin(Float64(t_1 * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $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]}, If[LessEqual[y$46$re, -1.7], N[(t$95$0 * N[Sin[N[(N[(y$46$im * N[(t$95$1 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1600000000000.0], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1.7:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(y.im, \frac{t\_1}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1600000000000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \left({\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(t\_1 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -1.69999999999999996Initial program 38.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6489.6
Applied rewrites89.6%
if -1.69999999999999996 < y.re < 1.6e12Initial program 41.0%
Applied rewrites81.4%
Applied rewrites81.4%
if 1.6e12 < y.re Initial program 52.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.2
Applied rewrites77.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1 (log (hypot x.im x.re))))
(if (<= y.re -21.0)
(* t_0 (sin (* (fma y.im (/ t_1 y.re) (atan2 x.im x.re)) y.re)))
(if (<= y.re 25000.0)
(*
1.0
(*
(pow (exp (- y.im)) (atan2 x.im x.re))
(sin (fma (log (hypot x.re x.im)) y.im (* (atan2 x.im x.re) y.re)))))
(* t_0 (sin (* t_1 y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -21.0) {
tmp = t_0 * sin((fma(y_46_im, (t_1 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else if (y_46_re <= 25000.0) {
tmp = 1.0 * (pow(exp(-y_46_im), atan2(x_46_im, x_46_re)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (atan2(x_46_im, x_46_re) * y_46_re))));
} else {
tmp = t_0 * sin((t_1 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -21.0) tmp = Float64(t_0 * sin(Float64(fma(y_46_im, Float64(t_1 / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); elseif (y_46_re <= 25000.0) tmp = Float64(1.0 * Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re))))); else tmp = Float64(t_0 * sin(Float64(t_1 * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $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]}, If[LessEqual[y$46$re, -21.0], N[(t$95$0 * N[Sin[N[(N[(y$46$im * N[(t$95$1 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 25000.0], N[(1.0 * N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -21:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(y.im, \frac{t\_1}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 25000:\\
\;\;\;\;1 \cdot \left({\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(t\_1 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -21Initial program 39.4%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6491.0
Applied rewrites91.0%
if -21 < y.re < 25000Initial program 40.7%
Applied rewrites80.8%
Applied rewrites80.8%
Taylor expanded in y.re around 0
Applied rewrites80.0%
if 25000 < y.re Initial program 52.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.2
Applied rewrites77.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -21.0) (not (<= y.re 25000.0)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (log (hypot x.im x.re)) y.im)))
(*
1.0
(*
(pow (exp (- y.im)) (atan2 x.im x.re))
(sin (fma (log (hypot x.re x.im)) 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 tmp;
if ((y_46_re <= -21.0) || !(y_46_re <= 25000.0)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = 1.0 * (pow(exp(-y_46_im), atan2(x_46_im, x_46_re)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (atan2(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) tmp = 0.0 if ((y_46_re <= -21.0) || !(y_46_re <= 25000.0)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(1.0 * Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(atan(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_] := If[Or[LessEqual[y$46$re, -21.0], N[Not[LessEqual[y$46$re, 25000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -21 \lor \neg \left(y.re \leq 25000\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left({\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -21 or 25000 < y.re Initial program 45.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.8
Applied rewrites83.8%
if -21 < y.re < 25000Initial program 40.7%
Applied rewrites80.8%
Applied rewrites80.8%
Taylor expanded in y.re around 0
Applied rewrites80.0%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -21.0) (not (<= y.re 25000.0)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* t_0 y.im)))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (fma y.im t_0 (* 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_im, x_46_re));
double tmp;
if ((y_46_re <= -21.0) || !(y_46_re <= 25000.0)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((t_0 * y_46_im));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(fma(y_46_im, t_0, (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -21.0) || !(y_46_re <= 25000.0)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(t_0 * y_46_im))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(fma(y_46_im, t_0, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -21.0], N[Not[LessEqual[y$46$re, 25000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0 + 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.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -21 \lor \neg \left(y.re \leq 25000\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, t\_0, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -21 or 25000 < y.re Initial program 45.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.8
Applied rewrites83.8%
if -21 < y.re < 25000Initial program 40.7%
Applied rewrites80.8%
Taylor expanded in y.re around 0
rec-expN/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.0
Applied rewrites80.0%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3e+17) (not (<= y.re 3e-33)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (fma y.im (log (hypot x.im x.re)) (* 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 tmp;
if ((y_46_re <= -3e+17) || !(y_46_re <= 3e-33)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3e+17) || !(y_46_re <= 3e-33)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3e+17], N[Not[LessEqual[y$46$re, 3e-33]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3 \cdot 10^{+17} \lor \neg \left(y.re \leq 3 \cdot 10^{-33}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -3e17 or 3.0000000000000002e-33 < y.re Initial program 46.4%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6477.6
Applied rewrites77.6%
if -3e17 < y.re < 3.0000000000000002e-33Initial program 39.8%
Applied rewrites79.8%
Taylor expanded in y.re around 0
rec-expN/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6481.2
Applied rewrites81.2%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3.8e-59) (not (<= y.re 2.7e-110)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.8e-59) || !(y_46_re <= 2.7e-110)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.8e-59) || !(y_46_re <= 2.7e-110)) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.8e-59) or not (y_46_re <= 2.7e-110): tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.8e-59) || !(y_46_re <= 2.7e-110)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.8e-59) || ~((y_46_re <= 2.7e-110))) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.8e-59], N[Not[LessEqual[y$46$re, 2.7e-110]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{-59} \lor \neg \left(y.re \leq 2.7 \cdot 10^{-110}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -3.79999999999999983e-59 or 2.6999999999999998e-110 < y.re Initial program 44.4%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.0
Applied rewrites72.0%
if -3.79999999999999983e-59 < y.re < 2.6999999999999998e-110Initial program 40.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6474.5
Applied rewrites74.5%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3e+17) (not (<= y.re 1e-32)))
(* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re)))
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3e+17) || !(y_46_re <= 1e-32)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3e+17) || !(y_46_re <= 1e-32)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3e+17) or not (y_46_re <= 1e-32): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3e+17) || !(y_46_re <= 1e-32)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3e+17) || ~((y_46_re <= 1e-32))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3e+17], N[Not[LessEqual[y$46$re, 1e-32]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3 \cdot 10^{+17} \lor \neg \left(y.re \leq 10^{-32}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -3e17 or 1.00000000000000006e-32 < y.re Initial program 46.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.7
Applied rewrites72.7%
if -3e17 < y.re < 1.00000000000000006e-32Initial program 40.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6466.2
Applied rewrites66.2%
Final simplification69.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -8.2e-30)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(if (<= y.re 4.3e-172)
(*
(* y.re y.re)
(fma
(log (hypot x.im x.re))
(atan2 x.im x.re)
(/ (atan2 x.im x.re) y.re)))
(* (pow (hypot x.im x.re) y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -8.2e-30) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 4.3e-172) {
tmp = (y_46_re * y_46_re) * fma(log(hypot(x_46_im, x_46_re)), atan2(x_46_im, x_46_re), (atan2(x_46_im, x_46_re) / y_46_re));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -8.2e-30) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 4.3e-172) tmp = Float64(Float64(y_46_re * y_46_re) * fma(log(hypot(x_46_im, x_46_re)), atan(x_46_im, x_46_re), Float64(atan(x_46_im, x_46_re) / y_46_re))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-30], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-172], N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-30}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-172}:\\
\;\;\;\;\left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -8.2000000000000007e-30Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.7
Applied rewrites75.7%
Taylor expanded in x.im around 0
Applied rewrites76.7%
if -8.2000000000000007e-30 < y.re < 4.2999999999999997e-172Initial program 41.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6414.7
Applied rewrites14.7%
Taylor expanded in y.re around 0
Applied rewrites14.7%
Taylor expanded in y.re around inf
Applied rewrites30.0%
if 4.2999999999999997e-172 < y.re Initial program 45.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.9
Applied rewrites50.9%
Final simplification51.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.6e-148) (not (<= y.re 4.3e-172))) (* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re))) (* (* y.re y.re) (* (log (hypot x.im x.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 tmp;
if ((y_46_re <= -3.6e-148) || !(y_46_re <= 4.3e-172)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = (y_46_re * y_46_re) * (log(hypot(x_46_im, x_46_re)) * atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.6e-148) || !(y_46_re <= 4.3e-172)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = (y_46_re * y_46_re) * (Math.log(Math.hypot(x_46_im, x_46_re)) * Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.6e-148) or not (y_46_re <= 4.3e-172): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = (y_46_re * y_46_re) * (math.log(math.hypot(x_46_im, x_46_re)) * math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.6e-148) || !(y_46_re <= 4.3e-172)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(Float64(y_46_re * y_46_re) * Float64(log(hypot(x_46_im, x_46_re)) * atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.6e-148) || ~((y_46_re <= 4.3e-172))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = (y_46_re * y_46_re) * (log(hypot(x_46_im, x_46_re)) * atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.6e-148], N[Not[LessEqual[y$46$re, 4.3e-172]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-148} \lor \neg \left(y.re \leq 4.3 \cdot 10^{-172}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot y.re\right) \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -3.5999999999999998e-148 or 4.2999999999999997e-172 < y.re Initial program 41.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.5
Applied rewrites57.5%
if -3.5999999999999998e-148 < y.re < 4.2999999999999997e-172Initial program 47.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f649.0
Applied rewrites9.0%
Taylor expanded in y.re around 0
Applied rewrites9.0%
Taylor expanded in y.re around inf
Applied rewrites30.5%
Final simplification51.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (log (hypot x.im x.re)))
(t_2 (* (* (fma t_1 y.re 1.0) (atan2 x.im x.re)) y.re)))
(if (<= y.re -8.2e-30)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(if (<= y.re -1.25e-145)
t_2
(if (<= y.re 4.3e-172)
(* y.re (* y.re (* t_1 (atan2 x.im x.re))))
(if (<= y.re 25000.0)
t_2
(* (pow (fma 0.5 (/ (* x.re x.re) x.im) x.im) y.re) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = (fma(t_1, y_46_re, 1.0) * atan2(x_46_im, x_46_re)) * y_46_re;
double tmp;
if (y_46_re <= -8.2e-30) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * t_0;
} else if (y_46_re <= -1.25e-145) {
tmp = t_2;
} else if (y_46_re <= 4.3e-172) {
tmp = y_46_re * (y_46_re * (t_1 * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 25000.0) {
tmp = t_2;
} else {
tmp = pow(fma(0.5, ((x_46_re * x_46_re) / x_46_im), x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(Float64(fma(t_1, y_46_re, 1.0) * atan(x_46_im, x_46_re)) * y_46_re) tmp = 0.0 if (y_46_re <= -8.2e-30) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= -1.25e-145) tmp = t_2; elseif (y_46_re <= 4.3e-172) tmp = Float64(y_46_re * Float64(y_46_re * Float64(t_1 * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 25000.0) tmp = t_2; else tmp = Float64((fma(0.5, Float64(Float64(x_46_re * x_46_re) / x_46_im), x_46_im) ^ y_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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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[(N[(N[(t$95$1 * y$46$re + 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-30], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -1.25e-145], t$95$2, If[LessEqual[y$46$re, 4.3e-172], N[(y$46$re * N[(y$46$re * N[(t$95$1 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 25000.0], t$95$2, N[(N[Power[N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \left(\mathsf{fma}\left(t\_1, y.re, 1\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-30}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -1.25 \cdot 10^{-145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-172}:\\
\;\;\;\;y.re \cdot \left(y.re \cdot \left(t\_1 \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 25000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -8.2000000000000007e-30Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.7
Applied rewrites75.7%
Taylor expanded in x.im around 0
Applied rewrites76.7%
if -8.2000000000000007e-30 < y.re < -1.2499999999999999e-145 or 4.2999999999999997e-172 < y.re < 25000Initial program 32.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6434.0
Applied rewrites34.0%
Taylor expanded in y.re around 0
Applied rewrites32.1%
Applied rewrites32.1%
if -1.2499999999999999e-145 < y.re < 4.2999999999999997e-172Initial program 47.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f648.9
Applied rewrites8.9%
Taylor expanded in y.re around 0
Applied rewrites8.9%
Taylor expanded in y.re around inf
Applied rewrites30.0%
if 25000 < y.re Initial program 52.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.6
Applied rewrites61.6%
Taylor expanded in x.re around 0
Applied rewrites59.8%
Final simplification50.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re)
(sin (* (atan2 x.im x.re) y.re))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* (* (fma t_1 y.re 1.0) (atan2 x.im x.re)) y.re)))
(if (<= y.re -8.2e-30)
t_0
(if (<= y.re -1.25e-145)
t_2
(if (<= y.re 4.3e-172)
(* y.re (* y.re (* t_1 (atan2 x.im x.re))))
(if (<= y.re 13000.0) t_2 t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = (fma(t_1, y_46_re, 1.0) * atan2(x_46_im, x_46_re)) * y_46_re;
double tmp;
if (y_46_re <= -8.2e-30) {
tmp = t_0;
} else if (y_46_re <= -1.25e-145) {
tmp = t_2;
} else if (y_46_re <= 4.3e-172) {
tmp = y_46_re * (y_46_re * (t_1 * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 13000.0) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(Float64(fma(t_1, y_46_re, 1.0) * atan(x_46_im, x_46_re)) * y_46_re) tmp = 0.0 if (y_46_re <= -8.2e-30) tmp = t_0; elseif (y_46_re <= -1.25e-145) tmp = t_2; elseif (y_46_re <= 4.3e-172) tmp = Float64(y_46_re * Float64(y_46_re * Float64(t_1 * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 13000.0) tmp = t_2; else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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[(N[(N[(t$95$1 * y$46$re + 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-30], t$95$0, If[LessEqual[y$46$re, -1.25e-145], t$95$2, If[LessEqual[y$46$re, 4.3e-172], N[(y$46$re * N[(y$46$re * N[(t$95$1 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 13000.0], t$95$2, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \left(\mathsf{fma}\left(t\_1, y.re, 1\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.25 \cdot 10^{-145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-172}:\\
\;\;\;\;y.re \cdot \left(y.re \cdot \left(t\_1 \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 13000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -8.2000000000000007e-30 or 13000 < y.re Initial program 45.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.7
Applied rewrites69.7%
Taylor expanded in x.im around 0
Applied rewrites67.3%
if -8.2000000000000007e-30 < y.re < -1.2499999999999999e-145 or 4.2999999999999997e-172 < y.re < 13000Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6432.9
Applied rewrites32.9%
Taylor expanded in y.re around 0
Applied rewrites32.5%
Applied rewrites32.5%
if -1.2499999999999999e-145 < y.re < 4.2999999999999997e-172Initial program 47.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f648.9
Applied rewrites8.9%
Taylor expanded in y.re around 0
Applied rewrites8.9%
Taylor expanded in y.re around inf
Applied rewrites30.0%
Final simplification49.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= x.im -1.8e+17)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 8.2e-17)
(* (pow (- x.re) y.re) t_0)
(* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -1.8e+17) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 8.2e-17) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_46_re) * 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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= (-1.8d+17)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 8.2d-17) then
tmp = (-x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_46re) * 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -1.8e+17) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 8.2e-17) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= -1.8e+17: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 8.2e-17: tmp = math.pow(-x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= -1.8e+17) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 8.2e-17) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= -1.8e+17) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 8.2e-17) tmp = (-x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.8e+17], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 8.2e-17], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq -1.8 \cdot 10^{+17}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 8.2 \cdot 10^{-17}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -1.8e17Initial program 25.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.1
Applied rewrites41.1%
Taylor expanded in x.im around -inf
Applied rewrites41.1%
if -1.8e17 < x.im < 8.2000000000000001e-17Initial program 56.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.5
Applied rewrites46.5%
Taylor expanded in x.re around -inf
Applied rewrites42.8%
if 8.2000000000000001e-17 < x.im Initial program 35.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.6
Applied rewrites48.6%
Taylor expanded in x.re around 0
Applied rewrites48.6%
Final simplification44.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= x.im -5.8e-14)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 4.6e-18) (* (pow x.re y.re) t_0) (* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -5.8e-14) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 4.6e-18) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_46_re) * 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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= (-5.8d-14)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 4.6d-18) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_46re) * 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -5.8e-14) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 4.6e-18) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= -5.8e-14: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 4.6e-18: tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= -5.8e-14) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 4.6e-18) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= -5.8e-14) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 4.6e-18) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -5.8e-14], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 4.6e-18], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq -5.8 \cdot 10^{-14}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 4.6 \cdot 10^{-18}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -5.8000000000000005e-14Initial program 26.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6439.7
Applied rewrites39.7%
Taylor expanded in x.im around -inf
Applied rewrites39.7%
if -5.8000000000000005e-14 < x.im < 4.6000000000000002e-18Initial program 57.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.6
Applied rewrites47.6%
Taylor expanded in x.im around 0
Applied rewrites42.3%
if 4.6000000000000002e-18 < x.im Initial program 35.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.6
Applied rewrites48.6%
Taylor expanded in x.re around 0
Applied rewrites48.6%
Final simplification43.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))) (if (<= x.im 4.6e-18) (* (pow x.re y.re) t_0) (* (pow x.im y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= 4.6e-18) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_46_re) * 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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= 4.6d-18) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_46re) * 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= 4.6e-18) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= 4.6e-18: tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= 4.6e-18) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= 4.6e-18) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 4.6e-18], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq 4.6 \cdot 10^{-18}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < 4.6000000000000002e-18Initial program 46.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.7
Applied rewrites44.7%
Taylor expanded in x.im around 0
Applied rewrites36.1%
if 4.6000000000000002e-18 < x.im Initial program 35.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.6
Applied rewrites48.6%
Taylor expanded in x.re around 0
Applied rewrites48.6%
Final simplification40.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re 3e-37)
(* (pow x.im y.re) (sin (* (atan2 x.im x.re) y.re)))
(*
(*
(fma (log (fma (/ (* x.im x.im) x.re) 0.5 x.re)) y.re 1.0)
(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 tmp;
if (x_46_re <= 3e-37) {
tmp = pow(x_46_im, y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = (fma(log(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re)), y_46_re, 1.0) * atan2(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) tmp = 0.0 if (x_46_re <= 3e-37) tmp = Float64((x_46_im ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(Float64(fma(log(fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re)), y_46_re, 1.0) * atan(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_] := If[LessEqual[x$46$re, 3e-37], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 3 \cdot 10^{-37}:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log \left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right), y.re, 1\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\\
\end{array}
\end{array}
if x.re < 3e-37Initial program 50.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.7
Applied rewrites50.7%
Taylor expanded in x.re around 0
Applied rewrites37.6%
if 3e-37 < x.re Initial program 27.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6435.0
Applied rewrites35.0%
Taylor expanded in y.re around 0
Applied rewrites17.7%
Taylor expanded in x.im around 0
Applied rewrites26.2%
Applied rewrites26.2%
Final simplification34.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (or (<= y.im -1.15e-97) (not (<= y.im 5e-30)))
(* y.re (* (* (/ (* x.im x.im) x.re) 0.5) (/ t_0 x.re)))
(* 1.0 (sin 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_re;
double tmp;
if ((y_46_im <= -1.15e-97) || !(y_46_im <= 5e-30)) {
tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * (t_0 / x_46_re));
} else {
tmp = 1.0 * sin(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) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46re
if ((y_46im <= (-1.15d-97)) .or. (.not. (y_46im <= 5d-30))) then
tmp = y_46re * ((((x_46im * x_46im) / x_46re) * 0.5d0) * (t_0 / x_46re))
else
tmp = 1.0d0 * sin(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_re;
double tmp;
if ((y_46_im <= -1.15e-97) || !(y_46_im <= 5e-30)) {
tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * (t_0 / x_46_re));
} else {
tmp = 1.0 * Math.sin(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_re tmp = 0 if (y_46_im <= -1.15e-97) or not (y_46_im <= 5e-30): tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * (t_0 / x_46_re)) else: tmp = 1.0 * math.sin(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_re) tmp = 0.0 if ((y_46_im <= -1.15e-97) || !(y_46_im <= 5e-30)) tmp = Float64(y_46_re * Float64(Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5) * Float64(t_0 / x_46_re))); else tmp = Float64(1.0 * sin(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_re; tmp = 0.0; if ((y_46_im <= -1.15e-97) || ~((y_46_im <= 5e-30))) tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * (t_0 / x_46_re)); else tmp = 1.0 * sin(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$re), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1.15e-97], N[Not[LessEqual[y$46$im, 5e-30]], $MachinePrecision]], N[(y$46$re * N[(N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision] * N[(t$95$0 / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{-97} \lor \neg \left(y.im \leq 5 \cdot 10^{-30}\right):\\
\;\;\;\;y.re \cdot \left(\left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5\right) \cdot \frac{t\_0}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin t\_0\\
\end{array}
\end{array}
if y.im < -1.14999999999999997e-97 or 4.99999999999999972e-30 < y.im Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
Applied rewrites11.7%
Taylor expanded in x.re around -inf
Applied rewrites6.6%
Taylor expanded in x.re around 0
Applied rewrites24.7%
if -1.14999999999999997e-97 < y.im < 4.99999999999999972e-30Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.5
Applied rewrites64.5%
Taylor expanded in y.re around 0
Applied rewrites24.6%
Final simplification24.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -1.15e-97) (not (<= y.im 5e-30)))
(*
y.re
(* (* (/ (* x.im x.im) x.re) 0.5) (/ (* (atan2 x.im x.re) y.re) x.re)))
(* 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 tmp;
if ((y_46_im <= -1.15e-97) || !(y_46_im <= 5e-30)) {
tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * ((atan2(x_46_im, x_46_re) * y_46_re) / x_46_re));
} else {
tmp = y_46_re * atan2(x_46_im, x_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.15d-97)) .or. (.not. (y_46im <= 5d-30))) then
tmp = y_46re * ((((x_46im * x_46im) / x_46re) * 0.5d0) * ((atan2(x_46im, x_46re) * y_46re) / x_46re))
else
tmp = y_46re * atan2(x_46im, x_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.15e-97) || !(y_46_im <= 5e-30)) {
tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * ((Math.atan2(x_46_im, x_46_re) * y_46_re) / x_46_re));
} else {
tmp = y_46_re * Math.atan2(x_46_im, x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.15e-97) or not (y_46_im <= 5e-30): tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * ((math.atan2(x_46_im, x_46_re) * y_46_re) / x_46_re)) else: tmp = y_46_re * math.atan2(x_46_im, x_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.15e-97) || !(y_46_im <= 5e-30)) tmp = Float64(y_46_re * Float64(Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5) * Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) / x_46_re))); else tmp = Float64(y_46_re * atan(x_46_im, x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.15e-97) || ~((y_46_im <= 5e-30))) tmp = y_46_re * ((((x_46_im * x_46_im) / x_46_re) * 0.5) * ((atan2(x_46_im, x_46_re) * y_46_re) / x_46_re)); else tmp = y_46_re * atan2(x_46_im, x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.15e-97], N[Not[LessEqual[y$46$im, 5e-30]], $MachinePrecision]], N[(y$46$re * N[(N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{-97} \lor \neg \left(y.im \leq 5 \cdot 10^{-30}\right):\\
\;\;\;\;y.re \cdot \left(\left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5\right) \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\end{array}
\end{array}
if y.im < -1.14999999999999997e-97 or 4.99999999999999972e-30 < y.im Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
Applied rewrites11.7%
Taylor expanded in x.re around -inf
Applied rewrites6.6%
Taylor expanded in x.re around 0
Applied rewrites24.7%
if -1.14999999999999997e-97 < y.im < 4.99999999999999972e-30Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.5
Applied rewrites64.5%
Taylor expanded in y.re around 0
Applied rewrites30.3%
Taylor expanded in y.re around 0
Applied rewrites24.4%
Final simplification24.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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 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 = 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 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 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 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 = 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 43.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.9
Applied rewrites45.9%
Taylor expanded in y.re around 0
Applied rewrites18.4%
Taylor expanded in y.re around 0
Applied rewrites13.4%
herbie shell --seed 2024313
(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)))))