
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 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 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -1.06e-234)
(* (exp (- (* (- y.re) t_2) t_0)) (sin (fma -1.0 (* y.im t_2) t_1)))
(if (<= x.im 9.2e-299)
(* (pow x.re y.re) (sin (* y.im (log x.re))))
(*
(exp (- (* y.re (log x.im)) t_0))
(sin (fma y.im (log x.im) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.06e-234) {
tmp = exp(((-y_46_re * t_2) - t_0)) * sin(fma(-1.0, (y_46_im * t_2), t_1));
} else if (x_46_im <= 9.2e-299) {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.06e-234) tmp = Float64(exp(Float64(Float64(Float64(-y_46_re) * t_2) - t_0)) * sin(fma(-1.0, Float64(y_46_im * t_2), t_1))); elseif (x_46_im <= 9.2e-299) tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(x_46_re)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.06e-234], N[(N[Exp[N[(N[((-y$46$re) * t$95$2), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-1.0 * N[(y$46$im * t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 9.2e-299], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1.06 \cdot 10^{-234}:\\
\;\;\;\;e^{\left(-y.re\right) \cdot t\_2 - t\_0} \cdot \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 9.2 \cdot 10^{-299}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -1.06000000000000004e-234Initial program 39.1%
Taylor expanded in x.im around -inf
lower-*.f64N/A
Applied rewrites74.8%
if -1.06000000000000004e-234 < x.im < 9.2000000000000003e-299Initial program 44.8%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6463.5
Applied rewrites63.5%
Taylor expanded in y.im around 0
lower-pow.f6463.5
Applied rewrites63.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-log.f6463.5
Applied rewrites63.5%
if 9.2000000000000003e-299 < x.im Initial program 46.2%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6470.8
Applied rewrites70.8%
Final simplification72.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (fma x.im x.im (* x.re x.re)))))
(t_3 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_4 (exp (- (* t_3 y.re) t_0)))
(t_5 (* t_4 (sin (+ (* t_3 y.im) (* (atan2 x.im x.re) y.re)))))
(t_6 (* t_4 (sin (* y.im t_2)))))
(if (<= t_5 -1e-7)
t_6
(if (<= t_5 1.0)
(* t_4 (fma y.im t_2 t_1))
(if (<= t_5 INFINITY)
t_6
(* (exp (- (* (log (sqrt (* x.re x.re))) y.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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))));
double t_3 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_4 = exp(((t_3 * y_46_re) - t_0));
double t_5 = t_4 * sin(((t_3 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
double t_6 = t_4 * sin((y_46_im * t_2));
double tmp;
if (t_5 <= -1e-7) {
tmp = t_6;
} else if (t_5 <= 1.0) {
tmp = t_4 * fma(y_46_im, t_2, t_1);
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = exp(((log(sqrt((x_46_re * x_46_re))) * y_46_re) - t_0)) * 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(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) t_3 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_4 = exp(Float64(Float64(t_3 * y_46_re) - t_0)) t_5 = Float64(t_4 * sin(Float64(Float64(t_3 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) t_6 = Float64(t_4 * sin(Float64(y_46_im * t_2))) tmp = 0.0 if (t_5 <= -1e-7) tmp = t_6; elseif (t_5 <= 1.0) tmp = Float64(t_4 * fma(y_46_im, t_2, t_1)); elseif (t_5 <= Inf) tmp = t_6; else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(x_46_re * x_46_re))) * y_46_re) - t_0)) * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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$4 = N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Sin[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 * N[Sin[N[(y$46$im * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -1e-7], t$95$6, If[LessEqual[t$95$5, 1.0], N[(t$95$4 * N[(y$46$im * t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$6, N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\\
t_3 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_4 := e^{t\_3 \cdot y.re - t\_0}\\
t_5 := t\_4 \cdot \sin \left(t\_3 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_6 := t\_4 \cdot \sin \left(y.im \cdot t\_2\right)\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{-7}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 \leq 1:\\
\;\;\;\;t\_4 \cdot \mathsf{fma}\left(y.im, t\_2, t\_1\right)\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re}\right) \cdot y.re - t\_0} \cdot 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)))) < -9.9999999999999995e-8 or 1 < (*.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 65.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-*.f6463.5
Applied rewrites63.5%
if -9.9999999999999995e-8 < (*.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)))) < 1Initial program 97.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6498.0
Applied rewrites98.0%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6498.0
Applied rewrites98.0%
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%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6411.4
Applied rewrites11.4%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6411.4
Applied rewrites11.4%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6445.6
Applied rewrites45.6%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6447.4
Applied rewrites47.4%
Final simplification66.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (exp (* y.im (- (atan2 x.im x.re)))))
(t_3 (sin t_1)))
(if (<= y.re -23000000000.0)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_1)
(if (<= y.re -8e-182)
(* t_2 t_3)
(if (<= y.re 2.5e-278)
(* t_2 (* y.im (log t_0)))
(if (<= y.re 5e+19) (* t_2 t_1) (* t_3 (pow t_0 y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_3 = sin(t_1);
double tmp;
if (y_46_re <= -23000000000.0) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_1;
} else if (y_46_re <= -8e-182) {
tmp = t_2 * t_3;
} else if (y_46_re <= 2.5e-278) {
tmp = t_2 * (y_46_im * log(t_0));
} else if (y_46_re <= 5e+19) {
tmp = t_2 * t_1;
} else {
tmp = t_3 * pow(t_0, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) t_3 = sin(t_1) tmp = 0.0 if (y_46_re <= -23000000000.0) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_1); elseif (y_46_re <= -8e-182) tmp = Float64(t_2 * t_3); elseif (y_46_re <= 2.5e-278) tmp = Float64(t_2 * Float64(y_46_im * log(t_0))); elseif (y_46_re <= 5e+19) tmp = Float64(t_2 * t_1); else tmp = Float64(t_3 * (t_0 ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$re, -23000000000.0], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -8e-182], N[(t$95$2 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 2.5e-278], N[(t$95$2 * N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e+19], N[(t$95$2 * t$95$1), $MachinePrecision], N[(t$95$3 * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_3 := \sin t\_1\\
\mathbf{if}\;y.re \leq -23000000000:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\
\mathbf{elif}\;y.re \leq -8 \cdot 10^{-182}:\\
\;\;\;\;t\_2 \cdot t\_3\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-278}:\\
\;\;\;\;t\_2 \cdot \left(y.im \cdot \log t\_0\right)\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+19}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot {t\_0}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.3e10Initial program 42.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6438.1
Applied rewrites38.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6441.3
Applied rewrites41.3%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6485.8
Applied rewrites85.8%
if -2.3e10 < y.re < -8.0000000000000004e-182Initial program 35.7%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f6440.9
Applied rewrites40.9%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6429.4
Applied rewrites29.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-atan2.f64N/A
lift-*.f6455.8
Applied rewrites55.8%
if -8.0000000000000004e-182 < y.re < 2.49999999999999992e-278Initial program 52.8%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f6456.5
Applied rewrites56.5%
if 2.49999999999999992e-278 < y.re < 5e19Initial program 47.8%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6442.1
Applied rewrites42.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6442.1
Applied rewrites42.1%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6436.8
Applied rewrites36.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6459.4
Applied rewrites59.4%
if 5e19 < y.re Initial program 37.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6462.8
Applied rewrites62.8%
Final simplification65.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (exp (* y.im (- (atan2 x.im x.re)))))
(t_3 (* t_2 t_1)))
(if (<= y.re -4400000000.0)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_1)
(if (<= y.re -8e-182)
t_3
(if (<= y.re 2.5e-278)
(* t_2 (* y.im (log t_0)))
(if (<= y.re 5e+19) t_3 (* (sin t_1) (pow t_0 y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_3 = t_2 * t_1;
double tmp;
if (y_46_re <= -4400000000.0) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_1;
} else if (y_46_re <= -8e-182) {
tmp = t_3;
} else if (y_46_re <= 2.5e-278) {
tmp = t_2 * (y_46_im * log(t_0));
} else if (y_46_re <= 5e+19) {
tmp = t_3;
} else {
tmp = sin(t_1) * pow(t_0, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) t_3 = Float64(t_2 * t_1) tmp = 0.0 if (y_46_re <= -4400000000.0) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_1); elseif (y_46_re <= -8e-182) tmp = t_3; elseif (y_46_re <= 2.5e-278) tmp = Float64(t_2 * Float64(y_46_im * log(t_0))); elseif (y_46_re <= 5e+19) tmp = t_3; else tmp = Float64(sin(t_1) * (t_0 ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -4400000000.0], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -8e-182], t$95$3, If[LessEqual[y$46$re, 2.5e-278], N[(t$95$2 * N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e+19], t$95$3, N[(N[Sin[t$95$1], $MachinePrecision] * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_3 := t\_2 \cdot t\_1\\
\mathbf{if}\;y.re \leq -4400000000:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\
\mathbf{elif}\;y.re \leq -8 \cdot 10^{-182}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-278}:\\
\;\;\;\;t\_2 \cdot \left(y.im \cdot \log t\_0\right)\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+19}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\sin t\_1 \cdot {t\_0}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.4e9Initial program 42.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6438.1
Applied rewrites38.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6441.3
Applied rewrites41.3%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6485.8
Applied rewrites85.8%
if -4.4e9 < y.re < -8.0000000000000004e-182 or 2.49999999999999992e-278 < y.re < 5e19Initial program 43.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6437.9
Applied rewrites37.9%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6436.9
Applied rewrites36.9%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6458.1
Applied rewrites58.1%
if -8.0000000000000004e-182 < y.re < 2.49999999999999992e-278Initial program 52.8%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f6456.5
Applied rewrites56.5%
if 5e19 < y.re Initial program 37.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6462.8
Applied rewrites62.8%
Final simplification65.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0))
(t_2 (exp (* y.im (- (atan2 x.im x.re)))))
(t_3 (* t_2 t_0)))
(if (<= y.re -4400000000.0)
t_1
(if (<= y.re -8e-182)
t_3
(if (<= y.re 2.5e-278)
(* t_2 (* y.im (log (sqrt (fma x.im x.im (* x.re x.re))))))
(if (<= y.re 7.4e+19) t_3 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
double t_2 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_3 = t_2 * t_0;
double tmp;
if (y_46_re <= -4400000000.0) {
tmp = t_1;
} else if (y_46_re <= -8e-182) {
tmp = t_3;
} else if (y_46_re <= 2.5e-278) {
tmp = t_2 * (y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))));
} else if (y_46_re <= 7.4e+19) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0) t_2 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) t_3 = Float64(t_2 * t_0) tmp = 0.0 if (y_46_re <= -4400000000.0) tmp = t_1; elseif (y_46_re <= -8e-182) tmp = t_3; elseif (y_46_re <= 2.5e-278) tmp = Float64(t_2 * Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))))); elseif (y_46_re <= 7.4e+19) tmp = t_3; 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[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -4400000000.0], t$95$1, If[LessEqual[y$46$re, -8e-182], t$95$3, If[LessEqual[y$46$re, 2.5e-278], N[(t$95$2 * 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]), $MachinePrecision], If[LessEqual[y$46$re, 7.4e+19], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
t_2 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_3 := t\_2 \cdot t\_0\\
\mathbf{if}\;y.re \leq -4400000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -8 \cdot 10^{-182}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-278}:\\
\;\;\;\;t\_2 \cdot \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\\
\mathbf{elif}\;y.re \leq 7.4 \cdot 10^{+19}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -4.4e9 or 7.4e19 < y.re Initial program 40.2%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6447.6
Applied rewrites47.6%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6446.8
Applied rewrites46.8%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6474.7
Applied rewrites74.7%
if -4.4e9 < y.re < -8.0000000000000004e-182 or 2.49999999999999992e-278 < y.re < 7.4e19Initial program 43.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6437.9
Applied rewrites37.9%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6436.9
Applied rewrites36.9%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6458.1
Applied rewrites58.1%
if -8.0000000000000004e-182 < y.re < 2.49999999999999992e-278Initial program 52.8%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f6456.5
Applied rewrites56.5%
Final simplification65.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* t_0 t_1))
(t_3 (sqrt (fma x.im x.im (* x.re x.re))))
(t_4 (* t_1 (pow t_3 y.re))))
(if (<= y.re -5000000000.0)
t_4
(if (<= y.re -8e-182)
t_2
(if (<= y.re 2.5e-278)
(* t_0 (* y.im (log t_3)))
(if (<= y.re 7.4e+19) t_2 t_4))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = t_0 * t_1;
double t_3 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_4 = t_1 * pow(t_3, y_46_re);
double tmp;
if (y_46_re <= -5000000000.0) {
tmp = t_4;
} else if (y_46_re <= -8e-182) {
tmp = t_2;
} else if (y_46_re <= 2.5e-278) {
tmp = t_0 * (y_46_im * log(t_3));
} else if (y_46_re <= 7.4e+19) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(t_0 * t_1) t_3 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_4 = Float64(t_1 * (t_3 ^ y_46_re)) tmp = 0.0 if (y_46_re <= -5000000000.0) tmp = t_4; elseif (y_46_re <= -8e-182) tmp = t_2; elseif (y_46_re <= 2.5e-278) tmp = Float64(t_0 * Float64(y_46_im * log(t_3))); elseif (y_46_re <= 7.4e+19) tmp = t_2; else tmp = t_4; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[Power[t$95$3, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5000000000.0], t$95$4, If[LessEqual[y$46$re, -8e-182], t$95$2, If[LessEqual[y$46$re, 2.5e-278], N[(t$95$0 * N[(y$46$im * N[Log[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.4e+19], t$95$2, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := t\_0 \cdot t\_1\\
t_3 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_4 := t\_1 \cdot {t\_3}^{y.re}\\
\mathbf{if}\;y.re \leq -5000000000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y.re \leq -8 \cdot 10^{-182}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-278}:\\
\;\;\;\;t\_0 \cdot \left(y.im \cdot \log t\_3\right)\\
\mathbf{elif}\;y.re \leq 7.4 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if y.re < -5e9 or 7.4e19 < y.re Initial program 40.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6469.9
Applied rewrites69.9%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6469.0
Applied rewrites69.0%
if -5e9 < y.re < -8.0000000000000004e-182 or 2.49999999999999992e-278 < y.re < 7.4e19Initial program 43.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6437.9
Applied rewrites37.9%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6436.9
Applied rewrites36.9%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6458.1
Applied rewrites58.1%
if -8.0000000000000004e-182 < y.re < 2.49999999999999992e-278Initial program 52.8%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f6456.5
Applied rewrites56.5%
Final simplification63.1%
(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.re (atan2 x.im x.re))))
(if (<= (* t_2 (sin (+ (* t_1 y.im) (* (atan2 x.im x.re) y.re)))) 1.0)
(* t_2 (fma y.im (log (sqrt (fma x.im x.im (* x.re x.re)))) t_3))
(* (exp (- (* (log (sqrt (* x.re x.re))) y.re) t_0)) t_3))))
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_re * atan2(x_46_im, x_46_re);
double tmp;
if ((t_2 * sin(((t_1 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)))) <= 1.0) {
tmp = t_2 * fma(y_46_im, log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))), t_3);
} else {
tmp = exp(((log(sqrt((x_46_re * x_46_re))) * y_46_re) - t_0)) * t_3;
}
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_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * sin(Float64(Float64(t_1 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) <= 1.0) tmp = Float64(t_2 * fma(y_46_im, log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))), t_3)); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(x_46_re * x_46_re))) * y_46_re) - t_0)) * t_3); 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(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]), $MachinePrecision], 1.0], N[(t$95$2 * 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] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;t\_2 \cdot \sin \left(t\_1 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \leq 1:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re}\right) \cdot y.re - t\_0} \cdot t\_3\\
\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)))) < 1Initial program 90.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6485.1
Applied rewrites85.1%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6484.1
Applied rewrites84.1%
if 1 < (*.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 9.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6416.3
Applied rewrites16.3%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6415.6
Applied rewrites15.6%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6446.0
Applied rewrites46.0%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6446.2
Applied rewrites46.2%
Final simplification61.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) t_0)))
(t_4 (* t_3 (sin (+ (* t_2 y.im) (* (atan2 x.im x.re) y.re)))))
(t_5 (sqrt (fma x.im x.im (* x.re x.re))))
(t_6 (log t_5)))
(if (<= t_4 0.0)
(* t_3 (* y.im t_6))
(if (<= t_4 1.0)
(* (pow t_5 y.re) (fma y.im t_6 t_1))
(* (exp (- (* (log (sqrt (* x.re x.re))) y.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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = 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 = exp(((t_2 * y_46_re) - t_0));
double t_4 = t_3 * sin(((t_2 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
double t_5 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_6 = log(t_5);
double tmp;
if (t_4 <= 0.0) {
tmp = t_3 * (y_46_im * t_6);
} else if (t_4 <= 1.0) {
tmp = pow(t_5, y_46_re) * fma(y_46_im, t_6, t_1);
} else {
tmp = exp(((log(sqrt((x_46_re * x_46_re))) * y_46_re) - t_0)) * 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(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 = exp(Float64(Float64(t_2 * y_46_re) - t_0)) t_4 = Float64(t_3 * sin(Float64(Float64(t_2 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) t_5 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_6 = log(t_5) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(t_3 * Float64(y_46_im * t_6)); elseif (t_4 <= 1.0) tmp = Float64((t_5 ^ y_46_re) * fma(y_46_im, t_6, t_1)); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(x_46_re * x_46_re))) * y_46_re) - t_0)) * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $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[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(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]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[Log[t$95$5], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(t$95$3 * N[(y$46$im * t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 1.0], N[(N[Power[t$95$5, y$46$re], $MachinePrecision] * N[(y$46$im * t$95$6 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.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}\\
t_4 := t\_3 \cdot \sin \left(t\_2 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_5 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_6 := \log t\_5\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;t\_3 \cdot \left(y.im \cdot t\_6\right)\\
\mathbf{elif}\;t\_4 \leq 1:\\
\;\;\;\;{t\_5}^{y.re} \cdot \mathsf{fma}\left(y.im, t\_6, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re}\right) \cdot y.re - t\_0} \cdot 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)))) < 0.0Initial program 90.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6482.4
Applied rewrites82.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6481.4
Applied rewrites81.4%
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)))) < 1Initial program 93.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6493.6
Applied rewrites93.6%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6493.6
Applied rewrites93.6%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6492.6
Applied rewrites92.6%
if 1 < (*.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 9.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6416.3
Applied rewrites16.3%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f6415.6
Applied rewrites15.6%
Taylor expanded in y.re around inf
lift-atan2.f64N/A
lift-*.f6446.0
Applied rewrites46.0%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6446.2
Applied rewrites46.2%
Final simplification61.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re))))
(t_1 (* (* y.re (atan2 x.im x.re)) (pow t_0 y.re))))
(if (<= y.re -1.46e-114)
t_1
(if (<= y.re 1.85e-16)
(* (exp (* y.im (- (atan2 x.im x.re)))) (* y.im (log 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 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = (y_46_re * atan2(x_46_im, x_46_re)) * pow(t_0, y_46_re);
double tmp;
if (y_46_re <= -1.46e-114) {
tmp = t_1;
} else if (y_46_re <= 1.85e-16) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * (y_46_im * log(t_0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_1 = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (t_0 ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.46e-114) tmp = t_1; elseif (y_46_re <= 1.85e-16) tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * Float64(y_46_im * log(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[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.46e-114], t$95$1, If[LessEqual[y$46$re, 1.85e-16], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {t\_0}^{y.re}\\
\mathbf{if}\;y.re \leq -1.46 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-16}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(y.im \cdot \log t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.45999999999999993e-114 or 1.85e-16 < y.re Initial program 38.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-*.f6462.5
Applied rewrites62.5%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6461.2
Applied rewrites61.2%
if -1.45999999999999993e-114 < y.re < 1.85e-16Initial program 49.5%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6446.0
Applied rewrites46.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6439.0
Applied rewrites39.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f6442.0
Applied rewrites42.0%
Final simplification53.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_1 (sqrt (fma x.im x.im (* x.re x.re))))
(t_2 (pow t_1 y.re)))
(if (<=
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))
INFINITY)
(* t_2 (* y.im (log t_1)))
(* (* y.re (atan2 x.im x.re)) t_2))))
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))));
double t_1 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_2 = pow(t_1, y_46_re);
double tmp;
if ((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)))) <= ((double) INFINITY)) {
tmp = t_2 * (y_46_im * log(t_1));
} else {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * t_2;
}
return tmp;
}
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)))) t_1 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_2 = t_1 ^ y_46_re tmp = 0.0 if (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)))) <= Inf) tmp = Float64(t_2 * Float64(y_46_im * log(t_1))); else tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$1, y$46$re], $MachinePrecision]}, If[LessEqual[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], Infinity], N[(t$95$2 * N[(y$46$im * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_1 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_2 := {t\_1}^{y.re}\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;t\_2 \cdot \left(y.im \cdot \log t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_2\\
\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 86.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6471.4
Applied rewrites71.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6452.3
Applied rewrites52.3%
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%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6443.3
Applied rewrites43.3%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6445.6
Applied rewrites45.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re)))) (t_1 (pow t_0 y.re)))
(if (<= x.im -0.4)
(* t_1 (* y.im (log (- x.im))))
(if (<= x.im 1.8e-239)
(* (pow (sqrt (* x.re x.re)) y.re) (* y.im (log t_0)))
(* t_1 (* y.im (log x.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = pow(t_0, y_46_re);
double tmp;
if (x_46_im <= -0.4) {
tmp = t_1 * (y_46_im * log(-x_46_im));
} else if (x_46_im <= 1.8e-239) {
tmp = pow(sqrt((x_46_re * x_46_re)), y_46_re) * (y_46_im * log(t_0));
} else {
tmp = t_1 * (y_46_im * log(x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_1 = t_0 ^ y_46_re tmp = 0.0 if (x_46_im <= -0.4) tmp = Float64(t_1 * Float64(y_46_im * log(Float64(-x_46_im)))); elseif (x_46_im <= 1.8e-239) tmp = Float64((sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re) * Float64(y_46_im * log(t_0))); else tmp = Float64(t_1 * Float64(y_46_im * log(x_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -0.4], N[(t$95$1 * N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.8e-239], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := {t\_0}^{y.re}\\
\mathbf{if}\;x.im \leq -0.4:\\
\;\;\;\;t\_1 \cdot \left(y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 1.8 \cdot 10^{-239}:\\
\;\;\;\;{\left(\sqrt{x.re \cdot x.re}\right)}^{y.re} \cdot \left(y.im \cdot \log t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -0.40000000000000002Initial program 24.6%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6430.7
Applied rewrites30.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6429.9
Applied rewrites29.9%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6421.5
Applied rewrites21.5%
Taylor expanded in x.im around -inf
lower-*.f6440.8
Applied rewrites40.8%
if -0.40000000000000002 < x.im < 1.8000000000000001e-239Initial program 56.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6456.2
Applied rewrites56.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6453.4
Applied rewrites53.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6442.6
Applied rewrites42.6%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6443.3
Applied rewrites43.3%
if 1.8000000000000001e-239 < x.im Initial program 46.7%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6446.1
Applied rewrites46.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6441.5
Applied rewrites41.5%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6432.0
Applied rewrites32.0%
Taylor expanded in x.re around 0
Applied rewrites43.1%
Final simplification42.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_1 (sqrt (fma x.im x.im (* x.re x.re)))))
(if (<=
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))
INFINITY)
(* (pow t_1 y.re) (* y.im (log t_1)))
(* (* y.re (atan2 x.im x.re)) (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 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_1 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double tmp;
if ((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)))) <= ((double) INFINITY)) {
tmp = pow(t_1, y_46_re) * (y_46_im * log(t_1));
} else {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * 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 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_1 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) tmp = 0.0 if (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)))) <= Inf) tmp = Float64((t_1 ^ y_46_re) * Float64(y_46_im * log(t_1))); else tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (Float64(-x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[Power[t$95$1, y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_1 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;{t\_1}^{y.re} \cdot \left(y.im \cdot \log t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(-x.re\right)}^{y.re}\\
\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 86.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6471.4
Applied rewrites71.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6452.3
Applied rewrites52.3%
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%
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
lower-*.f6430.1
Applied rewrites30.1%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6432.4
Applied rewrites32.4%
Final simplification42.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
(if (<= x.im -4e-310)
(* t_0 (* y.im (log (- x.im))))
(* t_0 (* y.im (log x.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (x_46_im <= -4e-310) {
tmp = t_0 * (y_46_im * log(-x_46_im));
} else {
tmp = t_0 * (y_46_im * log(x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re tmp = 0.0 if (x_46_im <= -4e-310) tmp = Float64(t_0 * Float64(y_46_im * log(Float64(-x_46_im)))); else tmp = Float64(t_0 * Float64(y_46_im * log(x_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -4e-310], N[(t$95$0 * N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -3.999999999999988e-310Initial program 38.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6442.3
Applied rewrites42.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6439.5
Applied rewrites39.5%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6429.6
Applied rewrites29.6%
Taylor expanded in x.im around -inf
lower-*.f6439.5
Applied rewrites39.5%
if -3.999999999999988e-310 < x.im Initial program 47.0%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6443.1
Applied rewrites43.1%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6433.8
Applied rewrites33.8%
Taylor expanded in x.re around 0
Applied rewrites42.0%
Final simplification40.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re)))) (t_1 (* y.im (log t_0))))
(if (<= x.im -4.8e-55)
(* 1.0 t_1)
(if (<= x.im 7.2e-295)
(* (pow x.re y.re) t_1)
(* (pow t_0 y.re) (* y.im (log x.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = y_46_im * log(t_0);
double tmp;
if (x_46_im <= -4.8e-55) {
tmp = 1.0 * t_1;
} else if (x_46_im <= 7.2e-295) {
tmp = pow(x_46_re, y_46_re) * t_1;
} else {
tmp = pow(t_0, y_46_re) * (y_46_im * log(x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_1 = Float64(y_46_im * log(t_0)) tmp = 0.0 if (x_46_im <= -4.8e-55) tmp = Float64(1.0 * t_1); elseif (x_46_im <= 7.2e-295) tmp = Float64((x_46_re ^ y_46_re) * t_1); else tmp = Float64((t_0 ^ y_46_re) * Float64(y_46_im * log(x_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -4.8e-55], N[(1.0 * t$95$1), $MachinePrecision], If[LessEqual[x$46$im, 7.2e-295], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Power[t$95$0, y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := y.im \cdot \log t\_0\\
\mathbf{if}\;x.im \leq -4.8 \cdot 10^{-55}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{elif}\;x.im \leq 7.2 \cdot 10^{-295}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{t\_0}^{y.re} \cdot \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -4.79999999999999983e-55Initial program 32.4%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6437.9
Applied rewrites37.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6435.9
Applied rewrites35.9%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6425.4
Applied rewrites25.4%
Taylor expanded in y.re around 0
Applied rewrites20.9%
if -4.79999999999999983e-55 < x.im < 7.2000000000000003e-295Initial program 54.6%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6454.3
Applied rewrites54.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6450.6
Applied rewrites50.6%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6440.3
Applied rewrites40.3%
Taylor expanded in x.re around inf
Applied rewrites40.0%
if 7.2000000000000003e-295 < x.im Initial program 45.4%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6441.4
Applied rewrites41.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6432.6
Applied rewrites32.6%
Taylor expanded in x.re around 0
Applied rewrites42.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* y.im (log (sqrt (fma x.im x.im (* x.re x.re))))))
(t_2 (* (pow x.im y.re) t_1)))
(if (<= y.re -1.05e+46)
t_2
(if (<= y.re -5.5e-107)
t_0
(if (<= y.re 4e-218) (* 1.0 t_1) (if (<= y.re 1.12) t_0 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 = y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))));
double t_2 = pow(x_46_im, y_46_re) * t_1;
double tmp;
if (y_46_re <= -1.05e+46) {
tmp = t_2;
} else if (y_46_re <= -5.5e-107) {
tmp = t_0;
} else if (y_46_re <= 4e-218) {
tmp = 1.0 * t_1;
} else if (y_46_re <= 1.12) {
tmp = t_0;
} 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 = Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))) t_2 = Float64((x_46_im ^ y_46_re) * t_1) tmp = 0.0 if (y_46_re <= -1.05e+46) tmp = t_2; elseif (y_46_re <= -5.5e-107) tmp = t_0; elseif (y_46_re <= 4e-218) tmp = Float64(1.0 * t_1); elseif (y_46_re <= 1.12) tmp = t_0; 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[(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$2 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e+46], t$95$2, If[LessEqual[y$46$re, -5.5e-107], t$95$0, If[LessEqual[y$46$re, 4e-218], N[(1.0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.12], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\\
t_2 := {x.im}^{y.re} \cdot t\_1\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -5.5 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{-218}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.12:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.05e46 or 1.1200000000000001 < y.re Initial program 39.0%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6447.5
Applied rewrites47.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6450.9
Applied rewrites50.9%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6445.9
Applied rewrites45.9%
Taylor expanded in x.re around 0
Applied rewrites37.6%
if -1.05e46 < y.re < -5.49999999999999986e-107 or 4.0000000000000001e-218 < y.re < 1.1200000000000001Initial program 43.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6430.0
Applied rewrites30.0%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6427.9
Applied rewrites27.9%
if -5.49999999999999986e-107 < y.re < 4.0000000000000001e-218Initial program 51.6%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6451.8
Applied rewrites51.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6449.0
Applied rewrites49.0%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6429.8
Applied rewrites29.8%
Taylor expanded in y.re around 0
Applied rewrites35.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -5.5e-107) (* y.re (atan2 x.im x.re)) (* 1.0 (* y.im (log (sqrt (fma x.im x.im (* x.re x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -5.5e-107) {
tmp = y_46_re * atan2(x_46_im, x_46_re);
} else {
tmp = 1.0 * (y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -5.5e-107) tmp = Float64(y_46_re * atan(x_46_im, x_46_re)); else tmp = Float64(1.0 * Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -5.5e-107], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * 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]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.5 \cdot 10^{-107}:\\
\;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\\
\end{array}
\end{array}
if y.re < -5.49999999999999986e-107Initial program 39.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6463.8
Applied rewrites63.8%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6413.8
Applied rewrites13.8%
if -5.49999999999999986e-107 < y.re Initial program 45.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.6
Applied rewrites49.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6445.4
Applied rewrites45.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6435.5
Applied rewrites35.5%
Taylor expanded in y.re around 0
Applied rewrites24.5%
(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 43.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-*.f6444.4
Applied rewrites44.4%
Taylor expanded in y.re around 0
lift-atan2.f64N/A
lift-*.f6414.1
Applied rewrites14.1%
herbie shell --seed 2025064
(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)))))