
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -1.05e-84)
(* (exp (- (* -1.0 (* y.re t_2)) t_0)) (sin (fma -1.0 (* y.im t_2) t_1)))
(if (<= x.im 10500000000.0)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_1)
(*
(exp (- (* y.re (log x.im)) t_0))
(+ (sin t_1) (* y.im (* (cos t_1) (log x.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.05e-84) {
tmp = exp(((-1.0 * (y_46_re * t_2)) - t_0)) * sin(fma(-1.0, (y_46_im * t_2), t_1));
} else if (x_46_im <= 10500000000.0) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_1;
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * (sin(t_1) + (y_46_im * (cos(t_1) * log(x_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.05e-84) tmp = Float64(exp(Float64(Float64(-1.0 * Float64(y_46_re * t_2)) - t_0)) * sin(fma(-1.0, Float64(y_46_im * t_2), t_1))); elseif (x_46_im <= 10500000000.0) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_1); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * Float64(sin(t_1) + Float64(y_46_im * Float64(cos(t_1) * log(x_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.05e-84], N[(N[Exp[N[(N[(-1.0 * N[(y$46$re * t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-1.0 * N[(y$46$im * t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 10500000000.0], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] + N[(y$46$im * N[(N[Cos[t$95$1], $MachinePrecision] * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1.05 \cdot 10^{-84}:\\
\;\;\;\;e^{-1 \cdot \left(y.re \cdot t\_2\right) - t\_0} \cdot \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 10500000000:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \left(\sin t\_1 + y.im \cdot \left(\cos t\_1 \cdot \log x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -1.04999999999999999e-84Initial program 34.8%
Taylor expanded in x.im around -inf
lower-*.f64N/A
Applied rewrites71.7%
if -1.04999999999999999e-84 < x.im < 1.05e10Initial program 50.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6455.6
Applied rewrites55.6%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6455.2
Applied rewrites55.2%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6452.2
Applied rewrites52.2%
if 1.05e10 < x.im Initial program 29.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6477.3
Applied rewrites77.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-log.f6477.1
Applied rewrites77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -1.05e-84)
(* (exp (- (* -1.0 (* y.re t_2)) t_0)) (sin (fma -1.0 (* y.im t_2) t_1)))
(if (<= x.im 1.42e+66)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_1)
(*
(exp (- (* y.re (log x.im)) t_0))
(sin (fma y.im (log x.im) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.05e-84) {
tmp = exp(((-1.0 * (y_46_re * t_2)) - t_0)) * sin(fma(-1.0, (y_46_im * t_2), t_1));
} else if (x_46_im <= 1.42e+66) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_1;
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.05e-84) tmp = Float64(exp(Float64(Float64(-1.0 * Float64(y_46_re * t_2)) - t_0)) * sin(fma(-1.0, Float64(y_46_im * t_2), t_1))); elseif (x_46_im <= 1.42e+66) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_1); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.05e-84], N[(N[Exp[N[(N[(-1.0 * N[(y$46$re * t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-1.0 * N[(y$46$im * t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.42e+66], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1.05 \cdot 10^{-84}:\\
\;\;\;\;e^{-1 \cdot \left(y.re \cdot t\_2\right) - t\_0} \cdot \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 1.42 \cdot 10^{+66}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -1.04999999999999999e-84Initial program 34.8%
Taylor expanded in x.im around -inf
lower-*.f64N/A
Applied rewrites71.7%
if -1.04999999999999999e-84 < x.im < 1.4200000000000001e66Initial program 50.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6456.1
Applied rewrites56.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6455.9
Applied rewrites55.9%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6452.8
Applied rewrites52.8%
if 1.4200000000000001e66 < x.im Initial program 22.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6478.5
Applied rewrites78.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= x.im -5.2e-243)
(* t_1 (fma -1.0 (* y.im (log (/ -1.0 x.im))) t_2))
(if (<= x.im 6.3e-288)
(* (exp (- (* y.re (log x.re)) t_0)) (sin (fma y.im (log x.re) t_2)))
(if (<= x.im 1.42e+66)
(* t_1 t_2)
(*
(exp (- (* y.re (log x.im)) t_0))
(sin (fma y.im (log x.im) t_2))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -5.2e-243) {
tmp = t_1 * fma(-1.0, (y_46_im * log((-1.0 / x_46_im))), t_2);
} else if (x_46_im <= 6.3e-288) {
tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), t_2));
} else if (x_46_im <= 1.42e+66) {
tmp = t_1 * t_2;
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_2));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -5.2e-243) tmp = Float64(t_1 * fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_im))), t_2)); elseif (x_46_im <= 6.3e-288) tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), t_2))); elseif (x_46_im <= 1.42e+66) tmp = Float64(t_1 * t_2); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_2))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -5.2e-243], N[(t$95$1 * N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6.3e-288], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.42e+66], N[(t$95$1 * t$95$2), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -5.2 \cdot 10^{-243}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.im}\right), t\_2\right)\\
\mathbf{elif}\;x.im \leq 6.3 \cdot 10^{-288}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_2\right)\right)\\
\mathbf{elif}\;x.im \leq 1.42 \cdot 10^{+66}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_2\right)\right)\\
\end{array}
\end{array}
if x.im < -5.1999999999999995e-243Initial program 39.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6446.8
Applied rewrites46.8%
Taylor expanded in x.im around -inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lift-atan2.f64N/A
lift-*.f6455.9
Applied rewrites55.9%
if -5.1999999999999995e-243 < x.im < 6.3000000000000002e-288Initial program 41.5%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6437.4
Applied rewrites37.4%
if 6.3000000000000002e-288 < x.im < 1.4200000000000001e66Initial program 53.6%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6458.0
Applied rewrites58.0%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6457.5
Applied rewrites57.5%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6454.9
Applied rewrites54.9%
if 1.4200000000000001e66 < x.im Initial program 22.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6478.5
Applied rewrites78.5%
(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 (* y.re (atan2 x.im x.re))))
(if (<= x.im -1.12e-70)
(* t_0 (fma -1.0 (* y.im (log (/ -1.0 x.im))) t_1))
(if (<= x.im 1.42e+66)
(* t_0 t_1)
(*
(exp (- (* y.re (log x.im)) (* y.im (atan2 x.im x.re))))
(sin (fma y.im (log x.im) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -1.12e-70) {
tmp = t_0 * fma(-1.0, (y_46_im * log((-1.0 / x_46_im))), t_1);
} else if (x_46_im <= 1.42e+66) {
tmp = t_0 * t_1;
} else {
tmp = exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(fma(y_46_im, log(x_46_im), t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -1.12e-70) tmp = Float64(t_0 * fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_im))), t_1)); elseif (x_46_im <= 1.42e+66) tmp = Float64(t_0 * t_1); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(fma(y_46_im, log(x_46_im), t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.12e-70], N[(t$95$0 * N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.42e+66], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -1.12 \cdot 10^{-70}:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.im}\right), t\_1\right)\\
\mathbf{elif}\;x.im \leq 1.42 \cdot 10^{+66}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -1.12e-70Initial program 33.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6442.2
Applied rewrites42.2%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6442.5
Applied rewrites42.5%
Taylor expanded in x.im around -inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lift-atan2.f64N/A
lift-*.f6456.7
Applied rewrites56.7%
if -1.12e-70 < x.im < 1.4200000000000001e66Initial program 51.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6456.3
Applied rewrites56.3%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6456.1
Applied rewrites56.1%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6452.8
Applied rewrites52.8%
if 1.4200000000000001e66 < x.im Initial program 22.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6478.5
Applied rewrites78.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -2.65e-17)
(* t_2 t_1)
(if (<= y.re -2.45e-113)
(* (exp (- (* y.im (atan2 x.im x.re)))) t_1)
(if (<= y.re 1.35)
(* t_2 (fma y.im (log t_0) t_1))
(* (sin t_1) (pow t_0 y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -2.65e-17) {
tmp = t_2 * t_1;
} else if (y_46_re <= -2.45e-113) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 1.35) {
tmp = t_2 * fma(y_46_im, log(t_0), t_1);
} else {
tmp = sin(t_1) * pow(t_0, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -2.65e-17) tmp = Float64(t_2 * t_1); elseif (y_46_re <= -2.45e-113) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_1); elseif (y_46_re <= 1.35) tmp = Float64(t_2 * fma(y_46_im, log(t_0), t_1)); else tmp = Float64(sin(t_1) * (t_0 ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.65e-17], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -2.45e-113], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.35], N[(t$95$2 * N[(y$46$im * N[Log[t$95$0], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$1], $MachinePrecision] * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.re \leq -2.45 \cdot 10^{-113}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.35:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(y.im, \log t\_0, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t\_1 \cdot {t\_0}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.6499999999999999e-17Initial program 41.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.1
Applied rewrites44.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6479.8
Applied rewrites79.8%
if -2.6499999999999999e-17 < y.re < -2.4500000000000001e-113Initial program 41.4%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6440.8
Applied rewrites40.8%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6440.8
Applied rewrites40.8%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6442.0
Applied rewrites42.0%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-exp.f6462.2
Applied rewrites62.2%
if -2.4500000000000001e-113 < y.re < 1.3500000000000001Initial program 40.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.9
Applied rewrites43.9%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6443.7
Applied rewrites43.7%
if 1.3500000000000001 < y.re Initial program 37.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6454.5
Applied rewrites54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -2.65e-17)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 5.1e-14)
(* (exp (- (* y.im (atan2 x.im x.re)))) t_0)
(* (sin t_0) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -2.65e-17) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 5.1e-14) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = sin(t_0) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.65e-17) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 5.1e-14) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64(sin(t_0) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.65e-17], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 5.1e-14], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 5.1 \cdot 10^{-14}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.6499999999999999e-17Initial program 41.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.1
Applied rewrites44.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6479.8
Applied rewrites79.8%
if -2.6499999999999999e-17 < y.re < 5.0999999999999997e-14Initial program 41.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6443.4
Applied rewrites43.4%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6434.4
Applied rewrites34.4%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-exp.f6451.5
Applied rewrites51.5%
if 5.0999999999999997e-14 < y.re Initial program 37.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6453.0
Applied rewrites53.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -2.65e-17)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 1.4)
(* (exp (- (* y.im (atan2 x.im x.re)))) t_0)
(* t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -2.65e-17) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 1.4) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_0 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.65e-17) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 1.4) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.65e-17], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.4], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.4:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.6499999999999999e-17Initial program 41.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.1
Applied rewrites44.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6479.8
Applied rewrites79.8%
if -2.6499999999999999e-17 < y.re < 1.3999999999999999Initial program 40.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6443.2
Applied rewrites43.2%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6434.4
Applied rewrites34.4%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-exp.f6451.5
Applied rewrites51.5%
if 1.3999999999999999 < y.re Initial program 37.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6454.5
Applied rewrites54.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6453.8
Applied rewrites53.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
(if (<= y.re -1150000000000.0)
t_1
(if (<= y.re 1.4) (* (exp (- (* y.im (atan2 x.im x.re)))) t_0) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = t_0 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -1150000000000.0) {
tmp = t_1;
} else if (y_46_re <= 1.4) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1150000000000.0) tmp = t_1; elseif (y_46_re <= 1.4) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1150000000000.0], t$95$1, If[LessEqual[y$46$re, 1.4], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1150000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.4:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.15e12 or 1.3999999999999999 < y.re Initial program 39.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6467.0
Applied rewrites67.0%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6466.2
Applied rewrites66.2%
if -1.15e12 < y.re < 1.3999999999999999Initial program 41.2%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.5
Applied rewrites43.5%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6443.2
Applied rewrites43.2%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-exp.f6451.2
Applied rewrites51.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sqrt (fma x.im x.im (* x.re x.re))))
(t_2 (* t_0 (pow t_1 y.re))))
(if (<= y.re -1.3e-30)
t_2
(if (<= y.re -2.6e-112)
t_0
(if (<= y.re 55000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) (* y.im (log t_1)))
t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_2 = t_0 * pow(t_1, y_46_re);
double tmp;
if (y_46_re <= -1.3e-30) {
tmp = t_2;
} else if (y_46_re <= -2.6e-112) {
tmp = t_0;
} else if (y_46_re <= 55000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_2 = Float64(t_0 * (t_1 ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.3e-30) tmp = t_2; elseif (y_46_re <= -2.6e-112) tmp = t_0; elseif (y_46_re <= 55000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64(y_46_im * log(t_1))); else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.3e-30], t$95$2, If[LessEqual[y$46$re, -2.6e-112], t$95$0, If[LessEqual[y$46$re, 55000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[(y$46$im * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_2 := t\_0 \cdot {t\_1}^{y.re}\\
\mathbf{if}\;y.re \leq -1.3 \cdot 10^{-30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -2.6 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 55000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.im \cdot \log t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.29999999999999993e-30 or 5.5e7 < y.re Initial program 39.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6465.7
Applied rewrites65.7%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6464.8
Applied rewrites64.8%
if -1.29999999999999993e-30 < y.re < -2.59999999999999992e-112Initial program 43.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6426.6
Applied rewrites26.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6433.3
Applied rewrites33.3%
if -2.59999999999999992e-112 < y.re < 5.5e7Initial program 40.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.9
Applied rewrites43.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6436.5
Applied rewrites36.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6438.7
Applied rewrites38.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(* y.re (atan2 x.im x.re))
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
(if (<= y.re -5e-144)
t_0
(if (<= y.re 0.52)
(* (exp (- (* y.im (atan2 x.im x.re)))) (* y.im (log x.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * atan2(x_46_im, x_46_re)) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -5e-144) {
tmp = t_0;
} else if (y_46_re <= 0.52) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -5e-144) tmp = t_0; elseif (y_46_re <= 0.52) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64(y_46_im * log(x_46_im))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-144], t$95$0, If[LessEqual[y$46$re, 0.52], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-144}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.52:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.im \cdot \log x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.9999999999999998e-144 or 0.52000000000000002 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6458.7
Applied rewrites58.7%
if -4.9999999999999998e-144 < y.re < 0.52000000000000002Initial program 40.8%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6433.0
Applied rewrites33.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-log.f6425.6
Applied rewrites25.6%
Taylor expanded in y.im around 0
lift-log.f64N/A
lift-*.f6425.3
Applied rewrites25.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im -2.2e+31)
(* t_0 (pow (sqrt (* x.im x.im)) y.re))
(if (<= x.im 8.2e-168)
(* t_0 (pow (sqrt (* x.re x.re)) y.re))
(* (exp (- (* y.im (atan2 x.im x.re)))) (* y.im (log x.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -2.2e+31) {
tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
} else if (x_46_im <= 8.2e-168) {
tmp = t_0 * pow(sqrt((x_46_re * x_46_re)), y_46_re);
} else {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im));
}
return tmp;
}
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
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (x_46im <= (-2.2d+31)) then
tmp = t_0 * (sqrt((x_46im * x_46im)) ** y_46re)
else if (x_46im <= 8.2d-168) then
tmp = t_0 * (sqrt((x_46re * x_46re)) ** y_46re)
else
tmp = exp(-(y_46im * atan2(x_46im, x_46re))) * (y_46im * log(x_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -2.2e+31) {
tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
} else if (x_46_im <= 8.2e-168) {
tmp = t_0 * Math.pow(Math.sqrt((x_46_re * x_46_re)), y_46_re);
} else {
tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * (y_46_im * Math.log(x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -2.2e+31: tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re) elif x_46_im <= 8.2e-168: tmp = t_0 * math.pow(math.sqrt((x_46_re * x_46_re)), y_46_re) else: tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * (y_46_im * math.log(x_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -2.2e+31) tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re)); elseif (x_46_im <= 8.2e-168) tmp = Float64(t_0 * (sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re)); else tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64(y_46_im * log(x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -2.2e+31) tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re); elseif (x_46_im <= 8.2e-168) tmp = t_0 * (sqrt((x_46_re * x_46_re)) ^ y_46_re); else tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.2e+31], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 8.2e-168], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{+31}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 8.2 \cdot 10^{-168}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -2.2000000000000001e31Initial program 25.8%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.2
Applied rewrites44.2%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6444.8
Applied rewrites44.8%
Taylor expanded in x.re around 0
pow2N/A
lift-*.f6445.2
Applied rewrites45.2%
if -2.2000000000000001e31 < x.im < 8.1999999999999996e-168Initial program 47.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6442.0
Applied rewrites42.0%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6441.1
Applied rewrites41.1%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6439.9
Applied rewrites39.9%
if 8.1999999999999996e-168 < x.im Initial program 41.2%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6468.2
Applied rewrites68.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-log.f6438.8
Applied rewrites38.8%
Taylor expanded in y.im around 0
lift-log.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im -4.9e-94)
(* t_0 (pow (sqrt (* x.im x.im)) y.re))
(if (<= x.im 4.6e-169)
(* t_0 (pow (* -1.0 x.re) y.re))
(* (exp (- (* y.im (atan2 x.im x.re)))) (* y.im (log x.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4.9e-94) {
tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
} else if (x_46_im <= 4.6e-169) {
tmp = t_0 * pow((-1.0 * x_46_re), y_46_re);
} else {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im));
}
return tmp;
}
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
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (x_46im <= (-4.9d-94)) then
tmp = t_0 * (sqrt((x_46im * x_46im)) ** y_46re)
else if (x_46im <= 4.6d-169) then
tmp = t_0 * (((-1.0d0) * x_46re) ** y_46re)
else
tmp = exp(-(y_46im * atan2(x_46im, x_46re))) * (y_46im * log(x_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4.9e-94) {
tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
} else if (x_46_im <= 4.6e-169) {
tmp = t_0 * Math.pow((-1.0 * x_46_re), y_46_re);
} else {
tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * (y_46_im * Math.log(x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -4.9e-94: tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re) elif x_46_im <= 4.6e-169: tmp = t_0 * math.pow((-1.0 * x_46_re), y_46_re) else: tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * (y_46_im * math.log(x_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -4.9e-94) tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re)); elseif (x_46_im <= 4.6e-169) tmp = Float64(t_0 * (Float64(-1.0 * x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64(y_46_im * log(x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -4.9e-94) tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re); elseif (x_46_im <= 4.6e-169) tmp = t_0 * ((-1.0 * x_46_re) ^ y_46_re); else tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -4.9e-94], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.6e-169], N[(t$95$0 * N[Power[N[(-1.0 * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -4.9 \cdot 10^{-94}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 4.6 \cdot 10^{-169}:\\
\;\;\;\;t\_0 \cdot {\left(-1 \cdot x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -4.89999999999999987e-94Initial program 35.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.2
Applied rewrites44.2%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6444.2
Applied rewrites44.2%
Taylor expanded in x.re around 0
pow2N/A
lift-*.f6441.3
Applied rewrites41.3%
if -4.89999999999999987e-94 < x.im < 4.6000000000000002e-169Initial program 44.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6441.1
Applied rewrites41.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6440.4
Applied rewrites40.4%
Taylor expanded in x.re around -inf
lower-*.f6436.8
Applied rewrites36.8%
if 4.6000000000000002e-169 < x.im Initial program 41.2%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6468.2
Applied rewrites68.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-log.f6438.8
Applied rewrites38.8%
Taylor expanded in y.im around 0
lift-log.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (* y.re (atan2 x.im x.re)) (pow x.re y.re))))
(if (<= y.re -2.15e-51)
t_0
(if (<= y.re 0.0285)
(* (exp (- (* y.im (atan2 x.im x.re)))) (* y.im (log x.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * atan2(x_46_im, x_46_re)) * pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -2.15e-51) {
tmp = t_0;
} else if (y_46_re <= 0.0285) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
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
real(8) :: tmp
t_0 = (y_46re * atan2(x_46im, x_46re)) * (x_46re ** y_46re)
if (y_46re <= (-2.15d-51)) then
tmp = t_0
else if (y_46re <= 0.0285d0) then
tmp = exp(-(y_46im * atan2(x_46im, x_46re))) * (y_46im * log(x_46im))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -2.15e-51) {
tmp = t_0;
} else if (y_46_re <= 0.0285) {
tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * (y_46_im * Math.log(x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * math.atan2(x_46_im, x_46_re)) * math.pow(x_46_re, y_46_re) tmp = 0 if y_46_re <= -2.15e-51: tmp = t_0 elif y_46_re <= 0.0285: tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * (y_46_im * math.log(x_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (x_46_re ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.15e-51) tmp = t_0; elseif (y_46_re <= 0.0285) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64(y_46_im * log(x_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * atan2(x_46_im, x_46_re)) * (x_46_re ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.15e-51) tmp = t_0; elseif (y_46_re <= 0.0285) tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * (y_46_im * log(x_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.15e-51], t$95$0, If[LessEqual[y$46$re, 0.0285], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{if}\;y.re \leq -2.15 \cdot 10^{-51}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.0285:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.im \cdot \log x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.1499999999999999e-51 or 0.028500000000000001 < y.re Initial program 39.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6464.6
Applied rewrites64.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x.im around 0
lower-pow.f6448.5
Applied rewrites48.5%
if -2.1499999999999999e-51 < y.re < 0.028500000000000001Initial program 41.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6433.6
Applied rewrites33.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-log.f6425.2
Applied rewrites25.2%
Taylor expanded in y.im around 0
lift-log.f64N/A
lift-*.f6424.9
Applied rewrites24.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -5.5e-49)
(* t_0 (pow (* -1.0 x.re) y.re))
(if (<= x.re 1.6e-135)
(* t_0 (pow x.im y.re))
(*
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)
(* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -5.5e-49) {
tmp = t_0 * pow((-1.0 * x_46_re), y_46_re);
} else if (x_46_re <= 1.6e-135) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * (y_46_im * log(x_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -5.5e-49) tmp = Float64(t_0 * (Float64(-1.0 * x_46_re) ^ y_46_re)); elseif (x_46_re <= 1.6e-135) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * Float64(y_46_im * log(x_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5.5e-49], N[(t$95$0 * N[Power[N[(-1.0 * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.6e-135], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -5.5 \cdot 10^{-49}:\\
\;\;\;\;t\_0 \cdot {\left(-1 \cdot x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.6 \cdot 10^{-135}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -5.50000000000000031e-49Initial program 32.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.6
Applied rewrites43.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6442.8
Applied rewrites42.8%
Taylor expanded in x.re around -inf
lower-*.f6442.3
Applied rewrites42.3%
if -5.50000000000000031e-49 < x.re < 1.6e-135Initial program 47.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6446.1
Applied rewrites46.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6445.8
Applied rewrites45.8%
Taylor expanded in x.re around 0
Applied rewrites40.0%
if 1.6e-135 < x.re Initial program 39.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6445.1
Applied rewrites45.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6442.1
Applied rewrites42.1%
Taylor expanded in x.re around inf
Applied rewrites54.2%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f6446.8
Applied rewrites46.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -3.7e+109)
(* t_0 (pow x.re y.re))
(if (<= x.re 1.6e-135)
(* t_0 (pow x.im y.re))
(*
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)
(* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -3.7e+109) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else if (x_46_re <= 1.6e-135) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * (y_46_im * log(x_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -3.7e+109) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); elseif (x_46_re <= 1.6e-135) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * Float64(y_46_im * log(x_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -3.7e+109], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.6e-135], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -3.7 \cdot 10^{+109}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.6 \cdot 10^{-135}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -3.7000000000000002e109Initial program 13.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.3
Applied rewrites43.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6442.3
Applied rewrites42.3%
Taylor expanded in x.im around 0
lower-pow.f6431.0
Applied rewrites31.0%
if -3.7000000000000002e109 < x.re < 1.6e-135Initial program 50.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6445.5
Applied rewrites45.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6445.1
Applied rewrites45.1%
Taylor expanded in x.re around 0
Applied rewrites36.8%
if 1.6e-135 < x.re Initial program 39.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6445.1
Applied rewrites45.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6442.1
Applied rewrites42.1%
Taylor expanded in x.re around inf
Applied rewrites54.2%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f6446.8
Applied rewrites46.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* t_0 (pow x.re y.re)))) (if (<= y.re -2.65e-17) t_1 (if (<= y.re 1.6) t_0 t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = t_0 * pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -2.65e-17) {
tmp = t_1;
} else if (y_46_re <= 1.6) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = t_0 * (x_46re ** y_46re)
if (y_46re <= (-2.65d-17)) then
tmp = t_1
else if (y_46re <= 1.6d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = t_0 * Math.pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -2.65e-17) {
tmp = t_1;
} else if (y_46_re <= 1.6) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = t_0 * math.pow(x_46_re, y_46_re) tmp = 0 if y_46_re <= -2.65e-17: tmp = t_1 elif y_46_re <= 1.6: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(t_0 * (x_46_re ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.65e-17) tmp = t_1; elseif (y_46_re <= 1.6) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = t_0 * (x_46_re ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.65e-17) tmp = t_1; elseif (y_46_re <= 1.6) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.65e-17], t$95$1, If[LessEqual[y$46$re, 1.6], t$95$0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t\_0 \cdot {x.re}^{y.re}\\
\mathbf{if}\;y.re \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.6:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.6499999999999999e-17 or 1.6000000000000001 < y.re Initial program 39.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6466.5
Applied rewrites66.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6465.4
Applied rewrites65.4%
Taylor expanded in x.im around 0
lower-pow.f6450.2
Applied rewrites50.2%
if -2.6499999999999999e-17 < y.re < 1.6000000000000001Initial program 40.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6419.1
Applied rewrites19.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6421.3
Applied rewrites21.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 5.2e-284) (* y.re (atan2 x.im x.re)) (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) (* y.im (log x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 5.2e-284) {
tmp = y_46_re * atan2(x_46_im, x_46_re);
} else {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * (y_46_im * log(x_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 5.2e-284) tmp = Float64(y_46_re * atan(x_46_im, x_46_re)); else tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * Float64(y_46_im * log(x_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 5.2e-284], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 5.2 \cdot 10^{-284}:\\
\;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 5.2e-284Initial program 40.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.6
Applied rewrites44.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6412.9
Applied rewrites12.9%
if 5.2e-284 < x.re Initial program 40.4%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6443.1
Applied rewrites43.1%
Taylor expanded in x.re around inf
Applied rewrites53.0%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f6444.8
Applied rewrites44.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_46_re);
}
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 = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 40.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.8
Applied rewrites43.8%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6413.2
Applied rewrites13.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.im (log x.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_im * log(x_46_im);
}
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 = y_46im * log(x_46im)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_im * Math.log(x_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_im * math.log(x_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_im * log(x_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_im * log(x_46_im); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.im \cdot \log x.im
\end{array}
Initial program 40.2%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6431.8
Applied rewrites31.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-log.f6418.3
Applied rewrites18.3%
Taylor expanded in y.im around 0
lift-log.f64N/A
lift-*.f644.7
Applied rewrites4.7%
herbie shell --seed 2025112
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))