
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re 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(hypot(x_46_re, 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)));
}
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));
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.hypot(x_46_re, 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(hypot(x_46_re, 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(hypot(x_46_re, 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[x$46$re ^ 2 + x$46$im ^ 2], $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(\mathsf{hypot}\left(x.re, x.im\right)\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}
Initial program 39.9%
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f6439.9
Applied rewrites39.9%
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f6479.9
Applied rewrites79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (/ 1.0 x.re)))
(t_2 (log (/ -1.0 x.re)))
(t_3 (* y.re (atan2 x.im x.re)))
(t_4 (log (fabs (- x.im)))))
(if (<= x.re -1.2e-38)
(/ (sin (fma -1.0 (* y.im t_2) t_3)) (exp (- t_0 (* -1.0 (* y.re t_2)))))
(if (<= x.re 0.92)
(*
(exp (- (* t_4 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_4 y.im) (* (atan2 x.im x.re) y.re))))
(/
(sin (fma -1.0 (* y.im t_1) t_3))
(exp (- t_0 (* -1.0 (* 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_im * atan2(x_46_im, x_46_re);
double t_1 = log((1.0 / x_46_re));
double t_2 = log((-1.0 / x_46_re));
double t_3 = y_46_re * atan2(x_46_im, x_46_re);
double t_4 = log(fabs(-x_46_im));
double tmp;
if (x_46_re <= -1.2e-38) {
tmp = sin(fma(-1.0, (y_46_im * t_2), t_3)) / exp((t_0 - (-1.0 * (y_46_re * t_2))));
} else if (x_46_re <= 0.92) {
tmp = exp(((t_4 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_4 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = sin(fma(-1.0, (y_46_im * t_1), t_3)) / exp((t_0 - (-1.0 * (y_46_re * 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 = log(Float64(1.0 / x_46_re)) t_2 = log(Float64(-1.0 / x_46_re)) t_3 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_4 = log(abs(Float64(-x_46_im))) tmp = 0.0 if (x_46_re <= -1.2e-38) tmp = Float64(sin(fma(-1.0, Float64(y_46_im * t_2), t_3)) / exp(Float64(t_0 - Float64(-1.0 * Float64(y_46_re * t_2))))); elseif (x_46_re <= 0.92) tmp = Float64(exp(Float64(Float64(t_4 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_4 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = Float64(sin(fma(-1.0, Float64(y_46_im * t_1), t_3)) / exp(Float64(t_0 - Float64(-1.0 * Float64(y_46_re * 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[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Abs[(-x$46$im)], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.2e-38], N[(N[Sin[N[(-1.0 * N[(y$46$im * t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(t$95$0 - N[(-1.0 * N[(y$46$re * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 0.92], N[(N[Exp[N[(N[(t$95$4 * 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$4 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(-1.0 * N[(y$46$im * t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(t$95$0 - N[(-1.0 * N[(y$46$re * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\frac{1}{x.re}\right)\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_4 := \log \left(\left|-x.im\right|\right)\\
\mathbf{if}\;x.re \leq -1.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_2, t\_3\right)\right)}{e^{t\_0 - -1 \cdot \left(y.re \cdot t\_2\right)}}\\
\mathbf{elif}\;x.re \leq 0.92:\\
\;\;\;\;e^{t\_4 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_4 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_1, t\_3\right)\right)}{e^{t\_0 - -1 \cdot \left(y.re \cdot t\_1\right)}}\\
\end{array}
\end{array}
if x.re < -1.20000000000000011e-38Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in x.re around -inf
lower-/.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
Applied rewrites34.0%
if -1.20000000000000011e-38 < x.re < 0.92000000000000004Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if 0.92000000000000004 < x.re Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in x.re around inf
lower-/.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
Applied rewrites32.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (/ 1.0 x.re)))
(t_2 (log (/ -1.0 x.re)))
(t_3 (* y.re (atan2 x.im x.re)))
(t_4 (log (fabs (- x.im)))))
(if (<= x.re -1.2e-38)
(/ (sin (fma -1.0 (* y.im t_2) t_3)) (exp (- t_0 (* -1.0 (* y.re t_2)))))
(if (<= x.re 0.92)
(*
(exp (- (* t_4 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_4 y.im) (* (atan2 x.im x.re) y.re))))
(*
(exp (- (* -1.0 (* y.re t_1)) t_0))
(sin (fma -1.0 (* y.im t_1) t_3)))))))
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 = log((1.0 / x_46_re));
double t_2 = log((-1.0 / x_46_re));
double t_3 = y_46_re * atan2(x_46_im, x_46_re);
double t_4 = log(fabs(-x_46_im));
double tmp;
if (x_46_re <= -1.2e-38) {
tmp = sin(fma(-1.0, (y_46_im * t_2), t_3)) / exp((t_0 - (-1.0 * (y_46_re * t_2))));
} else if (x_46_re <= 0.92) {
tmp = exp(((t_4 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_4 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = exp(((-1.0 * (y_46_re * t_1)) - t_0)) * sin(fma(-1.0, (y_46_im * t_1), t_3));
}
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 = log(Float64(1.0 / x_46_re)) t_2 = log(Float64(-1.0 / x_46_re)) t_3 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_4 = log(abs(Float64(-x_46_im))) tmp = 0.0 if (x_46_re <= -1.2e-38) tmp = Float64(sin(fma(-1.0, Float64(y_46_im * t_2), t_3)) / exp(Float64(t_0 - Float64(-1.0 * Float64(y_46_re * t_2))))); elseif (x_46_re <= 0.92) tmp = Float64(exp(Float64(Float64(t_4 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_4 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = Float64(exp(Float64(Float64(-1.0 * Float64(y_46_re * t_1)) - t_0)) * sin(fma(-1.0, Float64(y_46_im * t_1), t_3))); 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[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Abs[(-x$46$im)], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.2e-38], N[(N[Sin[N[(-1.0 * N[(y$46$im * t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(t$95$0 - N[(-1.0 * N[(y$46$re * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 0.92], N[(N[Exp[N[(N[(t$95$4 * 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$4 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(-1.0 * N[(y$46$re * t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-1.0 * N[(y$46$im * t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\frac{1}{x.re}\right)\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_4 := \log \left(\left|-x.im\right|\right)\\
\mathbf{if}\;x.re \leq -1.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_2, t\_3\right)\right)}{e^{t\_0 - -1 \cdot \left(y.re \cdot t\_2\right)}}\\
\mathbf{elif}\;x.re \leq 0.92:\\
\;\;\;\;e^{t\_4 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_4 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-1 \cdot \left(y.re \cdot t\_1\right) - t\_0} \cdot \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_1, t\_3\right)\right)\\
\end{array}
\end{array}
if x.re < -1.20000000000000011e-38Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in x.re around -inf
lower-/.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
Applied rewrites34.0%
if -1.20000000000000011e-38 < x.re < 0.92000000000000004Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if 0.92000000000000004 < x.re Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
Applied rewrites32.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (/ 1.0 x.re)))
(t_2 (log (fabs (- x.re))))
(t_3 (log (fabs (- x.im))))
(t_4 (* (atan2 x.im x.re) y.re)))
(if (<= x.re -1.2e-38)
(* (sin (fma y.im t_2 t_4)) (exp (- (* y.re t_2) t_0)))
(if (<= x.re 0.92)
(*
(exp (- (* t_3 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_3 y.im) t_4)))
(*
(exp (- (* -1.0 (* y.re t_1)) t_0))
(sin (fma -1.0 (* y.im 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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log((1.0 / x_46_re));
double t_2 = log(fabs(-x_46_re));
double t_3 = log(fabs(-x_46_im));
double t_4 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= -1.2e-38) {
tmp = sin(fma(y_46_im, t_2, t_4)) * exp(((y_46_re * t_2) - t_0));
} else if (x_46_re <= 0.92) {
tmp = exp(((t_3 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_3 * y_46_im) + t_4));
} else {
tmp = exp(((-1.0 * (y_46_re * t_1)) - t_0)) * sin(fma(-1.0, (y_46_im * t_1), (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(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(Float64(1.0 / x_46_re)) t_2 = log(abs(Float64(-x_46_re))) t_3 = log(abs(Float64(-x_46_im))) t_4 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_re <= -1.2e-38) tmp = Float64(sin(fma(y_46_im, t_2, t_4)) * exp(Float64(Float64(y_46_re * t_2) - t_0))); elseif (x_46_re <= 0.92) tmp = Float64(exp(Float64(Float64(t_3 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_3 * y_46_im) + t_4))); else tmp = Float64(exp(Float64(Float64(-1.0 * Float64(y_46_re * t_1)) - t_0)) * sin(fma(-1.0, Float64(y_46_im * t_1), 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Abs[(-x$46$re)], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Abs[(-x$46$im)], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, -1.2e-38], N[(N[Sin[N[(y$46$im * t$95$2 + t$95$4), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 0.92], N[(N[Exp[N[(N[(t$95$3 * 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$3 * y$46$im), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(-1.0 * N[(y$46$re * t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-1.0 * N[(y$46$im * t$95$1), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\frac{1}{x.re}\right)\\
t_2 := \log \left(\left|-x.re\right|\right)\\
t_3 := \log \left(\left|-x.im\right|\right)\\
t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.re \leq -1.2 \cdot 10^{-38}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, t\_2, t\_4\right)\right) \cdot e^{y.re \cdot t\_2 - t\_0}\\
\mathbf{elif}\;x.re \leq 0.92:\\
\;\;\;\;e^{t\_3 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_3 \cdot y.im + t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;e^{-1 \cdot \left(y.re \cdot t\_1\right) - t\_0} \cdot \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_1, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if x.re < -1.20000000000000011e-38Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
Taylor expanded in x.re around -inf
lower-*.f6464.2
Applied rewrites64.2%
Taylor expanded in x.re around -inf
lower-*.f6466.8
Applied rewrites66.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.8
Applied rewrites66.8%
if -1.20000000000000011e-38 < x.re < 0.92000000000000004Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
if 0.92000000000000004 < x.re Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
Applied rewrites32.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (fabs (- x.re))))
(t_1 (log (fabs (- x.im))))
(t_2 (* (atan2 x.im x.re) y.re))
(t_3
(*
(sin (fma y.im t_0 t_2))
(exp (- (* y.re t_0) (* y.im (atan2 x.im x.re)))))))
(if (<= x.re -1.2e-38)
t_3
(if (<= x.re 31.0)
(*
(exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_1 y.im) t_2)))
t_3))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(fabs(-x_46_re));
double t_1 = log(fabs(-x_46_im));
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double t_3 = sin(fma(y_46_im, t_0, t_2)) * exp(((y_46_re * t_0) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -1.2e-38) {
tmp = t_3;
} else if (x_46_re <= 31.0) {
tmp = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_1 * y_46_im) + t_2));
} else {
tmp = t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(abs(Float64(-x_46_re))) t_1 = log(abs(Float64(-x_46_im))) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_3 = Float64(sin(fma(y_46_im, t_0, t_2)) * exp(Float64(Float64(y_46_re * t_0) - Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (x_46_re <= -1.2e-38) tmp = t_3; elseif (x_46_re <= 31.0) tmp = Float64(exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_1 * y_46_im) + t_2))); else tmp = t_3; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Abs[(-x$46$re)], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Abs[(-x$46$im)], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[N[(y$46$im * t$95$0 + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.2e-38], t$95$3, If[LessEqual[x$46$re, 31.0], N[(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] * N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\left|-x.re\right|\right)\\
t_1 := \log \left(\left|-x.im\right|\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_3 := \sin \left(\mathsf{fma}\left(y.im, t\_0, t\_2\right)\right) \cdot e^{y.re \cdot t\_0 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;x.re \leq -1.2 \cdot 10^{-38}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x.re \leq 31:\\
\;\;\;\;e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_1 \cdot y.im + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x.re < -1.20000000000000011e-38 or 31 < x.re Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
Taylor expanded in x.re around -inf
lower-*.f6464.2
Applied rewrites64.2%
Taylor expanded in x.re around -inf
lower-*.f6466.8
Applied rewrites66.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.8
Applied rewrites66.8%
if -1.20000000000000011e-38 < x.re < 31Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (log (fabs (- x.re)))))
(if (<= y.re -0.025)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* -1.0 (* y.re (atan2 x.im x.re)))))
(if (<= y.re 4.8e-187)
(/ (sin (fma y.im (log (hypot x.re x.im)) t_0)) (exp t_1))
(* (sin (fma y.im t_2 t_0)) (exp (- (* y.re t_2) 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_re;
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = log(fabs(-x_46_re));
double tmp;
if (y_46_re <= -0.025) {
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))) * cos((-1.0 * (y_46_re * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.8e-187) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), t_0)) / exp(t_1);
} else {
tmp = sin(fma(y_46_im, t_2, t_0)) * exp(((y_46_re * t_2) - 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_re) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = log(abs(Float64(-x_46_re))) tmp = 0.0 if (y_46_re <= -0.025) 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))) * cos(Float64(-1.0 * Float64(y_46_re * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4.8e-187) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), t_0)) / exp(t_1)); else tmp = Float64(sin(fma(y_46_im, t_2, t_0)) * exp(Float64(Float64(y_46_re * t_2) - 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$re), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Abs[(-x$46$re)], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.025], 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] * N[Cos[N[(-1.0 * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.8e-187], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * t$95$2 + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\left|-x.re\right|\right)\\
\mathbf{if}\;y.re \leq -0.025:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(-1 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{-187}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), t\_0\right)\right)}{e^{t\_1}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.im, t\_2, t\_0\right)\right) \cdot e^{y.re \cdot t\_2 - t\_1}\\
\end{array}
\end{array}
if y.re < -0.025000000000000001Initial program 39.9%
lift-sin.f64N/A
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
sub-negate-revN/A
sin-negN/A
cos-+PI/2-revN/A
lower-cos.f64N/A
lower-+.f64N/A
Applied rewrites28.4%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-*.f64N/A
lower-atan2.f6449.4
Applied rewrites49.4%
if -0.025000000000000001 < y.re < 4.80000000000000027e-187Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6452.9
Applied rewrites52.9%
if 4.80000000000000027e-187 < y.re Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
Taylor expanded in x.re around -inf
lower-*.f6464.2
Applied rewrites64.2%
Taylor expanded in x.re around -inf
lower-*.f6466.8
Applied rewrites66.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.8
Applied rewrites66.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))))
(if (<= y.re -0.025)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(cos (* -1.0 t_1)))
(if (<= y.re 3.7e+18)
(/
(sin (fma y.im (log (hypot x.re x.im)) (* (atan2 x.im x.re) y.re)))
(exp (* y.im (atan2 x.im x.re))))
(*
(exp (- (* (log (sqrt (fma x.re x.re (* x.im x.im)))) y.re) t_0))
(sin 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 tmp;
if (y_46_re <= -0.025) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos((-1.0 * t_1));
} else if (y_46_re <= 3.7e+18) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), (atan2(x_46_im, x_46_re) * y_46_re))) / exp((y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = exp(((log(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im)))) * y_46_re) - t_0)) * sin(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)) tmp = 0.0 if (y_46_re <= -0.025) 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) - t_0)) * cos(Float64(-1.0 * t_1))); elseif (y_46_re <= 3.7e+18) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), Float64(atan(x_46_im, x_46_re) * y_46_re))) / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(Float64(log(sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)) * sin(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]}, If[LessEqual[y$46$re, -0.025], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(-1.0 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.7e+18], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $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}\\
\mathbf{if}\;y.re \leq -0.025:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \cos \left(-1 \cdot t\_1\right)\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right) \cdot y.re - t\_0} \cdot \sin t\_1\\
\end{array}
\end{array}
if y.re < -0.025000000000000001Initial program 39.9%
lift-sin.f64N/A
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
sub-negate-revN/A
sin-negN/A
cos-+PI/2-revN/A
lower-cos.f64N/A
lower-+.f64N/A
Applied rewrites28.4%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-*.f64N/A
lower-atan2.f6449.4
Applied rewrites49.4%
if -0.025000000000000001 < y.re < 3.7e18Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6452.9
Applied rewrites52.9%
if 3.7e18 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6453.4
Applied rewrites53.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(exp
(-
(* (log (sqrt (fma x.re x.re (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))))
(if (<= y.re -0.024)
t_0
(if (<= y.re 3.7e+18)
(/
(sin (fma y.im (log (hypot x.re x.im)) (* (atan2 x.im x.re) y.re)))
(exp (* y.im (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(fma(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))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.024) {
tmp = t_0;
} else if (y_46_re <= 3.7e+18) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), (atan2(x_46_im, x_46_re) * y_46_re))) / exp((y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(exp(Float64(Float64(log(sqrt(fma(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))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.024) tmp = t_0; elseif (y_46_re <= 3.7e+18) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), Float64(atan(x_46_im, x_46_re) * y_46_re))) / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re + 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] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.024], t$95$0, If[LessEqual[y$46$re, 3.7e+18], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.024:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.024 or 3.7e18 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6453.4
Applied rewrites53.4%
if -0.024 < y.re < 3.7e18Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6452.9
Applied rewrites52.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(exp
(-
(* (log (sqrt (fma x.re x.re (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))))
(if (<= y.re -0.024)
t_0
(if (<= y.re 3.7e+18)
(*
(exp (- (* y.im (atan2 x.im x.re))))
(sin (+ (* (log (fabs (- x.im))) y.im) (* (atan2 x.im x.re) y.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(sqrt(fma(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))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.024) {
tmp = t_0;
} else if (y_46_re <= 3.7e+18) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin(((log(fabs(-x_46_im)) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(exp(Float64(Float64(log(sqrt(fma(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))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.024) tmp = t_0; elseif (y_46_re <= 3.7e+18) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(Float64(log(abs(Float64(-x_46_im))) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re + 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] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.024], t$95$0, If[LessEqual[y$46$re, 3.7e+18], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(N[(N[Log[N[Abs[(-x$46$im)], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.024:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+18}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\left|-x.im\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.024 or 3.7e18 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6453.4
Applied rewrites53.4%
if -0.024 < y.re < 3.7e18Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6445.0
Applied rewrites45.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2
(*
(exp (- (* (log (sqrt (fma x.im x.im (* x.re x.re)))) y.re) t_0))
(* (pow t_1 3.0) -0.16666666666666666))))
(if (<= y.re -0.75)
t_2
(if (<= y.re 6.6e+151)
(* (exp (- t_0)) (sin (+ (* (log (fabs (- x.im))) y.im) 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_im * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = exp(((log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * y_46_re) - t_0)) * (pow(t_1, 3.0) * -0.16666666666666666);
double tmp;
if (y_46_re <= -0.75) {
tmp = t_2;
} else if (y_46_re <= 6.6e+151) {
tmp = exp(-t_0) * sin(((log(fabs(-x_46_im)) * y_46_im) + 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_im * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = Float64(exp(Float64(Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * y_46_re) - t_0)) * Float64((t_1 ^ 3.0) * -0.16666666666666666)) tmp = 0.0 if (y_46_re <= -0.75) tmp = t_2; elseif (y_46_re <= 6.6e+151) tmp = Float64(exp(Float64(-t_0)) * sin(Float64(Float64(log(abs(Float64(-x_46_im))) * y_46_im) + 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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[t$95$1, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.75], t$95$2, If[LessEqual[y$46$re, 6.6e+151], N[(N[Exp[(-t$95$0)], $MachinePrecision] * N[Sin[N[(N[(N[Log[N[Abs[(-x$46$im)], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := e^{\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot y.re - t\_0} \cdot \left({t\_1}^{3} \cdot -0.16666666666666666\right)\\
\mathbf{if}\;y.re \leq -0.75:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{+151}:\\
\;\;\;\;e^{-t\_0} \cdot \sin \left(\log \left(\left|-x.im\right|\right) \cdot y.im + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -0.75 or 6.60000000000000049e151 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-atan2.f64N/A
lower-atan2.f6437.3
Applied rewrites37.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-atan2.f6427.2
Applied rewrites27.2%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f6427.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f6427.2
Applied rewrites31.4%
if -0.75 < y.re < 6.60000000000000049e151Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.5
Applied rewrites17.5%
Taylor expanded in x.im around -inf
lower-*.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6431.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Applied rewrites31.3%
rem-exp-logN/A
lift-log.f64N/A
exp-fabsN/A
lift-log.f64N/A
rem-exp-logN/A
lower-fabs.f6462.9
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6462.9
Applied rewrites62.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6445.0
Applied rewrites45.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2
(*
(exp (- (* (log (sqrt (fma x.im x.im (* x.re x.re)))) y.re) t_0))
(* (pow t_1 3.0) -0.16666666666666666))))
(if (<= y.re -0.03)
t_2
(if (<= y.re 4.1e-45)
(/ (sin (fma y.im (log (hypot x.re x.im)) t_1)) 1.0)
(if (<= y.re 1.02e+15)
(/ (sin (* y.im (log (sqrt (pow x.im 2.0))))) (exp 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_im * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = exp(((log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * y_46_re) - t_0)) * (pow(t_1, 3.0) * -0.16666666666666666);
double tmp;
if (y_46_re <= -0.03) {
tmp = t_2;
} else if (y_46_re <= 4.1e-45) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), t_1)) / 1.0;
} else if (y_46_re <= 1.02e+15) {
tmp = sin((y_46_im * log(sqrt(pow(x_46_im, 2.0))))) / exp(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_im * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = Float64(exp(Float64(Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * y_46_re) - t_0)) * Float64((t_1 ^ 3.0) * -0.16666666666666666)) tmp = 0.0 if (y_46_re <= -0.03) tmp = t_2; elseif (y_46_re <= 4.1e-45) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), t_1)) / 1.0); elseif (y_46_re <= 1.02e+15) tmp = Float64(sin(Float64(y_46_im * log(sqrt((x_46_im ^ 2.0))))) / exp(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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[t$95$1, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.03], t$95$2, If[LessEqual[y$46$re, 4.1e-45], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], If[LessEqual[y$46$re, 1.02e+15], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[N[Power[x$46$im, 2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := e^{\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot y.re - t\_0} \cdot \left({t\_1}^{3} \cdot -0.16666666666666666\right)\\
\mathbf{if}\;y.re \leq -0.03:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{-45}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), t\_1\right)\right)}{1}\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+15}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2}}\right)\right)}{e^{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -0.029999999999999999 or 1.02e15 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-atan2.f64N/A
lower-atan2.f6437.3
Applied rewrites37.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-atan2.f6427.2
Applied rewrites27.2%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f6427.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f6427.2
Applied rewrites31.4%
if -0.029999999999999999 < y.re < 4.0999999999999999e-45Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6426.5
Applied rewrites26.5%
if 4.0999999999999999e-45 < y.re < 1.02e15Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
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
lower-+.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6422.2
Applied rewrites22.2%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
lower-pow.f6418.5
Applied rewrites18.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
(exp
(-
(* (log (sqrt (fma x.im x.im (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))
(* (pow t_0 3.0) -0.16666666666666666))))
(if (<= y.re -0.03)
t_1
(if (<= y.re 4.1e-45)
(/ (sin (fma y.im (log (hypot x.re x.im)) t_0)) 1.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_re;
double t_1 = exp(((log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * (pow(t_0, 3.0) * -0.16666666666666666);
double tmp;
if (y_46_re <= -0.03) {
tmp = t_1;
} else if (y_46_re <= 4.1e-45) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), t_0)) / 1.0;
} 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_re) t_1 = Float64(exp(Float64(Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64((t_0 ^ 3.0) * -0.16666666666666666)) tmp = 0.0 if (y_46_re <= -0.03) tmp = t_1; elseif (y_46_re <= 4.1e-45) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), t_0)) / 1.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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[t$95$0, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.03], t$95$1, If[LessEqual[y$46$re, 4.1e-45], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left({t\_0}^{3} \cdot -0.16666666666666666\right)\\
\mathbf{if}\;y.re \leq -0.03:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{-45}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), t\_0\right)\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -0.029999999999999999 or 4.0999999999999999e-45 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6453.4
Applied rewrites53.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-atan2.f64N/A
lower-atan2.f6437.3
Applied rewrites37.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-atan2.f6427.2
Applied rewrites27.2%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f6427.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f6427.2
Applied rewrites31.4%
if -0.029999999999999999 < y.re < 4.0999999999999999e-45Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6426.5
Applied rewrites26.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/
(sin (* -1.0 (* y.im (log (/ -1.0 x.re)))))
(exp (* y.im (atan2 x.im x.re))))))
(if (<= y.im -1.6e+33)
t_0
(if (<= y.im 11500.0)
(/
(sin (fma y.im (log (hypot x.re x.im)) (* (atan2 x.im x.re) y.re)))
1.0)
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((-1.0 * (y_46_im * log((-1.0 / x_46_re))))) / exp((y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1.6e+33) {
tmp = t_0;
} else if (y_46_im <= 11500.0) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), (atan2(x_46_im, x_46_re) * y_46_re))) / 1.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(-1.0 * Float64(y_46_im * log(Float64(-1.0 / x_46_re))))) / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1.6e+33) tmp = t_0; elseif (y_46_im <= 11500.0) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), Float64(atan(x_46_im, x_46_re) * y_46_re))) / 1.0); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e+33], t$95$0, If[LessEqual[y$46$im, 11500.0], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin \left(-1 \cdot \left(y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\right)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 11500:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.60000000000000009e33 or 11500 < y.im Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
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
lower-+.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6422.2
Applied rewrites22.2%
Taylor expanded in x.re around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6420.4
Applied rewrites20.4%
if -1.60000000000000009e33 < y.im < 11500Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6426.5
Applied rewrites26.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/
(sin (* -1.0 (* y.im (log (/ -1.0 x.im)))))
(exp (* y.im (atan2 x.im x.re))))))
(if (<= y.im -1.15e-5)
t_0
(if (<= y.im 2.7e+14)
(/
(sin (fma y.im (log (hypot x.re x.im)) (* (atan2 x.im x.re) y.re)))
1.0)
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((-1.0 * (y_46_im * log((-1.0 / x_46_im))))) / exp((y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1.15e-5) {
tmp = t_0;
} else if (y_46_im <= 2.7e+14) {
tmp = sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), (atan2(x_46_im, x_46_re) * y_46_re))) / 1.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(-1.0 * Float64(y_46_im * log(Float64(-1.0 / x_46_im))))) / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1.15e-5) tmp = t_0; elseif (y_46_im <= 2.7e+14) tmp = Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), Float64(atan(x_46_im, x_46_re) * y_46_re))) / 1.0); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.15e-5], t$95$0, If[LessEqual[y$46$im, 2.7e+14], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin \left(-1 \cdot \left(y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{+14}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.15e-5 or 2.7e14 < y.im Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
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
lower-+.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6422.2
Applied rewrites22.2%
Taylor expanded in x.im around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6417.8
Applied rewrites17.8%
if -1.15e-5 < y.im < 2.7e14Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6426.5
Applied rewrites26.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (sin (fma y.im (log (hypot x.re x.im)) (* (atan2 x.im x.re) y.re))) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), (atan2(x_46_im, x_46_re) * y_46_re))) / 1.0;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(fma(y_46_im, log(hypot(x_46_re, x_46_im)), Float64(atan(x_46_im, x_46_re) * y_46_re))) / 1.0) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}{1}
\end{array}
Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
lift-sqrt.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-hypot.f6426.5
Applied rewrites26.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -5e-308)
(/
(sin (fma -1.0 (* y.im (log (/ -1.0 x.re))) (* y.re (atan2 x.im x.re))))
1.0)
(/
(sin (fma y.im (* -1.0 (log (/ 1.0 x.re))) (* (atan2 x.im x.re) y.re)))
1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -5e-308) {
tmp = sin(fma(-1.0, (y_46_im * log((-1.0 / x_46_re))), (y_46_re * atan2(x_46_im, x_46_re)))) / 1.0;
} else {
tmp = sin(fma(y_46_im, (-1.0 * log((1.0 / x_46_re))), (atan2(x_46_im, x_46_re) * y_46_re))) / 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -5e-308) tmp = Float64(sin(fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_re))), Float64(y_46_re * atan(x_46_im, x_46_re)))) / 1.0); else tmp = Float64(sin(fma(y_46_im, Float64(-1.0 * log(Float64(1.0 / x_46_re))), Float64(atan(x_46_im, x_46_re) * y_46_re))) / 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -5e-308], N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[(-1.0 * N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{-308}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.re}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(y.im, -1 \cdot \log \left(\frac{1}{x.re}\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}{1}\\
\end{array}
\end{array}
if x.re < -4.99999999999999955e-308Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.re around -inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f6410.2
Applied rewrites10.2%
if -4.99999999999999955e-308 < x.re Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6410.5
Applied rewrites10.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -5e-308)
(/ (sin (fma -1.0 (* y.im (log (/ -1.0 x.re))) t_0)) 1.0)
(/ (sin (fma -1.0 (* y.im (log (/ 1.0 x.re))) t_0)) 1.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 tmp;
if (x_46_re <= -5e-308) {
tmp = sin(fma(-1.0, (y_46_im * log((-1.0 / x_46_re))), t_0)) / 1.0;
} else {
tmp = sin(fma(-1.0, (y_46_im * log((1.0 / x_46_re))), t_0)) / 1.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)) tmp = 0.0 if (x_46_re <= -5e-308) tmp = Float64(sin(fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_re))), t_0)) / 1.0); else tmp = Float64(sin(fma(-1.0, Float64(y_46_im * log(Float64(1.0 / x_46_re))), t_0)) / 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5e-308], N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-308}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.re}\right), t\_0\right)\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{1}{x.re}\right), t\_0\right)\right)}{1}\\
\end{array}
\end{array}
if x.re < -4.99999999999999955e-308Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.re around -inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f6410.2
Applied rewrites10.2%
if -4.99999999999999955e-308 < x.re Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.re around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f6410.5
Applied rewrites10.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -1.2e-302)
(/ (sin (fma -1.0 (* y.im (log (/ -1.0 x.re))) t_0)) 1.0)
(/ (sin (fma -1.0 (* y.im (log (/ 1.0 x.im))) t_0)) 1.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 tmp;
if (x_46_re <= -1.2e-302) {
tmp = sin(fma(-1.0, (y_46_im * log((-1.0 / x_46_re))), t_0)) / 1.0;
} else {
tmp = sin(fma(-1.0, (y_46_im * log((1.0 / x_46_im))), t_0)) / 1.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)) tmp = 0.0 if (x_46_re <= -1.2e-302) tmp = Float64(sin(fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_re))), t_0)) / 1.0); else tmp = Float64(sin(fma(-1.0, Float64(y_46_im * log(Float64(1.0 / x_46_im))), t_0)) / 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.2e-302], N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision], N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -1.2 \cdot 10^{-302}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.re}\right), t\_0\right)\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{1}{x.im}\right), t\_0\right)\right)}{1}\\
\end{array}
\end{array}
if x.re < -1.20000000000000011e-302Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.re around -inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f6410.2
Applied rewrites10.2%
if -1.20000000000000011e-302 < x.re Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.im around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f649.5
Applied rewrites9.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (sin (fma -1.0 (* y.im (log (/ -1.0 x.re))) (* y.re (atan2 x.im x.re)))) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin(fma(-1.0, (y_46_im * log((-1.0 / x_46_re))), (y_46_re * atan2(x_46_im, x_46_re)))) / 1.0;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_re))), Float64(y_46_re * atan(x_46_im, x_46_re)))) / 1.0) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.re}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{1}
\end{array}
Initial program 39.9%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-*.f64N/A
lower-atan2.f6427.0
Applied rewrites27.0%
Taylor expanded in y.im around 0
Applied rewrites13.4%
Taylor expanded in x.re around -inf
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f6410.2
Applied rewrites10.2%
herbie shell --seed 2025155
(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)))))