
(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)))
(cos (+ (* 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))) * cos(((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))) * cos(((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.cos(((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.cos(((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))) * cos(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))) * cos(((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[Cos[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 \cos \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 15 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)))
(cos (+ (* 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))) * cos(((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))) * cos(((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.cos(((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.cos(((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))) * cos(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))) * cos(((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[Cos[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 \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1 (log (hypot x.im x.re))))
(if (<= y.re -3.2e-5)
(*
t_0
(sin (+ (- (fma y.im t_1 (* (atan2 x.im x.re) y.re))) (/ (PI) 2.0))))
(if (<= y.re 1e-18)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (fma 0.5 (PI) (* y.im t_1))))
(* t_0 (sin (fma y.im t_1 (* 0.5 (PI)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{-5}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\\
\mathbf{elif}\;y.re \leq 10^{-18}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(y.im, t\_1, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -3.19999999999999986e-5Initial program 34.8%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites79.8%
if -3.19999999999999986e-5 < y.re < 1.0000000000000001e-18Initial program 40.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6423.6
Applied rewrites23.6%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6416.0
Applied rewrites16.0%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites16.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.0
Applied rewrites80.0%
if 1.0000000000000001e-18 < y.re Initial program 35.2%
Taylor expanded in x.im around 0
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6442.3
Applied rewrites42.3%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
lower-+.f6435.3
Applied rewrites35.3%
Taylor expanded in y.re around 0
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-PI.f6478.9
Applied rewrites78.9%
Final simplification79.7%
(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)))))
(if (<= y.re -5.6e-10)
(* t_1 (sin (- (* (PI) 0.5) (* (atan2 x.im x.re) y.re))))
(if (<= y.re 1e-18)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (fma 0.5 (PI) (* y.im t_0))))
(* t_1 (sin (fma y.im t_0 (* 0.5 (PI)))))))))\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}\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-10}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{PI}\left(\right) \cdot 0.5 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 10^{-18}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(y.im, t\_0, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -5.60000000000000031e-10Initial program 34.8%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites79.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
if -5.60000000000000031e-10 < y.re < 1.0000000000000001e-18Initial program 40.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6423.6
Applied rewrites23.6%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6416.0
Applied rewrites16.0%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites16.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.0
Applied rewrites80.0%
if 1.0000000000000001e-18 < y.re Initial program 35.2%
Taylor expanded in x.im around 0
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6442.3
Applied rewrites42.3%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
lower-+.f6435.3
Applied rewrites35.3%
Taylor expanded in y.re around 0
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-PI.f6478.9
Applied rewrites78.9%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (fma 0.5 (PI) (* y.im (log (hypot x.im x.re)))))))
(if (<= y.re -5.6e-10)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (- (* (PI) 0.5) (* (atan2 x.im x.re) y.re))))
(if (<= y.re 0.0038)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
(* (pow (hypot x.im x.re) y.re) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-10}:\\
\;\;\;\;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(\mathsf{PI}\left(\right) \cdot 0.5 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 0.0038:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.60000000000000031e-10Initial program 34.8%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites79.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
if -5.60000000000000031e-10 < y.re < 0.00379999999999999999Initial program 40.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.8
Applied rewrites24.8%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6416.8
Applied rewrites16.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites16.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.4
Applied rewrites80.4%
if 0.00379999999999999999 < y.re Initial program 33.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6430.9
Applied rewrites30.9%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6418.6
Applied rewrites18.6%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites15.5%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.5
Applied rewrites75.5%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (sin (fma 0.5 (PI) (* y.im (log (hypot x.im x.re)))))))
(if (<= y.re -1e-14)
(* (sin (- (* 0.5 (PI)) (* y.re (atan2 x.im x.re)))) t_0)
(if (<= y.re 0.0038)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
(* t_0 t_1)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{-14}:\\
\;\;\;\;\sin \left(0.5 \cdot \mathsf{PI}\left(\right) - y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.0038:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -9.99999999999999999e-15Initial program 34.3%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites78.8%
Taylor expanded in y.re around 0
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-PI.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6474.5
Applied rewrites74.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6474.6
Applied rewrites74.6%
if -9.99999999999999999e-15 < y.re < 0.00379999999999999999Initial program 40.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.0
Applied rewrites25.0%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6416.9
Applied rewrites16.9%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites16.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.4
Applied rewrites80.4%
if 0.00379999999999999999 < y.re Initial program 33.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6430.9
Applied rewrites30.9%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6418.6
Applied rewrites18.6%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites15.5%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.5
Applied rewrites75.5%
Final simplification77.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -2.8e+75)
(* (sin (- (* 0.5 (PI)) (* y.re (atan2 x.im x.re)))) t_0)
(if (<= y.re 9.8e-15)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (atan2 x.im x.re) y.re)))
(* t_0 (sin (fma 0.5 (PI) (* y.im (log (hypot x.im x.re))))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+75}:\\
\;\;\;\;\sin \left(0.5 \cdot \mathsf{PI}\left(\right) - y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 9.8 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -2.80000000000000012e75Initial program 34.0%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites86.9%
Taylor expanded in y.re around 0
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-PI.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.1
Applied rewrites83.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.1
Applied rewrites83.1%
if -2.80000000000000012e75 < y.re < 9.7999999999999999e-15Initial program 39.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.5
Applied rewrites25.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites44.1%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
if 9.7999999999999999e-15 < y.re Initial program 35.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.3
Applied rewrites32.3%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6420.5
Applied rewrites20.5%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites17.6%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.0
Applied rewrites75.0%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* 0.5 (PI))))
(if (<= y.re -2.8e+75)
(* (sin (- t_0 (* y.re (atan2 x.im x.re)))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 1e-18)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (atan2 x.im x.re) y.re)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin t_0))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+75}:\\
\;\;\;\;\sin \left(t\_0 - y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 10^{-18}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;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\\
\end{array}
\end{array}
if y.re < -2.80000000000000012e75Initial program 34.0%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites86.9%
Taylor expanded in y.re around 0
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-PI.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.1
Applied rewrites83.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.1
Applied rewrites83.1%
if -2.80000000000000012e75 < y.re < 1.0000000000000001e-18Initial program 39.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.3
Applied rewrites25.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.3
Applied rewrites50.3%
Taylor expanded in y.re around 0
Applied rewrites44.3%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6475.0
Applied rewrites75.0%
if 1.0000000000000001e-18 < y.re Initial program 35.2%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites66.3%
Taylor expanded in y.re around 0
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-PI.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.5
Applied rewrites70.5%
Taylor expanded in y.im around 0
Applied rewrites71.9%
Final simplification75.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* (sin (- (* 0.5 (PI)) t_1)) t_0)))
(if (<= y.re -2.8e+75)
t_2
(if (<= y.re 9.8e-15)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 2.45e+182) (* t_0 (sin (fma 0.5 (PI) t_1))) t_2)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right) - t\_1\right) \cdot t\_0\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+75}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 9.8 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+182}:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -2.80000000000000012e75 or 2.45e182 < y.re Initial program 33.3%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites85.2%
Taylor expanded in y.re around 0
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-PI.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.1
Applied rewrites79.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.9
Applied rewrites77.9%
if -2.80000000000000012e75 < y.re < 9.7999999999999999e-15Initial program 39.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.5
Applied rewrites25.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites44.1%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
if 9.7999999999999999e-15 < y.re < 2.45e182Initial program 37.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.3
Applied rewrites32.3%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites22.4%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-atan2.f6469.9
Applied rewrites69.9%
Final simplification75.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (or (<= y.re -2.8e+75) (not (<= y.re 9.8e-15)))
(* (pow (hypot x.im x.re) y.re) t_0)
(* (exp (* (- y.im) (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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -2.8e+75) || !(y_46_re <= 9.8e-15)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_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.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -2.8e+75) || !(y_46_re <= 9.8e-15)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (y_46_re <= -2.8e+75) or not (y_46_re <= 9.8e-15): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 else: tmp = math.exp((-y_46_im * math.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 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((y_46_re <= -2.8e+75) || !(y_46_re <= 9.8e-15)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_re <= -2.8e+75) || ~((y_46_re <= 9.8e-15))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0; else tmp = exp((-y_46_im * atan2(x_46_im, x_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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -2.8e+75], N[Not[LessEqual[y$46$re, 9.8e-15]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+75} \lor \neg \left(y.re \leq 9.8 \cdot 10^{-15}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -2.80000000000000012e75 or 9.7999999999999999e-15 < y.re Initial program 34.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.2
Applied rewrites32.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.7
Applied rewrites63.7%
if -2.80000000000000012e75 < y.re < 9.7999999999999999e-15Initial program 39.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.5
Applied rewrites25.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites44.1%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
Final simplification69.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -2.8e+75)
(* t_0 t_1)
(if (<= y.re 9.8e-15)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
(* t_0 (sin (fma 0.5 (PI) (* y.re (atan2 x.im x.re)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+75}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 9.8 \cdot 10^{-15}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -2.80000000000000012e75Initial program 34.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.1
Applied rewrites32.1%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.9
Applied rewrites69.9%
if -2.80000000000000012e75 < y.re < 9.7999999999999999e-15Initial program 39.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.5
Applied rewrites25.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites44.1%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
if 9.7999999999999999e-15 < y.re Initial program 35.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.3
Applied rewrites32.3%
Taylor expanded in x.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6420.5
Applied rewrites20.5%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
Applied rewrites17.6%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-fma.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-atan2.f6461.7
Applied rewrites61.7%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow (hypot x.im x.re) y.re) (cos (* (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 pow(hypot(x_46_im, x_46_re), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((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 math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((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((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(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 = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((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[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 37.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.7
Applied rewrites28.7%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.4
Applied rewrites56.4%
Final simplification56.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -600000.0) (not (<= y.re 0.00036))) (* (pow x.re y.re) (cos (* (atan2 x.im x.re) y.re))) (* 1.0 (cos (* y.im (log (hypot x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -600000.0) || !(y_46_re <= 0.00036)) {
tmp = pow(x_46_re, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -600000.0) || !(y_46_re <= 0.00036)) {
tmp = Math.pow(x_46_re, y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -600000.0) or not (y_46_re <= 0.00036): tmp = math.pow(x_46_re, y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = 1.0 * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -600000.0) || !(y_46_re <= 0.00036)) tmp = Float64((x_46_re ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -600000.0) || ~((y_46_re <= 0.00036))) tmp = (x_46_re ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -600000.0], N[Not[LessEqual[y$46$re, 0.00036]], $MachinePrecision]], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -600000 \lor \neg \left(y.re \leq 0.00036\right):\\
\;\;\;\;{x.re}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -6e5 or 3.60000000000000023e-4 < y.re Initial program 34.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6431.9
Applied rewrites31.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.3
Applied rewrites62.3%
Taylor expanded in x.im around 0
Applied rewrites50.5%
if -6e5 < y.re < 3.60000000000000023e-4Initial program 40.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.2
Applied rewrites25.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.2
Applied rewrites50.2%
Taylor expanded in y.re around 0
Applied rewrites48.7%
Taylor expanded in y.re around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.6
Applied rewrites49.6%
Final simplification50.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -195000000000.0) (not (<= y.re 2.1e+19))) (* (pow x.im y.re) (cos (* (atan2 x.im x.re) y.re))) (* 1.0 (cos (* y.im (log (hypot x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -195000000000.0) || !(y_46_re <= 2.1e+19)) {
tmp = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -195000000000.0) || !(y_46_re <= 2.1e+19)) {
tmp = Math.pow(x_46_im, y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -195000000000.0) or not (y_46_re <= 2.1e+19): tmp = math.pow(x_46_im, y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = 1.0 * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -195000000000.0) || !(y_46_re <= 2.1e+19)) tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -195000000000.0) || ~((y_46_re <= 2.1e+19))) tmp = (x_46_im ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -195000000000.0], N[Not[LessEqual[y$46$re, 2.1e+19]], $MachinePrecision]], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -195000000000 \lor \neg \left(y.re \leq 2.1 \cdot 10^{+19}\right):\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.95e11 or 2.1e19 < y.re Initial program 35.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.4
Applied rewrites33.4%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.7
Applied rewrites63.7%
Taylor expanded in x.re around 0
Applied rewrites48.1%
if -1.95e11 < y.re < 2.1e19Initial program 38.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.1
Applied rewrites24.1%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.4
Applied rewrites49.4%
Taylor expanded in y.re around 0
Applied rewrites46.7%
Taylor expanded in y.re around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6447.4
Applied rewrites47.4%
Final simplification47.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (+ 1.0 (* (* -0.5 (* y.re y.re)) (pow (atan2 x.im x.re) 2.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 * (1.0 + ((-0.5 * (y_46_re * y_46_re)) * pow(atan2(x_46_im, x_46_re), 2.0)));
}
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 * (1.0d0 + (((-0.5d0) * (y_46re * y_46re)) * (atan2(x_46im, x_46re) ** 2.0d0)))
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 * (1.0 + ((-0.5 * (y_46_re * y_46_re)) * Math.pow(Math.atan2(x_46_im, x_46_re), 2.0)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 * (1.0 + ((-0.5 * (y_46_re * y_46_re)) * math.pow(math.atan2(x_46_im, x_46_re), 2.0)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 * Float64(1.0 + Float64(Float64(-0.5 * Float64(y_46_re * y_46_re)) * (atan(x_46_im, x_46_re) ^ 2.0)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 * (1.0 + ((-0.5 * (y_46_re * y_46_re)) * (atan2(x_46_im, x_46_re) ^ 2.0))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[(1.0 + N[(N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \left(1 + \left(-0.5 \cdot \left(y.re \cdot y.re\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)
\end{array}
Initial program 37.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.7
Applied rewrites28.7%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.4
Applied rewrites56.4%
Taylor expanded in y.re around 0
Applied rewrites24.9%
Taylor expanded in y.re around 0
Applied rewrites30.4%
Final simplification30.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))))
\begin{array}{l}
\\
1 \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)
\end{array}
Initial program 37.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.7
Applied rewrites28.7%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.4
Applied rewrites56.4%
Taylor expanded in y.re around 0
Applied rewrites24.9%
Applied rewrites24.9%
Final simplification24.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (cos (* (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 * cos((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 * cos((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.cos((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.cos((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 * cos(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 * cos((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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 37.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.7
Applied rewrites28.7%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.4
Applied rewrites56.4%
Taylor expanded in y.re around 0
Applied rewrites24.9%
Final simplification24.9%
herbie shell --seed 2024364
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))