
(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 21 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 (* (atan2 x.im x.re) y.re))
(t_1 (sin t_0))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_3 (log (hypot x.re x.im))))
(if (<= y.re -7.2e-18)
(* (fma (* t_3 1.0) y.im t_1) t_2)
(if (<= y.re 2.5e-12)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_3) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(* (fma (* (cos t_0) t_3) 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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double t_2 = exp(((log(sqrt(((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))));
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -7.2e-18) {
tmp = fma((t_3 * 1.0), y_46_im, t_1) * t_2;
} else if (y_46_re <= 2.5e-12) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_3) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = fma((cos(t_0) * t_3), y_46_im, t_1) * t_2;
}
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) 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(y_46_im * atan(x_46_im, x_46_re)))) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -7.2e-18) tmp = Float64(fma(Float64(t_3 * 1.0), y_46_im, t_1) * t_2); elseif (y_46_re <= 2.5e-12) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_3) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(fma(Float64(cos(t_0) * t_3), y_46_im, t_1) * t_2); 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]}, 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e-18], N[(N[(N[(t$95$3 * 1.0), $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 2.5e-12], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$3), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$3), $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(t\_3 \cdot 1, y.im, t\_1\right) \cdot t\_2\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_3\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos t\_0 \cdot t\_3, y.im, t\_1\right) \cdot t\_2\\
\end{array}
\end{array}
if y.re < -7.20000000000000021e-18Initial program 46.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 rewrites82.6%
Taylor expanded in y.re around 0
Applied rewrites82.6%
if -7.20000000000000021e-18 < y.re < 2.49999999999999985e-12Initial program 39.1%
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.f6448.0
Applied rewrites48.0%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6480.6
Applied rewrites80.6%
if 2.49999999999999985e-12 < y.re Initial program 43.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 rewrites73.8%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1
(*
(fma (* t_0 1.0) y.im (sin (* (atan2 x.im x.re) y.re)))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -7.2e-18)
t_1
(if (<= y.re 2.5e-12)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
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 = fma((t_0 * 1.0), y_46_im, sin((atan2(x_46_im, x_46_re) * y_46_re))) * exp(((log(sqrt(((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))));
double tmp;
if (y_46_re <= -7.2e-18) {
tmp = t_1;
} else if (y_46_re <= 2.5e-12) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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 = Float64(fma(Float64(t_0 * 1.0), y_46_im, sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) * exp(Float64(Float64(log(sqrt(Float64(Float64(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))))) tmp = 0.0 if (y_46_re <= -7.2e-18) tmp = t_1; elseif (y_46_re <= 2.5e-12) 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(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(t$95$0 * 1.0), $MachinePrecision] * y$46$im + N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e-18], t$95$1, If[LessEqual[y$46$re, 2.5e-12], 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[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \mathsf{fma}\left(t\_0 \cdot 1, y.im, \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;\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^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -7.20000000000000021e-18 or 2.49999999999999985e-12 < y.re Initial program 44.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 rewrites77.8%
Taylor expanded in y.re around 0
Applied rewrites77.0%
if -7.20000000000000021e-18 < y.re < 2.49999999999999985e-12Initial program 39.1%
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.f6448.0
Applied rewrites48.0%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6480.6
Applied rewrites80.6%
Final simplification78.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1
(*
(sin (* t_0 y.im))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -1.55)
t_1
(if (<= y.re 2200.0)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
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 = sin((t_0 * y_46_im)) * exp(((log(sqrt(((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))));
double tmp;
if (y_46_re <= -1.55) {
tmp = t_1;
} else if (y_46_re <= 2200.0) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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 = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(Float64(log(sqrt(Float64(Float64(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))))) tmp = 0.0 if (y_46_re <= -1.55) tmp = t_1; elseif (y_46_re <= 2200.0) 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(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.55], t$95$1, If[LessEqual[y$46$re, 2200.0], 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[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sin \left(t\_0 \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -1.55:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2200:\\
\;\;\;\;\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^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.55000000000000004 or 2200 < y.re Initial program 43.5%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.4
Applied rewrites76.4%
if -1.55000000000000004 < y.re < 2200Initial program 40.6%
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.f6450.5
Applied rewrites50.5%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6479.1
Applied rewrites79.1%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -7.2e-18)
t_0
(if (<= y.re 7.6e-10)
(*
(sin
(*
(fma y.re (/ (atan2 x.im x.re) y.im) (log (hypot x.re x.im)))
y.im))
(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 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((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))));
double tmp;
if (y_46_re <= -7.2e-18) {
tmp = t_0;
} else if (y_46_re <= 7.6e-10) {
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((-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(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(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))))) tmp = 0.0 if (y_46_re <= -7.2e-18) tmp = t_0; elseif (y_46_re <= 7.6e-10) 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(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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e-18], t$95$0, If[LessEqual[y$46$re, 7.6e-10], 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[((-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 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 7.6 \cdot 10^{-10}:\\
\;\;\;\;\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^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7.20000000000000021e-18 or 7.5999999999999996e-10 < y.re Initial program 44.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6474.5
Applied rewrites74.5%
if -7.20000000000000021e-18 < y.re < 7.5999999999999996e-10Initial program 39.3%
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.f6448.0
Applied rewrites48.0%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6479.8
Applied rewrites79.8%
Final simplification77.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)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -7.2e-18)
t_1
(if (<= y.re 7.6e-10)
(*
(fma (* (log (hypot x.re x.im)) 1.0) y.im t_0)
(exp (* (- y.im) (atan2 x.im x.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) * exp(((log(sqrt(((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))));
double tmp;
if (y_46_re <= -7.2e-18) {
tmp = t_1;
} else if (y_46_re <= 7.6e-10) {
tmp = fma((log(hypot(x_46_re, x_46_im)) * 1.0), y_46_im, t_0) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(sin(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(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -7.2e-18) tmp = t_1; elseif (y_46_re <= 7.6e-10) tmp = Float64(fma(Float64(log(hypot(x_46_re, x_46_im)) * 1.0), y_46_im, t_0) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); 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[Sin[t$95$0], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e-18], t$95$1, If[LessEqual[y$46$re, 7.6e-10], N[(N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $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 := \sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 7.6 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot 1, y.im, t\_0\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -7.20000000000000021e-18 or 7.5999999999999996e-10 < y.re Initial program 44.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6474.5
Applied rewrites74.5%
if -7.20000000000000021e-18 < y.re < 7.5999999999999996e-10Initial 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 rewrites46.2%
Taylor expanded in y.re around 0
Applied rewrites46.2%
Taylor expanded in y.re around 0
Applied rewrites46.2%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6477.1
Applied rewrites77.1%
Final simplification75.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -4.1e+36)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 1.26e-8)
(*
(fma (* (log (hypot x.re x.im)) 1.0) y.im t_0)
(exp (* (- y.im) (atan2 x.im x.re))))
(* (pow (hypot x.re x.im) y.re) (sin t_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 tmp;
if (y_46_re <= -4.1e+36) {
tmp = t_0 * exp(((log(sqrt(((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))));
} else if (y_46_re <= 1.26e-8) {
tmp = fma((log(hypot(x_46_re, x_46_im)) * 1.0), y_46_im, t_0) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(t_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) tmp = 0.0 if (y_46_re <= -4.1e+36) 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(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 1.26e-8) tmp = Float64(fma(Float64(log(hypot(x_46_re, x_46_im)) * 1.0), y_46_im, t_0) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -4.1e+36], 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.26e-8], N[(N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -4.1 \cdot 10^{+36}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.26 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot 1, y.im, t\_0\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -4.10000000000000013e36Initial program 48.1%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites55.8%
Taylor expanded in y.im around 0
Applied rewrites84.6%
if -4.10000000000000013e36 < y.re < 1.26e-8Initial program 39.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 rewrites47.7%
Taylor expanded in y.re around 0
Applied rewrites47.7%
Taylor expanded in y.re around 0
Applied rewrites46.1%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6474.5
Applied rewrites74.5%
if 1.26e-8 < y.re Initial program 43.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.f6466.3
Applied rewrites66.3%
Final simplification74.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (pow (hypot x.re x.im) y.re) (sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -1.45e-41)
t_0
(if (<= y.re 2.8e-12)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(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 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.45e-41) {
tmp = t_0;
} else if (y_46_re <= 2.8e-12) {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.45e-41) {
tmp = t_0;
} else if (y_46_re <= 2.8e-12) {
tmp = Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -1.45e-41: tmp = t_0 elif y_46_re <= 2.8e-12: tmp = math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * math.exp((-y_46_im * math.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((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -1.45e-41) tmp = t_0; elseif (y_46_re <= 2.8e-12) tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -1.45e-41) tmp = t_0; elseif (y_46_re <= 2.8e-12) tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.45e-41], t$95$0, If[LessEqual[y$46$re, 2.8e-12], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $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 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-12}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.44999999999999989e-41 or 2.8000000000000002e-12 < y.re Initial program 42.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.f6468.9
Applied rewrites68.9%
if -1.44999999999999989e-41 < y.re < 2.8000000000000002e-12Initial program 41.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 rewrites48.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6463.6
Applied rewrites63.6%
Applied rewrites63.8%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (pow (hypot x.re x.im) y.re) (sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -1.12e-29)
t_0
(if (<= y.re 2.8e-12)
(*
(* (log (hypot x.re x.im)) y.im)
(pow (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 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.12e-29) {
tmp = t_0;
} else if (y_46_re <= 2.8e-12) {
tmp = (log(hypot(x_46_re, x_46_im)) * y_46_im) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.12e-29) {
tmp = t_0;
} else if (y_46_re <= 2.8e-12) {
tmp = (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -1.12e-29: tmp = t_0 elif y_46_re <= 2.8e-12: tmp = (math.log(math.hypot(x_46_re, x_46_im)) * y_46_im) * math.pow(math.exp(y_46_im), -math.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((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -1.12e-29) tmp = t_0; elseif (y_46_re <= 2.8e-12) tmp = Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -1.12e-29) tmp = t_0; elseif (y_46_re <= 2.8e-12) tmp = (log(hypot(x_46_re, x_46_im)) * y_46_im) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.12e-29], t$95$0, If[LessEqual[y$46$re, 2.8e-12], N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.12 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-12}:\\
\;\;\;\;\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.11999999999999995e-29 or 2.8000000000000002e-12 < y.re Initial program 43.5%
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.2
Applied rewrites70.2%
if -1.11999999999999995e-29 < y.re < 2.8000000000000002e-12Initial program 40.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 rewrites47.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6462.3
Applied rewrites62.3%
Taylor expanded in y.im around 0
Applied rewrites59.7%
Final simplification65.4%
(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 (<= y.re -7.2e-18)
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 4.2e-17)
(* t_1 (exp (* (- y.im) (atan2 x.im x.re))))
(* (pow (hypot x.re x.im) 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 (y_46_re <= -7.2e-18) {
tmp = t_0 * exp(((log(sqrt(((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))));
} else if (y_46_re <= 4.2e-17) {
tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_re, x_46_im), 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 (y_46_re <= -7.2e-18) {
tmp = t_0 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.2e-17) {
tmp = t_1 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), 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 y_46_re <= -7.2e-18: tmp = t_0 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 4.2e-17: tmp = t_1 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), 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 (y_46_re <= -7.2e-18) 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(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4.2e-17) tmp = Float64(t_1 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ 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 (y_46_re <= -7.2e-18) tmp = t_0 * exp(((log(sqrt(((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)))); elseif (y_46_re <= 4.2e-17) tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = (hypot(x_46_re, x_46_im) ^ 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[y$46$re, -7.2e-18], 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.2e-17], N[(t$95$1 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], 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}\;y.re \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4.2 \cdot 10^{-17}:\\
\;\;\;\;t\_1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -7.20000000000000021e-18Initial program 46.0%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites54.0%
Taylor expanded in y.im around 0
Applied rewrites77.8%
if -7.20000000000000021e-18 < y.re < 4.19999999999999984e-17Initial program 39.3%
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.f6448.3
Applied rewrites48.3%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6480.5
Applied rewrites80.5%
Taylor expanded in y.im around 0
Applied rewrites52.7%
if 4.19999999999999984e-17 < y.re Initial program 43.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.f6463.6
Applied rewrites63.6%
Final simplification62.2%
(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 -1.55e-5)
t_1
(if (<= y.re 4.2e-17) (* t_0 (exp (* (- y.im) (atan2 x.im x.re)))) 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 <= -1.55e-5) {
tmp = t_1;
} else if (y_46_re <= 4.2e-17) {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} 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 <= -1.55e-5) {
tmp = t_1;
} else if (y_46_re <= 4.2e-17) {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} 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 <= -1.55e-5: tmp = t_1 elif y_46_re <= 4.2e-17: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) 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 <= -1.55e-5) tmp = t_1; elseif (y_46_re <= 4.2e-17) tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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 <= -1.55e-5) tmp = t_1; elseif (y_46_re <= 4.2e-17) tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[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, -1.55e-5], t$95$1, If[LessEqual[y$46$re, 4.2e-17], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -1.55 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4.2 \cdot 10^{-17}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.55000000000000007e-5 or 4.19999999999999984e-17 < y.re Initial program 44.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.f6469.5
Applied rewrites69.5%
if -1.55000000000000007e-5 < y.re < 4.19999999999999984e-17Initial program 39.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.2
Applied rewrites49.2%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6480.8
Applied rewrites80.8%
Taylor expanded in y.im around 0
Applied rewrites53.5%
Final simplification62.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (pow (hypot x.re x.im) y.re) (sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -1e-61)
t_0
(if (<= y.re 5.5e-239)
(*
(pow (+ 1.0 y.im) (- (atan2 x.im x.re)))
(* (log (hypot x.re x.im)) y.im))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1e-61) {
tmp = t_0;
} else if (y_46_re <= 5.5e-239) {
tmp = pow((1.0 + y_46_im), -atan2(x_46_im, x_46_re)) * (log(hypot(x_46_re, x_46_im)) * y_46_im);
} else {
tmp = 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1e-61) {
tmp = t_0;
} else if (y_46_re <= 5.5e-239) {
tmp = Math.pow((1.0 + y_46_im), -Math.atan2(x_46_im, x_46_re)) * (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -1e-61: tmp = t_0 elif y_46_re <= 5.5e-239: tmp = math.pow((1.0 + y_46_im), -math.atan2(x_46_im, x_46_re)) * (math.log(math.hypot(x_46_re, x_46_im)) * y_46_im) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -1e-61) tmp = t_0; elseif (y_46_re <= 5.5e-239) tmp = Float64((Float64(1.0 + y_46_im) ^ Float64(-atan(x_46_im, x_46_re))) * Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -1e-61) tmp = t_0; elseif (y_46_re <= 5.5e-239) tmp = ((1.0 + y_46_im) ^ -atan2(x_46_im, x_46_re)) * (log(hypot(x_46_re, x_46_im)) * y_46_im); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1e-61], t$95$0, If[LessEqual[y$46$re, 5.5e-239], N[(N[Power[N[(1.0 + y$46$im), $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision] * N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{-61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{-239}:\\
\;\;\;\;{\left(1 + y.im\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1e-61 or 5.49999999999999978e-239 < y.re Initial 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.f6458.6
Applied rewrites58.6%
if -1e-61 < y.re < 5.49999999999999978e-239Initial program 48.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 rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6466.2
Applied rewrites66.2%
Taylor expanded in y.im around 0
Applied rewrites48.3%
Taylor expanded in y.im around 0
Applied rewrites45.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (pow (hypot x.re x.im) y.re) (sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -9.5e-147)
t_0
(if (<= y.re 2.6e-12)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -9.5e-147) {
tmp = t_0;
} else if (y_46_re <= 2.6e-12) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = 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.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -9.5e-147) {
tmp = t_0;
} else if (y_46_re <= 2.6e-12) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -9.5e-147: tmp = t_0 elif y_46_re <= 2.6e-12: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -9.5e-147) tmp = t_0; elseif (y_46_re <= 2.6e-12) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -9.5e-147) tmp = t_0; elseif (y_46_re <= 2.6e-12) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.5e-147], t$95$0, If[LessEqual[y$46$re, 2.6e-12], N[(1.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$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{-147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{-12}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.49999999999999986e-147 or 2.59999999999999983e-12 < y.re Initial program 42.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.f6464.8
Applied rewrites64.8%
if -9.49999999999999986e-147 < y.re < 2.59999999999999983e-12Initial program 41.9%
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 rewrites45.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6466.7
Applied rewrites66.7%
Taylor expanded in y.im around 0
Applied rewrites34.1%
Final simplification53.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* (pow (hypot x.re x.im) y.re) t_0)))
(if (<= y.re -9.5e-147)
t_1
(if (<= y.re 2.6e-12)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
(if (<= y.re 5.1e+68) t_1 (* (pow x.re y.re) (sin t_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(hypot(x_46_re, x_46_im), y_46_re) * t_0;
double tmp;
if (y_46_re <= -9.5e-147) {
tmp = t_1;
} else if (y_46_re <= 2.6e-12) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 5.1e+68) {
tmp = t_1;
} else {
tmp = pow(x_46_re, y_46_re) * sin(t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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 <= -9.5e-147) {
tmp = t_1;
} else if (y_46_re <= 2.6e-12) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 5.1e+68) {
tmp = t_1;
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin(t_0);
}
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.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_0 tmp = 0 if y_46_re <= -9.5e-147: tmp = t_1 elif y_46_re <= 2.6e-12: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) elif y_46_re <= 5.1e+68: tmp = t_1 else: tmp = math.pow(x_46_re, y_46_re) * math.sin(t_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((hypot(x_46_re, x_46_im) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -9.5e-147) tmp = t_1; elseif (y_46_re <= 2.6e-12) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); elseif (y_46_re <= 5.1e+68) tmp = t_1; else tmp = Float64((x_46_re ^ y_46_re) * sin(t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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 <= -9.5e-147) tmp = t_1; elseif (y_46_re <= 2.6e-12) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); elseif (y_46_re <= 5.1e+68) tmp = t_1; else tmp = (x_46_re ^ y_46_re) * sin(t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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, -9.5e-147], t$95$1, If[LessEqual[y$46$re, 2.6e-12], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.1e+68], t$95$1, N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{-12}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 5.1 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -9.49999999999999986e-147 or 2.59999999999999983e-12 < y.re < 5.1e68Initial program 43.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.f6463.3
Applied rewrites63.3%
Taylor expanded in y.re around 0
Applied rewrites61.4%
if -9.49999999999999986e-147 < y.re < 2.59999999999999983e-12Initial program 41.9%
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 rewrites45.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6466.7
Applied rewrites66.7%
Taylor expanded in y.im around 0
Applied rewrites34.1%
if 5.1e68 < y.re Initial program 39.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.f6468.1
Applied rewrites68.1%
Taylor expanded in x.im around 0
Applied rewrites70.0%
Final simplification53.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.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
t_0)))
(if (<= y.re -5.6e-55)
t_1
(if (<= y.re 0.009)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
(if (<= y.re 2.35e+116) t_1 (* (pow x.im y.re) (sin t_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_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * t_0;
double tmp;
if (y_46_re <= -5.6e-55) {
tmp = t_1;
} else if (y_46_re <= 0.009) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 2.35e+116) {
tmp = t_1;
} else {
tmp = pow(x_46_im, y_46_re) * sin(t_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((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -5.6e-55) tmp = t_1; elseif (y_46_re <= 0.009) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); elseif (y_46_re <= 2.35e+116) tmp = t_1; else tmp = Float64((x_46_im ^ y_46_re) * sin(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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e-55], t$95$1, If[LessEqual[y$46$re, 0.009], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.35e+116], t$95$1, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $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(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 0.009:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 2.35 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -5.59999999999999968e-55 or 0.00899999999999999932 < y.re < 2.3500000000000002e116Initial program 41.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.f6467.0
Applied rewrites67.0%
Taylor expanded in x.im around inf
Applied rewrites58.4%
Taylor expanded in x.re around inf
Applied rewrites58.4%
Taylor expanded in y.re around 0
Applied rewrites61.3%
if -5.59999999999999968e-55 < y.re < 0.00899999999999999932Initial program 43.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 rewrites48.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6461.5
Applied rewrites61.5%
Taylor expanded in y.im around 0
Applied rewrites32.9%
if 2.3500000000000002e116 < y.re Initial program 39.5%
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.f6471.2
Applied rewrites71.2%
Taylor expanded in x.re around 0
Applied rewrites55.7%
Final simplification47.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -5.6e-55)
(* (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re) t_0)
(if (<= y.re 2.8e-12)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
(* (pow x.re y.re) (sin t_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 tmp;
if (y_46_re <= -5.6e-55) {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 2.8e-12) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = pow(x_46_re, y_46_re) * sin(t_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) tmp = 0.0 if (y_46_re <= -5.6e-55) tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 2.8e-12) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64((x_46_re ^ y_46_re) * sin(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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e-55], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2.8e-12], N[(1.0 * 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[x$46$re, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-55}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-12}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -5.59999999999999968e-55Initial program 40.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.8
Applied rewrites70.8%
Taylor expanded in x.im around inf
Applied rewrites66.5%
Taylor expanded in x.re around inf
Applied rewrites65.1%
Taylor expanded in y.re around 0
Applied rewrites67.9%
if -5.59999999999999968e-55 < y.re < 2.8000000000000002e-12Initial program 42.5%
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 rewrites48.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6463.0
Applied rewrites63.0%
Taylor expanded in y.im around 0
Applied rewrites33.7%
if 2.8000000000000002e-12 < y.re Initial program 42.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.f6465.5
Applied rewrites65.5%
Taylor expanded in x.im around 0
Applied rewrites59.5%
Final simplification50.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
(* (atan2 x.im x.re) y.re))))
(if (<= y.re -5.6e-55)
t_0
(if (<= y.re 0.009) (* 1.0 (sin (* (log (hypot x.re x.im)) y.im))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * (atan2(x_46_im, x_46_re) * y_46_re);
double tmp;
if (y_46_re <= -5.6e-55) {
tmp = t_0;
} else if (y_46_re <= 0.009) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -5.6e-55) tmp = t_0; elseif (y_46_re <= 0.009) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e-55], t$95$0, If[LessEqual[y$46$re, 0.009], N[(1.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$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-55}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.009:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.59999999999999968e-55 or 0.00899999999999999932 < y.re Initial program 41.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.f6468.1
Applied rewrites68.1%
Taylor expanded in x.im around inf
Applied rewrites59.8%
Taylor expanded in x.re around inf
Applied rewrites59.0%
Taylor expanded in y.re around 0
Applied rewrites56.3%
if -5.59999999999999968e-55 < y.re < 0.00899999999999999932Initial program 43.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 rewrites48.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6461.5
Applied rewrites61.5%
Taylor expanded in y.im around 0
Applied rewrites32.9%
Final simplification46.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
(* (atan2 x.im x.re) y.re))))
(if (<= y.re -2.1e-57)
t_0
(if (<= y.re 0.009) (* (log (hypot x.re x.im)) y.im) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * (atan2(x_46_im, x_46_re) * y_46_re);
double tmp;
if (y_46_re <= -2.1e-57) {
tmp = t_0;
} else if (y_46_re <= 0.009) {
tmp = log(hypot(x_46_re, x_46_im)) * y_46_im;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -2.1e-57) tmp = t_0; elseif (y_46_re <= 0.009) tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-57], t$95$0, If[LessEqual[y$46$re, 0.009], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-57}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.009:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.0999999999999999e-57 or 0.00899999999999999932 < y.re Initial program 41.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.f6468.1
Applied rewrites68.1%
Taylor expanded in x.im around inf
Applied rewrites59.8%
Taylor expanded in x.re around inf
Applied rewrites59.0%
Taylor expanded in y.re around 0
Applied rewrites56.3%
if -2.0999999999999999e-57 < y.re < 0.00899999999999999932Initial program 43.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 rewrites48.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6461.5
Applied rewrites61.5%
Taylor expanded in y.im around 0
Applied rewrites39.5%
Taylor expanded in y.im around 0
Applied rewrites32.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re)
(* (atan2 x.im x.re) y.re))))
(if (<= y.re -5.6e-143)
t_0
(if (<= y.re 7.5e-12) (* (log (hypot x.re x.im)) y.im) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow((fma((0.5 / x_46_im), ((x_46_re * x_46_re) / x_46_im), 1.0) * x_46_im), y_46_re) * (atan2(x_46_im, x_46_re) * y_46_re);
double tmp;
if (y_46_re <= -5.6e-143) {
tmp = t_0;
} else if (y_46_re <= 7.5e-12) {
tmp = log(hypot(x_46_re, x_46_im)) * y_46_im;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((Float64(fma(Float64(0.5 / x_46_im), Float64(Float64(x_46_re * x_46_re) / x_46_im), 1.0) * x_46_im) ^ y_46_re) * Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -5.6e-143) tmp = t_0; elseif (y_46_re <= 7.5e-12) tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[(N[(N[(0.5 / x$46$im), $MachinePrecision] * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e-143], t$95$0, If[LessEqual[y$46$re, 7.5e-12], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-143}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.5999999999999997e-143 or 7.5e-12 < y.re Initial program 42.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.f6465.6
Applied rewrites65.6%
Taylor expanded in x.im around inf
Applied rewrites57.6%
Taylor expanded in y.re around 0
Applied rewrites52.6%
if -5.5999999999999997e-143 < y.re < 7.5e-12Initial program 41.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 rewrites44.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6466.4
Applied rewrites66.4%
Taylor expanded in y.im around 0
Applied rewrites40.2%
Taylor expanded in y.im around 0
Applied rewrites32.7%
Final simplification45.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (hypot x.re x.im)) y.im)))
(if (<= y.im -1.4e-236)
t_0
(if (<= y.im 2.15e-253) (* 1.0 (sin (* (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 = log(hypot(x_46_re, x_46_im)) * y_46_im;
double tmp;
if (y_46_im <= -1.4e-236) {
tmp = t_0;
} else if (y_46_im <= 2.15e-253) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 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.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
double tmp;
if (y_46_im <= -1.4e-236) {
tmp = t_0;
} else if (y_46_im <= 2.15e-253) {
tmp = 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im tmp = 0 if y_46_im <= -1.4e-236: tmp = t_0 elif y_46_im <= 2.15e-253: tmp = 1.0 * math.sin((math.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(log(hypot(x_46_re, x_46_im)) * y_46_im) tmp = 0.0 if (y_46_im <= -1.4e-236) tmp = t_0; elseif (y_46_im <= 2.15e-253) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) * y_46_im; tmp = 0.0; if (y_46_im <= -1.4e-236) tmp = t_0; elseif (y_46_im <= 2.15e-253) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.4e-236], t$95$0, If[LessEqual[y$46$im, 2.15e-253], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{-236}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.15 \cdot 10^{-253}:\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.39999999999999993e-236 or 2.1500000000000001e-253 < y.im Initial program 41.5%
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.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6446.9
Applied rewrites46.9%
Taylor expanded in y.im around 0
Applied rewrites22.8%
Taylor expanded in y.im around 0
Applied rewrites17.9%
if -1.39999999999999993e-236 < y.im < 2.1500000000000001e-253Initial program 45.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.f6480.8
Applied rewrites80.8%
Taylor expanded in y.re around 0
Applied rewrites44.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (hypot x.re x.im)) y.im)))
(if (<= y.im -1.4e-236)
t_0
(if (<= y.im 4.7e-250) (* (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 = log(hypot(x_46_re, x_46_im)) * y_46_im;
double tmp;
if (y_46_im <= -1.4e-236) {
tmp = t_0;
} else if (y_46_im <= 4.7e-250) {
tmp = atan2(x_46_im, x_46_re) * y_46_re;
} else {
tmp = 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.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
double tmp;
if (y_46_im <= -1.4e-236) {
tmp = t_0;
} else if (y_46_im <= 4.7e-250) {
tmp = Math.atan2(x_46_im, x_46_re) * y_46_re;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im tmp = 0 if y_46_im <= -1.4e-236: tmp = t_0 elif y_46_im <= 4.7e-250: tmp = math.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(log(hypot(x_46_re, x_46_im)) * y_46_im) tmp = 0.0 if (y_46_im <= -1.4e-236) tmp = t_0; elseif (y_46_im <= 4.7e-250) tmp = Float64(atan(x_46_im, x_46_re) * y_46_re); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) * y_46_im; tmp = 0.0; if (y_46_im <= -1.4e-236) tmp = t_0; elseif (y_46_im <= 4.7e-250) tmp = atan2(x_46_im, x_46_re) * y_46_re; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.4e-236], t$95$0, If[LessEqual[y$46$im, 4.7e-250], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{-236}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.7 \cdot 10^{-250}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.39999999999999993e-236 or 4.69999999999999982e-250 < y.im Initial program 41.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.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/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.f6447.1
Applied rewrites47.1%
Taylor expanded in y.im around 0
Applied rewrites22.9%
Taylor expanded in y.im around 0
Applied rewrites18.0%
if -1.39999999999999993e-236 < y.im < 4.69999999999999982e-250Initial program 44.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.f6478.6
Applied rewrites78.6%
Taylor expanded in y.re around 0
Applied rewrites43.3%
Final simplification21.6%
(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 42.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.f6448.5
Applied rewrites48.5%
Taylor expanded in y.re around 0
Applied rewrites12.8%
Final simplification12.8%
herbie shell --seed 2024270
(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)))))