
(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)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
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 18 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)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
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)))
(t_1 (exp (* (fma (- y.im) (/ (atan2 x.im x.re) y.re) t_0) y.re)))
(t_2 (* (atan2 x.im x.re) y.re)))
(if (<= y.re 4e+108)
(* (fma (* (cos t_2) t_0) y.im (sin t_2)) t_1)
(* (sin (* t_0 y.im)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp((fma(-y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re));
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= 4e+108) {
tmp = fma((cos(t_2) * t_0), y_46_im, sin(t_2)) * t_1;
} else {
tmp = sin((t_0 * y_46_im)) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(fma(Float64(-y_46_im), Float64(atan(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= 4e+108) tmp = Float64(fma(Float64(cos(t_2) * t_0), y_46_im, sin(t_2)) * t_1); else tmp = Float64(sin(Float64(t_0 * y_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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[((-y$46$im) * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, 4e+108], N[(N[(N[(N[Cos[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision] * y$46$im + N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(-y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, t\_0\right) \cdot y.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq 4 \cdot 10^{+108}:\\
\;\;\;\;\mathsf{fma}\left(\cos t\_2 \cdot t\_0, y.im, \sin t\_2\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < 4.0000000000000001e108Initial program 41.1%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites65.5%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.0%
if 4.0000000000000001e108 < y.re Initial program 40.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites64.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.8%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.8
Applied rewrites77.8%
Final simplification84.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (* (fma (- y.im) (/ (atan2 x.im x.re) y.re) t_0) y.re))))
(if (<= y.re 2.6e+60)
(* (fma (* 1.0 t_0) y.im (sin (* (atan2 x.im x.re) y.re))) t_1)
(* (sin (* t_0 y.im)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp((fma(-y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re));
double tmp;
if (y_46_re <= 2.6e+60) {
tmp = fma((1.0 * t_0), y_46_im, sin((atan2(x_46_im, x_46_re) * y_46_re))) * t_1;
} else {
tmp = sin((t_0 * y_46_im)) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(fma(Float64(-y_46_im), Float64(atan(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re)) tmp = 0.0 if (y_46_re <= 2.6e+60) tmp = Float64(fma(Float64(1.0 * t_0), y_46_im, sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) * t_1); else tmp = Float64(sin(Float64(t_0 * y_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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[((-y$46$im) * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2.6e+60], N[(N[(N[(1.0 * t$95$0), $MachinePrecision] * y$46$im + N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(-y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, t\_0\right) \cdot y.re}\\
\mathbf{if}\;y.re \leq 2.6 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(1 \cdot t\_0, y.im, \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < 2.60000000000000008e60Initial program 41.6%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites64.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.0%
Taylor expanded in y.re around 0
Applied rewrites86.0%
if 2.60000000000000008e60 < y.re Initial program 39.3%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites67.2%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.2%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.0
Applied rewrites77.0%
Final simplification83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (sin t_1))
(t_3 (fma (* (cos t_1) t_0) y.im t_2)))
(if (<= y.re -2.4e-9)
(*
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im)))
(fma (* 1.0 t_0) y.im t_2))
(if (<= y.re 4.3e-23)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_3)
(if (<= y.re 1.32e+107)
(* (pow (hypot x.re x.im) y.re) t_3)
(*
(sin (* t_0 y.im))
(exp (* (fma (- y.im) (/ (atan2 x.im x.re) y.re) 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 = log(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = sin(t_1);
double t_3 = fma((cos(t_1) * t_0), y_46_im, t_2);
double tmp;
if (y_46_re <= -2.4e-9) {
tmp = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * fma((1.0 * t_0), y_46_im, t_2);
} else if (y_46_re <= 4.3e-23) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_3;
} else if (y_46_re <= 1.32e+107) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_3;
} else {
tmp = sin((t_0 * y_46_im)) * exp((fma(-y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = sin(t_1) t_3 = fma(Float64(cos(t_1) * t_0), y_46_im, t_2) tmp = 0.0 if (y_46_re <= -2.4e-9) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * fma(Float64(1.0 * t_0), y_46_im, t_2)); elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_3); elseif (y_46_re <= 1.32e+107) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_3); else tmp = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(fma(Float64(-y_46_im), Float64(atan(x_46_im, x_46_re) / y_46_re), 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Cos[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -2.4e-9], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $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[(N[(1.0 * t$95$0), $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 1.32e+107], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$3), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[((-y$46$im) * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \sin t\_1\\
t_3 := \mathsf{fma}\left(\cos t\_1 \cdot t\_0, y.im, t\_2\right)\\
\mathbf{if}\;y.re \leq -2.4 \cdot 10^{-9}:\\
\;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \mathsf{fma}\left(1 \cdot t\_0, y.im, t\_2\right)\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_3\\
\mathbf{elif}\;y.re \leq 1.32 \cdot 10^{+107}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot e^{\mathsf{fma}\left(-y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, t\_0\right) \cdot y.re}\\
\end{array}
\end{array}
if y.re < -2.4e-9Initial program 45.6%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites83.9%
Taylor expanded in y.re around 0
Applied rewrites86.8%
if -2.4e-9 < y.re < 4.30000000000000002e-23Initial program 40.4%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites52.7%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6484.3
Applied rewrites84.3%
if 4.30000000000000002e-23 < y.re < 1.32000000000000003e107Initial program 30.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites75.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites89.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6490.0
Applied rewrites90.0%
if 1.32000000000000003e107 < y.re Initial program 40.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites64.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.8%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.8
Applied rewrites77.8%
Final simplification84.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -140000000000.0)
(*
(sin t_1)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.im 1.8e-54)
(/
1.0
(/
(fma y.im (atan2 x.im x.re) 1.0)
(*
(sin (fma y.im (log (hypot x.im x.re)) t_1))
(pow (hypot x.im x.re) y.re))))
(*
(sin (* t_0 y.im))
(exp (* (fma (- y.im) (/ (atan2 x.im x.re) y.re) 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 = log(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= -140000000000.0) {
tmp = sin(t_1) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_im <= 1.8e-54) {
tmp = 1.0 / (fma(y_46_im, atan2(x_46_im, x_46_re), 1.0) / (sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = sin((t_0 * y_46_im)) * exp((fma(-y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= -140000000000.0) tmp = Float64(sin(t_1) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_im <= 1.8e-54) tmp = Float64(1.0 / Float64(fma(y_46_im, atan(x_46_im, x_46_re), 1.0) / Float64(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) * (hypot(x_46_im, x_46_re) ^ y_46_re)))); else tmp = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(fma(Float64(-y_46_im), Float64(atan(x_46_im, x_46_re) / y_46_re), 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -140000000000.0], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.8e-54], N[(1.0 / N[(N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[((-y$46$im) * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -140000000000:\\
\;\;\;\;\sin t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{-54}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot e^{\mathsf{fma}\left(-y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, t\_0\right) \cdot y.re}\\
\end{array}
\end{array}
if y.im < -1.4e11Initial program 40.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6476.1
Applied rewrites76.1%
if -1.4e11 < y.im < 1.79999999999999988e-54Initial program 44.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites87.5%
Taylor expanded in y.im around 0
+-commutativeN/A
lower-fma.f64N/A
lower-atan2.f6487.6
Applied rewrites87.6%
if 1.79999999999999988e-54 < y.im Initial program 36.3%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites65.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.3%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.8
Applied rewrites73.8%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -1.6e-9)
(*
t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.re 4.3e-23)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.3e+107)
(* (pow (hypot x.re x.im) y.re) t_1)
(*
(sin (* t_0 y.im))
(exp (* (fma (- y.im) (/ (atan2 x.im x.re) y.re) 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 = log(hypot(x_46_re, x_46_im));
double t_1 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.6e-9) {
tmp = t_1 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 4.3e-23) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.3e+107) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else {
tmp = sin((t_0 * y_46_im)) * exp((fma(-y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), t_0) * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -1.6e-9) tmp = Float64(t_1 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 4.3e-23) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.3e+107) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1); else tmp = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(fma(Float64(-y_46_im), Float64(atan(x_46_im, x_46_re) / y_46_re), 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e-9], N[(t$95$1 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.3e+107], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[((-y$46$im) * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-9}:\\
\;\;\;\;t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_0\right) \cdot y.im\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+107}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot e^{\mathsf{fma}\left(-y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, t\_0\right) \cdot y.re}\\
\end{array}
\end{array}
if y.re < -1.60000000000000006e-9Initial program 45.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.9
Applied rewrites83.9%
if -1.60000000000000006e-9 < y.re < 4.30000000000000002e-23Initial program 40.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.4
Applied rewrites49.4%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.3
Applied rewrites80.3%
if 4.30000000000000002e-23 < y.re < 1.3000000000000001e107Initial program 30.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6490.0
Applied rewrites90.0%
if 1.3000000000000001e107 < y.re Initial program 40.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites64.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.8%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.8
Applied rewrites77.8%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (sin (* (atan2 x.im x.re) y.re)))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -1.6e-9)
(* t_1 t_2)
(if (<= y.re 4.3e-23)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.3e+107)
(* (pow (hypot x.re x.im) y.re) t_1)
(* (sin (* t_0 y.im)) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -1.6e-9) {
tmp = t_1 * t_2;
} else if (y_46_re <= 4.3e-23) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.3e+107) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else {
tmp = sin((t_0 * y_46_im)) * t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -1.6e-9) tmp = Float64(t_1 * t_2); elseif (y_46_re <= 4.3e-23) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.3e+107) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1); else tmp = Float64(sin(Float64(t_0 * y_46_im)) * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e-9], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.3e+107], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-9}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_0\right) \cdot y.im\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+107}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot t\_2\\
\end{array}
\end{array}
if y.re < -1.60000000000000006e-9Initial program 45.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.9
Applied rewrites83.9%
if -1.60000000000000006e-9 < y.re < 4.30000000000000002e-23Initial program 40.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.4
Applied rewrites49.4%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.3
Applied rewrites80.3%
if 4.30000000000000002e-23 < y.re < 1.3000000000000001e107Initial program 30.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6490.0
Applied rewrites90.0%
if 1.3000000000000001e107 < y.re Initial program 40.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.8
Applied rewrites77.8%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -1.6e-9)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.re 4.3e-23)
(*
(sin
(*
(fma y.re (/ (atan2 x.im x.re) y.im) (log (hypot x.re x.im)))
y.im))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (pow (hypot x.re x.im) 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.6e-9) {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 4.3e-23) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_re, x_46_im))) * y_46_im)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -1.6e-9) tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 4.3e-23) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_re, x_46_im))) * y_46_im)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e-9], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-23], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-9}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot y.im\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.60000000000000006e-9Initial program 45.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.9
Applied rewrites83.9%
if -1.60000000000000006e-9 < y.re < 4.30000000000000002e-23Initial program 40.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.4
Applied rewrites49.4%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.3
Applied rewrites80.3%
if 4.30000000000000002e-23 < y.re Initial program 37.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.3
Applied rewrites70.3%
Final simplification78.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -4.5e-89)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(if (<= y.re 2.3e-26)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* (log (hypot x.re x.im)) y.im)))
(* (pow (hypot x.re x.im) 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -4.5e-89) {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 2.3e-26) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -4.5e-89) {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 2.3e-26) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -4.5e-89: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_re <= 2.3e-26: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -4.5e-89) tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 2.3e-26) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -4.5e-89) tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); elseif (y_46_re <= 2.3e-26) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.5e-89], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.3e-26], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-89}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{-26}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -4.4999999999999999e-89Initial program 45.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.0
Applied rewrites80.0%
if -4.4999999999999999e-89 < y.re < 2.30000000000000009e-26Initial program 39.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6415.6
Applied rewrites15.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.3
Applied rewrites70.3%
if 2.30000000000000009e-26 < y.re Initial program 37.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.3
Applied rewrites70.3%
Final simplification73.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(t_1 (sin (* (atan2 x.im x.re) y.re)))
(t_2 (* (pow (hypot x.re x.im) y.re) t_1)))
(if (<= y.re -6.5e-15)
t_2
(if (<= y.re -3.6e-158)
(* t_0 t_1)
(if (<= y.re 2.3e-26)
(* t_0 (sin (* (log (hypot x.re x.im)) y.im)))
t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
double tmp;
if (y_46_re <= -6.5e-15) {
tmp = t_2;
} else if (y_46_re <= -3.6e-158) {
tmp = t_0 * t_1;
} else if (y_46_re <= 2.3e-26) {
tmp = t_0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * t_1;
double tmp;
if (y_46_re <= -6.5e-15) {
tmp = t_2;
} else if (y_46_re <= -3.6e-158) {
tmp = t_0 * t_1;
} else if (y_46_re <= 2.3e-26) {
tmp = t_0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_2 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_1 tmp = 0 if y_46_re <= -6.5e-15: tmp = t_2 elif y_46_re <= -3.6e-158: tmp = t_0 * t_1 elif y_46_re <= 2.3e-26: tmp = t_0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) t_1 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_2 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1) tmp = 0.0 if (y_46_re <= -6.5e-15) tmp = t_2; elseif (y_46_re <= -3.6e-158) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 2.3e-26) tmp = Float64(t_0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_2 = (hypot(x_46_re, x_46_im) ^ y_46_re) * t_1; tmp = 0.0; if (y_46_re <= -6.5e-15) tmp = t_2; elseif (y_46_re <= -3.6e-158) tmp = t_0 * t_1; elseif (y_46_re <= 2.3e-26) tmp = t_0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -6.5e-15], t$95$2, If[LessEqual[y$46$re, -3.6e-158], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 2.3e-26], N[(t$95$0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{-15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -3.6 \cdot 10^{-158}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{-26}:\\
\;\;\;\;t\_0 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -6.49999999999999991e-15 or 2.30000000000000009e-26 < y.re Initial program 41.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.1
Applied rewrites75.1%
if -6.49999999999999991e-15 < y.re < -3.59999999999999991e-158Initial program 41.8%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites48.9%
Taylor expanded in y.im around inf
Applied rewrites48.9%
Taylor expanded in y.im around 0
Applied rewrites79.9%
if -3.59999999999999991e-158 < y.re < 2.30000000000000009e-26Initial program 40.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6414.7
Applied rewrites14.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.2
Applied rewrites70.2%
Final simplification74.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (* (pow (hypot x.re x.im) y.re) t_0)))
(if (<= y.re -6.5e-15)
t_1
(if (<= y.re 4.3e-23) (* (exp (* (atan2 x.im x.re) (- y.im))) 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re) * t_0;
double tmp;
if (y_46_re <= -6.5e-15) {
tmp = t_1;
} else if (y_46_re <= 4.3e-23) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * t_0;
double tmp;
if (y_46_re <= -6.5e-15) {
tmp = t_1;
} else if (y_46_re <= 4.3e-23) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_0 tmp = 0 if y_46_re <= -6.5e-15: tmp = t_1 elif y_46_re <= 4.3e-23: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -6.5e-15) tmp = t_1; elseif (y_46_re <= 4.3e-23) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = (hypot(x_46_re, x_46_im) ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -6.5e-15) tmp = t_1; elseif (y_46_re <= 4.3e-23) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -6.5e-15], t$95$1, If[LessEqual[y$46$re, 4.3e-23], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -6.49999999999999991e-15 or 4.30000000000000002e-23 < y.re Initial program 41.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.1
Applied rewrites75.1%
if -6.49999999999999991e-15 < y.re < 4.30000000000000002e-23Initial program 41.2%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites40.3%
Taylor expanded in y.im around inf
Applied rewrites40.3%
Taylor expanded in y.im around 0
Applied rewrites52.0%
Final simplification65.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.im -41000.0)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(* (pow (hypot x.re x.im) 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_im <= -41000.0) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * t_0;
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_im <= -41000.0) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * t_0); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -41000.0], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.im \leq -41000:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.im < -41000Initial program 40.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6432.8
Applied rewrites32.8%
Taylor expanded in x.im around 0
Applied rewrites44.4%
if -41000 < y.im Initial program 41.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.3
Applied rewrites54.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) (sin t_0))))
(if (<= y.im -1.15e-30)
t_1
(if (<= y.im 4.3e-163)
(* t_0 (pow (hypot x.re x.im) y.re))
(if (<= y.im 5e+211)
t_1
(*
(*
(fma
(* (* y.re y.re) -0.16666666666666666)
(pow (atan2 x.im x.re) 3.0)
(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 t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * sin(t_0);
double tmp;
if (y_46_im <= -1.15e-30) {
tmp = t_1;
} else if (y_46_im <= 4.3e-163) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 5e+211) {
tmp = t_1;
} else {
tmp = (fma(((y_46_re * y_46_re) * -0.16666666666666666), pow(atan2(x_46_im, x_46_re), 3.0), 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) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * sin(t_0)) tmp = 0.0 if (y_46_im <= -1.15e-30) tmp = t_1; elseif (y_46_im <= 4.3e-163) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 5e+211) tmp = t_1; else tmp = Float64(Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.16666666666666666), (atan(x_46_im, x_46_re) ^ 3.0), 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_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.15e-30], t$95$1, If[LessEqual[y$46$im, 4.3e-163], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5e+211], t$95$1, N[(N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin t\_0\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 4.3 \cdot 10^{-163}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+211}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.16666666666666666, {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot 1\\
\end{array}
\end{array}
if y.im < -1.14999999999999992e-30 or 4.30000000000000009e-163 < y.im < 4.9999999999999995e211Initial program 42.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.6
Applied rewrites44.6%
Taylor expanded in x.im around 0
Applied rewrites47.8%
if -1.14999999999999992e-30 < y.im < 4.30000000000000009e-163Initial program 43.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.1
Applied rewrites63.1%
Taylor expanded in y.re around 0
Applied rewrites61.1%
if 4.9999999999999995e211 < y.im Initial program 18.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6425.0
Applied rewrites25.0%
Taylor expanded in y.re around 0
Applied rewrites14.1%
Taylor expanded in y.re around 0
Applied rewrites13.7%
Taylor expanded in y.re around 0
Applied rewrites42.9%
Final simplification52.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (sin t_0)))
(if (<= x.re -7.8e-267)
(* t_0 (pow (hypot x.re x.im) y.re))
(if (<= x.re 0.122) (* (pow x.im y.re) t_1) (* (pow x.re y.re) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (x_46_re <= -7.8e-267) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (x_46_re <= 0.122) {
tmp = pow(x_46_im, y_46_re) * t_1;
} else {
tmp = pow(x_46_re, y_46_re) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double tmp;
if (x_46_re <= -7.8e-267) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else if (x_46_re <= 0.122) {
tmp = Math.pow(x_46_im, y_46_re) * t_1;
} else {
tmp = Math.pow(x_46_re, y_46_re) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.sin(t_0) tmp = 0 if x_46_re <= -7.8e-267: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) elif x_46_re <= 0.122: tmp = math.pow(x_46_im, y_46_re) * t_1 else: tmp = math.pow(x_46_re, y_46_re) * 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 = sin(t_0) tmp = 0.0 if (x_46_re <= -7.8e-267) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (x_46_re <= 0.122) tmp = Float64((x_46_im ^ y_46_re) * t_1); else tmp = Float64((x_46_re ^ y_46_re) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); tmp = 0.0; if (x_46_re <= -7.8e-267) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); elseif (x_46_re <= 0.122) tmp = (x_46_im ^ y_46_re) * t_1; else tmp = (x_46_re ^ y_46_re) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[x$46$re, -7.8e-267], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 0.122], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;x.re \leq -7.8 \cdot 10^{-267}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 0.122:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if x.re < -7.79999999999999954e-267Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.6
Applied rewrites49.6%
Taylor expanded in y.re around 0
Applied rewrites49.1%
if -7.79999999999999954e-267 < x.re < 0.122Initial program 49.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.6
Applied rewrites55.6%
Taylor expanded in x.re around 0
Applied rewrites53.2%
if 0.122 < x.re Initial program 29.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.7
Applied rewrites41.7%
Taylor expanded in x.im around 0
Applied rewrites41.7%
Final simplification48.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (sin t_0)))
(if (<= x.re -0.95)
(* t_0 (pow (* (fma 0.5 (/ (* x.re x.re) (* x.im x.im)) 1.0) x.im) y.re))
(if (<= x.re 0.122) (* (pow x.im y.re) t_1) (* (pow x.re y.re) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (x_46_re <= -0.95) {
tmp = t_0 * pow((fma(0.5, ((x_46_re * x_46_re) / (x_46_im * x_46_im)), 1.0) * x_46_im), y_46_re);
} else if (x_46_re <= 0.122) {
tmp = pow(x_46_im, y_46_re) * t_1;
} else {
tmp = pow(x_46_re, y_46_re) * 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 = sin(t_0) tmp = 0.0 if (x_46_re <= -0.95) tmp = Float64(t_0 * (Float64(fma(0.5, Float64(Float64(x_46_re * x_46_re) / Float64(x_46_im * x_46_im)), 1.0) * x_46_im) ^ y_46_re)); elseif (x_46_re <= 0.122) tmp = Float64((x_46_im ^ y_46_re) * t_1); else tmp = Float64((x_46_re ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[x$46$re, -0.95], N[(t$95$0 * N[Power[N[(N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 0.122], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;x.re \leq -0.95:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im \cdot x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 0.122:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if x.re < -0.94999999999999996Initial program 30.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6443.5
Applied rewrites43.5%
Taylor expanded in x.im around inf
Applied rewrites35.5%
Taylor expanded in y.re around 0
Applied rewrites35.5%
if -0.94999999999999996 < x.re < 0.122Initial program 49.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.3
Applied rewrites55.3%
Taylor expanded in x.re around 0
Applied rewrites50.8%
if 0.122 < x.re Initial program 29.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.7
Applied rewrites41.7%
Taylor expanded in x.im around 0
Applied rewrites41.7%
Final simplification45.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
t_0
(pow (* (fma 0.5 (/ (* x.re x.re) (* x.im x.im)) 1.0) x.im) y.re))))
(if (<= x.re -0.95)
t_1
(if (<= x.re 0.122) (* (pow x.im y.re) (sin 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_re;
double t_1 = t_0 * pow((fma(0.5, ((x_46_re * x_46_re) / (x_46_im * x_46_im)), 1.0) * x_46_im), y_46_re);
double tmp;
if (x_46_re <= -0.95) {
tmp = t_1;
} else if (x_46_re <= 0.122) {
tmp = pow(x_46_im, y_46_re) * sin(t_0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(t_0 * (Float64(fma(0.5, Float64(Float64(x_46_re * x_46_re) / Float64(x_46_im * x_46_im)), 1.0) * x_46_im) ^ y_46_re)) tmp = 0.0 if (x_46_re <= -0.95) tmp = t_1; elseif (x_46_re <= 0.122) tmp = Float64((x_46_im ^ y_46_re) * sin(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[(N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -0.95], t$95$1, If[LessEqual[x$46$re, 0.122], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := t\_0 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im \cdot x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
\mathbf{if}\;x.re \leq -0.95:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.re \leq 0.122:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.re < -0.94999999999999996 or 0.122 < x.re Initial program 30.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6442.6
Applied rewrites42.6%
Taylor expanded in x.im around inf
Applied rewrites33.9%
Taylor expanded in y.re around 0
Applied rewrites33.1%
if -0.94999999999999996 < x.re < 0.122Initial program 49.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.3
Applied rewrites55.3%
Taylor expanded in x.re around 0
Applied rewrites50.8%
Final simplification42.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
t_0
(pow (* (fma 0.5 (/ (* x.re x.re) (* x.im x.im)) 1.0) x.im) y.re))))
(if (<= y.re -1.6e-223) t_1 (if (<= y.re 0.41) 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_re;
double t_1 = t_0 * pow((fma(0.5, ((x_46_re * x_46_re) / (x_46_im * x_46_im)), 1.0) * x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.6e-223) {
tmp = t_1;
} else if (y_46_re <= 0.41) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(t_0 * (Float64(fma(0.5, Float64(Float64(x_46_re * x_46_re) / Float64(x_46_im * x_46_im)), 1.0) * x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.6e-223) tmp = t_1; elseif (y_46_re <= 0.41) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[(N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e-223], t$95$1, If[LessEqual[y$46$re, 0.41], t$95$0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := t\_0 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im \cdot x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 0.41:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.6e-223 or 0.409999999999999976 < y.re Initial program 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.8
Applied rewrites60.8%
Taylor expanded in x.im around inf
Applied rewrites46.5%
Taylor expanded in y.re around 0
Applied rewrites41.0%
if -1.6e-223 < y.re < 0.409999999999999976Initial program 35.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6420.6
Applied rewrites20.6%
Taylor expanded in y.re around 0
Applied rewrites18.6%
Final simplification34.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (sin (* (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) {
return 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0 * sin((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) {
return 1.0 * Math.sin((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): return 1.0 * math.sin((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) return Float64(1.0 * sin(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) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 41.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.7
Applied rewrites49.7%
Taylor expanded in y.re around 0
Applied rewrites11.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (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) {
return atan2(x_46_im, x_46_re) * y_46_re;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
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 = 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) {
return 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): return 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) return 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) tmp = atan2(x_46_im, x_46_re) * y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re
\end{array}
Initial program 41.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.7
Applied rewrites49.7%
Taylor expanded in y.re around 0
Applied rewrites11.3%
Final simplification11.3%
herbie shell --seed 2024249
(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)))))