
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(* (log (hypot x.re x.im)) y.im)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -47000000000000.0)
t_0
(if (<= y.re 2.5e+15)
(/
1.0
(/
(pow (exp y.im) (atan2 x.im x.re))
(*
(sin (fma y.im (log (hypot x.im x.re)) (* (atan2 x.im x.re) y.re)))
(pow (hypot x.im x.re) y.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (log(hypot(x_46_re, x_46_im)) * y_46_im) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -47000000000000.0) {
tmp = t_0;
} else if (y_46_re <= 2.5e+15) {
tmp = 1.0 / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / (sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), (atan2(x_46_im, x_46_re) * y_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -47000000000000.0) tmp = t_0; elseif (y_46_re <= 2.5e+15) tmp = Float64(1.0 / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / Float64(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), Float64(atan(x_46_im, x_46_re) * y_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -47000000000000.0], t$95$0, If[LessEqual[y$46$re, 2.5e+15], N[(1.0 / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -47000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.7e13 or 2.5e15 < y.re Initial program 37.6%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites63.3%
Taylor expanded in y.re around 0
Applied rewrites76.9%
if -4.7e13 < y.re < 2.5e15Initial program 45.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites84.0%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (* t_1 y.im))
(t_3
(*
t_2
(exp
(- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))))
(if (<= y.re -100.0)
t_3
(if (<= y.re -2.2e-97)
(* (exp (- t_0)) (sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 9.8e-87)
(* (sin t_2) (exp (* (- y.im) (atan2 x.im x.re))))
(if (<= y.re 1.4e+16)
(/
1.0
(/
1.0
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_1) y.im))
(pow (hypot x.im x.re) y.re))))
t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = t_1 * y_46_im;
double t_3 = t_2 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
double tmp;
if (y_46_re <= -100.0) {
tmp = t_3;
} else if (y_46_re <= -2.2e-97) {
tmp = exp(-t_0) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 9.8e-87) {
tmp = sin(t_2) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.4e+16) {
tmp = 1.0 / (1.0 / (sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_1) * y_46_im)) * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(t_1 * y_46_im) t_3 = Float64(t_2 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))) tmp = 0.0 if (y_46_re <= -100.0) tmp = t_3; elseif (y_46_re <= -2.2e-97) tmp = Float64(exp(Float64(-t_0)) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 9.8e-87) tmp = Float64(sin(t_2) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.4e+16) tmp = Float64(1.0 / Float64(1.0 / Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_1) * y_46_im)) * (hypot(x_46_im, x_46_re) ^ y_46_re)))); else tmp = t_3; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -100.0], t$95$3, If[LessEqual[y$46$re, -2.2e-97], N[(N[Exp[(-t$95$0)], $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-87], N[(N[Sin[t$95$2], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.4e+16], N[(1.0 / N[(1.0 / N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := t\_1 \cdot y.im\\
t_3 := t\_2 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{if}\;y.re \leq -100:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;e^{-t\_0} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 9.8 \cdot 10^{-87}:\\
\;\;\;\;\sin t\_2 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.4 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_1\right) \cdot y.im\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.re < -100 or 1.4e16 < y.re Initial program 37.8%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites63.8%
Taylor expanded in y.re around 0
Applied rewrites77.3%
if -100 < y.re < -2.1999999999999999e-97Initial program 47.0%
Taylor expanded in x.im around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites48.0%
Taylor expanded in y.im around inf
Applied rewrites48.0%
Taylor expanded in y.im around 0
Applied rewrites81.8%
if -2.1999999999999999e-97 < y.re < 9.7999999999999994e-87Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6413.3
Applied rewrites13.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.8
Applied rewrites75.8%
if 9.7999999999999994e-87 < y.re < 1.4e16Initial program 49.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites86.0%
Taylor expanded in y.im around inf
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6486.0
Applied rewrites86.0%
Taylor expanded in y.im around 0
Applied rewrites73.6%
Final simplification76.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* (log (hypot x.re x.im)) y.im))
(t_2
(*
t_1
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0))))
(t_3 (* (exp (- t_0)) (sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -100.0)
t_2
(if (<= y.re -2.2e-97)
t_3
(if (<= y.re 5.2e-112)
(* (sin t_1) (exp (* (- y.im) (atan2 x.im x.re))))
(if (<= y.re 1.5e-27) t_3 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im)) * y_46_im;
double t_2 = t_1 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
double t_3 = exp(-t_0) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -100.0) {
tmp = t_2;
} else if (y_46_re <= -2.2e-97) {
tmp = t_3;
} else if (y_46_re <= 5.2e-112) {
tmp = sin(t_1) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.5e-27) {
tmp = t_3;
} 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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im;
double t_2 = t_1 * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
double t_3 = Math.exp(-t_0) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -100.0) {
tmp = t_2;
} else if (y_46_re <= -2.2e-97) {
tmp = t_3;
} else if (y_46_re <= 5.2e-112) {
tmp = Math.sin(t_1) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.5e-27) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.log(math.hypot(x_46_re, x_46_im)) * y_46_im t_2 = t_1 * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0)) t_3 = math.exp(-t_0) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -100.0: tmp = t_2 elif y_46_re <= -2.2e-97: tmp = t_3 elif y_46_re <= 5.2e-112: tmp = math.sin(t_1) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.5e-27: tmp = t_3 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) t_2 = Float64(t_1 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))) t_3 = Float64(exp(Float64(-t_0)) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) tmp = 0.0 if (y_46_re <= -100.0) tmp = t_2; elseif (y_46_re <= -2.2e-97) tmp = t_3; elseif (y_46_re <= 5.2e-112) tmp = Float64(sin(t_1) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.5e-27) tmp = t_3; 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 = y_46_im * atan2(x_46_im, x_46_re); t_1 = log(hypot(x_46_re, x_46_im)) * y_46_im; t_2 = t_1 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0)); t_3 = exp(-t_0) * sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -100.0) tmp = t_2; elseif (y_46_re <= -2.2e-97) tmp = t_3; elseif (y_46_re <= 5.2e-112) tmp = sin(t_1) * exp((-y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.5e-27) tmp = t_3; 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[(-t$95$0)], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -100.0], t$95$2, If[LessEqual[y$46$re, -2.2e-97], t$95$3, If[LessEqual[y$46$re, 5.2e-112], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.5e-27], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
t_2 := t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
t_3 := e^{-t\_0} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -100:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{-112}:\\
\;\;\;\;\sin t\_1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -100 or 1.5000000000000001e-27 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.5%
Taylor expanded in y.re around 0
Applied rewrites75.9%
if -100 < y.re < -2.1999999999999999e-97 or 5.19999999999999983e-112 < y.re < 1.5000000000000001e-27Initial program 46.0%
Taylor expanded in x.im around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites39.0%
Taylor expanded in y.im around inf
Applied rewrites39.0%
Taylor expanded in y.im around 0
Applied rewrites79.6%
if -2.1999999999999999e-97 < y.re < 5.19999999999999983e-112Initial program 43.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6412.7
Applied rewrites12.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.6
Applied rewrites76.6%
Final simplification76.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (sin t_0))
(t_2 (* (exp (- (* y.im (atan2 x.im x.re)))) t_1))
(t_3 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re -9.4e+23)
t_3
(if (<= y.re -2.2e-97)
t_2
(if (<= y.re 5.2e-112)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(if (<= y.re 0.04)
t_2
(if (<= y.re 8.6e+230) (* t_1 (pow (- x.re) y.re)) t_3)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double t_2 = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_1;
double t_3 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9.4e+23) {
tmp = t_3;
} else if (y_46_re <= -2.2e-97) {
tmp = t_2;
} else if (y_46_re <= 5.2e-112) {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 0.04) {
tmp = t_2;
} else if (y_46_re <= 8.6e+230) {
tmp = t_1 * pow(-x_46_re, y_46_re);
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double t_2 = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * t_1;
double t_3 = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9.4e+23) {
tmp = t_3;
} else if (y_46_re <= -2.2e-97) {
tmp = t_2;
} else if (y_46_re <= 5.2e-112) {
tmp = Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 0.04) {
tmp = t_2;
} else if (y_46_re <= 8.6e+230) {
tmp = t_1 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = t_3;
}
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.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * t_1 t_3 = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -9.4e+23: tmp = t_3 elif y_46_re <= -2.2e-97: tmp = t_2 elif y_46_re <= 5.2e-112: tmp = math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 0.04: tmp = t_2 elif y_46_re <= 8.6e+230: tmp = t_1 * math.pow(-x_46_re, y_46_re) else: tmp = t_3 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) t_2 = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_1) t_3 = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -9.4e+23) tmp = t_3; elseif (y_46_re <= -2.2e-97) tmp = t_2; elseif (y_46_re <= 5.2e-112) tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 0.04) tmp = t_2; elseif (y_46_re <= 8.6e+230) tmp = Float64(t_1 * (Float64(-x_46_re) ^ y_46_re)); else tmp = t_3; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); t_2 = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_1; t_3 = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -9.4e+23) tmp = t_3; elseif (y_46_re <= -2.2e-97) tmp = t_2; elseif (y_46_re <= 5.2e-112) tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 0.04) tmp = t_2; elseif (y_46_re <= 8.6e+230) tmp = t_1 * (-x_46_re ^ y_46_re); else tmp = t_3; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.4e+23], t$95$3, If[LessEqual[y$46$re, -2.2e-97], t$95$2, If[LessEqual[y$46$re, 5.2e-112], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.04], t$95$2, If[LessEqual[y$46$re, 8.6e+230], N[(t$95$1 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
t_2 := e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
t_3 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -9.4 \cdot 10^{+23}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{-112}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 0.04:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{+230}:\\
\;\;\;\;t\_1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.re < -9.3999999999999994e23 or 8.59999999999999918e230 < y.re Initial program 40.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.5
Applied rewrites68.5%
Taylor expanded in y.re around 0
Applied rewrites75.8%
if -9.3999999999999994e23 < y.re < -2.1999999999999999e-97 or 5.19999999999999983e-112 < y.re < 0.0400000000000000008Initial program 42.1%
Taylor expanded in x.im around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites36.0%
Taylor expanded in y.im around inf
Applied rewrites33.9%
Taylor expanded in y.im around 0
Applied rewrites73.6%
if -2.1999999999999999e-97 < y.re < 5.19999999999999983e-112Initial program 43.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6412.7
Applied rewrites12.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6476.6
Applied rewrites76.6%
if 0.0400000000000000008 < y.re < 8.59999999999999918e230Initial program 38.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.7
Applied rewrites45.7%
Taylor expanded in x.re around -inf
Applied rewrites57.0%
Final simplification72.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 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re -9.4e+23)
t_2
(if (<= y.re 0.04)
(* (exp (- (* y.im (atan2 x.im x.re)))) t_1)
(if (<= y.re 8.6e+230) (* t_1 (pow (- 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 = sin(t_0);
double t_2 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9.4e+23) {
tmp = t_2;
} else if (y_46_re <= 0.04) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 8.6e+230) {
tmp = t_1 * pow(-x_46_re, y_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.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double t_2 = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9.4e+23) {
tmp = t_2;
} else if (y_46_re <= 0.04) {
tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 8.6e+230) {
tmp = t_1 * Math.pow(-x_46_re, y_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.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.sin(t_0) t_2 = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -9.4e+23: tmp = t_2 elif y_46_re <= 0.04: tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * t_1 elif y_46_re <= 8.6e+230: tmp = t_1 * math.pow(-x_46_re, y_46_re) 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(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -9.4e+23) tmp = t_2; elseif (y_46_re <= 0.04) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_1); elseif (y_46_re <= 8.6e+230) tmp = Float64(t_1 * (Float64(-x_46_re) ^ y_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 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); t_2 = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -9.4e+23) tmp = t_2; elseif (y_46_re <= 0.04) tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_1; elseif (y_46_re <= 8.6e+230) tmp = t_1 * (-x_46_re ^ y_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[(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[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.4e+23], t$95$2, If[LessEqual[y$46$re, 0.04], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 8.6e+230], N[(t$95$1 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], 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 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -9.4 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 0.04:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{+230}:\\
\;\;\;\;t\_1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -9.3999999999999994e23 or 8.59999999999999918e230 < y.re Initial program 40.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.5
Applied rewrites68.5%
Taylor expanded in y.re around 0
Applied rewrites75.8%
if -9.3999999999999994e23 < y.re < 0.0400000000000000008Initial program 43.1%
Taylor expanded in x.im around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites33.9%
Taylor expanded in y.im around inf
Applied rewrites33.1%
Taylor expanded in y.im around 0
Applied rewrites50.4%
if 0.0400000000000000008 < y.re < 8.59999999999999918e230Initial program 38.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.7
Applied rewrites45.7%
Taylor expanded in x.re around -inf
Applied rewrites57.0%
Final simplification59.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (sin t_0))
(t_2 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re -9e-169)
t_2
(if (<= y.re 2.6e-105)
(* (* (log (hypot x.re x.im)) y.re) t_1)
(if (<= y.re 8.6e+230) (* t_1 (pow (- 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 = sin(t_0);
double t_2 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9e-169) {
tmp = t_2;
} else if (y_46_re <= 2.6e-105) {
tmp = (log(hypot(x_46_re, x_46_im)) * y_46_re) * t_1;
} else if (y_46_re <= 8.6e+230) {
tmp = t_1 * pow(-x_46_re, y_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.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double t_2 = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9e-169) {
tmp = t_2;
} else if (y_46_re <= 2.6e-105) {
tmp = (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) * t_1;
} else if (y_46_re <= 8.6e+230) {
tmp = t_1 * Math.pow(-x_46_re, y_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.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.sin(t_0) t_2 = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -9e-169: tmp = t_2 elif y_46_re <= 2.6e-105: tmp = (math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) * t_1 elif y_46_re <= 8.6e+230: tmp = t_1 * math.pow(-x_46_re, y_46_re) 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(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -9e-169) tmp = t_2; elseif (y_46_re <= 2.6e-105) tmp = Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) * t_1); elseif (y_46_re <= 8.6e+230) tmp = Float64(t_1 * (Float64(-x_46_re) ^ y_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 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); t_2 = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -9e-169) tmp = t_2; elseif (y_46_re <= 2.6e-105) tmp = (log(hypot(x_46_re, x_46_im)) * y_46_re) * t_1; elseif (y_46_re <= 8.6e+230) tmp = t_1 * (-x_46_re ^ y_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[(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[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9e-169], t$95$2, If[LessEqual[y$46$re, 2.6e-105], N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 8.6e+230], N[(t$95$1 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], 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 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{-169}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{-105}:\\
\;\;\;\;\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{+230}:\\
\;\;\;\;t\_1 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -8.9999999999999997e-169 or 8.59999999999999918e230 < y.re Initial program 41.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.0
Applied rewrites57.0%
Taylor expanded in y.re around 0
Applied rewrites62.1%
if -8.9999999999999997e-169 < y.re < 2.5999999999999999e-105Initial program 42.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.1
Applied rewrites11.1%
Taylor expanded in y.re around 0
Applied rewrites11.1%
Taylor expanded in y.re around inf
Applied rewrites21.0%
if 2.5999999999999999e-105 < y.re < 8.59999999999999918e230Initial program 39.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.8
Applied rewrites46.8%
Taylor expanded in x.re around -inf
Applied rewrites54.2%
Final simplification48.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re 0.022)
t_1
(if (<= y.re 8.6e+230) (* (sin t_0) (pow (- x.re) y.re)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= 0.022) {
tmp = t_1;
} else if (y_46_re <= 8.6e+230) {
tmp = sin(t_0) * pow(-x_46_re, y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= 0.022) {
tmp = t_1;
} else if (y_46_re <= 8.6e+230) {
tmp = Math.sin(t_0) * Math.pow(-x_46_re, y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= 0.022: tmp = t_1 elif y_46_re <= 8.6e+230: tmp = math.sin(t_0) * math.pow(-x_46_re, y_46_re) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= 0.022) tmp = t_1; elseif (y_46_re <= 8.6e+230) tmp = Float64(sin(t_0) * (Float64(-x_46_re) ^ y_46_re)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= 0.022) tmp = t_1; elseif (y_46_re <= 8.6e+230) tmp = sin(t_0) * (-x_46_re ^ y_46_re); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, 0.022], t$95$1, If[LessEqual[y$46$re, 8.6e+230], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq 0.022:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8.6 \cdot 10^{+230}:\\
\;\;\;\;\sin t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < 0.021999999999999999 or 8.59999999999999918e230 < y.re Initial program 42.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.0
Applied rewrites40.0%
Taylor expanded in y.re around 0
Applied rewrites42.8%
if 0.021999999999999999 < y.re < 8.59999999999999918e230Initial program 38.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.7
Applied rewrites45.7%
Taylor expanded in x.re around -inf
Applied rewrites57.0%
Final simplification45.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re 34000000000000.0)
t_1
(if (<= y.re 8.5e+238) (* (pow x.re y.re) (sin t_0)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= 34000000000000.0) {
tmp = t_1;
} else if (y_46_re <= 8.5e+238) {
tmp = pow(x_46_re, y_46_re) * sin(t_0);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= 34000000000000.0) {
tmp = t_1;
} else if (y_46_re <= 8.5e+238) {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin(t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= 34000000000000.0: tmp = t_1 elif y_46_re <= 8.5e+238: tmp = math.pow(x_46_re, y_46_re) * math.sin(t_0) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= 34000000000000.0) tmp = t_1; elseif (y_46_re <= 8.5e+238) tmp = Float64((x_46_re ^ y_46_re) * sin(t_0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= 34000000000000.0) tmp = t_1; elseif (y_46_re <= 8.5e+238) tmp = (x_46_re ^ y_46_re) * sin(t_0); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, 34000000000000.0], t$95$1, If[LessEqual[y$46$re, 8.5e+238], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq 34000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{+238}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < 3.4e13 or 8.49999999999999998e238 < y.re Initial program 43.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.0
Applied rewrites41.0%
Taylor expanded in y.re around 0
Applied rewrites43.0%
if 3.4e13 < y.re < 8.49999999999999998e238Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.8
Applied rewrites40.8%
Taylor expanded in x.im around 0
Applied rewrites52.6%
Final simplification44.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (sin t_0)))
(if (<= y.re -3.1e-16)
(* (pow (* (fma 0.5 (/ (* x.im x.im) (* x.re x.re)) 1.0) x.re) y.re) t_0)
(if (<= y.re 5800000.0) (* 1.0 t_1) (* (pow x.re y.re) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -3.1e-16) {
tmp = pow((fma(0.5, ((x_46_im * x_46_im) / (x_46_re * x_46_re)), 1.0) * x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 5800000.0) {
tmp = 1.0 * t_1;
} else {
tmp = pow(x_46_re, y_46_re) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -3.1e-16) tmp = Float64((Float64(fma(0.5, Float64(Float64(x_46_im * x_46_im) / Float64(x_46_re * x_46_re)), 1.0) * x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 5800000.0) tmp = Float64(1.0 * t_1); else tmp = Float64((x_46_re ^ y_46_re) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e-16], N[(N[Power[N[(N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 5800000.0], N[(1.0 * t$95$1), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{-16}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re \cdot x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 5800000:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -3.1000000000000001e-16Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.5
Applied rewrites71.5%
Taylor expanded in x.re around inf
Applied rewrites64.8%
Taylor expanded in y.re around 0
Applied rewrites66.1%
if -3.1000000000000001e-16 < y.re < 5.8e6Initial program 44.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6422.9
Applied rewrites22.9%
Taylor expanded in y.re around 0
Applied rewrites20.6%
if 5.8e6 < y.re Initial program 30.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6439.5
Applied rewrites39.5%
Taylor expanded in x.im around 0
Applied rewrites45.0%
Final simplification39.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)))
(if (<= y.re -3.1e-16)
(* (pow (* (fma 0.5 (/ (* x.im x.im) (* x.re x.re)) 1.0) x.re) y.re) t_0)
(if (<= y.re 8e+46) (* 1.0 t_1) (* (pow x.im y.re) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -3.1e-16) {
tmp = pow((fma(0.5, ((x_46_im * x_46_im) / (x_46_re * x_46_re)), 1.0) * x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 8e+46) {
tmp = 1.0 * t_1;
} else {
tmp = pow(x_46_im, y_46_re) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -3.1e-16) tmp = Float64((Float64(fma(0.5, Float64(Float64(x_46_im * x_46_im) / Float64(x_46_re * x_46_re)), 1.0) * x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 8e+46) tmp = Float64(1.0 * t_1); else tmp = Float64((x_46_im ^ y_46_re) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e-16], N[(N[Power[N[(N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 8e+46], N[(1.0 * t$95$1), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{-16}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re \cdot x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+46}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -3.1000000000000001e-16Initial program 44.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.5
Applied rewrites71.5%
Taylor expanded in x.re around inf
Applied rewrites64.8%
Taylor expanded in y.re around 0
Applied rewrites66.1%
if -3.1000000000000001e-16 < y.re < 7.9999999999999999e46Initial program 44.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6422.4
Applied rewrites22.4%
Taylor expanded in y.re around 0
Applied rewrites20.2%
if 7.9999999999999999e46 < y.re Initial program 28.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.7
Applied rewrites41.7%
Taylor expanded in x.re around 0
Applied rewrites34.7%
Final simplification36.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(*
(pow (* (fma 0.5 (/ (* x.im x.im) (* x.re x.re)) 1.0) x.re) y.re)
t_0)))
(if (<= y.re -3.1e-16) t_1 (if (<= y.re 7.2e+58) (* 1.0 (sin t_0)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow((fma(0.5, ((x_46_im * x_46_im) / (x_46_re * x_46_re)), 1.0) * x_46_re), y_46_re) * t_0;
double tmp;
if (y_46_re <= -3.1e-16) {
tmp = t_1;
} else if (y_46_re <= 7.2e+58) {
tmp = 1.0 * sin(t_0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((Float64(fma(0.5, Float64(Float64(x_46_im * x_46_im) / Float64(x_46_re * x_46_re)), 1.0) * x_46_re) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -3.1e-16) tmp = t_1; elseif (y_46_re <= 7.2e+58) tmp = Float64(1.0 * sin(t_0)); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e-16], t$95$1, If[LessEqual[y$46$re, 7.2e+58], N[(1.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re \cdot x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{+58}:\\
\;\;\;\;1 \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -3.1000000000000001e-16 or 7.19999999999999993e58 < y.re Initial program 38.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.4
Applied rewrites59.4%
Taylor expanded in x.re around inf
Applied rewrites51.5%
Taylor expanded in y.re around 0
Applied rewrites51.5%
if -3.1000000000000001e-16 < y.re < 7.19999999999999993e58Initial program 44.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6422.8
Applied rewrites22.8%
Taylor expanded in y.re around 0
Applied rewrites19.9%
Final simplification35.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (atan2 x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return atan2(x_46_im, x_46_re) * y_46_re;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = atan2(x_46im, x_46re) * y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.atan2(x_46_im, x_46_re) * y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.atan2(x_46_im, x_46_re) * y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(atan(x_46_im, x_46_re) * y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = atan2(x_46_im, x_46_re) * y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re
\end{array}
Initial program 41.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.0
Applied rewrites41.0%
Taylor expanded in y.re around 0
Applied rewrites12.4%
Final simplification12.4%
herbie shell --seed 2024268
(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)))))