
(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 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)))
(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 (log (hypot x.im x.re)))
(t_1 (exp (* y.im (- (* y.re (/ t_0 y.im)) (atan2 x.im x.re))))))
(if (<= x.re 4e-201)
(* t_1 (sin (fma 0.5 (PI) (* (- y.im) t_0))))
(* t_1 (sin (fma 0.5 (PI) (* (- y.im) (log x.re))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{y.im \cdot \left(y.re \cdot \frac{t\_0}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;x.re \leq 4 \cdot 10^{-201}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(-y.im\right) \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(-y.im\right) \cdot \log x.re\right)\right)\\
\end{array}
\end{array}
if x.re < 3.99999999999999978e-201Initial program 44.8%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites67.3%
Taylor expanded in y.im around inf
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6484.2
Applied rewrites84.2%
Taylor expanded in y.re around 0
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
lower-PI.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.8
Applied rewrites84.8%
if 3.99999999999999978e-201 < x.re Initial program 41.3%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites63.3%
Taylor expanded in y.im around inf
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
Taylor expanded in y.re around 0
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
lower-PI.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.3
Applied rewrites79.3%
Taylor expanded in x.im around 0
Applied rewrites83.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* 0.5 (PI))) (t_1 (log (hypot x.im x.re))))
(if (<= y.re -6.5e-20)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* t_1 y.im)))
(if (<= y.re 1.5e-14)
(* (exp (* (- y.im) (atan2 x.im x.re))) (sin (fma (- y.im) t_1 t_0)))
(*
(sin (fma (- y.re) (atan2 x.im x.re) t_0))
(pow (hypot x.im x.re) y.re))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \mathsf{PI}\left(\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{-20}:\\
\;\;\;\;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 \cos \left(t\_1 \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-14}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_1, t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -6.50000000000000032e-20Initial program 53.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.8
Applied rewrites80.8%
if -6.50000000000000032e-20 < y.re < 1.4999999999999999e-14Initial program 45.1%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites55.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
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
Applied rewrites85.6%
if 1.4999999999999999e-14 < y.re Initial program 30.4%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites71.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.6
Applied rewrites72.6%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.8)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* (atan2 x.im x.re) y.re)))
(if (<= y.re 1.5e-14)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (- y.im) (atan2 x.im x.re))))
(*
(sin (fma (- y.re) (atan2 x.im x.re) (* 0.5 (PI))))
(pow (hypot x.im x.re) y.re)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.8:\\
\;\;\;\;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 \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-14}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.80000000000000004Initial program 55.0%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.4
Applied rewrites83.4%
if -0.80000000000000004 < y.re < 1.4999999999999999e-14Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.6
Applied rewrites40.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6483.7
Applied rewrites83.7%
if 1.4999999999999999e-14 < y.re Initial program 30.4%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites71.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6472.6
Applied rewrites72.6%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.0019) (not (<= y.re 1.5e-14)))
(*
(sin (fma (- y.re) (atan2 x.im x.re) (* 0.5 (PI))))
(pow (hypot x.im x.re) y.re))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (- y.im) (atan2 x.im x.re))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.0019 \lor \neg \left(y.re \leq 1.5 \cdot 10^{-14}\right):\\
\;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -0.0019 or 1.4999999999999999e-14 < y.re Initial program 41.5%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites76.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.4
Applied rewrites76.4%
if -0.0019 < y.re < 1.4999999999999999e-14Initial program 45.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.8
Applied rewrites40.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
Final simplification80.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re)))))
(if (<= y.im -4.5e+88)
(* (cos (* y.im (log (- x.im)))) t_0)
(if (<= y.im -17000000.0)
(*
(pow (hypot x.im (sqrt (* x.re x.re))) y.re)
(cos (* (atan2 x.im x.re) y.re)))
(if (<= y.im 9.5e+20)
(* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))
(if (<= y.im 4.6e+107)
(* (cos (* y.im (log (- x.re)))) t_0)
(* (cos (* y.im (log x.im))) t_0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -4.5 \cdot 10^{+88}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.im\right)\right) \cdot t\_0\\
\mathbf{elif}\;y.im \leq -17000000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, \sqrt{x.re \cdot x.re}\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{+20}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{+107}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.re\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot t\_0\\
\end{array}
\end{array}
if y.im < -4.5e88Initial program 42.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.0
Applied rewrites29.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6463.3
Applied rewrites63.3%
Taylor expanded in x.im around -inf
Applied rewrites50.5%
if -4.5e88 < y.im < -1.7e7Initial program 52.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.3
Applied rewrites55.3%
Applied rewrites60.5%
if -1.7e7 < y.im < 9.5e20Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.9
Applied rewrites81.9%
Applied rewrites85.2%
Taylor expanded in y.re around 0
Applied rewrites90.9%
if 9.5e20 < y.im < 4.6000000000000001e107Initial program 30.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6417.2
Applied rewrites17.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6469.2
Applied rewrites69.2%
Taylor expanded in x.re around -inf
Applied rewrites69.2%
if 4.6000000000000001e107 < y.im Initial program 34.1%
Taylor expanded in x.im around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.4%
Taylor expanded in y.re around 0
Applied rewrites37.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re)))))
(if (<= y.im -2e+22)
(* (cos (* y.im (log (- x.im)))) t_0)
(if (<= y.im 9.5e+20)
(* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))
(if (<= y.im 4.6e+107)
(* (cos (* y.im (log (- x.re)))) t_0)
(* (cos (* y.im (log x.im))) t_0))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+22}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.im\right)\right) \cdot t\_0\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{+20}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{+107}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.re\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot t\_0\\
\end{array}
\end{array}
if y.im < -2e22Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6434.6
Applied rewrites34.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6459.7
Applied rewrites59.7%
Taylor expanded in x.im around -inf
Applied rewrites48.1%
if -2e22 < y.im < 9.5e20Initial program 47.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.7
Applied rewrites80.7%
Applied rewrites83.0%
Taylor expanded in y.re around 0
Applied rewrites88.5%
if 9.5e20 < y.im < 4.6000000000000001e107Initial program 30.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6417.2
Applied rewrites17.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6469.2
Applied rewrites69.2%
Taylor expanded in x.re around -inf
Applied rewrites69.2%
if 4.6000000000000001e107 < y.im Initial program 34.1%
Taylor expanded in x.im around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.4%
Taylor expanded in y.re around 0
Applied rewrites37.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re)))))
(if (<= y.im -2e+22)
(* (cos (* y.im (log (- x.im)))) t_0)
(if (<= y.im 4e+113)
(* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))
(* (cos (* y.im (log x.im))) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+22}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.im\right)\right) \cdot t\_0\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{+113}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot t\_0\\
\end{array}
\end{array}
if y.im < -2e22Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6434.6
Applied rewrites34.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6459.7
Applied rewrites59.7%
Taylor expanded in x.im around -inf
Applied rewrites48.1%
if -2e22 < y.im < 4e113Initial program 46.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.4
Applied rewrites75.4%
Applied rewrites76.7%
Taylor expanded in y.re around 0
Applied rewrites82.3%
if 4e113 < y.im Initial program 32.1%
Taylor expanded in x.im around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.8%
Taylor expanded in y.re around 0
Applied rewrites38.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.5e+112)
(*
(pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re)
(sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))))
(if (<= y.im 4e+113)
(* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))
(* (cos (* y.im (log x.im))) (exp (* (- y.im) (atan2 x.im x.re)))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.5 \cdot 10^{+112}:\\
\;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{+113}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -3.49999999999999997e112Initial program 37.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6427.6
Applied rewrites27.6%
Applied rewrites27.6%
Taylor expanded in x.im around 0
Applied rewrites38.5%
if -3.49999999999999997e112 < y.im < 4e113Initial program 48.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.7
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in y.re around 0
Applied rewrites77.0%
if 4e113 < y.im Initial program 32.1%
Taylor expanded in x.im around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.8%
Taylor expanded in y.re around 0
Applied rewrites38.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -3.5e+112) (not (<= y.im 3e+147)))
(*
(pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re)
(sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))))
(* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.5 \cdot 10^{+112} \lor \neg \left(y.im \leq 3 \cdot 10^{+147}\right):\\
\;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if y.im < -3.49999999999999997e112 or 2.99999999999999993e147 < y.im Initial program 34.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6426.5
Applied rewrites26.5%
Applied rewrites27.7%
Taylor expanded in x.im around 0
Applied rewrites37.5%
if -3.49999999999999997e112 < y.im < 2.99999999999999993e147Initial program 47.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.4
Applied rewrites69.4%
Applied rewrites69.4%
Taylor expanded in y.re around 0
Applied rewrites74.1%
Final simplification61.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 (PI)))))
(if (<= y.im -5e+111)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(if (<= y.im 1.46e+149)
(* (pow (hypot x.im x.re) y.re) t_0)
(*
(pow (+ x.im (* 0.5 (/ (* x.re x.re) x.im))) y.re)
(sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+111}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.im \leq 1.46 \cdot 10^{+149}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right)}^{y.re} \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}
\end{array}
if y.im < -4.9999999999999997e111Initial program 37.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6427.6
Applied rewrites27.6%
Applied rewrites27.6%
Taylor expanded in y.re around 0
Applied rewrites25.3%
Taylor expanded in x.im around 0
Applied rewrites36.2%
if -4.9999999999999997e111 < y.im < 1.46e149Initial program 47.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.2
Applied rewrites69.2%
Applied rewrites69.2%
Taylor expanded in y.re around 0
Applied rewrites73.8%
if 1.46e149 < y.im Initial program 30.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6424.2
Applied rewrites24.2%
Applied rewrites26.6%
Taylor expanded in x.re around 0
Applied rewrites32.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 (PI)))))
(if (or (<= y.im -5e+111) (not (<= y.im 2.6e+30)))
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(* (pow (hypot x.im x.re) y.re) t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+111} \lor \neg \left(y.im \leq 2.6 \cdot 10^{+30}\right):\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.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.im < -4.9999999999999997e111 or 2.59999999999999988e30 < y.im Initial program 35.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6425.9
Applied rewrites25.9%
Applied rewrites25.9%
Taylor expanded in y.re around 0
Applied rewrites23.1%
Taylor expanded in x.im around 0
Applied rewrites32.5%
if -4.9999999999999997e111 < y.im < 2.59999999999999988e30Initial program 49.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.5
Applied rewrites76.5%
Applied rewrites77.2%
Taylor expanded in y.re around 0
Applied rewrites81.3%
Final simplification60.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3e-5) (not (<= y.re 0.00013))) (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) (sin (* 0.5 (PI)))) (fma y.re (log (hypot x.im x.re)) 1.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3 \cdot 10^{-5} \lor \neg \left(y.re \leq 0.00013\right):\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
\end{array}
\end{array}
if y.re < -3.00000000000000008e-5 or 1.29999999999999989e-4 < y.re Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.5
Applied rewrites68.5%
Applied rewrites69.3%
Taylor expanded in y.re around 0
Applied rewrites71.6%
Taylor expanded in x.im around 0
Applied rewrites70.1%
if -3.00000000000000008e-5 < y.re < 1.29999999999999989e-4Initial program 45.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.2
Applied rewrites41.2%
Taylor expanded in y.re around 0
Applied rewrites41.2%
Final simplification55.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.00065) (not (<= y.re 8.5))) (* (pow x.re y.re) (sin (* 0.5 (PI)))) (fma y.re (log (hypot x.im x.re)) 1.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00065 \lor \neg \left(y.re \leq 8.5\right):\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
\end{array}
\end{array}
if y.re < -6.4999999999999997e-4 or 8.5 < y.re Initial program 41.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.3
Applied rewrites68.3%
Applied rewrites69.0%
Taylor expanded in y.re around 0
Applied rewrites71.4%
Taylor expanded in x.im around 0
Applied rewrites58.4%
if -6.4999999999999997e-4 < y.re < 8.5Initial program 45.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.7
Applied rewrites41.7%
Taylor expanded in y.re around 0
Applied rewrites40.9%
Final simplification49.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.1e+28) (not (<= y.re 1.3e-16))) (* (pow x.im y.re) (sin (* 0.5 (PI)))) (fma y.re (log (hypot x.im x.re)) 1.0)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{+28} \lor \neg \left(y.re \leq 1.3 \cdot 10^{-16}\right):\\
\;\;\;\;{x.im}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
\end{array}
\end{array}
if y.re < -1.09999999999999993e28 or 1.2999999999999999e-16 < y.re Initial program 41.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.3
Applied rewrites67.3%
Applied rewrites69.0%
Taylor expanded in y.re around 0
Applied rewrites72.3%
Taylor expanded in x.re around 0
Applied rewrites48.1%
if -1.09999999999999993e28 < y.re < 1.2999999999999999e-16Initial program 45.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6443.7
Applied rewrites43.7%
Taylor expanded in y.re around 0
Applied rewrites38.4%
Final simplification43.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 (PI)))))
(if (<= x.im -2.3e+14)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 2.8e-247) (* (pow x.re y.re) t_0) (* (pow x.im y.re) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;x.im \leq -2.3 \cdot 10^{+14}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 2.8 \cdot 10^{-247}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -2.3e14Initial program 40.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.5
Applied rewrites45.5%
Applied rewrites51.1%
Taylor expanded in y.re around 0
Applied rewrites49.2%
Taylor expanded in x.im around -inf
Applied rewrites49.2%
if -2.3e14 < x.im < 2.79999999999999986e-247Initial program 45.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.0
Applied rewrites63.0%
Applied rewrites63.0%
Taylor expanded in y.re around 0
Applied rewrites62.0%
Taylor expanded in x.im around 0
Applied rewrites54.4%
if 2.79999999999999986e-247 < x.im Initial program 43.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6452.4
Applied rewrites52.4%
Applied rewrites50.5%
Taylor expanded in y.re around 0
Applied rewrites55.3%
Taylor expanded in x.re around 0
Applied rewrites49.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 23.5)
(fma y.re (log (hypot x.im x.re)) 1.0)
(fma
y.re
(fma -1.0 (log (/ -1.0 x.im)) (* (* 0.5 x.re) (/ x.re (* x.im x.im))))
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 23.5) {
tmp = fma(y_46_re, log(hypot(x_46_im, x_46_re)), 1.0);
} else {
tmp = fma(y_46_re, fma(-1.0, log((-1.0 / x_46_im)), ((0.5 * x_46_re) * (x_46_re / (x_46_im * x_46_im)))), 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 23.5) tmp = fma(y_46_re, log(hypot(x_46_im, x_46_re)), 1.0); else tmp = fma(y_46_re, fma(-1.0, log(Float64(-1.0 / x_46_im)), Float64(Float64(0.5 * x_46_re) * Float64(x_46_re / Float64(x_46_im * x_46_im)))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 23.5], N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision], N[(y$46$re * N[(-1.0 * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * x$46$re), $MachinePrecision] * N[(x$46$re / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 23.5:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \left(0.5 \cdot x.re\right) \cdot \frac{x.re}{x.im \cdot x.im}\right), 1\right)\\
\end{array}
\end{array}
if y.re < 23.5Initial program 48.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.8
Applied rewrites53.8%
Taylor expanded in y.re around 0
Applied rewrites28.3%
if 23.5 < y.re Initial program 29.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around 0
Applied rewrites3.2%
Taylor expanded in x.im around -inf
Applied rewrites18.7%
Applied rewrites18.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 92000000000000.0)
1.0
(fma
y.re
(fma -1.0 (log (/ -1.0 x.im)) (* (* 0.5 x.re) (/ x.re (* x.im x.im))))
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 92000000000000.0) {
tmp = 1.0;
} else {
tmp = fma(y_46_re, fma(-1.0, log((-1.0 / x_46_im)), ((0.5 * x_46_re) * (x_46_re / (x_46_im * x_46_im)))), 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 92000000000000.0) tmp = 1.0; else tmp = fma(y_46_re, fma(-1.0, log(Float64(-1.0 / x_46_im)), Float64(Float64(0.5 * x_46_re) * Float64(x_46_re / Float64(x_46_im * x_46_im)))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 92000000000000.0], 1.0, N[(y$46$re * N[(-1.0 * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * x$46$re), $MachinePrecision] * N[(x$46$re / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 92000000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \left(0.5 \cdot x.re\right) \cdot \frac{x.re}{x.im \cdot x.im}\right), 1\right)\\
\end{array}
\end{array}
if y.re < 9.2e13Initial program 48.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.0
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites28.2%
Taylor expanded in y.re around 0
Applied rewrites28.0%
if 9.2e13 < y.re Initial program 28.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.7
Applied rewrites57.7%
Taylor expanded in y.re around 0
Applied rewrites3.2%
Taylor expanded in x.im around -inf
Applied rewrites19.0%
Applied rewrites19.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 42000000000.0)
1.0
(fma
y.re
(fma -1.0 (- (log (- x.im))) (/ (* 0.5 (* x.re x.re)) (* x.im x.im)))
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 42000000000.0) {
tmp = 1.0;
} else {
tmp = fma(y_46_re, fma(-1.0, -log(-x_46_im), ((0.5 * (x_46_re * x_46_re)) / (x_46_im * x_46_im))), 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 42000000000.0) tmp = 1.0; else tmp = fma(y_46_re, fma(-1.0, Float64(-log(Float64(-x_46_im))), Float64(Float64(0.5 * Float64(x_46_re * x_46_re)) / Float64(x_46_im * x_46_im))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 42000000000.0], 1.0, N[(y$46$re * N[(-1.0 * (-N[Log[(-x$46$im)], $MachinePrecision]) + N[(N[(0.5 * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 42000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, -\log \left(-x.im\right), \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im}\right), 1\right)\\
\end{array}
\end{array}
if y.re < 4.2e10Initial program 48.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.0
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites28.2%
Taylor expanded in y.re around 0
Applied rewrites28.0%
if 4.2e10 < y.re Initial program 28.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.7
Applied rewrites57.7%
Taylor expanded in y.re around 0
Applied rewrites3.2%
Taylor expanded in x.im around -inf
Applied rewrites19.0%
Applied rewrites19.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 5.5e+42) (fma (- y.im) (atan2 x.im x.re) 1.0) (fma y.re (+ (log x.re) (/ (* 0.5 (* x.im x.im)) (* x.re x.re))) 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 5.5e+42) {
tmp = fma(-y_46_im, atan2(x_46_im, x_46_re), 1.0);
} else {
tmp = fma(y_46_re, (log(x_46_re) + ((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re))), 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 5.5e+42) tmp = fma(Float64(-y_46_im), atan(x_46_im, x_46_re), 1.0); else tmp = fma(y_46_re, Float64(log(x_46_re) + Float64(Float64(0.5 * Float64(x_46_im * x_46_im)) / Float64(x_46_re * x_46_re))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 5.5e+42], N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision], N[(y$46$re * N[(N[Log[x$46$re], $MachinePrecision] + N[(N[(0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 5.5 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log x.re + \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re}, 1\right)\\
\end{array}
\end{array}
if y.re < 5.50000000000000001e42Initial program 47.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.9
Applied rewrites53.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6461.8
Applied rewrites61.8%
Taylor expanded in x.re around 0
Applied rewrites31.9%
Taylor expanded in y.im around 0
Applied rewrites27.0%
if 5.50000000000000001e42 < y.re Initial program 29.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.7
Applied rewrites58.7%
Taylor expanded in y.re around 0
Applied rewrites3.3%
Taylor expanded in x.im around 0
Applied rewrites11.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 3.9e+87) 1.0 (fma y.re (log (+ x.re (* 0.5 (/ (* x.im x.im) x.re)))) 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.9e+87) {
tmp = 1.0;
} else {
tmp = fma(y_46_re, log((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re)))), 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 3.9e+87) tmp = 1.0; else tmp = fma(y_46_re, log(Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * x_46_im) / x_46_re)))), 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3.9e+87], 1.0, N[(y$46$re * N[Log[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3.9 \cdot 10^{+87}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \log \left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right), 1\right)\\
\end{array}
\end{array}
if y.re < 3.9000000000000002e87Initial program 46.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.5
Applied rewrites54.5%
Taylor expanded in y.re around 0
Applied rewrites26.3%
Taylor expanded in y.re around 0
Applied rewrites26.2%
if 3.9000000000000002e87 < y.re Initial program 29.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.9
Applied rewrites56.9%
Taylor expanded in y.re around 0
Applied rewrites3.4%
Taylor expanded in x.im around 0
Applied rewrites11.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (- y.im) (atan2 x.im x.re) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma(-y_46_im, atan2(x_46_im, x_46_re), 1.0);
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(-y_46_im), atan(x_46_im, x_46_re), 1.0) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)
\end{array}
Initial program 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.0
Applied rewrites55.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
distribute-lft-neg-inN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6452.9
Applied rewrites52.9%
Taylor expanded in x.re around 0
Applied rewrites26.0%
Taylor expanded in y.im around 0
Applied rewrites21.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.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
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;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.0
Applied rewrites55.0%
Taylor expanded in y.re around 0
Applied rewrites21.8%
Taylor expanded in y.re around 0
Applied rewrites21.4%
herbie shell --seed 2024351
(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)))))