
(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 16 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 (pow (hypot x.im x.re) y.re))
(t_2 (log (hypot x.im x.re)))
(t_3
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* t_2 y.im)))))
(if (<= y.re -1.45e+33)
t_3
(if (<= y.re 3.8e+14)
(*
(* t_1 (pow (exp y.im) (- (atan2 x.im x.re))))
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_2) y.im)))
(if (<= y.re 8.8e+250)
t_3
(* t_1 (fma (* (cos t_0) t_2) y.im (sin t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = 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((t_2 * y_46_im));
double tmp;
if (y_46_re <= -1.45e+33) {
tmp = t_3;
} else if (y_46_re <= 3.8e+14) {
tmp = (t_1 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re))) * sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_2) * y_46_im));
} else if (y_46_re <= 8.8e+250) {
tmp = t_3;
} else {
tmp = t_1 * fma((cos(t_0) * t_2), y_46_im, sin(t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re t_2 = log(hypot(x_46_im, x_46_re)) t_3 = 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(t_2 * y_46_im))) tmp = 0.0 if (y_46_re <= -1.45e+33) tmp = t_3; elseif (y_46_re <= 3.8e+14) tmp = Float64(Float64(t_1 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))) * sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_2) * y_46_im))); elseif (y_46_re <= 8.8e+250) tmp = t_3; else tmp = Float64(t_1 * fma(Float64(cos(t_0) * t_2), y_46_im, sin(t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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[(t$95$2 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.45e+33], t$95$3, If[LessEqual[y$46$re, 3.8e+14], N[(N[(t$95$1 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$2), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.8e+250], t$95$3, N[(t$95$1 * N[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := 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(t\_2 \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{+33}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{+14}:\\
\;\;\;\;\left(t\_1 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right) \cdot \sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_2\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+250}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\cos t\_0 \cdot t\_2, y.im, \sin t\_0\right)\\
\end{array}
\end{array}
if y.re < -1.45000000000000012e33 or 3.8e14 < y.re < 8.80000000000000058e250Initial 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.f6483.3
Applied rewrites83.3%
if -1.45000000000000012e33 < y.re < 3.8e14Initial program 36.4%
lift-exp.f64N/A
lift--.f64N/A
sub-negN/A
exp-sumN/A
lower-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f64N/A
Applied rewrites36.0%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.4
Applied rewrites79.4%
if 8.80000000000000058e250 < y.re Initial program 38.5%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64100.0
Applied rewrites100.0%
(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 (fma (* (cos t_0) t_1) y.im (sin t_0)))
(t_3 (sin (* t_1 y.im)))
(t_4 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -6e+14)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_3)
(if (<= y.re 8e+17)
(* (pow (exp (- y.im)) (atan2 x.im x.re)) t_2)
(if (<= y.re 9e+250) (* t_4 t_3) (* t_4 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 = fma((cos(t_0) * t_1), y_46_im, sin(t_0));
double t_3 = sin((t_1 * y_46_im));
double t_4 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -6e+14) {
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_3;
} else if (y_46_re <= 8e+17) {
tmp = pow(exp(-y_46_im), atan2(x_46_im, x_46_re)) * t_2;
} else if (y_46_re <= 9e+250) {
tmp = t_4 * t_3;
} else {
tmp = t_4 * 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 = fma(Float64(cos(t_0) * t_1), y_46_im, sin(t_0)) t_3 = sin(Float64(t_1 * y_46_im)) t_4 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -6e+14) 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_3); elseif (y_46_re <= 8e+17) tmp = Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * t_2); elseif (y_46_re <= 9e+250) tmp = Float64(t_4 * t_3); else tmp = Float64(t_4 * 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[(N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -6e+14], 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$3), $MachinePrecision], If[LessEqual[y$46$re, 8e+17], N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 9e+250], N[(t$95$4 * t$95$3), $MachinePrecision], N[(t$95$4 * 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 := \mathsf{fma}\left(\cos t\_0 \cdot t\_1, y.im, \sin t\_0\right)\\
t_3 := \sin \left(t\_1 \cdot y.im\right)\\
t_4 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+14}:\\
\;\;\;\;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\_3\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+17}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_2\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{+250}:\\
\;\;\;\;t\_4 \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_4 \cdot t\_2\\
\end{array}
\end{array}
if y.re < -6e14Initial program 38.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6485.8
Applied rewrites85.8%
if -6e14 < y.re < 8e17Initial program 36.2%
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 rewrites42.7%
Taylor expanded in y.re around 0
neg-mul-1N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6475.3
Applied rewrites75.3%
if 8e17 < y.re < 8.99999999999999993e250Initial program 31.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6431.0
Applied rewrites31.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.3
Applied rewrites83.3%
if 8.99999999999999993e250 < y.re Initial program 38.5%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64100.0
Applied rewrites100.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.im -33.0)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(fma (* 1.0 t_0) y.im (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.im 0.021)
(*
(pow (hypot x.im x.re) y.re)
(sin (fma (atan2 x.im x.re) y.re (* y.im t_0))))
(* (sin (* t_0 y.im)) (pow (exp y.im) (- (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -33.0) {
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))) * fma((1.0 * t_0), y_46_im, sin((atan2(x_46_im, x_46_re) * y_46_re)));
} else if (y_46_im <= 0.021) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_0)));
} else {
tmp = sin((t_0 * y_46_im)) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -33.0) 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))) * fma(Float64(1.0 * t_0), y_46_im, sin(Float64(atan(x_46_im, x_46_re) * y_46_re)))); elseif (y_46_im <= 0.021) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * t_0)))); else tmp = Float64(sin(Float64(t_0 * y_46_im)) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -33.0], 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[(N[(1.0 * t$95$0), $MachinePrecision] * y$46$im + N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 0.021], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $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.im \leq -33:\\
\;\;\;\;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 \mathsf{fma}\left(1 \cdot t\_0, y.im, \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\mathbf{elif}\;y.im \leq 0.021:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.im < -33Initial program 31.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.1%
Taylor expanded in y.re around 0
Applied rewrites60.7%
if -33 < y.im < 0.0210000000000000013Initial program 41.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.6
Applied rewrites40.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6440.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.6
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6490.9
Applied rewrites90.9%
if 0.0210000000000000013 < y.im Initial program 28.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 rewrites48.1%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites58.1%
Applied rewrites58.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.im -1.06e+37)
(*
(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 (or (<= y.im -1.32e-6) (not (<= y.im 0.021)))
(* (sin (* t_0 y.im)) (pow (exp y.im) (- (atan2 x.im x.re))))
(*
(pow (hypot x.im x.re) y.re)
(sin (fma (atan2 x.im x.re) y.re (* y.im t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1.06e+37) {
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_im <= -1.32e-6) || !(y_46_im <= 0.021)) {
tmp = sin((t_0 * y_46_im)) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_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_im <= -1.06e+37) 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_im <= -1.32e-6) || !(y_46_im <= 0.021)) tmp = Float64(sin(Float64(t_0 * y_46_im)) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * t_0)))); 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]}, If[LessEqual[y$46$im, -1.06e+37], 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[Or[LessEqual[y$46$im, -1.32e-6], N[Not[LessEqual[y$46$im, 0.021]], $MachinePrecision]], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $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.im \leq -1.06 \cdot 10^{+37}:\\
\;\;\;\;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.im \leq -1.32 \cdot 10^{-6} \lor \neg \left(y.im \leq 0.021\right):\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if y.im < -1.06e37Initial program 32.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.9
Applied rewrites57.9%
if -1.06e37 < y.im < -1.3200000000000001e-6 or 0.0210000000000000013 < y.im Initial program 28.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites61.3%
Applied rewrites61.4%
if -1.3200000000000001e-6 < y.im < 0.0210000000000000013Initial 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%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6441.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.5
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6492.5
Applied rewrites92.5%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (sin (* (log (hypot x.im x.re)) y.im)))
(t_2 (* t_0 t_1)))
(if (<= y.re -5e+123)
t_2
(if (<= y.re -6.5e-33)
(* t_0 (sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 8e+17)
(* 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double t_2 = t_0 * t_1;
double tmp;
if (y_46_re <= -5e+123) {
tmp = t_2;
} else if (y_46_re <= -6.5e-33) {
tmp = t_0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 8e+17) {
tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double t_2 = t_0 * t_1;
double tmp;
if (y_46_re <= -5e+123) {
tmp = t_2;
} else if (y_46_re <= -6.5e-33) {
tmp = t_0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 8e+17) {
tmp = t_1 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) t_2 = t_0 * t_1 tmp = 0 if y_46_re <= -5e+123: tmp = t_2 elif y_46_re <= -6.5e-33: tmp = t_0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 8e+17: tmp = t_1 * math.exp((-y_46_im * math.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 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) t_2 = Float64(t_0 * t_1) tmp = 0.0 if (y_46_re <= -5e+123) tmp = t_2; elseif (y_46_re <= -6.5e-33) tmp = Float64(t_0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 8e+17) 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
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); t_2 = t_0 * t_1; tmp = 0.0; if (y_46_re <= -5e+123) tmp = t_2; elseif (y_46_re <= -6.5e-33) tmp = t_0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 8e+17) tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -5e+123], t$95$2, If[LessEqual[y$46$re, -6.5e-33], N[(t$95$0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8e+17], 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 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
t_2 := t\_0 \cdot t\_1\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{+123}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-33}:\\
\;\;\;\;t\_0 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+17}:\\
\;\;\;\;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 < -4.99999999999999974e123 or 8e17 < y.re Initial program 37.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6435.4
Applied rewrites35.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.9
Applied rewrites82.9%
if -4.99999999999999974e123 < y.re < -6.4999999999999993e-33Initial program 36.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 rewrites73.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6479.1
Applied rewrites79.1%
if -6.4999999999999993e-33 < y.re < 8e17Initial program 35.1%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites41.0%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites58.5%
Applied rewrites59.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -6e+14) (not (<= y.re 8e+17)))
(* (pow (hypot x.im x.re) y.re) (sin (* t_0 y.im)))
(* 1.0 (sin (fma (atan2 x.im x.re) y.re (* y.im t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -6e+14) || !(y_46_re <= 8e+17)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_0 * y_46_im));
} else {
tmp = 1.0 * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_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 <= -6e+14) || !(y_46_re <= 8e+17)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_0 * y_46_im))); else tmp = Float64(1.0 * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * t_0)))); 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]}, If[Or[LessEqual[y$46$re, -6e+14], N[Not[LessEqual[y$46$re, 8e+17]], $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[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $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 -6 \cdot 10^{+14} \lor \neg \left(y.re \leq 8 \cdot 10^{+17}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -6e14 or 8e17 < y.re Initial program 36.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6434.4
Applied rewrites34.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.9
Applied rewrites80.9%
if -6e14 < y.re < 8e17Initial program 36.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.0
Applied rewrites24.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6424.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6424.0
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6454.0
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites51.1%
Final simplification65.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -4.5e-45) (not (<= y.re 2.5e-11)))
(* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re)))
(*
1.0
(sin (fma (atan2 x.im x.re) y.re (* y.im (log (hypot 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 <= -4.5e-45) || !(y_46_re <= 2.5e-11)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * log(hypot(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 <= -4.5e-45) || !(y_46_re <= 2.5e-11)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * log(hypot(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, -4.5e-45], N[Not[LessEqual[y$46$re, 2.5e-11]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.5 \cdot 10^{-45} \lor \neg \left(y.re \leq 2.5 \cdot 10^{-11}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -4.4999999999999999e-45 or 2.50000000000000009e-11 < y.re Initial program 38.1%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6467.6
Applied rewrites67.6%
if -4.4999999999999999e-45 < y.re < 2.50000000000000009e-11Initial program 33.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6422.5
Applied rewrites22.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6422.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6454.4
Applied rewrites54.4%
Taylor expanded in y.re around 0
Applied rewrites54.0%
Final simplification61.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.5e-137) (not (<= y.re 6.8e-109))) (* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re))) (* (log (hypot x.re x.im)) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = log(hypot(x_46_re, x_46_im)) * 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 tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.5e-137) or not (y_46_re <= 6.8e-109): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); 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_re <= -1.5e-137) || ~((y_46_re <= 6.8e-109))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = log(hypot(x_46_re, x_46_im)) * y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.5e-137], N[Not[LessEqual[y$46$re, 6.8e-109]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-137} \lor \neg \left(y.re \leq 6.8 \cdot 10^{-109}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\end{array}
\end{array}
if y.re < -1.4999999999999999e-137 or 6.80000000000000023e-109 < y.re Initial program 37.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.5
Applied rewrites61.5%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
Final simplification56.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* (pow (hypot x.im x.re) y.re) t_0)))
(if (<= y.re -1.5e-137)
t_1
(if (<= y.re 6.8e-109)
(* (log (hypot x.re x.im)) y.im)
(if (<= y.re 5.9e+63)
t_1
(*
(pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
(sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
double tmp;
if (y_46_re <= -1.5e-137) {
tmp = t_1;
} else if (y_46_re <= 6.8e-109) {
tmp = log(hypot(x_46_re, x_46_im)) * y_46_im;
} else if (y_46_re <= 5.9e+63) {
tmp = t_1;
} else {
tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * sin(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -1.5e-137) tmp = t_1; elseif (y_46_re <= 6.8e-109) tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); elseif (y_46_re <= 5.9e+63) tmp = t_1; else tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -1.5e-137], t$95$1, If[LessEqual[y$46$re, 6.8e-109], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 5.9e+63], t$95$1, N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{-109}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{elif}\;y.re \leq 5.9 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -1.4999999999999999e-137 or 6.80000000000000023e-109 < y.re < 5.90000000000000029e63Initial program 39.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
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.9
Applied rewrites60.9%
Taylor expanded in y.re around 0
Applied rewrites29.5%
Taylor expanded in y.re around 0
Applied rewrites56.6%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
if 5.90000000000000029e63 < y.re Initial program 32.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.3
Applied rewrites63.3%
Taylor expanded in x.re around inf
Applied rewrites59.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* (pow (hypot x.im x.re) y.re) t_0)))
(if (<= y.re -1.5e-137)
t_1
(if (<= y.re 6.8e-109)
(* (log (hypot x.re x.im)) y.im)
(if (<= y.re 1e+31)
t_1
(* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) (sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
double tmp;
if (y_46_re <= -1.5e-137) {
tmp = t_1;
} else if (y_46_re <= 6.8e-109) {
tmp = log(hypot(x_46_re, x_46_im)) * y_46_im;
} else if (y_46_re <= 1e+31) {
tmp = t_1;
} else {
tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * sin(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -1.5e-137) tmp = t_1; elseif (y_46_re <= 6.8e-109) tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); elseif (y_46_re <= 1e+31) tmp = t_1; else tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -1.5e-137], t$95$1, If[LessEqual[y$46$re, 6.8e-109], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1e+31], t$95$1, N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{-109}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{elif}\;y.re \leq 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -1.4999999999999999e-137 or 6.80000000000000023e-109 < y.re < 9.9999999999999996e30Initial program 40.1%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.2
Applied rewrites61.2%
Taylor expanded in y.re around 0
Applied rewrites28.9%
Taylor expanded in y.re around 0
Applied rewrites56.8%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
if 9.9999999999999996e30 < y.re Initial program 32.1%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.3
Applied rewrites62.3%
Taylor expanded in x.im around 0
Applied rewrites58.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (sin t_0))
(t_2 (* (pow x.im y.re) t_1)))
(if (<= y.re -6.8e+19)
t_2
(if (<= y.re -1.5e-137)
(* 1.0 t_1)
(if (<= y.re 6.8e-109)
(* (log (hypot x.re x.im)) y.im)
(if (<= y.re 5.1e+30) t_0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double t_2 = pow(x_46_im, y_46_re) * t_1;
double tmp;
if (y_46_re <= -6.8e+19) {
tmp = t_2;
} else if (y_46_re <= -1.5e-137) {
tmp = 1.0 * t_1;
} else if (y_46_re <= 6.8e-109) {
tmp = log(hypot(x_46_re, x_46_im)) * y_46_im;
} else if (y_46_re <= 5.1e+30) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double t_2 = Math.pow(x_46_im, y_46_re) * t_1;
double tmp;
if (y_46_re <= -6.8e+19) {
tmp = t_2;
} else if (y_46_re <= -1.5e-137) {
tmp = 1.0 * t_1;
} else if (y_46_re <= 6.8e-109) {
tmp = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
} else if (y_46_re <= 5.1e+30) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.sin(t_0) t_2 = math.pow(x_46_im, y_46_re) * t_1 tmp = 0 if y_46_re <= -6.8e+19: tmp = t_2 elif y_46_re <= -1.5e-137: tmp = 1.0 * t_1 elif y_46_re <= 6.8e-109: tmp = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im elif y_46_re <= 5.1e+30: tmp = t_0 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) t_2 = Float64((x_46_im ^ y_46_re) * t_1) tmp = 0.0 if (y_46_re <= -6.8e+19) tmp = t_2; elseif (y_46_re <= -1.5e-137) tmp = Float64(1.0 * t_1); elseif (y_46_re <= 6.8e-109) tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); elseif (y_46_re <= 5.1e+30) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); t_2 = (x_46_im ^ y_46_re) * t_1; tmp = 0.0; if (y_46_re <= -6.8e+19) tmp = t_2; elseif (y_46_re <= -1.5e-137) tmp = 1.0 * t_1; elseif (y_46_re <= 6.8e-109) tmp = log(hypot(x_46_re, x_46_im)) * y_46_im; elseif (y_46_re <= 5.1e+30) tmp = t_0; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -6.8e+19], t$95$2, If[LessEqual[y$46$re, -1.5e-137], N[(1.0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 6.8e-109], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 5.1e+30], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
t_2 := {x.im}^{y.re} \cdot t\_1\\
\mathbf{if}\;y.re \leq -6.8 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -1.5 \cdot 10^{-137}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{-109}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\mathbf{elif}\;y.re \leq 5.1 \cdot 10^{+30}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -6.8e19 or 5.10000000000000035e30 < y.re Initial program 36.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 rewrites74.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.5
Applied rewrites69.5%
Taylor expanded in x.re around 0
Applied rewrites54.1%
if -6.8e19 < y.re < -1.4999999999999999e-137Initial program 40.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.3
Applied rewrites53.3%
Taylor expanded in y.re around 0
Applied rewrites41.7%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
if 6.80000000000000023e-109 < y.re < 5.10000000000000035e30Initial program 41.2%
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 rewrites38.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6435.6
Applied rewrites35.6%
Taylor expanded in y.re around 0
Applied rewrites31.2%
Taylor expanded in y.re around 0
Applied rewrites31.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.5e-137) (not (<= y.re 6.8e-109))) (* (pow (hypot x.im x.re) y.re) (* (atan2 x.im x.re) y.re)) (* (log (hypot x.re x.im)) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * (atan2(x_46_im, x_46_re) * y_46_re);
} else {
tmp = log(hypot(x_46_re, x_46_im)) * 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 tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * (Math.atan2(x_46_im, x_46_re) * y_46_re);
} else {
tmp = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.5e-137) or not (y_46_re <= 6.8e-109): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * (math.atan2(x_46_im, x_46_re) * y_46_re) else: tmp = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * Float64(atan(x_46_im, x_46_re) * y_46_re)); else tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); 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_re <= -1.5e-137) || ~((y_46_re <= 6.8e-109))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * (atan2(x_46_im, x_46_re) * y_46_re); else tmp = log(hypot(x_46_re, x_46_im)) * y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.5e-137], N[Not[LessEqual[y$46$re, 6.8e-109]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-137} \lor \neg \left(y.re \leq 6.8 \cdot 10^{-109}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\end{array}
\end{array}
if y.re < -1.4999999999999999e-137 or 6.80000000000000023e-109 < y.re Initial program 37.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.5
Applied rewrites61.5%
Taylor expanded in y.re around 0
Applied rewrites27.6%
Taylor expanded in y.re around 0
Applied rewrites55.1%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
Final simplification51.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5e-104) (not (<= y.re 1.85e-107))) (* (pow x.re y.re) (sin (* (atan2 x.im x.re) y.re))) (* (log (hypot x.re x.im)) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -5e-104) || !(y_46_re <= 1.85e-107)) {
tmp = pow(x_46_re, y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = log(hypot(x_46_re, x_46_im)) * 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 tmp;
if ((y_46_re <= -5e-104) || !(y_46_re <= 1.85e-107)) {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -5e-104) or not (y_46_re <= 1.85e-107): tmp = math.pow(x_46_re, y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -5e-104) || !(y_46_re <= 1.85e-107)) tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); 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_re <= -5e-104) || ~((y_46_re <= 1.85e-107))) tmp = (x_46_re ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = log(hypot(x_46_re, x_46_im)) * y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -5e-104], N[Not[LessEqual[y$46$re, 1.85e-107]], $MachinePrecision]], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5 \cdot 10^{-104} \lor \neg \left(y.re \leq 1.85 \cdot 10^{-107}\right):\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\end{array}
\end{array}
if y.re < -4.99999999999999979e-104 or 1.8500000000000001e-107 < y.re Initial program 37.2%
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 rewrites66.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.5
Applied rewrites62.5%
Taylor expanded in x.im around 0
Applied rewrites47.4%
if -4.99999999999999979e-104 < y.re < 1.8500000000000001e-107Initial program 33.9%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites41.1%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites68.3%
Taylor expanded in y.im around 0
Applied rewrites44.8%
Taylor expanded in y.im around 0
Applied rewrites42.4%
Final simplification45.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.5e-137) (not (<= y.re 6.8e-109))) (* 1.0 (sin (* (atan2 x.im x.re) y.re))) (* (log (hypot x.re x.im)) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = log(hypot(x_46_re, x_46_im)) * 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 tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.5e-137) or not (y_46_re <= 6.8e-109): tmp = 1.0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); 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_re <= -1.5e-137) || ~((y_46_re <= 6.8e-109))) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = log(hypot(x_46_re, x_46_im)) * y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.5e-137], N[Not[LessEqual[y$46$re, 6.8e-109]], $MachinePrecision]], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-137} \lor \neg \left(y.re \leq 6.8 \cdot 10^{-109}\right):\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\end{array}
\end{array}
if y.re < -1.4999999999999999e-137 or 6.80000000000000023e-109 < y.re Initial program 37.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.5
Applied rewrites61.5%
Taylor expanded in y.re around 0
Applied rewrites16.6%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
Final simplification24.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.5e-137) (not (<= y.re 6.8e-109))) (* (atan2 x.im x.re) y.re) (* (log (hypot x.re x.im)) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = atan2(x_46_im, x_46_re) * y_46_re;
} else {
tmp = log(hypot(x_46_re, x_46_im)) * 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 tmp;
if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) {
tmp = Math.atan2(x_46_im, x_46_re) * y_46_re;
} else {
tmp = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.5e-137) or not (y_46_re <= 6.8e-109): tmp = math.atan2(x_46_im, x_46_re) * y_46_re else: tmp = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.5e-137) || !(y_46_re <= 6.8e-109)) tmp = Float64(atan(x_46_im, x_46_re) * y_46_re); else tmp = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im); 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_re <= -1.5e-137) || ~((y_46_re <= 6.8e-109))) tmp = atan2(x_46_im, x_46_re) * y_46_re; else tmp = log(hypot(x_46_re, x_46_im)) * y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.5e-137], N[Not[LessEqual[y$46$re, 6.8e-109]], $MachinePrecision]], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-137} \lor \neg \left(y.re \leq 6.8 \cdot 10^{-109}\right):\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{else}:\\
\;\;\;\;\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
\end{array}
\end{array}
if y.re < -1.4999999999999999e-137 or 6.80000000000000023e-109 < y.re Initial program 37.7%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.5
Applied rewrites61.5%
Taylor expanded in y.re around 0
Applied rewrites16.6%
Taylor expanded in y.re around 0
Applied rewrites16.3%
if -1.4999999999999999e-137 < y.re < 6.80000000000000023e-109Initial program 32.2%
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 rewrites38.7%
Taylor expanded in y.re around 0
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
associate-*r*N/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites70.1%
Taylor expanded in y.im around 0
Applied rewrites46.6%
Taylor expanded in y.im around 0
Applied rewrites44.0%
Final simplification24.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (atan2 x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return atan2(x_46_im, x_46_re) * y_46_re;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = atan2(x_46im, x_46re) * y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.atan2(x_46_im, x_46_re) * y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.atan2(x_46_im, x_46_re) * y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(atan(x_46_im, x_46_re) * y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = atan2(x_46_im, x_46_re) * y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re
\end{array}
Initial program 36.1%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.8
Applied rewrites46.8%
Taylor expanded in y.re around 0
Applied rewrites15.0%
Taylor expanded in y.re around 0
Applied rewrites14.8%
herbie shell --seed 2024318
(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)))))