
(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 17 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 (* (atan2 x.im x.re) y.im))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) t_0)))
(t_3 (* y.im (log (sqrt (fma x.im x.im (* x.re x.re))))))
(t_4 (* (atan2 x.im x.re) y.re))
(t_5 (log (hypot x.re x.im))))
(if (<= (* t_2 (sin (+ (* t_1 y.im) t_4))) INFINITY)
(* t_2 (+ (sin t_3) (* y.re (* (cos t_3) (atan2 x.im x.re)))))
(* (exp (- (* t_5 y.re) t_0)) (sin (+ (* t_5 y.im) t_4))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - t_0));
double t_3 = y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))));
double t_4 = atan2(x_46_im, x_46_re) * y_46_re;
double t_5 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((t_2 * sin(((t_1 * y_46_im) + t_4))) <= ((double) INFINITY)) {
tmp = t_2 * (sin(t_3) + (y_46_re * (cos(t_3) * atan2(x_46_im, x_46_re))));
} else {
tmp = exp(((t_5 * y_46_re) - t_0)) * sin(((t_5 * y_46_im) + t_4));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - t_0)) t_3 = Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))) t_4 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_5 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (Float64(t_2 * sin(Float64(Float64(t_1 * y_46_im) + t_4))) <= Inf) tmp = Float64(t_2 * Float64(sin(t_3) + Float64(y_46_re * Float64(cos(t_3) * atan(x_46_im, x_46_re))))); else tmp = Float64(exp(Float64(Float64(t_5 * y_46_re) - t_0)) * sin(Float64(Float64(t_5 * y_46_im) + t_4))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$5 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * N[(N[Sin[t$95$3], $MachinePrecision] + N[(y$46$re * N[(N[Cos[t$95$3], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(t$95$5 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$5 * y$46$im), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - t\_0}\\
t_3 := y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\\
t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_5 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;t\_2 \cdot \sin \left(t\_1 \cdot y.im + t\_4\right) \leq \infty:\\
\;\;\;\;t\_2 \cdot \left(\sin t\_3 + y.re \cdot \left(\cos t\_3 \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{t\_5 \cdot y.re - t\_0} \cdot \sin \left(t\_5 \cdot y.im + t\_4\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 80.7%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
Applied rewrites80.1%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f640.0
Applied rewrites0.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6479.3
Applied rewrites79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= y.im 4e+46)
(* t_1 (sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))
(* t_1 (* y.re (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= 4e+46) {
tmp = t_1 * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = t_1 * (y_46_re * atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.hypot(x_46_re, x_46_im));
double t_1 = Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_im <= 4e+46) {
tmp = t_1 * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = t_1 * (y_46_re * Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_re, x_46_im)) t_1 = math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if y_46_im <= 4e+46: tmp = t_1 * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re))) else: tmp = t_1 * (y_46_re * math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_im <= 4e+46) tmp = Float64(t_1 * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = Float64(t_1 * Float64(y_46_re * atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)); t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (y_46_im <= 4e+46) tmp = t_1 * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); else tmp = t_1 * (y_46_re * atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[y$46$im, 4e+46], N[(t$95$1 * 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], N[(t$95$1 * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq 4 \cdot 10^{+46}:\\
\;\;\;\;t\_1 \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.im < 4e46Initial program 41.1%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6441.1
Applied rewrites41.1%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6482.7
Applied rewrites82.7%
if 4e46 < y.im Initial program 36.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6436.0
Applied rewrites36.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6469.6
Applied rewrites69.6%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6468.4
Applied rewrites68.4%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6468.2
Applied rewrites68.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re -5e-14)
(* t_2 t_0)
(if (<= y.re 1.6e-16)
(*
(exp (- (* y.im (atan2 x.im x.re))))
(sin (+ (* t_1 y.im) (* (atan2 x.im x.re) y.re))))
(* t_2 (sin 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);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_2 * t_0;
} else if (y_46_re <= 1.6e-16) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin(((t_1 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = t_2 * sin(t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(Math.hypot(x_46_re, x_46_im));
double t_2 = Math.exp(((t_1 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_2 * t_0;
} else if (y_46_re <= 1.6e-16) {
tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin(((t_1 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = t_2 * Math.sin(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) t_1 = math.log(math.hypot(x_46_re, x_46_im)) t_2 = math.exp(((t_1 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if y_46_re <= -5e-14: tmp = t_2 * t_0 elif y_46_re <= 1.6e-16: tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin(((t_1 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re))) else: tmp = t_2 * math.sin(t_0) 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 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64(t_2 * t_0); elseif (y_46_re <= 1.6e-16) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(Float64(t_1 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = Float64(t_2 * sin(t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = log(hypot(x_46_re, x_46_im)); t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (y_46_re <= -5e-14) tmp = t_2 * t_0; elseif (y_46_re <= 1.6e-16) tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin(((t_1 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); else tmp = t_2 * sin(t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * 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, -5e-14], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-16], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-16}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(t\_1 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 41.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6441.0
Applied rewrites41.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6484.9
Applied rewrites84.9%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6483.6
Applied rewrites83.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6484.4
Applied rewrites84.4%
if -5.0000000000000002e-14 < y.re < 1.60000000000000011e-16Initial program 41.2%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6441.2
Applied rewrites41.2%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6483.0
Applied rewrites83.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6482.9
Applied rewrites82.9%
if 1.60000000000000011e-16 < y.re Initial program 36.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6436.9
Applied rewrites36.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6469.5
Applied rewrites69.5%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6466.4
Applied rewrites66.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (sin (+ (* t_1 y.im) (* (atan2 x.im x.re) y.re))))
(t_3 (exp (- (* t_1 y.re) t_0)))
(t_4 (* t_3 t_2))
(t_5 (sqrt (fma x.im x.im (* x.re x.re)))))
(if (<= t_4 0.0)
(* t_3 (sin (* y.im (log t_5))))
(if (<= t_4 0.4)
(* (pow t_5 y.re) t_2)
(*
(exp (- (* (log (hypot x.re x.im)) y.re) t_0))
(* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = sin(((t_1 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
double t_3 = exp(((t_1 * y_46_re) - t_0));
double t_4 = t_3 * t_2;
double t_5 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double tmp;
if (t_4 <= 0.0) {
tmp = t_3 * sin((y_46_im * log(t_5)));
} else if (t_4 <= 0.4) {
tmp = pow(t_5, y_46_re) * t_2;
} else {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * (y_46_re * atan2(x_46_im, x_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = sin(Float64(Float64(t_1 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))) t_3 = exp(Float64(Float64(t_1 * y_46_re) - t_0)) t_4 = Float64(t_3 * t_2) t_5 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(t_3 * sin(Float64(y_46_im * log(t_5)))); elseif (t_4 <= 0.4) tmp = Float64((t_5 ^ y_46_re) * t_2); else tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Float64(y_46_re * atan(x_46_im, x_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[t$95$5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.4], N[(N[Power[t$95$5, y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := \sin \left(t\_1 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_3 := e^{t\_1 \cdot y.re - t\_0}\\
t_4 := t\_3 \cdot t\_2\\
t_5 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log t\_5\right)\\
\mathbf{elif}\;t\_4 \leq 0.4:\\
\;\;\;\;{t\_5}^{y.re} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t\_0} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.0Initial program 85.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6478.1
Applied rewrites78.1%
if -0.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 0.40000000000000002Initial program 96.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6495.5
Applied rewrites95.5%
if 0.40000000000000002 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 8.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f648.0
Applied rewrites8.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6474.9
Applied rewrites74.9%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6459.8
Applied rewrites59.8%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6458.5
Applied rewrites58.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (* (exp (- (* t_2 y.re) t_0)) (sin (+ (* t_2 y.im) t_1))))
(t_4 (log (hypot x.re x.im)))
(t_5 (* (exp (- (* t_4 y.re) t_0)) (* y.re (atan2 x.im x.re))))
(t_6 (* 1.0 (sin (+ (* t_4 y.im) t_1)))))
(if (<= t_3 (- INFINITY))
(*
(*
y.re
(fma
-0.16666666666666666
(* (* y.re y.re) (pow (atan2 x.im x.re) 3.0))
(atan2 x.im x.re)))
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(if (<= t_3 -5e-212)
t_6
(if (<= t_3 0.0) t_5 (if (<= t_3 4e-14) t_6 t_5))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - t_0)) * sin(((t_2 * y_46_im) + t_1));
double t_4 = log(hypot(x_46_re, x_46_im));
double t_5 = exp(((t_4 * y_46_re) - t_0)) * (y_46_re * atan2(x_46_im, x_46_re));
double t_6 = 1.0 * sin(((t_4 * y_46_im) + t_1));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (y_46_re * fma(-0.16666666666666666, ((y_46_re * y_46_re) * pow(atan2(x_46_im, x_46_re), 3.0)), 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);
} else if (t_3 <= -5e-212) {
tmp = t_6;
} else if (t_3 <= 0.0) {
tmp = t_5;
} else if (t_3 <= 4e-14) {
tmp = t_6;
} else {
tmp = t_5;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * sin(Float64(Float64(t_2 * y_46_im) + t_1))) t_4 = log(hypot(x_46_re, x_46_im)) t_5 = Float64(exp(Float64(Float64(t_4 * y_46_re) - t_0)) * Float64(y_46_re * atan(x_46_im, x_46_re))) t_6 = Float64(1.0 * sin(Float64(Float64(t_4 * y_46_im) + t_1))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(y_46_re * fma(-0.16666666666666666, Float64(Float64(y_46_re * y_46_re) * (atan(x_46_im, x_46_re) ^ 3.0)), 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)); elseif (t_3 <= -5e-212) tmp = t_6; elseif (t_3 <= 0.0) tmp = t_5; elseif (t_3 <= 4e-14) tmp = t_6; else tmp = t_5; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Exp[N[(N[(t$95$4 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(1.0 * N[Sin[N[(N[(t$95$4 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(y$46$re * N[(-0.16666666666666666 * N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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[t$95$3, -5e-212], t$95$6, If[LessEqual[t$95$3, 0.0], t$95$5, If[LessEqual[t$95$3, 4e-14], t$95$6, t$95$5]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - t\_0} \cdot \sin \left(t\_2 \cdot y.im + t\_1\right)\\
t_4 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_5 := e^{t\_4 \cdot y.re - t\_0} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_6 := 1 \cdot \sin \left(t\_4 \cdot y.im + t\_1\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-212}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{-14}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -inf.0Initial program 54.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-*.f6433.7
Applied rewrites33.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-atan2.f6428.2
Applied rewrites28.2%
if -inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -5.00000000000000043e-212 or -0.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 4e-14Initial program 94.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6494.4
Applied rewrites94.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6494.5
Applied rewrites94.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6492.3
Applied rewrites92.3%
Taylor expanded in y.im around 0
Applied rewrites91.1%
if -5.00000000000000043e-212 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.0 or 4e-14 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 29.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6429.9
Applied rewrites29.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6480.7
Applied rewrites80.7%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6468.3
Applied rewrites68.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6467.3
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (log (hypot x.re x.im)))
(t_4 (* y.re (atan2 x.im x.re)))
(t_5 (* (exp (- (* t_3 y.re) t_0)) t_4))
(t_6 (* (exp (- (* t_2 y.re) t_0)) (sin (+ (* t_2 y.im) t_1))))
(t_7 (* 1.0 (sin (+ (* t_3 y.im) t_1)))))
(if (<= t_6 (- INFINITY))
(* (sin t_4) (pow (+ x.im (* 0.5 (/ (* x.re x.re) x.im))) y.re))
(if (<= t_6 -5e-212)
t_7
(if (<= t_6 0.0) t_5 (if (<= t_6 4e-14) t_7 t_5))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = log(hypot(x_46_re, x_46_im));
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double t_5 = exp(((t_3 * y_46_re) - t_0)) * t_4;
double t_6 = exp(((t_2 * y_46_re) - t_0)) * sin(((t_2 * y_46_im) + t_1));
double t_7 = 1.0 * sin(((t_3 * y_46_im) + t_1));
double tmp;
if (t_6 <= -((double) INFINITY)) {
tmp = sin(t_4) * pow((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))), y_46_re);
} else if (t_6 <= -5e-212) {
tmp = t_7;
} else if (t_6 <= 0.0) {
tmp = t_5;
} else if (t_6 <= 4e-14) {
tmp = t_7;
} else {
tmp = t_5;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = Math.log(Math.hypot(x_46_re, x_46_im));
double t_4 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_5 = Math.exp(((t_3 * y_46_re) - t_0)) * t_4;
double t_6 = Math.exp(((t_2 * y_46_re) - t_0)) * Math.sin(((t_2 * y_46_im) + t_1));
double t_7 = 1.0 * Math.sin(((t_3 * y_46_im) + t_1));
double tmp;
if (t_6 <= -Double.POSITIVE_INFINITY) {
tmp = Math.sin(t_4) * Math.pow((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))), y_46_re);
} else if (t_6 <= -5e-212) {
tmp = t_7;
} else if (t_6 <= 0.0) {
tmp = t_5;
} else if (t_6 <= 4e-14) {
tmp = t_7;
} else {
tmp = t_5;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.atan2(x_46_im, x_46_re) * y_46_re t_2 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_3 = math.log(math.hypot(x_46_re, x_46_im)) t_4 = y_46_re * math.atan2(x_46_im, x_46_re) t_5 = math.exp(((t_3 * y_46_re) - t_0)) * t_4 t_6 = math.exp(((t_2 * y_46_re) - t_0)) * math.sin(((t_2 * y_46_im) + t_1)) t_7 = 1.0 * math.sin(((t_3 * y_46_im) + t_1)) tmp = 0 if t_6 <= -math.inf: tmp = math.sin(t_4) * math.pow((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))), y_46_re) elif t_6 <= -5e-212: tmp = t_7 elif t_6 <= 0.0: tmp = t_5 elif t_6 <= 4e-14: tmp = t_7 else: tmp = t_5 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = log(hypot(x_46_re, x_46_im)) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_5 = Float64(exp(Float64(Float64(t_3 * y_46_re) - t_0)) * t_4) t_6 = Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * sin(Float64(Float64(t_2 * y_46_im) + t_1))) t_7 = Float64(1.0 * sin(Float64(Float64(t_3 * y_46_im) + t_1))) tmp = 0.0 if (t_6 <= Float64(-Inf)) tmp = Float64(sin(t_4) * (Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))) ^ y_46_re)); elseif (t_6 <= -5e-212) tmp = t_7; elseif (t_6 <= 0.0) tmp = t_5; elseif (t_6 <= 4e-14) tmp = t_7; else tmp = t_5; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = atan2(x_46_im, x_46_re) * y_46_re; t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_3 = log(hypot(x_46_re, x_46_im)); t_4 = y_46_re * atan2(x_46_im, x_46_re); t_5 = exp(((t_3 * y_46_re) - t_0)) * t_4; t_6 = exp(((t_2 * y_46_re) - t_0)) * sin(((t_2 * y_46_im) + t_1)); t_7 = 1.0 * sin(((t_3 * y_46_im) + t_1)); tmp = 0.0; if (t_6 <= -Inf) tmp = sin(t_4) * ((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))) ^ y_46_re); elseif (t_6 <= -5e-212) tmp = t_7; elseif (t_6 <= 0.0) tmp = t_5; elseif (t_6 <= 4e-14) tmp = t_7; else tmp = t_5; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(1.0 * N[Sin[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, (-Infinity)], N[(N[Sin[t$95$4], $MachinePrecision] * N[Power[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, -5e-212], t$95$7, If[LessEqual[t$95$6, 0.0], t$95$5, If[LessEqual[t$95$6, 4e-14], t$95$7, t$95$5]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_5 := e^{t\_3 \cdot y.re - t\_0} \cdot t\_4\\
t_6 := e^{t\_2 \cdot y.re - t\_0} \cdot \sin \left(t\_2 \cdot y.im + t\_1\right)\\
t_7 := 1 \cdot \sin \left(t\_3 \cdot y.im + t\_1\right)\\
\mathbf{if}\;t\_6 \leq -\infty:\\
\;\;\;\;\sin t\_4 \cdot {\left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right)}^{y.re}\\
\mathbf{elif}\;t\_6 \leq -5 \cdot 10^{-212}:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;t\_6 \leq 0:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_6 \leq 4 \cdot 10^{-14}:\\
\;\;\;\;t\_7\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -inf.0Initial program 54.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-*.f6433.7
Applied rewrites33.7%
Taylor expanded in x.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6428.4
Applied rewrites28.4%
if -inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -5.00000000000000043e-212 or -0.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 4e-14Initial program 94.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6494.4
Applied rewrites94.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6494.5
Applied rewrites94.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6492.3
Applied rewrites92.3%
Taylor expanded in y.im around 0
Applied rewrites91.1%
if -5.00000000000000043e-212 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.0 or 4e-14 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 29.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6429.9
Applied rewrites29.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6480.7
Applied rewrites80.7%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6468.3
Applied rewrites68.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6467.3
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (* (exp (- (* t_2 y.re) t_0)) (sin (+ (* t_2 y.im) t_1))))
(t_4 (log (hypot x.re x.im)))
(t_5 (* 1.0 (sin (+ (* t_4 y.im) t_1))))
(t_6 (* y.re (atan2 x.im x.re)))
(t_7 (* (exp (- (* t_4 y.re) t_0)) t_6)))
(if (<= t_3 (- INFINITY))
(*
(* -0.16666666666666666 (pow t_6 3.0))
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(if (<= t_3 -5e-212)
t_5
(if (<= t_3 0.0) t_7 (if (<= t_3 4e-14) t_5 t_7))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - t_0)) * sin(((t_2 * y_46_im) + t_1));
double t_4 = log(hypot(x_46_re, x_46_im));
double t_5 = 1.0 * sin(((t_4 * y_46_im) + t_1));
double t_6 = y_46_re * atan2(x_46_im, x_46_re);
double t_7 = exp(((t_4 * y_46_re) - t_0)) * t_6;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (-0.16666666666666666 * pow(t_6, 3.0)) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
} else if (t_3 <= -5e-212) {
tmp = t_5;
} else if (t_3 <= 0.0) {
tmp = t_7;
} else if (t_3 <= 4e-14) {
tmp = t_5;
} else {
tmp = t_7;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * sin(Float64(Float64(t_2 * y_46_im) + t_1))) t_4 = log(hypot(x_46_re, x_46_im)) t_5 = Float64(1.0 * sin(Float64(Float64(t_4 * y_46_im) + t_1))) t_6 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_7 = Float64(exp(Float64(Float64(t_4 * y_46_re) - t_0)) * t_6) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(-0.16666666666666666 * (t_6 ^ 3.0)) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); elseif (t_3 <= -5e-212) tmp = t_5; elseif (t_3 <= 0.0) tmp = t_7; elseif (t_3 <= 4e-14) tmp = t_5; else tmp = t_7; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(1.0 * N[Sin[N[(N[(t$95$4 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[Exp[N[(N[(t$95$4 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$6), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(-0.16666666666666666 * N[Power[t$95$6, 3.0], $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[t$95$3, -5e-212], t$95$5, If[LessEqual[t$95$3, 0.0], t$95$7, If[LessEqual[t$95$3, 4e-14], t$95$5, t$95$7]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - t\_0} \cdot \sin \left(t\_2 \cdot y.im + t\_1\right)\\
t_4 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_5 := 1 \cdot \sin \left(t\_4 \cdot y.im + t\_1\right)\\
t_6 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_7 := e^{t\_4 \cdot y.re - t\_0} \cdot t\_6\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left(-0.16666666666666666 \cdot {t\_6}^{3}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-212}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{-14}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_7\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -inf.0Initial program 54.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-*.f6433.7
Applied rewrites33.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-atan2.f6428.2
Applied rewrites28.2%
Taylor expanded in y.re around inf
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6426.7
Applied rewrites26.7%
if -inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -5.00000000000000043e-212 or -0.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 4e-14Initial program 94.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6494.4
Applied rewrites94.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6494.5
Applied rewrites94.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6492.3
Applied rewrites92.3%
Taylor expanded in y.im around 0
Applied rewrites91.1%
if -5.00000000000000043e-212 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.0 or 4e-14 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 29.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6429.9
Applied rewrites29.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6480.7
Applied rewrites80.7%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6468.3
Applied rewrites68.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6467.3
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1
(*
(exp (- (* (log (hypot x.re x.im)) y.re) t_0))
(* y.re (atan2 x.im x.re))))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (sin (+ (* t_2 y.im) (* (atan2 x.im x.re) y.re))))
(t_4 (* (exp (- (* t_2 y.re) t_0)) t_3))
(t_5 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_3)))
(if (<= t_4 -5e-212) t_5 (if (<= t_4 0.0) t_1 (if (<= t_4 0.4) t_5 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * (y_46_re * atan2(x_46_im, x_46_re));
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = sin(((t_2 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
double t_4 = exp(((t_2 * y_46_re) - t_0)) * t_3;
double t_5 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_3;
double tmp;
if (t_4 <= -5e-212) {
tmp = t_5;
} else if (t_4 <= 0.0) {
tmp = t_1;
} else if (t_4 <= 0.4) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = sin(Float64(Float64(t_2 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))) t_4 = Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * t_3) t_5 = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_3) tmp = 0.0 if (t_4 <= -5e-212) tmp = t_5; elseif (t_4 <= 0.0) tmp = t_1; elseif (t_4 <= 0.4) tmp = t_5; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = 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] * t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, -5e-212], t$95$5, If[LessEqual[t$95$4, 0.0], t$95$1, If[LessEqual[t$95$4, 0.4], t$95$5, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t\_0} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := \sin \left(t\_2 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_4 := e^{t\_2 \cdot y.re - t\_0} \cdot t\_3\\
t_5 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_3\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{-212}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 0.4:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -5.00000000000000043e-212 or -0.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 0.40000000000000002Initial program 77.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6468.3
Applied rewrites68.3%
if -5.00000000000000043e-212 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.0 or 0.40000000000000002 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 29.5%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6429.5
Applied rewrites29.5%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6480.8
Applied rewrites80.8%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6468.6
Applied rewrites68.6%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6467.6
Applied rewrites67.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(t_2 (* t_0 t_1)))
(if (<= y.re -1.2e+17)
t_2
(if (<= y.re 0.032)
(* (exp (* -1.0 (* y.im (atan2 x.im x.re)))) t_0)
(if (<= y.re 1.95e+180)
(* (* -0.16666666666666666 (pow t_0 3.0)) 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 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double t_2 = t_0 * t_1;
double tmp;
if (y_46_re <= -1.2e+17) {
tmp = t_2;
} else if (y_46_re <= 0.032) {
tmp = exp((-1.0 * (y_46_im * atan2(x_46_im, x_46_re)))) * t_0;
} else if (y_46_re <= 1.95e+180) {
tmp = (-0.16666666666666666 * pow(t_0, 3.0)) * 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))) ^ y_46_re t_2 = Float64(t_0 * t_1) tmp = 0.0 if (y_46_re <= -1.2e+17) tmp = t_2; elseif (y_46_re <= 0.032) tmp = Float64(exp(Float64(-1.0 * Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); elseif (y_46_re <= 1.95e+180) tmp = Float64(Float64(-0.16666666666666666 * (t_0 ^ 3.0)) * 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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -1.2e+17], t$95$2, If[LessEqual[y$46$re, 0.032], N[(N[Exp[N[(-1.0 * N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.95e+180], N[(N[(-0.16666666666666666 * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
t_2 := t\_0 \cdot t\_1\\
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 0.032:\\
\;\;\;\;e^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{+180}:\\
\;\;\;\;\left(-0.16666666666666666 \cdot {t\_0}^{3}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.2e17 or 1.95e180 < y.re Initial program 38.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-*.f6472.1
Applied rewrites72.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6473.9
Applied rewrites73.9%
if -1.2e17 < y.re < 0.032000000000000001Initial program 41.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6441.4
Applied rewrites41.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6483.1
Applied rewrites83.1%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6452.0
Applied rewrites52.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-atan2.f64N/A
lift-*.f6450.0
Applied rewrites50.0%
if 0.032000000000000001 < y.re < 1.95e180Initial program 38.7%
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-*.f6455.9
Applied rewrites55.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-atan2.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around inf
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6443.4
Applied rewrites43.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im))) (* 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 exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * (y_46_re * atan2(x_46_im, x_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * (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 math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * (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(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * 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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * (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[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
\end{array}
Initial program 40.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6440.0
Applied rewrites40.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6480.0
Applied rewrites80.0%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6463.3
Applied rewrites63.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6462.5
Applied rewrites62.5%
(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 -1.2e+17)
t_1
(if (<= y.re 4.0)
(* (exp (* -1.0 (* 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 <= -1.2e+17) {
tmp = t_1;
} else if (y_46_re <= 4.0) {
tmp = exp((-1.0 * (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 <= -1.2e+17) tmp = t_1; elseif (y_46_re <= 4.0) tmp = Float64(exp(Float64(-1.0 * 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, -1.2e+17], t$95$1, If[LessEqual[y$46$re, 4.0], N[(N[Exp[N[(-1.0 * N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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 -1.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4:\\
\;\;\;\;e^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.2e17 or 4 < y.re Initial program 38.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-*.f6467.3
Applied rewrites67.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6466.5
Applied rewrites66.5%
if -1.2e17 < y.re < 4Initial program 41.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6441.4
Applied rewrites41.4%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lower-hypot.f6483.2
Applied rewrites83.2%
Taylor expanded in y.im around 0
lift-atan2.f64N/A
lift-*.f64N/A
lift-sin.f6452.7
Applied rewrites52.7%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6452.0
Applied rewrites52.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-atan2.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
(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 5.1e-174) t_1 (if (<= y.re 4e-16) 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 <= 5.1e-174) {
tmp = t_1;
} else if (y_46_re <= 4e-16) {
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 * (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 <= 5.1e-174) tmp = t_1; elseif (y_46_re <= 4e-16) tmp = 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, 5.1e-174], t$95$1, If[LessEqual[y$46$re, 4e-16], 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 {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq 5.1 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < 5.10000000000000032e-174 or 3.9999999999999999e-16 < y.re Initial program 40.1%
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-*.f6447.2
Applied rewrites47.2%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
if 5.10000000000000032e-174 < y.re < 3.9999999999999999e-16Initial 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-*.f6419.8
Applied rewrites19.8%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6429.6
Applied rewrites29.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -4.4e-10)
(* t_0 (pow (* -1.0 x.re) y.re))
(if (<= x.re 1.56e-196)
(* t_0 (pow x.im y.re))
(* t_0 (pow 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 (x_46_re <= -4.4e-10) {
tmp = t_0 * pow((-1.0 * x_46_re), y_46_re);
} else if (x_46_re <= 1.56e-196) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
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_46re <= (-4.4d-10)) then
tmp = t_0 * (((-1.0d0) * x_46re) ** y_46re)
else if (x_46re <= 1.56d-196) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -4.4e-10) {
tmp = t_0 * Math.pow((-1.0 * x_46_re), y_46_re);
} else if (x_46_re <= 1.56e-196) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
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_re <= -4.4e-10: tmp = t_0 * math.pow((-1.0 * x_46_re), y_46_re) elif x_46_re <= 1.56e-196: tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * math.pow(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 (x_46_re <= -4.4e-10) tmp = Float64(t_0 * (Float64(-1.0 * x_46_re) ^ y_46_re)); elseif (x_46_re <= 1.56e-196) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); 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_re <= -4.4e-10) tmp = t_0 * ((-1.0 * x_46_re) ^ y_46_re); elseif (x_46_re <= 1.56e-196) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * (x_46_re ^ y_46_re); 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$re, -4.4e-10], N[(t$95$0 * N[Power[N[(-1.0 * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.56e-196], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, 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}\;x.re \leq -4.4 \cdot 10^{-10}:\\
\;\;\;\;t\_0 \cdot {\left(-1 \cdot x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.56 \cdot 10^{-196}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -4.3999999999999998e-10Initial program 28.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-*.f6443.4
Applied rewrites43.4%
Taylor expanded in x.re around -inf
lift-*.f6445.5
Applied rewrites45.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6444.5
Applied rewrites44.5%
if -4.3999999999999998e-10 < x.re < 1.56e-196Initial program 49.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-*.f6445.2
Applied rewrites45.2%
Taylor expanded in x.re around -inf
lift-*.f6428.8
Applied rewrites28.8%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6429.5
Applied rewrites29.5%
Taylor expanded in x.re around 0
Applied rewrites39.7%
if 1.56e-196 < x.re Initial program 39.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-*.f6442.0
Applied rewrites42.0%
Taylor expanded in x.re around -inf
lift-*.f6426.3
Applied rewrites26.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6425.9
Applied rewrites25.9%
Taylor expanded in x.im around 0
lower-pow.f6436.1
Applied rewrites36.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im -5.6e-14)
(* t_0 (pow (* -1.0 x.im) y.re))
(if (<= x.im -2.6e-299)
(* t_0 (pow x.re y.re))
(* t_0 (pow x.im 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 (x_46_im <= -5.6e-14) {
tmp = t_0 * pow((-1.0 * x_46_im), y_46_re);
} else if (x_46_im <= -2.6e-299) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
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 <= (-5.6d-14)) then
tmp = t_0 * (((-1.0d0) * x_46im) ** y_46re)
else if (x_46im <= (-2.6d-299)) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -5.6e-14) {
tmp = t_0 * Math.pow((-1.0 * x_46_im), y_46_re);
} else if (x_46_im <= -2.6e-299) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
}
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 <= -5.6e-14: tmp = t_0 * math.pow((-1.0 * x_46_im), y_46_re) elif x_46_im <= -2.6e-299: tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, 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 (x_46_im <= -5.6e-14) tmp = Float64(t_0 * (Float64(-1.0 * x_46_im) ^ y_46_re)); elseif (x_46_im <= -2.6e-299) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_0 * (x_46_im ^ y_46_re)); 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 <= -5.6e-14) tmp = t_0 * ((-1.0 * x_46_im) ^ y_46_re); elseif (x_46_im <= -2.6e-299) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ y_46_re); 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, -5.6e-14], N[(t$95$0 * N[Power[N[(-1.0 * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -2.6e-299], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, 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}\;x.im \leq -5.6 \cdot 10^{-14}:\\
\;\;\;\;t\_0 \cdot {\left(-1 \cdot x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq -2.6 \cdot 10^{-299}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -5.6000000000000001e-14Initial program 31.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-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x.re around -inf
lift-*.f6426.1
Applied rewrites26.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6425.3
Applied rewrites25.3%
Taylor expanded in x.im around -inf
lower-*.f6444.0
Applied rewrites44.0%
if -5.6000000000000001e-14 < x.im < -2.5999999999999999e-299Initial program 48.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-*.f6440.6
Applied rewrites40.6%
Taylor expanded in x.re around -inf
lift-*.f6437.2
Applied rewrites37.2%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6437.9
Applied rewrites37.9%
Taylor expanded in x.im around 0
lower-pow.f6436.1
Applied rewrites36.1%
if -2.5999999999999999e-299 < x.im 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-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.3
Applied rewrites43.3%
Taylor expanded in x.re around -inf
lift-*.f6432.8
Applied rewrites32.8%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6432.5
Applied rewrites32.5%
Taylor expanded in x.re around 0
Applied rewrites37.4%
(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.im y.re))))
(if (<= x.im -30500000.0)
t_1
(if (<= x.im -2.6e-299) (* t_0 (pow x.re y.re)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = t_0 * pow(x_46_im, y_46_re);
double tmp;
if (x_46_im <= -30500000.0) {
tmp = t_1;
} else if (x_46_im <= -2.6e-299) {
tmp = t_0 * pow(x_46_re, y_46_re);
} 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_46im ** y_46re)
if (x_46im <= (-30500000.0d0)) then
tmp = t_1
else if (x_46im <= (-2.6d-299)) then
tmp = t_0 * (x_46re ** y_46re)
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_im, y_46_re);
double tmp;
if (x_46_im <= -30500000.0) {
tmp = t_1;
} else if (x_46_im <= -2.6e-299) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} 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_im, y_46_re) tmp = 0 if x_46_im <= -30500000.0: tmp = t_1 elif x_46_im <= -2.6e-299: tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(t_0 * (x_46_im ^ y_46_re)) tmp = 0.0 if (x_46_im <= -30500000.0) tmp = t_1; elseif (x_46_im <= -2.6e-299) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); 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_im ^ y_46_re); tmp = 0.0; if (x_46_im <= -30500000.0) tmp = t_1; elseif (x_46_im <= -2.6e-299) tmp = t_0 * (x_46_re ^ y_46_re); 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$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -30500000.0], t$95$1, If[LessEqual[x$46$im, -2.6e-299], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $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 {x.im}^{y.re}\\
\mathbf{if}\;x.im \leq -30500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.im \leq -2.6 \cdot 10^{-299}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.im < -3.05e7 or -2.5999999999999999e-299 < x.im Initial program 37.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.2
Applied rewrites44.2%
Taylor expanded in x.re around -inf
lift-*.f6430.4
Applied rewrites30.4%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6429.9
Applied rewrites29.9%
Taylor expanded in x.re around 0
Applied rewrites35.2%
if -3.05e7 < x.im < -2.5999999999999999e-299Initial program 49.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-*.f6441.2
Applied rewrites41.2%
Taylor expanded in x.re around -inf
lift-*.f6437.1
Applied rewrites37.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6437.5
Applied rewrites37.5%
Taylor expanded in x.im around 0
lower-pow.f6435.8
Applied rewrites35.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 -2100000000000.0) t_1 (if (<= y.re 900.0) 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 <= -2100000000000.0) {
tmp = t_1;
} else if (y_46_re <= 900.0) {
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 <= (-2100000000000.0d0)) then
tmp = t_1
else if (y_46re <= 900.0d0) 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 <= -2100000000000.0) {
tmp = t_1;
} else if (y_46_re <= 900.0) {
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 <= -2100000000000.0: tmp = t_1 elif y_46_re <= 900.0: 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 <= -2100000000000.0) tmp = t_1; elseif (y_46_re <= 900.0) 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 <= -2100000000000.0) tmp = t_1; elseif (y_46_re <= 900.0) 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, -2100000000000.0], t$95$1, If[LessEqual[y$46$re, 900.0], 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 -2100000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 900:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.1e12 or 900 < y.re Initial program 38.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-*.f6467.4
Applied rewrites67.4%
Taylor expanded in x.re around -inf
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6452.3
Applied rewrites52.3%
Taylor expanded in x.im around 0
lower-pow.f6452.5
Applied rewrites52.5%
if -2.1e12 < y.re < 900Initial 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-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6421.3
Applied rewrites21.3%
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 (* 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.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.4
Applied rewrites43.4%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6413.5
Applied rewrites13.5%
herbie shell --seed 2025117
(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)))))