
(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 (log (hypot x.im x.re)))
(t_2 (sin (* t_1 y.im))))
(if (<= y.re -1.05e-7)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_2)
(if (<= y.re 5800000000000.0)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(fma (* (cos t_0) t_1) y.im (sin t_0)))
(* (pow (hypot x.im x.re) y.re) 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 = log(hypot(x_46_im, x_46_re));
double t_2 = sin((t_1 * y_46_im));
double tmp;
if (y_46_re <= -1.05e-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))) * t_2;
} else if (y_46_re <= 5800000000000.0) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * fma((cos(t_0) * t_1), y_46_im, sin(t_0));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * 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 = log(hypot(x_46_im, x_46_re)) t_2 = sin(Float64(t_1 * y_46_im)) tmp = 0.0 if (y_46_re <= -1.05e-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))) * t_2); elseif (y_46_re <= 5800000000000.0) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * fma(Float64(cos(t_0) * t_1), y_46_im, sin(t_0))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-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] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 5800000000000.0], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \sin \left(t\_1 \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -1.05 \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 t\_2\\
\mathbf{elif}\;y.re \leq 5800000000000:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \mathsf{fma}\left(\cos t\_0 \cdot t\_1, y.im, \sin t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_2\\
\end{array}
\end{array}
if y.re < -1.05e-7Initial program 47.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.8
Applied rewrites84.8%
if -1.05e-7 < y.re < 5.8e12Initial program 41.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
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.5%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6479.4
Applied rewrites79.4%
if 5.8e12 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.3
Applied rewrites33.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.3
Applied rewrites76.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (exp (* (- y.im) (atan2 x.im x.re)))))
(if (<= y.re -1.25e-35)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re -9.8e-185)
(* t_1 (sin (* (fma t_0 (/ y.im y.re) (atan2 x.im x.re)) y.re)))
(if (<= y.re 5800000000000.0)
(* t_1 (sin (pow (/ (pow y.im -1.0) t_0) -1.0)))
(* (pow (hypot x.im x.re) y.re) (sin (* t_0 y.im))))))))
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_im, x_46_re));
double t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.25e-35) {
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((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= -9.8e-185) {
tmp = t_1 * sin((fma(t_0, (y_46_im / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else if (y_46_re <= 5800000000000.0) {
tmp = t_1 * sin(pow((pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_0 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.25e-35) 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(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= -9.8e-185) tmp = Float64(t_1 * sin(Float64(fma(t_0, Float64(y_46_im / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); elseif (y_46_re <= 5800000000000.0) tmp = Float64(t_1 * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.0))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_0 * y_46_im))); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.25e-35], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -9.8e-185], N[(t$95$1 * N[Sin[N[(N[(t$95$0 * N[(y$46$im / 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, 5800000000000.0], N[(t$95$1 * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-35}:\\
\;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq -9.8 \cdot 10^{-185}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(t\_0, \frac{y.im}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 5800000000000:\\
\;\;\;\;t\_1 \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_0 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -1.24999999999999991e-35Initial program 45.3%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.7
Applied rewrites82.7%
if -1.24999999999999991e-35 < y.re < -9.8000000000000005e-185Initial program 31.6%
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.f6438.9
Applied rewrites38.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6483.8
Applied rewrites83.8%
if -9.8000000000000005e-185 < y.re < 5.8e12Initial program 44.5%
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.f6431.5
Applied rewrites31.5%
Applied rewrites23.0%
Taylor expanded in y.re around 0
Applied rewrites42.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6468.0
Applied rewrites68.0%
if 5.8e12 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.3
Applied rewrites33.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.3
Applied rewrites76.3%
Final simplification75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -0.0005) (not (<= y.re 5800000000000.0)))
(* (pow (hypot x.im x.re) y.re) (sin (* t_0 y.im)))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (pow (/ (pow y.im -1.0) t_0) -1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -0.0005) || !(y_46_re <= 5800000000000.0)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_0 * y_46_im));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(pow((pow(y_46_im, -1.0) / t_0), -1.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_im, x_46_re));
double tmp;
if ((y_46_re <= -0.0005) || !(y_46_re <= 5800000000000.0)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((t_0 * y_46_im));
} else {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin(Math.pow((Math.pow(y_46_im, -1.0) / t_0), -1.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_im, x_46_re)) tmp = 0 if (y_46_re <= -0.0005) or not (y_46_re <= 5800000000000.0): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((t_0 * y_46_im)) else: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin(math.pow((math.pow(y_46_im, -1.0) / t_0), -1.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -0.0005) || !(y_46_re <= 5800000000000.0)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_0 * y_46_im))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.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_im, x_46_re)); tmp = 0.0; if ((y_46_re <= -0.0005) || ~((y_46_re <= 5800000000000.0))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((t_0 * y_46_im)); else tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((((y_46_im ^ -1.0) / t_0) ^ -1.0)); end tmp_2 = 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.0005], N[Not[LessEqual[y$46$re, 5800000000000.0]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -0.0005 \lor \neg \left(y.re \leq 5800000000000\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -5.0000000000000001e-4 or 5.8e12 < y.re Initial program 39.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6437.6
Applied rewrites37.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.3
Applied rewrites78.3%
if -5.0000000000000001e-4 < y.re < 5.8e12Initial program 42.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.f6433.0
Applied rewrites33.0%
Applied rewrites22.8%
Taylor expanded in y.re around 0
Applied rewrites42.2%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6466.2
Applied rewrites66.2%
Final simplification72.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -0.00045)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 5800000000000.0)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (pow (/ (pow y.im -1.0) t_0) -1.0)))
(* (pow (hypot x.im x.re) y.re) (sin (* t_0 y.im)))))))
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_im, x_46_re));
double tmp;
if (y_46_re <= -0.00045) {
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((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 5800000000000.0) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(pow((pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_0 * y_46_im));
}
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_im, x_46_re));
double tmp;
if (y_46_re <= -0.00045) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 5800000000000.0) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin(Math.pow((Math.pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((t_0 * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -0.00045: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 5800000000000.0: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin(math.pow((math.pow(y_46_im, -1.0) / t_0), -1.0)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((t_0 * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -0.00045) 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(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 5800000000000.0) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.0))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_0 * y_46_im))); 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_im, x_46_re)); tmp = 0.0; if (y_46_re <= -0.00045) 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((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 5800000000000.0) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((((y_46_im ^ -1.0) / t_0) ^ -1.0)); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((t_0 * y_46_im)); end tmp_2 = 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00045], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5800000000000.0], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -0.00045:\\
\;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 5800000000000:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_0 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -4.4999999999999999e-4Initial program 45.7%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.9
Applied rewrites82.9%
if -4.4999999999999999e-4 < y.re < 5.8e12Initial program 42.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.f6433.0
Applied rewrites33.0%
Applied rewrites22.8%
Taylor expanded in y.re around 0
Applied rewrites42.2%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6466.2
Applied rewrites66.2%
if 5.8e12 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.3
Applied rewrites33.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.3
Applied rewrites76.3%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (sin (* t_0 y.im)))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_3 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -4.4e-37)
(* t_2 t_1)
(if (<= y.im 1.9e-154)
(* t_3 (sin (* (fma t_0 (/ y.im y.re) (atan2 x.im x.re)) y.re)))
(if (<= y.im 400000000000.0)
(* t_3 t_1)
(* t_2 (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) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = sin((t_0 * y_46_im));
double t_2 = 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_3 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -4.4e-37) {
tmp = t_2 * t_1;
} else if (y_46_im <= 1.9e-154) {
tmp = t_3 * sin((fma(t_0, (y_46_im / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else if (y_46_im <= 400000000000.0) {
tmp = t_3 * t_1;
} else {
tmp = t_2 * sin((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_im, x_46_re)) t_1 = sin(Float64(t_0 * y_46_im)) t_2 = 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_3 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -4.4e-37) tmp = Float64(t_2 * t_1); elseif (y_46_im <= 1.9e-154) tmp = Float64(t_3 * sin(Float64(fma(t_0, Float64(y_46_im / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); elseif (y_46_im <= 400000000000.0) tmp = Float64(t_3 * t_1); else tmp = Float64(t_2 * sin(Float64(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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -4.4e-37], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 1.9e-154], N[(t$95$3 * N[Sin[N[(N[(t$95$0 * N[(y$46$im / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 400000000000.0], N[(t$95$3 * t$95$1), $MachinePrecision], N[(t$95$2 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \sin \left(t\_0 \cdot y.im\right)\\
t_2 := 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_3 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -4.4 \cdot 10^{-37}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{-154}:\\
\;\;\;\;t\_3 \cdot \sin \left(\mathsf{fma}\left(t\_0, \frac{y.im}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{elif}\;y.im \leq 400000000000:\\
\;\;\;\;t\_3 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\end{array}
\end{array}
if y.im < -4.40000000000000004e-37Initial program 36.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.2
Applied rewrites65.2%
if -4.40000000000000004e-37 < y.im < 1.90000000000000005e-154Initial program 44.7%
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.f6465.4
Applied rewrites65.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6490.3
Applied rewrites90.3%
if 1.90000000000000005e-154 < y.im < 4e11Initial program 39.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6439.3
Applied rewrites39.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6489.4
Applied rewrites89.4%
if 4e11 < y.im Initial program 40.5%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.2
Applied rewrites62.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re))))
(t_2 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -3900000.0)
t_1
(if (<= y.im 1.9e-154)
(* t_2 (sin (* (fma t_0 (/ y.im y.re) (atan2 x.im x.re)) y.re)))
(if (<= y.im 400000000000.0) (* t_2 (sin (* t_0 y.im))) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -3900000.0) {
tmp = t_1;
} else if (y_46_im <= 1.9e-154) {
tmp = t_2 * sin((fma(t_0, (y_46_im / y_46_re), atan2(x_46_im, x_46_re)) * y_46_re));
} else if (y_46_im <= 400000000000.0) {
tmp = t_2 * sin((t_0 * y_46_im));
} 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_im, x_46_re)) t_1 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -3900000.0) tmp = t_1; elseif (y_46_im <= 1.9e-154) tmp = Float64(t_2 * sin(Float64(fma(t_0, Float64(y_46_im / y_46_re), atan(x_46_im, x_46_re)) * y_46_re))); elseif (y_46_im <= 400000000000.0) tmp = Float64(t_2 * sin(Float64(t_0 * y_46_im))); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -3900000.0], t$95$1, If[LessEqual[y$46$im, 1.9e-154], N[(t$95$2 * N[Sin[N[(N[(t$95$0 * N[(y$46$im / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 400000000000.0], N[(t$95$2 * N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -3900000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{-154}:\\
\;\;\;\;t\_2 \cdot \sin \left(\mathsf{fma}\left(t\_0, \frac{y.im}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right)\\
\mathbf{elif}\;y.im \leq 400000000000:\\
\;\;\;\;t\_2 \cdot \sin \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3.9e6 or 4e11 < y.im Initial program 39.2%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.4
Applied rewrites61.4%
if -3.9e6 < y.im < 1.90000000000000005e-154Initial program 43.9%
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.f6464.8
Applied rewrites64.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6489.3
Applied rewrites89.3%
if 1.90000000000000005e-154 < y.im < 4e11Initial program 39.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6439.3
Applied rewrites39.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6489.4
Applied rewrites89.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im))))
(if (or (<= y.re -0.0005) (not (<= y.re 5800000000000.0)))
(* (pow (hypot x.im x.re) y.re) t_0)
(* (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((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if ((y_46_re <= -0.0005) || !(y_46_re <= 5800000000000.0)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if ((y_46_re <= -0.0005) || !(y_46_re <= 5800000000000.0)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_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.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if (y_46_re <= -0.0005) or not (y_46_re <= 5800000000000.0): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 else: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if ((y_46_re <= -0.0005) || !(y_46_re <= 5800000000000.0)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if ((y_46_re <= -0.0005) || ~((y_46_re <= 5800000000000.0))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0; else tmp = exp((-y_46_im * atan2(x_46_im, x_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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.0005], N[Not[LessEqual[y$46$re, 5800000000000.0]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -0.0005 \lor \neg \left(y.re \leq 5800000000000\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -5.0000000000000001e-4 or 5.8e12 < y.re Initial program 39.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6437.6
Applied rewrites37.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.3
Applied rewrites78.3%
if -5.0000000000000001e-4 < y.re < 5.8e12Initial program 42.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.6
Applied rewrites40.6%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6464.7
Applied rewrites64.7%
Final simplification71.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re 9.8e-142) (not (<= y.re 0.65)))
(* (pow (hypot x.im x.re) y.re) (sin (* (log (hypot x.im x.re)) y.im)))
(*
y.re
(fma
(* 0.5 y.re)
(* (log (fma x.im x.im (* x.re x.re))) (atan2 x.im x.re))
(atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= 9.8e-142) || !(y_46_re <= 0.65)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = y_46_re * fma((0.5 * y_46_re), (log(fma(x_46_im, x_46_im, (x_46_re * x_46_re))) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= 9.8e-142) || !(y_46_re <= 0.65)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(y_46_re * fma(Float64(0.5 * y_46_re), Float64(log(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, 9.8e-142], N[Not[LessEqual[y$46$re, 0.65]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[(0.5 * y$46$re), $MachinePrecision] * N[(N[Log[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 9.8 \cdot 10^{-142} \lor \neg \left(y.re \leq 0.65\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \mathsf{fma}\left(0.5 \cdot y.re, \log \left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.re < 9.8000000000000007e-142 or 0.650000000000000022 < y.re Initial program 40.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6431.9
Applied rewrites31.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.4
Applied rewrites63.4%
if 9.8000000000000007e-142 < y.re < 0.650000000000000022Initial program 42.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.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
unpow2N/A
unpow2N/A
lower-hypot.f6427.0
Applied rewrites27.0%
Applied rewrites33.1%
Taylor expanded in y.re around 0
Applied rewrites32.7%
Final simplification58.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im 1.05e+33)
(* (pow (hypot x.im x.re) y.re) (sin (* (log (hypot x.im x.re)) y.im)))
(*
(sin (* (atan2 x.im x.re) y.re))
(pow (pow (hypot x.im x.re) 2.0) (* y.re 0.5)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 1.05e+33) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * pow(pow(hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 1.05e+33) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.pow(Math.hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 1.05e+33: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.pow(math.hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 1.05e+33) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * ((hypot(x_46_im, x_46_re) ^ 2.0) ^ Float64(y_46_re * 0.5))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= 1.05e+33) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * ((hypot(x_46_im, x_46_re) ^ 2.0) ^ (y_46_re * 0.5)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 1.05e+33], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 1.05 \cdot 10^{+33}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{2}\right)}^{\left(y.re \cdot 0.5\right)}\\
\end{array}
\end{array}
if y.im < 1.05e33Initial program 41.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.6
Applied rewrites33.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.8
Applied rewrites63.8%
if 1.05e33 < y.im Initial program 40.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.9
Applied rewrites52.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
unpow2N/A
unpow2N/A
lower-hypot.f6434.5
Applied rewrites34.5%
Applied rewrites38.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* (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) {
return sin((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(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.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(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(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(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 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $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}
\\
\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 41.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.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
unpow2N/A
unpow2N/A
lower-hypot.f6445.5
Applied rewrites45.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (or (<= x.im -2300000000.0) (not (<= x.im 2e-297)))
(* t_0 (pow x.im y.re))
(* t_0 (pow x.re y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((x_46_im <= -2300000000.0) || !(x_46_im <= 2e-297)) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
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_46im <= (-2300000000.0d0)) .or. (.not. (x_46im <= 2d-297))) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * (x_46re ** y_46re)
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_im <= -2300000000.0) || !(x_46_im <= 2e-297)) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_re, 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 (x_46_im <= -2300000000.0) or not (x_46_im <= 2e-297): tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((x_46_im <= -2300000000.0) || !(x_46_im <= 2e-297)) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * (x_46_re ^ 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 ((x_46_im <= -2300000000.0) || ~((x_46_im <= 2e-297))) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * (x_46_re ^ 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[x$46$im, -2300000000.0], N[Not[LessEqual[x$46$im, 2e-297]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, 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}\;x.im \leq -2300000000 \lor \neg \left(x.im \leq 2 \cdot 10^{-297}\right):\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.im < -2.3e9 or 2.00000000000000008e-297 < x.im Initial program 35.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6459.2
Applied rewrites59.2%
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
unpow2N/A
unpow2N/A
lower-hypot.f6440.4
Applied rewrites40.4%
Taylor expanded in x.re around 0
Applied rewrites36.5%
if -2.3e9 < x.im < 2.00000000000000008e-297Initial program 52.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.0
Applied rewrites66.0%
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
unpow2N/A
unpow2N/A
lower-hypot.f6456.3
Applied rewrites56.3%
Taylor expanded in x.im around 0
Applied rewrites45.9%
Final simplification39.5%
(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.re -0.00039) (not (<= y.re 26500000000000.0)))
(* t_0 (pow x.im y.re))
(* t_0 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -0.00039) || !(y_46_re <= 26500000000000.0)) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * 1.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 ((y_46re <= (-0.00039d0)) .or. (.not. (y_46re <= 26500000000000.0d0))) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * 1.0d0
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 ((y_46_re <= -0.00039) || !(y_46_re <= 26500000000000.0)) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (y_46_re <= -0.00039) or not (y_46_re <= 26500000000000.0): tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * 1.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 <= -0.00039) || !(y_46_re <= 26500000000000.0)) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * 1.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_re <= -0.00039) || ~((y_46_re <= 26500000000000.0))) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * 1.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[Or[LessEqual[y$46$re, -0.00039], N[Not[LessEqual[y$46$re, 26500000000000.0]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.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 -0.00039 \lor \neg \left(y.re \leq 26500000000000\right):\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot 1\\
\end{array}
\end{array}
if y.re < -3.89999999999999993e-4 or 2.65e13 < y.re Initial program 39.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.4
Applied rewrites80.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
unpow2N/A
unpow2N/A
lower-hypot.f6469.0
Applied rewrites69.0%
Taylor expanded in x.re around 0
Applied rewrites52.6%
if -3.89999999999999993e-4 < y.re < 2.65e13Initial program 42.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6441.1
Applied rewrites41.1%
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
unpow2N/A
unpow2N/A
lower-hypot.f6420.4
Applied rewrites20.4%
Taylor expanded in y.re around 0
Applied rewrites18.1%
Final simplification35.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* (atan2 x.im x.re) y.re)) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((atan2(x_46_im, x_46_re) * y_46_re)) * 1.0;
}
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 = sin((atan2(x_46im, x_46re) * y_46re)) * 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * 1.0) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1
\end{array}
Initial program 41.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.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
unpow2N/A
unpow2N/A
lower-hypot.f6445.5
Applied rewrites45.5%
Taylor expanded in y.re around 0
Applied rewrites12.8%
herbie shell --seed 2024321
(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)))))