
(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 13 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
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (log (hypot x.re x.im)))
(t_3 (* (sin (* t_2 y.im)) (exp (* (- y.im) (atan2 x.im x.re)))))
(t_4 (log (hypot x.im x.re))))
(if (<= y.im -1e+185)
t_3
(if (<= y.im -1.3e-7)
(*
t_1
(sin (/ y.im (/ (- -1.0) (fma (/ (atan2 x.im x.re) y.im) y.re t_4)))))
(if (<= y.im 1700000000.0)
(*
(pow (hypot x.re x.im) y.re)
(fma (* (cos t_0) t_2) y.im (sin t_0)))
(if (<= y.im 1.6e+55)
(* t_1 (sin (* (fma t_4 (/ y.im y.re) (atan2 x.im x.re)) y.re)))
t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = sin((t_2 * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_4 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1e+185) {
tmp = t_3;
} else if (y_46_im <= -1.3e-7) {
tmp = t_1 * sin((y_46_im / (-(-1.0) / fma((atan2(x_46_im, x_46_re) / y_46_im), y_46_re, t_4))));
} else if (y_46_im <= 1700000000.0) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * fma((cos(t_0) * t_2), y_46_im, sin(t_0));
} else if (y_46_im <= 1.6e+55) {
tmp = t_1 * sin((fma(t_4, (y_46_im / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else {
tmp = t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = Float64(sin(Float64(t_2 * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) t_4 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1e+185) tmp = t_3; elseif (y_46_im <= -1.3e-7) tmp = Float64(t_1 * sin(Float64(y_46_im / Float64(Float64(-(-1.0)) / fma(Float64(atan(x_46_im, x_46_re) / y_46_im), y_46_re, t_4))))); elseif (y_46_im <= 1700000000.0) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * fma(Float64(cos(t_0) * t_2), y_46_im, sin(t_0))); elseif (y_46_im <= 1.6e+55) tmp = Float64(t_1 * sin(Float64(fma(t_4, Float64(y_46_im / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); else tmp = t_3; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[N[(t$95$2 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1e+185], t$95$3, If[LessEqual[y$46$im, -1.3e-7], N[(t$95$1 * N[Sin[N[(y$46$im / N[((--1.0) / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] * y$46$re + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1700000000.0], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.6e+55], N[(t$95$1 * N[Sin[N[(N[(t$95$4 * N[(y$46$im / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := \sin \left(t\_2 \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_4 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+185}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq -1.3 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot \sin \left(\frac{y.im}{\frac{--1}{\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, y.re, t\_4\right)}}\right)\\
\mathbf{elif}\;y.im \leq 1700000000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \mathsf{fma}\left(\cos t\_0 \cdot t\_2, y.im, \sin t\_0\right)\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+55}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(t\_4, \frac{y.im}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.im < -9.9999999999999998e184 or 1.6000000000000001e55 < y.im Initial program 26.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f649.4
Applied rewrites9.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6463.2
Applied rewrites63.2%
if -9.9999999999999998e184 < y.im < -1.29999999999999999e-7Initial program 41.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.9
Applied rewrites65.9%
Applied rewrites62.4%
Applied rewrites72.8%
if -1.29999999999999999e-7 < y.im < 1.7e9Initial program 46.1%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites66.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6487.6
Applied rewrites87.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 rewrites87.4%
if 1.7e9 < y.im < 1.6000000000000001e55Initial program 14.3%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-/.f64N/A
lower-atan2.f6485.7
Applied rewrites85.7%
Final simplification77.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp (* (- y.im) (atan2 x.im x.re)))))
(t_1 (log (hypot x.im x.re)))
(t_2 (fma (- (atan2 x.im x.re)) y.re (* y.im t_1))))
(if (<= y.im -1e+185)
t_0
(if (<= y.im -1.3e-7)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (/ y.im (/ (- -1.0) (fma (/ (atan2 x.im x.re) y.im) y.re t_1)))))
(if (<= y.im 1.55e+55)
(*
(pow (hypot x.re x.im) y.re)
(sin
(*
(fma y.im t_1 (* (atan2 x.im x.re) y.re))
(* t_2 (pow t_2 -1.0)))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = fma(-atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_1));
double tmp;
if (y_46_im <= -1e+185) {
tmp = t_0;
} else if (y_46_im <= -1.3e-7) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im / (-(-1.0) / fma((atan2(x_46_im, x_46_re) / y_46_im), y_46_re, t_1))));
} else if (y_46_im <= 1.55e+55) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((fma(y_46_im, t_1, (atan2(x_46_im, x_46_re) * y_46_re)) * (t_2 * pow(t_2, -1.0))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = fma(Float64(-atan(x_46_im, x_46_re)), y_46_re, Float64(y_46_im * t_1)) tmp = 0.0 if (y_46_im <= -1e+185) tmp = t_0; elseif (y_46_im <= -1.3e-7) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im / Float64(Float64(-(-1.0)) / fma(Float64(atan(x_46_im, x_46_re) / y_46_im), y_46_re, t_1))))); elseif (y_46_im <= 1.55e+55) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(fma(y_46_im, t_1, Float64(atan(x_46_im, x_46_re) * y_46_re)) * Float64(t_2 * (t_2 ^ -1.0))))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(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]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$re + N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1e+185], t$95$0, If[LessEqual[y$46$im, -1.3e-7], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im / N[((--1.0) / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] * y$46$re + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+55], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[(y$46$im * t$95$1 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[Power[t$95$2, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_1\right)\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+185}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.3 \cdot 10^{-7}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{y.im}{\frac{--1}{\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, y.re, t\_1\right)}}\right)\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+55}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, t\_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \left(t\_2 \cdot {t\_2}^{-1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -9.9999999999999998e184 or 1.54999999999999997e55 < y.im Initial program 26.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f649.4
Applied rewrites9.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6463.2
Applied rewrites63.2%
if -9.9999999999999998e184 < y.im < -1.29999999999999999e-7Initial program 41.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.9
Applied rewrites65.9%
Applied rewrites62.4%
Applied rewrites72.8%
if -1.29999999999999999e-7 < y.im < 1.54999999999999997e55Initial program 43.0%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites67.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.7
Applied rewrites84.7%
Final simplification76.4%
(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 (* (- y.im) (atan2 x.im x.re)))))
(t_2 (log (hypot x.im x.re))))
(if (<= y.im -1e+185)
t_1
(if (<= y.im -3.8e-18)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (/ y.im (/ (- -1.0) (fma (/ (atan2 x.im x.re) y.im) y.re t_2)))))
(if (<= y.im 1.55e+55)
(*
(pow (exp y.re) t_2)
(sin (* (fma y.im (/ t_0 y.re) (atan2 x.im 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 = log(hypot(x_46_re, x_46_im));
double t_1 = sin((t_0 * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double t_2 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1e+185) {
tmp = t_1;
} else if (y_46_im <= -3.8e-18) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im / (-(-1.0) / fma((atan2(x_46_im, x_46_re) / y_46_im), y_46_re, t_2))));
} else if (y_46_im <= 1.55e+55) {
tmp = pow(exp(y_46_re), t_2) * sin((fma(y_46_im, (t_0 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) t_2 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -1e+185) tmp = t_1; elseif (y_46_im <= -3.8e-18) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im / Float64(Float64(-(-1.0)) / fma(Float64(atan(x_46_im, x_46_re) / y_46_im), y_46_re, t_2))))); elseif (y_46_im <= 1.55e+55) tmp = Float64((exp(y_46_re) ^ t_2) * sin(Float64(fma(y_46_im, Float64(t_0 / y_46_re), atan(x_46_im, x_46_re)) * y_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[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1e+185], t$95$1, If[LessEqual[y$46$im, -3.8e-18], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im / N[((--1.0) / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] * y$46$re + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+55], N[(N[Power[N[Exp[y$46$re], $MachinePrecision], t$95$2], $MachinePrecision] * N[Sin[N[(N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $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^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-18}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{y.im}{\frac{--1}{\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, y.re, t\_2\right)}}\right)\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+55}:\\
\;\;\;\;{\left(e^{y.re}\right)}^{t\_2} \cdot \sin \left(\mathsf{fma}\left(y.im, \frac{t\_0}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -9.9999999999999998e184 or 1.54999999999999997e55 < y.im Initial program 26.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f649.4
Applied rewrites9.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6463.2
Applied rewrites63.2%
if -9.9999999999999998e184 < y.im < -3.7999999999999998e-18Initial program 43.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.0
Applied rewrites67.0%
Applied rewrites63.7%
Applied rewrites73.7%
if -3.7999999999999998e-18 < y.im < 1.54999999999999997e55Initial program 42.6%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites67.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.6
Applied rewrites84.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6483.9
Applied rewrites83.9%
Applied rewrites83.9%
Final simplification76.0%
(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 (* (- y.im) (atan2 x.im x.re))))))
(if (<= y.im -1e+185)
t_1
(if (<= y.im -3.8e-18)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin
(/
y.im
(/
(- -1.0)
(fma (/ (atan2 x.im x.re) y.im) y.re (log (hypot x.im x.re)))))))
(if (<= y.im 1.55e+55)
(*
(pow (hypot x.re x.im) y.re)
(sin (* (fma y.im (/ t_0 y.re) (atan2 x.im 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 = log(hypot(x_46_re, x_46_im));
double t_1 = sin((t_0 * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1e+185) {
tmp = t_1;
} else if (y_46_im <= -3.8e-18) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im / (-(-1.0) / fma((atan2(x_46_im, x_46_re) / y_46_im), y_46_re, log(hypot(x_46_im, x_46_re))))));
} else if (y_46_im <= 1.55e+55) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((fma(y_46_im, (t_0 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1e+185) tmp = t_1; elseif (y_46_im <= -3.8e-18) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im / Float64(Float64(-(-1.0)) / fma(Float64(atan(x_46_im, x_46_re) / y_46_im), y_46_re, log(hypot(x_46_im, x_46_re))))))); elseif (y_46_im <= 1.55e+55) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(fma(y_46_im, Float64(t_0 / y_46_re), atan(x_46_im, x_46_re)) * y_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[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1e+185], t$95$1, If[LessEqual[y$46$im, -3.8e-18], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im / N[((--1.0) / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] * y$46$re + N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+55], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $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^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -1 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-18}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{y.im}{\frac{--1}{\mathsf{fma}\left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}}\right)\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+55}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, \frac{t\_0}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -9.9999999999999998e184 or 1.54999999999999997e55 < y.im Initial program 26.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f649.4
Applied rewrites9.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6463.2
Applied rewrites63.2%
if -9.9999999999999998e184 < y.im < -3.7999999999999998e-18Initial program 43.6%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.0
Applied rewrites67.0%
Applied rewrites63.7%
Applied rewrites73.7%
if -3.7999999999999998e-18 < y.im < 1.54999999999999997e55Initial program 42.6%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites67.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.6
Applied rewrites84.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6483.9
Applied rewrites83.9%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -8.2e+85) (not (<= y.im 1.55e+55)))
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(*
(sin
(* (fma (log (hypot x.im x.re)) (/ y.im y.re) (atan2 x.im x.re)) y.re))
(pow (hypot 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 tmp;
if ((y_46_im <= -8.2e+85) || !(y_46_im <= 1.55e+55)) {
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 = sin((fma(log(hypot(x_46_im, x_46_re)), (y_46_im / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -8.2e+85) || !(y_46_im <= 1.55e+55)) 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 = Float64(sin(Float64(fma(log(hypot(x_46_im, x_46_re)), Float64(y_46_im / y_46_re), atan(x_46_im, x_46_re)) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -8.2e+85], N[Not[LessEqual[y$46$im, 1.55e+55]], $MachinePrecision]], 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], N[(N[Sin[N[(N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{+85} \lor \neg \left(y.im \leq 1.55 \cdot 10^{+55}\right):\\
\;\;\;\;\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}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \frac{y.im}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -8.19999999999999957e85 or 1.54999999999999997e55 < y.im Initial program 29.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6410.0
Applied rewrites10.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6461.5
Applied rewrites61.5%
if -8.19999999999999957e85 < y.im < 1.54999999999999997e55Initial program 42.7%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites67.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.6
Applied rewrites82.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6482.0
Applied rewrites82.0%
Applied rewrites82.0%
Final simplification73.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -8.2e+85) (not (<= y.im 1.55e+55)))
(* (sin (* t_0 y.im)) (exp (* (- y.im) (atan2 x.im x.re))))
(*
(pow (hypot x.re x.im) y.re)
(sin (* (fma y.im (/ t_0 y.re) (atan2 x.im x.re)) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -8.2e+85) || !(y_46_im <= 1.55e+55)) {
tmp = sin((t_0 * y_46_im)) * 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((fma(y_46_im, (t_0 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -8.2e+85) || !(y_46_im <= 1.55e+55)) tmp = Float64(sin(Float64(t_0 * y_46_im)) * 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(Float64(fma(y_46_im, Float64(t_0 / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -8.2e+85], N[Not[LessEqual[y$46$im, 1.55e+55]], $MachinePrecision]], N[(N[Sin[N[(t$95$0 * 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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)\\
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{+85} \lor \neg \left(y.im \leq 1.55 \cdot 10^{+55}\right):\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\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 \left(\mathsf{fma}\left(y.im, \frac{t\_0}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\end{array}
\end{array}
if y.im < -8.19999999999999957e85 or 1.54999999999999997e55 < y.im Initial program 29.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6410.0
Applied rewrites10.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6461.5
Applied rewrites61.5%
if -8.19999999999999957e85 < y.im < 1.54999999999999997e55Initial program 42.7%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites67.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.6
Applied rewrites82.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6482.0
Applied rewrites82.0%
Final simplification73.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (* t_0 (sin (* (log (hypot x.re x.im)) y.im))))
(t_2 (sin (* (atan2 x.im x.re) y.re)))
(t_3 (* (pow (* x.im x.im) (* y.re 0.5)) t_2)))
(if (<= y.im -1.65e+109)
t_3
(if (<= y.im -2.05e-181)
t_1
(if (<= y.im 6.2e-230) (* t_2 t_0) (if (<= y.im 6e+195) t_1 t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = t_0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
double t_2 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_3 = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_2;
double tmp;
if (y_46_im <= -1.65e+109) {
tmp = t_3;
} else if (y_46_im <= -2.05e-181) {
tmp = t_1;
} else if (y_46_im <= 6.2e-230) {
tmp = t_2 * t_0;
} else if (y_46_im <= 6e+195) {
tmp = t_1;
} else {
tmp = t_3;
}
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);
double t_1 = t_0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double t_2 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_3 = Math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_2;
double tmp;
if (y_46_im <= -1.65e+109) {
tmp = t_3;
} else if (y_46_im <= -2.05e-181) {
tmp = t_1;
} else if (y_46_im <= 6.2e-230) {
tmp = t_2 * t_0;
} else if (y_46_im <= 6e+195) {
tmp = t_1;
} else {
tmp = t_3;
}
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) t_1 = t_0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) t_2 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_3 = math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_2 tmp = 0 if y_46_im <= -1.65e+109: tmp = t_3 elif y_46_im <= -2.05e-181: tmp = t_1 elif y_46_im <= 6.2e-230: tmp = t_2 * t_0 elif y_46_im <= 6e+195: tmp = t_1 else: tmp = t_3 return tmp
function 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 t_1 = Float64(t_0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) t_2 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_3 = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * t_2) tmp = 0.0 if (y_46_im <= -1.65e+109) tmp = t_3; elseif (y_46_im <= -2.05e-181) tmp = t_1; elseif (y_46_im <= 6.2e-230) tmp = Float64(t_2 * t_0); elseif (y_46_im <= 6e+195) tmp = t_1; else tmp = t_3; 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; t_1 = t_0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); t_2 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_3 = ((x_46_im * x_46_im) ^ (y_46_re * 0.5)) * t_2; tmp = 0.0; if (y_46_im <= -1.65e+109) tmp = t_3; elseif (y_46_im <= -2.05e-181) tmp = t_1; elseif (y_46_im <= 6.2e-230) tmp = t_2 * t_0; elseif (y_46_im <= 6e+195) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[y$46$im, -1.65e+109], t$95$3, If[LessEqual[y$46$im, -2.05e-181], t$95$1, If[LessEqual[y$46$im, 6.2e-230], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 6e+195], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := t\_0 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
t_2 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_3 := {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_2\\
\mathbf{if}\;y.im \leq -1.65 \cdot 10^{+109}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq -2.05 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{-230}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{elif}\;y.im \leq 6 \cdot 10^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.im < -1.6499999999999999e109 or 6.0000000000000001e195 < y.im Initial program 29.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f649.4
Applied rewrites9.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.8
Applied rewrites25.8%
Taylor expanded in x.re around 0
Applied rewrites30.7%
Applied rewrites48.9%
if -1.6499999999999999e109 < y.im < -2.0500000000000001e-181 or 6.19999999999999999e-230 < y.im < 6.0000000000000001e195Initial program 40.3%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites64.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.8
Applied rewrites69.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.7
Applied rewrites67.7%
if -2.0500000000000001e-181 < y.im < 6.19999999999999999e-230Initial program 41.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6441.5
Applied rewrites41.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.2
Applied rewrites81.2%
Final simplification64.4%
(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)))
(t_2 (* (pow (hypot x.re x.im) y.re) t_1)))
(if (<= y.re -1.35e-25)
t_2
(if (<= y.re -2.5e-109)
(* 1.0 (sin (* (fma y.im (/ t_0 y.re) (atan2 x.im x.re)) y.re)))
(if (<= y.re 3.2) (* t_1 (exp (* (- y.im) (atan2 x.im x.re)))) t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = sin((t_0 * y_46_im));
double t_2 = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
double tmp;
if (y_46_re <= -1.35e-25) {
tmp = t_2;
} else if (y_46_re <= -2.5e-109) {
tmp = 1.0 * sin((fma(y_46_im, (t_0 / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else if (y_46_re <= 3.2) {
tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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(t_0 * y_46_im)) t_2 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1) tmp = 0.0 if (y_46_re <= -1.35e-25) tmp = t_2; elseif (y_46_re <= -2.5e-109) tmp = Float64(1.0 * sin(Float64(fma(y_46_im, Float64(t_0 / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); elseif (y_46_re <= 3.2) tmp = Float64(t_1 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(t$95$0 * y$46$im), $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, -1.35e-25], t$95$2, If[LessEqual[y$46$re, -2.5e-109], N[(1.0 * N[Sin[N[(N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.2], N[(t$95$1 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\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)\\
t_2 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -2.5 \cdot 10^{-109}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(y.im, \frac{t\_0}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 3.2:\\
\;\;\;\;t\_1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.35000000000000008e-25 or 3.2000000000000002 < y.re Initial program 32.1%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites69.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6468.4
Applied rewrites68.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.6
Applied rewrites70.6%
if -1.35000000000000008e-25 < y.re < -2.5000000000000001e-109Initial program 42.1%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites51.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6474.8
Applied rewrites74.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6474.6
Applied rewrites74.6%
Taylor expanded in y.re around 0
Applied rewrites74.6%
if -2.5000000000000001e-109 < y.re < 3.2000000000000002Initial program 44.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.0
Applied rewrites24.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6470.7
Applied rewrites70.7%
Final simplification71.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.re -1.25e-14)
(* t_0 (pow (hypot x.re x.im) y.re))
(if (<= y.re 2.1e-57)
(*
1.0
(sin
(*
(fma y.im (/ (log (hypot x.re x.im)) y.re) (atan2 x.im x.re))
y.re)))
(* (pow (* x.im x.im) (* y.re 0.5)) 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.25e-14) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_re <= 2.1e-57) {
tmp = 1.0 * sin((fma(y_46_im, (log(hypot(x_46_re, x_46_im)) / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * 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.25e-14) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_re <= 2.1e-57) tmp = Float64(1.0 * sin(Float64(fma(y_46_im, Float64(log(hypot(x_46_re, x_46_im)) / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); else tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * 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.25e-14], 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$re, 2.1e-57], N[(1.0 * N[Sin[N[(N[(y$46$im * N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $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.25 \cdot 10^{-14}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-57}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(y.im, \frac{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.25e-14Initial program 32.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6430.6
Applied rewrites30.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.1
Applied rewrites73.1%
if -1.25e-14 < y.re < 2.0999999999999999e-57Initial program 43.1%
lift-+.f64N/A
flip-+N/A
div-invN/A
difference-of-squaresN/A
lift-+.f64N/A
associate-*l*N/A
Applied rewrites49.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.9
Applied rewrites52.9%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6452.0
Applied rewrites52.0%
Taylor expanded in y.re around 0
Applied rewrites52.0%
if 2.0999999999999999e-57 < y.re Initial program 34.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.4
Applied rewrites28.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.3
Applied rewrites52.3%
Taylor expanded in x.re around 0
Applied rewrites49.9%
Applied rewrites55.8%
Final simplification58.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (or (<= y.im -4.8e+109) (not (<= y.im 2e+199)))
(* (pow (* x.im x.im) (* y.re 0.5)) t_0)
(* t_0 (pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_im <= -4.8e+109) || !(y_46_im <= 2e+199)) {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
} else {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_im <= -4.8e+109) || !(y_46_im <= 2e+199)) {
tmp = Math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
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_im <= -4.8e+109) or not (y_46_im <= 2e+199): tmp = math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0 else: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) 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 <= -4.8e+109) || !(y_46_im <= 2e+199)) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * t_0); else tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_im <= -4.8e+109) || ~((y_46_im <= 2e+199))) tmp = ((x_46_im * x_46_im) ^ (y_46_re * 0.5)) * t_0; else tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -4.8e+109], N[Not[LessEqual[y$46$im, 2e+199]], $MachinePrecision]], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $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 -4.8 \cdot 10^{+109} \lor \neg \left(y.im \leq 2 \cdot 10^{+199}\right):\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -4.79999999999999975e109 or 2.00000000000000019e199 < y.im Initial program 30.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f649.5
Applied rewrites9.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6426.1
Applied rewrites26.1%
Taylor expanded in x.re around 0
Applied rewrites31.2%
Applied rewrites49.6%
if -4.79999999999999975e109 < y.im < 2.00000000000000019e199Initial program 40.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6435.9
Applied rewrites35.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.1
Applied rewrites49.1%
Final simplification49.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= x.re 3.4e-112)
(* (pow (* x.im x.im) (* y.re 0.5)) t_0)
(* (pow 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 3.4e-112) {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
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
real(8) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= 3.4d-112) then
tmp = ((x_46im * x_46im) ** (y_46re * 0.5d0)) * t_0
else
tmp = (x_46re ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 3.4e-112) {
tmp = Math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
} else {
tmp = Math.pow(x_46_re, 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 x_46_re <= 3.4e-112: tmp = math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0 else: tmp = math.pow(x_46_re, 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 (x_46_re <= 3.4e-112) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * t_0); else tmp = Float64((x_46_re ^ 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 (x_46_re <= 3.4e-112) tmp = ((x_46_im * x_46_im) ^ (y_46_re * 0.5)) * t_0; else tmp = (x_46_re ^ 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[x$46$re, 3.4e-112], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, 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}\;x.re \leq 3.4 \cdot 10^{-112}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < 3.3999999999999998e-112Initial program 39.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6429.9
Applied rewrites29.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6448.6
Applied rewrites48.6%
Taylor expanded in x.re around 0
Applied rewrites42.1%
Applied rewrites50.2%
if 3.3999999999999998e-112 < x.re Initial program 34.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6426.3
Applied rewrites26.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.1
Applied rewrites32.1%
Taylor expanded in x.im around 0
Applied rewrites34.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))) (if (<= x.re 4.2e-217) (* (pow x.im y.re) t_0) (* (pow 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 4.2e-217) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
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
real(8) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= 4.2d-217) then
tmp = (x_46im ** y_46re) * t_0
else
tmp = (x_46re ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 4.2e-217) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_re, 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 x_46_re <= 4.2e-217: tmp = math.pow(x_46_im, y_46_re) * t_0 else: tmp = math.pow(x_46_re, 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 (x_46_re <= 4.2e-217) tmp = Float64((x_46_im ^ y_46_re) * t_0); else tmp = Float64((x_46_re ^ 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 (x_46_re <= 4.2e-217) tmp = (x_46_im ^ y_46_re) * t_0; else tmp = (x_46_re ^ 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[x$46$re, 4.2e-217], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, 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}\;x.re \leq 4.2 \cdot 10^{-217}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < 4.2e-217Initial program 39.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6429.6
Applied rewrites29.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6448.3
Applied rewrites48.3%
Taylor expanded in x.re around 0
Applied rewrites42.1%
if 4.2e-217 < x.re Initial program 35.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6427.4
Applied rewrites27.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6435.8
Applied rewrites35.8%
Taylor expanded in x.im around 0
Applied rewrites35.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow x.im y.re) (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 pow(x_46_im, y_46_re) * 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 = (x_46im ** y_46re) * 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 Math.pow(x_46_im, y_46_re) * 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 math.pow(x_46_im, y_46_re) * 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((x_46_im ^ y_46_re) * 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 = (x_46_im ^ y_46_re) * 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[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{x.im}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 37.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.7
Applied rewrites28.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6442.8
Applied rewrites42.8%
Taylor expanded in x.re around 0
Applied rewrites34.4%
herbie shell --seed 2024322
(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)))))