
(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)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (* t_0 y.im))
(t_3 (sin t_2)))
(if (<= y.re -3.8e+38)
(* t_1 (fma (* y.re (cos t_2)) (atan2 x.im x.re) t_3))
(if (<= y.re 27.0)
(*
(/ (pow (hypot x.im x.re) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(sin (fma t_0 y.im (* (atan2 x.im x.re) y.re))))
(* t_1 (fma (* y.re 1.0) (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 = log(hypot(x_46_im, x_46_re));
double t_1 = 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_2 = t_0 * y_46_im;
double t_3 = sin(t_2);
double tmp;
if (y_46_re <= -3.8e+38) {
tmp = t_1 * fma((y_46_re * cos(t_2)), atan2(x_46_im, x_46_re), t_3);
} else if (y_46_re <= 27.0) {
tmp = (pow(hypot(x_46_im, x_46_re), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin(fma(t_0, y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = t_1 * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), t_3);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = 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_2 = Float64(t_0 * y_46_im) t_3 = sin(t_2) tmp = 0.0 if (y_46_re <= -3.8e+38) tmp = Float64(t_1 * fma(Float64(y_46_re * cos(t_2)), atan(x_46_im, x_46_re), t_3)); elseif (y_46_re <= 27.0) tmp = Float64(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(fma(t_0, y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = Float64(t_1 * fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), t_3)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[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$2 = N[(t$95$0 * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, If[LessEqual[y$46$re, -3.8e+38], N[(t$95$1 * N[(N[(y$46$re * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 27.0], N[(N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := 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_2 := t\_0 \cdot y.im\\
t_3 := \sin t\_2\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{+38}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(y.re \cdot \cos t\_2, \tan^{-1}_* \frac{x.im}{x.re}, t\_3\right)\\
\mathbf{elif}\;y.re \leq 27:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, t\_3\right)\\
\end{array}
\end{array}
if y.re < -3.7999999999999998e38Initial program 37.9%
Taylor expanded in y.re around 0
Applied rewrites80.4%
if -3.7999999999999998e38 < y.re < 27Initial program 40.4%
Taylor expanded in y.re around 0
Applied rewrites49.7%
Taylor expanded in y.re around inf
Applied rewrites78.4%
if 27 < y.re Initial program 39.7%
Taylor expanded in y.re around 0
Applied rewrites70.7%
Taylor expanded in y.im around 0
Applied rewrites75.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -3.8e+38) (not (<= y.re 27.0)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(fma (* y.re 1.0) (atan2 x.im x.re) (sin (* t_0 y.im))))
(*
(/ (pow (hypot x.im x.re) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(sin (fma 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(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -3.8e+38) || !(y_46_re <= 27.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))) * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), sin((t_0 * y_46_im)));
} else {
tmp = (pow(hypot(x_46_im, x_46_re), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin(fma(t_0, 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) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -3.8e+38) || !(y_46_re <= 27.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))) * fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), sin(Float64(t_0 * y_46_im)))); else tmp = Float64(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(fma(t_0, 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_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -3.8e+38], N[Not[LessEqual[y$46$re, 27.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[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + 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(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{+38} \lor \neg \left(y.re \leq 27\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 \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(t\_0 \cdot y.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\end{array}
\end{array}
if y.re < -3.7999999999999998e38 or 27 < y.re Initial program 38.7%
Taylor expanded in y.re around 0
Applied rewrites75.9%
Taylor expanded in y.im around 0
Applied rewrites76.7%
if -3.7999999999999998e38 < y.re < 27Initial program 40.4%
Taylor expanded in y.re around 0
Applied rewrites49.7%
Taylor expanded in y.re around inf
Applied rewrites78.4%
Final simplification77.6%
(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)))
(t_2 (fma (* y.re 1.0) (atan2 x.im x.re) (sin (* t_1 y.im)))))
(if (<= y.im -1.6e+27)
(* t_0 t_2)
(if (<= y.im 7000.0)
(* (pow (hypot x.im x.re) y.re) t_2)
(* t_0 (fma (* 1.0 t_1) y.im (sin (* (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 = 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 t_2 = fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), sin((t_1 * y_46_im)));
double tmp;
if (y_46_im <= -1.6e+27) {
tmp = t_0 * t_2;
} else if (y_46_im <= 7000.0) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_2;
} else {
tmp = t_0 * fma((1.0 * t_1), y_46_im, sin((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) 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)) t_2 = fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), sin(Float64(t_1 * y_46_im))) tmp = 0.0 if (y_46_im <= -1.6e+27) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 7000.0) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_2); else tmp = Float64(t_0 * fma(Float64(1.0 * t_1), y_46_im, sin(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_] := 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]}, Block[{t$95$2 = N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e+27], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 7000.0], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision], N[(t$95$0 * N[(N[(1.0 * t$95$1), $MachinePrecision] * y$46$im + N[Sin[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 := 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)\\
t_2 := \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(t\_1 \cdot y.im\right)\right)\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+27}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 7000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(1 \cdot t\_1, y.im, \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\end{array}
\end{array}
if y.im < -1.60000000000000008e27Initial program 37.4%
Taylor expanded in y.re around 0
Applied rewrites63.5%
Taylor expanded in y.im around 0
Applied rewrites59.8%
if -1.60000000000000008e27 < y.im < 7e3Initial program 42.7%
Taylor expanded in y.re around 0
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites67.9%
Taylor expanded in y.im around 0
Applied rewrites90.0%
if 7e3 < y.im Initial program 36.5%
Taylor expanded in y.im around 0
Applied rewrites56.2%
Taylor expanded in y.re around 0
Applied rewrites59.8%
(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)) y.im))
(t_2 (fma (* y.re 1.0) (atan2 x.im x.re) (sin t_1))))
(if (<= y.im -1.6e+27)
(* t_0 t_2)
(if (<= y.im 1050.0)
(* (pow (hypot x.im x.re) y.re) t_2)
(* t_0 (fma (* y.re 1.0) (atan2 x.im x.re) t_1))))))
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)) * y_46_im;
double t_2 = fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), sin(t_1));
double tmp;
if (y_46_im <= -1.6e+27) {
tmp = t_0 * t_2;
} else if (y_46_im <= 1050.0) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_2;
} else {
tmp = t_0 * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), t_1);
}
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 = Float64(log(hypot(x_46_im, x_46_re)) * y_46_im) t_2 = fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), sin(t_1)) tmp = 0.0 if (y_46_im <= -1.6e+27) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 1050.0) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_2); else tmp = Float64(t_0 * fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), t_1)); 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[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e+27], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 1050.0], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision], N[(t$95$0 * N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$1), $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) \cdot y.im\\
t_2 := \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, \sin t\_1\right)\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+27}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 1050:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, t\_1\right)\\
\end{array}
\end{array}
if y.im < -1.60000000000000008e27Initial program 37.4%
Taylor expanded in y.re around 0
Applied rewrites63.5%
Taylor expanded in y.im around 0
Applied rewrites59.8%
if -1.60000000000000008e27 < y.im < 1050Initial program 42.7%
Taylor expanded in y.re around 0
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites67.9%
Taylor expanded in y.im around 0
Applied rewrites90.0%
if 1050 < y.im Initial program 36.5%
Taylor expanded in y.re around 0
Applied rewrites56.1%
Taylor expanded in y.im around 0
Applied rewrites57.3%
Taylor expanded in y.im around 0
Applied rewrites58.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (hypot x.im x.re)) y.im))
(t_1 (sin t_0))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.im -2e+27)
(* t_2 t_1)
(if (<= y.im 1050.0)
(*
(pow (hypot x.im x.re) y.re)
(fma (* y.re 1.0) (atan2 x.im x.re) t_1))
(* t_2 (fma (* y.re 1.0) (atan2 x.im 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 = log(hypot(x_46_im, x_46_re)) * y_46_im;
double t_1 = sin(t_0);
double t_2 = 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 tmp;
if (y_46_im <= -2e+27) {
tmp = t_2 * t_1;
} else if (y_46_im <= 1050.0) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), t_1);
} else {
tmp = t_2 * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(log(hypot(x_46_im, x_46_re)) * y_46_im) t_1 = sin(t_0) t_2 = 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))) tmp = 0.0 if (y_46_im <= -2e+27) tmp = Float64(t_2 * t_1); elseif (y_46_im <= 1050.0) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), t_1)); else tmp = Float64(t_2 * fma(Float64(y_46_re * 1.0), atan(x_46_im, 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[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$im, -2e+27], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 1050.0], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\\
t_1 := \sin t\_0\\
t_2 := 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}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+27}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 1050:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\\
\end{array}
\end{array}
if y.im < -2e27Initial program 37.4%
Taylor expanded in y.re around 0
Applied rewrites58.0%
if -2e27 < y.im < 1050Initial program 42.7%
Taylor expanded in y.re around 0
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites67.9%
Taylor expanded in y.im around 0
Applied rewrites90.0%
if 1050 < y.im Initial program 36.5%
Taylor expanded in y.re around 0
Applied rewrites56.1%
Taylor expanded in y.im around 0
Applied rewrites57.3%
Taylor expanded in y.im around 0
Applied rewrites58.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im))))
(if (or (<= y.im -2e+27) (not (<= y.im 1.9e-43)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0)
(*
(pow (hypot x.im x.re) y.re)
(fma (* y.re 1.0) (atan2 x.im 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 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if ((y_46_im <= -2e+27) || !(y_46_im <= 1.9e-43)) {
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))) * t_0;
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if ((y_46_im <= -2e+27) || !(y_46_im <= 1.9e-43)) 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))) * t_0); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(Float64(y_46_re * 1.0), atan(x_46_im, 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[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2e+27], N[Not[LessEqual[y$46$im, 1.9e-43]], $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] * t$95$0), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+27} \lor \neg \left(y.im \leq 1.9 \cdot 10^{-43}\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 t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\\
\end{array}
\end{array}
if y.im < -2e27 or 1.89999999999999985e-43 < y.im Initial program 38.9%
Taylor expanded in y.re around 0
Applied rewrites58.5%
if -2e27 < y.im < 1.89999999999999985e-43Initial program 40.4%
Taylor expanded in y.re around 0
Applied rewrites63.8%
Taylor expanded in y.im around 0
Applied rewrites65.6%
Taylor expanded in y.im around 0
Applied rewrites89.3%
Final simplification71.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin t_0)))
(t_2 (log (hypot x.im x.re))))
(if (<= y.re -2.2e-24)
t_1
(if (<= y.re -1.7e-87)
(* 1.0 (sin (fma t_2 y.im t_0)))
(if (<= y.re 1.75e-69)
(/ (sin (* t_2 y.im)) (pow (exp y.im) (atan2 x.im x.re)))
t_1)))))
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 t_1 = 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);
double t_2 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -2.2e-24) {
tmp = t_1;
} else if (y_46_re <= -1.7e-87) {
tmp = 1.0 * sin(fma(t_2, y_46_im, t_0));
} else if (y_46_re <= 1.75e-69) {
tmp = sin((t_2 * y_46_im)) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_1;
}
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) t_1 = 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(t_0)) t_2 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.2e-24) tmp = t_1; elseif (y_46_re <= -1.7e-87) tmp = Float64(1.0 * sin(fma(t_2, y_46_im, t_0))); elseif (y_46_re <= 1.75e-69) tmp = Float64(sin(Float64(t_2 * y_46_im)) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = t_1; 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$re), $MachinePrecision]}, Block[{t$95$1 = 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[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e-24], t$95$1, If[LessEqual[y$46$re, -1.7e-87], N[(1.0 * N[Sin[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.75e-69], N[(N[Sin[N[(t$95$2 * y$46$im), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := 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 t\_0\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.7 \cdot 10^{-87}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(t\_2, y.im, t\_0\right)\right)\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{-69}:\\
\;\;\;\;\frac{\sin \left(t\_2 \cdot y.im\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.20000000000000002e-24 or 1.7500000000000001e-69 < y.re Initial program 41.6%
Taylor expanded in y.re around inf
Applied rewrites69.7%
if -2.20000000000000002e-24 < y.re < -1.6999999999999999e-87Initial program 41.0%
Taylor expanded in y.im around 0
Applied rewrites31.3%
Taylor expanded in y.re around inf
Applied rewrites54.8%
Taylor expanded in y.re around 0
Applied rewrites54.8%
Taylor expanded in y.re around inf
Applied rewrites70.1%
if -1.6999999999999999e-87 < y.re < 1.7500000000000001e-69Initial program 35.8%
Taylor expanded in y.re around 0
Applied rewrites44.9%
Taylor expanded in y.re around inf
Applied rewrites76.2%
Taylor expanded in y.re around 0
Applied rewrites69.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im)))
(t_1 (* (pow (exp (- y.im)) (atan2 x.im x.re)) t_0)))
(if (<= y.im -7e+19)
t_1
(if (<= y.im 3500000.0)
(*
(pow (hypot x.im x.re) y.re)
(fma (* y.re 1.0) (atan2 x.im x.re) t_0))
(if (<= y.im 7.2e+238)
(*
(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)))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double t_1 = pow(exp(-y_46_im), atan2(x_46_im, x_46_re)) * t_0;
double tmp;
if (y_46_im <= -7e+19) {
tmp = t_1;
} else if (y_46_im <= 3500000.0) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma((y_46_re * 1.0), atan2(x_46_im, x_46_re), t_0);
} else if (y_46_im <= 7.2e+238) {
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 = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) t_1 = Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * t_0) tmp = 0.0 if (y_46_im <= -7e+19) tmp = t_1; elseif (y_46_im <= 3500000.0) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(Float64(y_46_re * 1.0), atan(x_46_im, x_46_re), t_0)); elseif (y_46_im <= 7.2e+238) 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 = t_1; 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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$im, -7e+19], t$95$1, If[LessEqual[y$46$im, 3500000.0], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[(y$46$re * 1.0), $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.2e+238], 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], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
t_1 := {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{if}\;y.im \leq -7 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 3500000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.re \cdot 1, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\\
\mathbf{elif}\;y.im \leq 7.2 \cdot 10^{+238}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -7e19 or 7.19999999999999942e238 < y.im Initial program 33.1%
Taylor expanded in y.re around 0
Applied rewrites56.8%
Taylor expanded in y.re around 0
Applied rewrites54.1%
if -7e19 < y.im < 3.5e6Initial program 43.1%
Taylor expanded in y.re around 0
Applied rewrites66.8%
Taylor expanded in y.im around 0
Applied rewrites68.5%
Taylor expanded in y.im around 0
Applied rewrites90.8%
if 3.5e6 < y.im < 7.19999999999999942e238Initial program 40.4%
Taylor expanded in y.re around inf
Applied rewrites62.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin t_0)))
(t_2 (log (hypot x.im x.re))))
(if (<= y.re -2.2e-24)
t_1
(if (<= y.re -1.7e-87)
(* 1.0 (sin (fma t_2 y.im t_0)))
(if (<= y.re 1.75e-69)
(* (pow (exp (- y.im)) (atan2 x.im x.re)) (sin (* t_2 y.im)))
t_1)))))
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 t_1 = 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);
double t_2 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -2.2e-24) {
tmp = t_1;
} else if (y_46_re <= -1.7e-87) {
tmp = 1.0 * sin(fma(t_2, y_46_im, t_0));
} else if (y_46_re <= 1.75e-69) {
tmp = pow(exp(-y_46_im), atan2(x_46_im, x_46_re)) * sin((t_2 * y_46_im));
} else {
tmp = t_1;
}
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) t_1 = 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(t_0)) t_2 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.2e-24) tmp = t_1; elseif (y_46_re <= -1.7e-87) tmp = Float64(1.0 * sin(fma(t_2, y_46_im, t_0))); elseif (y_46_re <= 1.75e-69) tmp = Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * sin(Float64(t_2 * y_46_im))); else tmp = t_1; 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$re), $MachinePrecision]}, Block[{t$95$1 = 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[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e-24], t$95$1, If[LessEqual[y$46$re, -1.7e-87], N[(1.0 * N[Sin[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.75e-69], N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$2 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := 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 t\_0\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.7 \cdot 10^{-87}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(t\_2, y.im, t\_0\right)\right)\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{-69}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(t\_2 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.20000000000000002e-24 or 1.7500000000000001e-69 < y.re Initial program 41.6%
Taylor expanded in y.re around inf
Applied rewrites69.7%
if -2.20000000000000002e-24 < y.re < -1.6999999999999999e-87Initial program 41.0%
Taylor expanded in y.im around 0
Applied rewrites31.3%
Taylor expanded in y.re around inf
Applied rewrites54.8%
Taylor expanded in y.re around 0
Applied rewrites54.8%
Taylor expanded in y.re around inf
Applied rewrites70.1%
if -1.6999999999999999e-87 < y.re < 1.7500000000000001e-69Initial program 35.8%
Taylor expanded in y.re around 0
Applied rewrites44.9%
Taylor expanded in y.re around 0
Applied rewrites69.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (* t_2 (sin (* (log (hypot x.im x.re)) y.im)))))
(if (<= y.im -9200000000.0)
t_1
(if (<= y.im -3.8e-193)
t_3
(if (<= y.im 1.75e-136) (* t_2 t_0) (if (<= y.im 410000.0) t_3 t_1))))))
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 = 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))) * t_0;
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_im <= -9200000000.0) {
tmp = t_1;
} else if (y_46_im <= -3.8e-193) {
tmp = t_3;
} else if (y_46_im <= 1.75e-136) {
tmp = t_2 * t_0;
} else if (y_46_im <= 410000.0) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = 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))) * t_0;
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_im <= -9200000000.0) {
tmp = t_1;
} else if (y_46_im <= -3.8e-193) {
tmp = t_3;
} else if (y_46_im <= 1.75e-136) {
tmp = t_2 * t_0;
} else if (y_46_im <= 410000.0) {
tmp = t_3;
} else {
tmp = t_1;
}
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)) t_1 = 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))) * t_0 t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_3 = t_2 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if y_46_im <= -9200000000.0: tmp = t_1 elif y_46_im <= -3.8e-193: tmp = t_3 elif y_46_im <= 1.75e-136: tmp = t_2 * t_0 elif y_46_im <= 410000.0: tmp = t_3 else: tmp = t_1 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 = 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))) * t_0) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = Float64(t_2 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))) tmp = 0.0 if (y_46_im <= -9200000000.0) tmp = t_1; elseif (y_46_im <= -3.8e-193) tmp = t_3; elseif (y_46_im <= 1.75e-136) tmp = Float64(t_2 * t_0); elseif (y_46_im <= 410000.0) tmp = t_3; else tmp = t_1; 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)); t_1 = 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))) * t_0; t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; t_3 = t_2 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if (y_46_im <= -9200000000.0) tmp = t_1; elseif (y_46_im <= -3.8e-193) tmp = t_3; elseif (y_46_im <= 1.75e-136) tmp = t_2 * t_0; elseif (y_46_im <= 410000.0) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9200000000.0], t$95$1, If[LessEqual[y$46$im, -3.8e-193], t$95$3, If[LessEqual[y$46$im, 1.75e-136], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 410000.0], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := 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 t\_0\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := t\_2 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.im \leq -9200000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-193}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq 1.75 \cdot 10^{-136}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{elif}\;y.im \leq 410000:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -9.2e9 or 4.1e5 < y.im Initial program 36.0%
Taylor expanded in y.re around inf
Applied rewrites53.3%
if -9.2e9 < y.im < -3.80000000000000004e-193 or 1.75000000000000015e-136 < y.im < 4.1e5Initial program 38.3%
Taylor expanded in y.im around 0
Applied rewrites38.3%
Taylor expanded in y.re around 0
Applied rewrites87.0%
if -3.80000000000000004e-193 < y.im < 1.75000000000000015e-136Initial program 49.8%
Taylor expanded in y.im around 0
Applied rewrites49.8%
Taylor expanded in y.re around inf
Applied rewrites76.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1
(*
(exp
(- (* (log (sqrt (* x.re x.re))) y.re) (* (atan2 x.im x.re) y.im)))
t_0))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (* t_2 (sin (* (log (hypot x.im x.re)) y.im)))))
(if (<= y.im -19500000000.0)
t_1
(if (<= y.im -3.8e-193)
t_3
(if (<= y.im 1.75e-136) (* t_2 t_0) (if (<= y.im 1.65e+94) t_3 t_1))))))
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 = exp(((log(sqrt((x_46_re * x_46_re))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_im <= -19500000000.0) {
tmp = t_1;
} else if (y_46_im <= -3.8e-193) {
tmp = t_3;
} else if (y_46_im <= 1.75e-136) {
tmp = t_2 * t_0;
} else if (y_46_im <= 1.65e+94) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.exp(((Math.log(Math.sqrt((x_46_re * x_46_re))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_2 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_im <= -19500000000.0) {
tmp = t_1;
} else if (y_46_im <= -3.8e-193) {
tmp = t_3;
} else if (y_46_im <= 1.75e-136) {
tmp = t_2 * t_0;
} else if (y_46_im <= 1.65e+94) {
tmp = t_3;
} else {
tmp = t_1;
}
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)) t_1 = math.exp(((math.log(math.sqrt((x_46_re * x_46_re))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0 t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_3 = t_2 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if y_46_im <= -19500000000.0: tmp = t_1 elif y_46_im <= -3.8e-193: tmp = t_3 elif y_46_im <= 1.75e-136: tmp = t_2 * t_0 elif y_46_im <= 1.65e+94: tmp = t_3 else: tmp = t_1 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 = Float64(exp(Float64(Float64(log(sqrt(Float64(x_46_re * x_46_re))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = Float64(t_2 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))) tmp = 0.0 if (y_46_im <= -19500000000.0) tmp = t_1; elseif (y_46_im <= -3.8e-193) tmp = t_3; elseif (y_46_im <= 1.75e-136) tmp = Float64(t_2 * t_0); elseif (y_46_im <= 1.65e+94) tmp = t_3; else tmp = t_1; 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)); t_1 = exp(((log(sqrt((x_46_re * x_46_re))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0; t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; t_3 = t_2 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if (y_46_im <= -19500000000.0) tmp = t_1; elseif (y_46_im <= -3.8e-193) tmp = t_3; elseif (y_46_im <= 1.75e-136) tmp = t_2 * t_0; elseif (y_46_im <= 1.65e+94) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -19500000000.0], t$95$1, If[LessEqual[y$46$im, -3.8e-193], t$95$3, If[LessEqual[y$46$im, 1.75e-136], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 1.65e+94], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := t\_2 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.im \leq -19500000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-193}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq 1.75 \cdot 10^{-136}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{+94}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.95e10 or 1.65e94 < y.im Initial program 35.2%
Taylor expanded in y.re around inf
Applied rewrites53.4%
Taylor expanded in x.re around inf
Applied rewrites49.2%
if -1.95e10 < y.im < -3.80000000000000004e-193 or 1.75000000000000015e-136 < y.im < 1.65e94Initial program 38.8%
Taylor expanded in y.im around 0
Applied rewrites36.5%
Taylor expanded in y.re around 0
Applied rewrites73.0%
if -3.80000000000000004e-193 < y.im < 1.75000000000000015e-136Initial program 49.8%
Taylor expanded in y.im around 0
Applied rewrites49.8%
Taylor expanded in y.re around inf
Applied rewrites76.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= x.im -2.9e-19)
(* t_1 (sin (+ (* (log (- x.im)) y.im) t_0)))
(if (<= x.im 9e-183)
(* t_1 (sin (* (log (hypot x.im x.re)) y.im)))
(*
(sin t_0)
(exp (- (* (log x.im) y.re) (* (atan2 x.im x.re) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -2.9e-19) {
tmp = t_1 * sin(((log(-x_46_im) * y_46_im) + t_0));
} else if (x_46_im <= 9e-183) {
tmp = t_1 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = sin(t_0) * exp(((log(x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -2.9e-19) {
tmp = t_1 * Math.sin(((Math.log(-x_46_im) * y_46_im) + t_0));
} else if (x_46_im <= 9e-183) {
tmp = t_1 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.sin(t_0) * Math.exp(((Math.log(x_46_im) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if x_46_im <= -2.9e-19: tmp = t_1 * math.sin(((math.log(-x_46_im) * y_46_im) + t_0)) elif x_46_im <= 9e-183: tmp = t_1 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.sin(t_0) * math.exp(((math.log(x_46_im) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (x_46_im <= -2.9e-19) tmp = Float64(t_1 * sin(Float64(Float64(log(Float64(-x_46_im)) * y_46_im) + t_0))); elseif (x_46_im <= 9e-183) tmp = Float64(t_1 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(sin(t_0) * exp(Float64(Float64(log(x_46_im) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (x_46_im <= -2.9e-19) tmp = t_1 * sin(((log(-x_46_im) * y_46_im) + t_0)); elseif (x_46_im <= 9e-183) tmp = t_1 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = sin(t_0) * exp(((log(x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -2.9e-19], N[(t$95$1 * N[Sin[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 9e-183], N[(t$95$1 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[x$46$im], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -2.9 \cdot 10^{-19}:\\
\;\;\;\;t\_1 \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + t\_0\right)\\
\mathbf{elif}\;x.im \leq 9 \cdot 10^{-183}:\\
\;\;\;\;t\_1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < -2.9e-19Initial program 31.3%
Taylor expanded in y.im around 0
Applied rewrites25.6%
Taylor expanded in x.im around -inf
Applied rewrites63.0%
if -2.9e-19 < x.im < 8.99999999999999942e-183Initial program 34.2%
Taylor expanded in y.im around 0
Applied rewrites26.6%
Taylor expanded in y.re around 0
Applied rewrites49.9%
if 8.99999999999999942e-183 < x.im Initial program 49.9%
Taylor expanded in y.re around 0
Applied rewrites68.4%
Taylor expanded in x.im around inf
Applied rewrites73.6%
Taylor expanded in y.re around inf
Applied rewrites64.3%
Final simplification58.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= x.im -2.9e-19)
(* t_0 (sin (+ (* (log (- x.im)) y.im) (* (atan2 x.im x.re) y.re))))
(if (<= x.im 2.9e-218)
(* t_0 (sin (* (log (hypot x.im x.re)) y.im)))
(*
(sin (* (log x.im) y.im))
(exp (- (* (log x.im) y.re) (* (atan2 x.im x.re) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -2.9e-19) {
tmp = t_0 * sin(((log(-x_46_im) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else if (x_46_im <= 2.9e-218) {
tmp = t_0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = sin((log(x_46_im) * y_46_im)) * exp(((log(x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -2.9e-19) {
tmp = t_0 * Math.sin(((Math.log(-x_46_im) * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
} else if (x_46_im <= 2.9e-218) {
tmp = t_0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.sin((Math.log(x_46_im) * y_46_im)) * Math.exp(((Math.log(x_46_im) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if x_46_im <= -2.9e-19: tmp = t_0 * math.sin(((math.log(-x_46_im) * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re))) elif x_46_im <= 2.9e-218: tmp = t_0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.sin((math.log(x_46_im) * y_46_im)) * math.exp(((math.log(x_46_im) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (x_46_im <= -2.9e-19) tmp = Float64(t_0 * sin(Float64(Float64(log(Float64(-x_46_im)) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); elseif (x_46_im <= 2.9e-218) tmp = Float64(t_0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(sin(Float64(log(x_46_im) * y_46_im)) * exp(Float64(Float64(log(x_46_im) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (x_46_im <= -2.9e-19) tmp = t_0 * sin(((log(-x_46_im) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); elseif (x_46_im <= 2.9e-218) tmp = t_0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = sin((log(x_46_im) * y_46_im)) * exp(((log(x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -2.9e-19], N[(t$95$0 * N[Sin[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.9e-218], N[(t$95$0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[x$46$im], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -2.9 \cdot 10^{-19}:\\
\;\;\;\;t\_0 \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;x.im \leq 2.9 \cdot 10^{-218}:\\
\;\;\;\;t\_0 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log x.im \cdot y.im\right) \cdot e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < -2.9e-19Initial program 31.3%
Taylor expanded in y.im around 0
Applied rewrites25.6%
Taylor expanded in x.im around -inf
Applied rewrites63.0%
if -2.9e-19 < x.im < 2.9000000000000002e-218Initial program 34.6%
Taylor expanded in y.im around 0
Applied rewrites27.6%
Taylor expanded in y.re around 0
Applied rewrites50.4%
if 2.9000000000000002e-218 < x.im Initial program 48.5%
Taylor expanded in y.re around 0
Applied rewrites67.7%
Taylor expanded in x.im around inf
Applied rewrites71.6%
Taylor expanded in y.re around 0
Applied rewrites59.8%
Final simplification57.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (sin t_0)))
(if (<= y.re -1.55e-15)
(* (pow (hypot x.im x.re) y.re) t_1)
(if (<= y.re 4.3e-161)
(* 1.0 (sin (fma (log (hypot x.im x.re)) y.im t_0)))
(* (pow (pow (hypot x.im x.re) 2.0) (* 0.5 y.re)) t_1)))))
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 t_1 = sin(t_0);
double tmp;
if (y_46_re <= -1.55e-15) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_1;
} else if (y_46_re <= 4.3e-161) {
tmp = 1.0 * sin(fma(log(hypot(x_46_im, x_46_re)), y_46_im, t_0));
} else {
tmp = pow(pow(hypot(x_46_im, x_46_re), 2.0), (0.5 * y_46_re)) * t_1;
}
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) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -1.55e-15) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_1); elseif (y_46_re <= 4.3e-161) tmp = Float64(1.0 * sin(fma(log(hypot(x_46_im, x_46_re)), y_46_im, t_0))); else tmp = Float64(((hypot(x_46_im, x_46_re) ^ 2.0) ^ Float64(0.5 * y_46_re)) * t_1); 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$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e-15], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-161], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{-15}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-161}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.im, t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{2}\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.5499999999999999e-15Initial program 40.3%
Taylor expanded in y.im around 0
Applied rewrites35.2%
Taylor expanded in y.re around inf
Applied rewrites73.0%
if -1.5499999999999999e-15 < y.re < 4.29999999999999967e-161Initial program 39.9%
Taylor expanded in y.im around 0
Applied rewrites22.3%
Taylor expanded in y.re around inf
Applied rewrites20.1%
Taylor expanded in y.re around 0
Applied rewrites20.1%
Taylor expanded in y.re around inf
Applied rewrites49.6%
if 4.29999999999999967e-161 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
Applied rewrites28.5%
Taylor expanded in y.re around inf
Applied rewrites43.7%
Applied rewrites48.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (or (<= y.re -1.55e-15) (not (<= y.re 5600.0)))
(* (pow (hypot x.im x.re) y.re) (sin t_0))
(* 1.0 (sin (fma (log (hypot x.im x.re)) y.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_re;
double tmp;
if ((y_46_re <= -1.55e-15) || !(y_46_re <= 5600.0)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(t_0);
} else {
tmp = 1.0 * sin(fma(log(hypot(x_46_im, x_46_re)), y_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_re) tmp = 0.0 if ((y_46_re <= -1.55e-15) || !(y_46_re <= 5600.0)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(t_0)); else tmp = Float64(1.0 * sin(fma(log(hypot(x_46_im, x_46_re)), y_46_im, 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.55e-15], N[Not[LessEqual[y$46$re, 5600.0]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{-15} \lor \neg \left(y.re \leq 5600\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.im, t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -1.5499999999999999e-15 or 5600 < y.re Initial program 39.6%
Taylor expanded in y.im around 0
Applied rewrites35.2%
Taylor expanded in y.re around inf
Applied rewrites67.4%
if -1.5499999999999999e-15 < y.re < 5600Initial program 39.6%
Taylor expanded in y.im around 0
Applied rewrites20.6%
Taylor expanded in y.re around inf
Applied rewrites18.2%
Taylor expanded in y.re around 0
Applied rewrites18.3%
Taylor expanded in y.re around inf
Applied rewrites43.5%
Final simplification56.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.05e-178) (not (<= y.re 1.16e-69))) (* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re))) (* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.05e-178) || !(y_46_re <= 1.16e-69)) {
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 = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.05e-178) || !(y_46_re <= 1.16e-69)) {
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 = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.05e-178) or not (y_46_re <= 1.16e-69): 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 = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.05e-178) || !(y_46_re <= 1.16e-69)) 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(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.05e-178) || ~((y_46_re <= 1.16e-69))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.05e-178], N[Not[LessEqual[y$46$re, 1.16e-69]], $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[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.05 \cdot 10^{-178} \lor \neg \left(y.re \leq 1.16 \cdot 10^{-69}\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}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -2.05e-178 or 1.15999999999999989e-69 < y.re Initial program 41.0%
Taylor expanded in y.im around 0
Applied rewrites31.9%
Taylor expanded in y.re around inf
Applied rewrites59.5%
if -2.05e-178 < y.re < 1.15999999999999989e-69Initial program 36.2%
Taylor expanded in y.im around 0
Applied rewrites19.4%
Taylor expanded in y.re around inf
Applied rewrites6.6%
Taylor expanded in y.re around 0
Applied rewrites6.6%
Taylor expanded in y.re around 0
Applied rewrites35.0%
Final simplification52.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) t_0)))
(if (<= y.re -45.0)
t_1
(if (<= y.re -2.05e-178)
(* 1.0 t_0)
(if (<= y.re 6.5e-162)
(* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))
t_1)))))
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 = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * t_0;
double tmp;
if (y_46_re <= -45.0) {
tmp = t_1;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 6.5e-162) {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_1;
}
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 = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -45.0) tmp = t_1; elseif (y_46_re <= -2.05e-178) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 6.5e-162) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = t_1; 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[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -45.0], t$95$1, If[LessEqual[y$46$re, -2.05e-178], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 6.5e-162], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -45:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -2.05 \cdot 10^{-178}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-162}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -45 or 6.49999999999999989e-162 < y.re Initial program 38.5%
Taylor expanded in y.im around 0
Applied rewrites30.5%
Taylor expanded in y.re around inf
Applied rewrites57.1%
Taylor expanded in x.im around 0
Applied rewrites56.3%
if -45 < y.re < -2.05e-178Initial program 43.8%
Taylor expanded in y.im around 0
Applied rewrites28.1%
Taylor expanded in y.re around inf
Applied rewrites46.8%
Taylor expanded in y.re around 0
Applied rewrites41.5%
if -2.05e-178 < y.re < 6.49999999999999989e-162Initial program 39.9%
Taylor expanded in y.im around 0
Applied rewrites22.2%
Taylor expanded in y.re around inf
Applied rewrites7.4%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in y.re around 0
Applied rewrites40.2%
(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 -5.9e+116)
(* (pow x.im y.re) t_0)
(if (<= y.re -1.25e-9)
(* (pow (- x.re) y.re) t_0)
(if (<= y.re -2.05e-178)
(* 1.0 t_0)
(if (<= y.re 1.7e-69)
(* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))
(* (pow 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 <= -5.9e+116) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else if (y_46_re <= -1.25e-9) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 1.7e-69) {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -5.9e+116) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else if (y_46_re <= -1.25e-9) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 1.7e-69) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.pow(x_46_re, 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 y_46_re <= -5.9e+116: tmp = math.pow(x_46_im, y_46_re) * t_0 elif y_46_re <= -1.25e-9: tmp = math.pow(-x_46_re, y_46_re) * t_0 elif y_46_re <= -2.05e-178: tmp = 1.0 * t_0 elif y_46_re <= 1.7e-69: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.pow(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 <= -5.9e+116) tmp = Float64((x_46_im ^ y_46_re) * t_0); elseif (y_46_re <= -1.25e-9) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= -2.05e-178) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 1.7e-69) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64((x_46_re ^ 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 (y_46_re <= -5.9e+116) tmp = (x_46_im ^ y_46_re) * t_0; elseif (y_46_re <= -1.25e-9) tmp = (-x_46_re ^ y_46_re) * t_0; elseif (y_46_re <= -2.05e-178) tmp = 1.0 * t_0; elseif (y_46_re <= 1.7e-69) tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = (x_46_re ^ 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[y$46$re, -5.9e+116], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -1.25e-9], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -2.05e-178], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.7e-69], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, 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 -5.9 \cdot 10^{+116}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -1.25 \cdot 10^{-9}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -2.05 \cdot 10^{-178}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-69}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.9e116Initial program 33.3%
Taylor expanded in y.im around 0
Applied rewrites29.0%
Taylor expanded in y.re around inf
Applied rewrites71.3%
Taylor expanded in x.re around 0
Applied rewrites62.5%
if -5.9e116 < y.re < -1.25e-9Initial program 51.6%
Taylor expanded in y.im around 0
Applied rewrites45.3%
Taylor expanded in y.re around inf
Applied rewrites77.6%
Taylor expanded in x.re around -inf
Applied rewrites69.7%
if -1.25e-9 < y.re < -2.05e-178Initial program 38.9%
Taylor expanded in y.im around 0
Applied rewrites21.8%
Taylor expanded in y.re around inf
Applied rewrites42.1%
Taylor expanded in y.re around 0
Applied rewrites42.1%
if -2.05e-178 < y.re < 1.70000000000000004e-69Initial program 36.2%
Taylor expanded in y.im around 0
Applied rewrites19.4%
Taylor expanded in y.re around inf
Applied rewrites6.6%
Taylor expanded in y.re around 0
Applied rewrites6.6%
Taylor expanded in y.re around 0
Applied rewrites35.0%
if 1.70000000000000004e-69 < y.re Initial program 42.3%
Taylor expanded in y.im around 0
Applied rewrites32.7%
Taylor expanded in y.re around inf
Applied rewrites52.3%
Taylor expanded in x.re around inf
Applied rewrites46.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))) (t_1 (* (pow x.re y.re) t_0)))
(if (<= y.re -5.9e+116)
(* (pow x.im y.re) t_0)
(if (<= y.re -1650000000000.0)
t_1
(if (<= y.re -2.05e-178)
(* 1.0 t_0)
(if (<= y.re 1.7e-69)
(* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))
t_1))))))
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 = pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -5.9e+116) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else if (y_46_re <= -1650000000000.0) {
tmp = t_1;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 1.7e-69) {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -5.9e+116) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else if (y_46_re <= -1650000000000.0) {
tmp = t_1;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 1.7e-69) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_1;
}
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)) t_1 = math.pow(x_46_re, y_46_re) * t_0 tmp = 0 if y_46_re <= -5.9e+116: tmp = math.pow(x_46_im, y_46_re) * t_0 elif y_46_re <= -1650000000000.0: tmp = t_1 elif y_46_re <= -2.05e-178: tmp = 1.0 * t_0 elif y_46_re <= 1.7e-69: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = t_1 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 = Float64((x_46_re ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -5.9e+116) tmp = Float64((x_46_im ^ y_46_re) * t_0); elseif (y_46_re <= -1650000000000.0) tmp = t_1; elseif (y_46_re <= -2.05e-178) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 1.7e-69) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = t_1; 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)); t_1 = (x_46_re ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -5.9e+116) tmp = (x_46_im ^ y_46_re) * t_0; elseif (y_46_re <= -1650000000000.0) tmp = t_1; elseif (y_46_re <= -2.05e-178) tmp = 1.0 * t_0; elseif (y_46_re <= 1.7e-69) tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -5.9e+116], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -1650000000000.0], t$95$1, If[LessEqual[y$46$re, -2.05e-178], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.7e-69], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {x.re}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -5.9 \cdot 10^{+116}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -1650000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -2.05 \cdot 10^{-178}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-69}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -5.9e116Initial program 33.3%
Taylor expanded in y.im around 0
Applied rewrites29.0%
Taylor expanded in y.re around inf
Applied rewrites71.3%
Taylor expanded in x.re around 0
Applied rewrites62.5%
if -5.9e116 < y.re < -1.65e12 or 1.70000000000000004e-69 < y.re Initial program 43.3%
Taylor expanded in y.im around 0
Applied rewrites34.3%
Taylor expanded in y.re around inf
Applied rewrites58.0%
Taylor expanded in x.re around inf
Applied rewrites52.8%
if -1.65e12 < y.re < -2.05e-178Initial program 44.1%
Taylor expanded in y.im around 0
Applied rewrites29.2%
Taylor expanded in y.re around inf
Applied rewrites49.5%
Taylor expanded in y.re around 0
Applied rewrites39.5%
if -2.05e-178 < y.re < 1.70000000000000004e-69Initial program 36.2%
Taylor expanded in y.im around 0
Applied rewrites19.4%
Taylor expanded in y.re around inf
Applied rewrites6.6%
Taylor expanded in y.re around 0
Applied rewrites6.6%
Taylor expanded in y.re around 0
Applied rewrites35.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 (* (pow x.im y.re) t_0)))
(if (<= y.re -45.0)
t_1
(if (<= y.re -2.05e-178)
(* 1.0 t_0)
(if (<= y.re 9.5e-30)
(* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))
t_1)))))
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 = pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -45.0) {
tmp = t_1;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 9.5e-30) {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -45.0) {
tmp = t_1;
} else if (y_46_re <= -2.05e-178) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 9.5e-30) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_1;
}
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)) t_1 = math.pow(x_46_im, y_46_re) * t_0 tmp = 0 if y_46_re <= -45.0: tmp = t_1 elif y_46_re <= -2.05e-178: tmp = 1.0 * t_0 elif y_46_re <= 9.5e-30: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = t_1 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 = Float64((x_46_im ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -45.0) tmp = t_1; elseif (y_46_re <= -2.05e-178) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 9.5e-30) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = t_1; 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)); t_1 = (x_46_im ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -45.0) tmp = t_1; elseif (y_46_re <= -2.05e-178) tmp = 1.0 * t_0; elseif (y_46_re <= 9.5e-30) tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -45.0], t$95$1, If[LessEqual[y$46$re, -2.05e-178], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-30], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {x.im}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -45:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -2.05 \cdot 10^{-178}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-30}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -45 or 9.49999999999999939e-30 < y.re Initial program 40.4%
Taylor expanded in y.im around 0
Applied rewrites34.0%
Taylor expanded in y.re around inf
Applied rewrites65.5%
Taylor expanded in x.re around 0
Applied rewrites51.2%
if -45 < y.re < -2.05e-178Initial program 43.8%
Taylor expanded in y.im around 0
Applied rewrites28.1%
Taylor expanded in y.re around inf
Applied rewrites46.8%
Taylor expanded in y.re around 0
Applied rewrites41.5%
if -2.05e-178 < y.re < 9.49999999999999939e-30Initial program 36.3%
Taylor expanded in y.im around 0
Applied rewrites18.9%
Taylor expanded in y.re around inf
Applied rewrites7.4%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in y.re around 0
Applied rewrites33.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -2.05e-178) (* 1.0 (sin (* (atan2 x.im x.re) y.re))) (* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.05e-178) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.05e-178) {
tmp = 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -2.05e-178: tmp = 1.0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -2.05e-178) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -2.05e-178) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.05e-178], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.05 \cdot 10^{-178}:\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -2.05e-178Initial program 40.2%
Taylor expanded in y.im around 0
Applied rewrites31.4%
Taylor expanded in y.re around inf
Applied rewrites64.1%
Taylor expanded in y.re around 0
Applied rewrites15.7%
if -2.05e-178 < y.re Initial program 39.1%
Taylor expanded in y.im around 0
Applied rewrites25.9%
Taylor expanded in y.re around inf
Applied rewrites28.8%
Taylor expanded in y.re around 0
Applied rewrites6.4%
Taylor expanded in y.re around 0
Applied rewrites20.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (sin (* (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) {
return 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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 = 1.0d0 * sin((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) {
return 1.0 * Math.sin((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): return 1.0 * math.sin((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) return Float64(1.0 * sin(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) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 39.6%
Taylor expanded in y.im around 0
Applied rewrites28.2%
Taylor expanded in y.re around inf
Applied rewrites44.0%
Taylor expanded in y.re around 0
Applied rewrites10.4%
herbie shell --seed 2025019
(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)))))