
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (log (hypot x.im x.re)))
(t_2 (* t_1 y.im))
(t_3 (sqrt (pow (hypot x.re x.im) y.re))))
(if (<= y.re -18.0)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) (sin t_0)) -1.0))
(if (<= y.re 0.00092)
(*
(* (sin (fma (log (hypot x.re x.im)) y.im t_0)) t_3)
(/ t_3 (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 5.4e+104)
(*
(fma (* (cos t_2) (atan2 x.im x.re)) y.re (sin t_2))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(/
1.0
(/
1.0
(* (sin (fma y.im t_1 t_0)) (pow (hypot x.im x.re) y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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 = t_1 * y_46_im;
double t_3 = sqrt(pow(hypot(x_46_re, x_46_im), y_46_re));
double tmp;
if (y_46_re <= -18.0) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / sin(t_0)) / -1.0);
} else if (y_46_re <= 0.00092) {
tmp = (sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_3) * (t_3 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.4e+104) {
tmp = fma((cos(t_2) * atan2(x_46_im, x_46_re)), y_46_re, sin(t_2)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = 1.0 / (1.0 / (sin(fma(y_46_im, t_1, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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 = Float64(t_1 * y_46_im) t_3 = sqrt((hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -18.0) tmp = Float64(-1.0 / Float64(Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / sin(t_0)) / -1.0)); elseif (y_46_re <= 0.00092) tmp = Float64(Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_3) * Float64(t_3 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 5.4e+104) tmp = Float64(fma(Float64(cos(t_2) * atan(x_46_im, x_46_re)), y_46_re, sin(t_2)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(1.0 / Float64(1.0 / Float64(sin(fma(y_46_im, t_1, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[(t$95$1 * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -18.0], N[(-1.0 / N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.00092], N[(N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.4e+104], N[(N[(N[(N[Cos[t$95$2], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[Sin[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := t\_1 \cdot y.im\\
t_3 := \sqrt{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\\
\mathbf{if}\;y.re \leq -18:\\
\;\;\;\;\frac{-1}{\frac{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{\sin t\_0}}{-1}}\\
\mathbf{elif}\;y.re \leq 0.00092:\\
\;\;\;\;\left(\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot t\_3\right) \cdot \frac{t\_3}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 5.4 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(\cos t\_2 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, \sin t\_2\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\mathsf{fma}\left(y.im, t\_1, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -18Initial program 46.2%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites73.8%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.7
Applied rewrites84.7%
Applied rewrites89.3%
if -18 < y.re < 9.2000000000000003e-4Initial program 34.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites84.4%
Applied rewrites84.4%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
associate-/r/N/A
Applied rewrites84.5%
if 9.2000000000000003e-4 < y.re < 5.39999999999999969e104Initial program 23.9%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.8%
if 5.39999999999999969e104 < y.re Initial program 45.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites51.4%
Taylor expanded in y.im around 0
Applied rewrites71.6%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (* t_0 y.im))
(t_3 (* (sin (fma y.im t_0 t_1)) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -18.0)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) (sin t_1)) -1.0))
(if (<= y.re 0.00092)
(/ 1.0 (/ (pow (exp y.im) (atan2 x.im x.re)) t_3))
(if (<= y.re 5.4e+104)
(*
(fma (* (cos t_2) (atan2 x.im x.re)) y.re (sin t_2))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))
(/ 1.0 (/ 1.0 t_3)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = t_0 * y_46_im;
double t_3 = sin(fma(y_46_im, t_0, t_1)) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -18.0) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / sin(t_1)) / -1.0);
} else if (y_46_re <= 0.00092) {
tmp = 1.0 / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / t_3);
} else if (y_46_re <= 5.4e+104) {
tmp = fma((cos(t_2) * atan2(x_46_im, x_46_re)), y_46_re, sin(t_2)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = 1.0 / (1.0 / t_3);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = Float64(t_0 * y_46_im) t_3 = Float64(sin(fma(y_46_im, t_0, t_1)) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -18.0) tmp = Float64(-1.0 / Float64(Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / sin(t_1)) / -1.0)); elseif (y_46_re <= 0.00092) tmp = Float64(1.0 / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / t_3)); elseif (y_46_re <= 5.4e+104) tmp = Float64(fma(Float64(cos(t_2) * atan(x_46_im, x_46_re)), y_46_re, sin(t_2)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(1.0 / Float64(1.0 / t_3)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[N[(y$46$im * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -18.0], N[(-1.0 / N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.00092], N[(1.0 / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.4e+104], N[(N[(N[(N[Cos[t$95$2], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := t\_0 \cdot y.im\\
t_3 := \sin \left(\mathsf{fma}\left(y.im, t\_0, t\_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -18:\\
\;\;\;\;\frac{-1}{\frac{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{\sin t\_1}}{-1}}\\
\mathbf{elif}\;y.re \leq 0.00092:\\
\;\;\;\;\frac{1}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{t\_3}}\\
\mathbf{elif}\;y.re \leq 5.4 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(\cos t\_2 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, \sin t\_2\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_3}}\\
\end{array}
\end{array}
if y.re < -18Initial program 46.2%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites73.8%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.7
Applied rewrites84.7%
Applied rewrites89.3%
if -18 < y.re < 9.2000000000000003e-4Initial program 34.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites84.4%
if 9.2000000000000003e-4 < y.re < 5.39999999999999969e104Initial program 23.9%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.8%
if 5.39999999999999969e104 < y.re Initial program 45.7%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites51.4%
Taylor expanded in y.im around 0
Applied rewrites71.6%
Final simplification81.3%
(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 -18.0)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) t_1) -1.0))
(if (<= y.re 4.35e-7)
(/
1.0
(/
(pow (exp y.im) (atan2 x.im x.re))
(*
(sin (fma y.im (log (hypot x.im x.re)) t_0))
(pow (hypot x.im x.re) y.re))))
(*
t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))))))
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 <= -18.0) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / t_1) / -1.0);
} else if (y_46_re <= 4.35e-7) {
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)), t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else {
tmp = t_1 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
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 <= -18.0) tmp = Float64(-1.0 / Float64(Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / t_1) / -1.0)); elseif (y_46_re <= 4.35e-7) 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)), t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)))); else tmp = 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) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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, -18.0], N[(-1.0 / N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / t$95$1), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.35e-7], 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] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -18:\\
\;\;\;\;\frac{-1}{\frac{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{t\_1}}{-1}}\\
\mathbf{elif}\;y.re \leq 4.35 \cdot 10^{-7}:\\
\;\;\;\;\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), t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -18Initial program 46.2%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites73.8%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.7
Applied rewrites84.7%
Applied rewrites89.3%
if -18 < y.re < 4.35000000000000017e-7Initial program 34.2%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites84.3%
if 4.35000000000000017e-7 < y.re Initial program 38.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.6
Applied rewrites61.6%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -0.0265)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) t_0) -1.0))
(if (<= y.re 3.7e-7)
(*
(sin
(*
(fma y.re (/ (atan2 x.im x.re) y.im) (log (hypot x.im x.re)))
y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.0265) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0);
} else if (y_46_re <= 3.7e-7) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_im, x_46_re))) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -0.0265) tmp = Float64(-1.0 / Float64(Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / t_0) / -1.0)); elseif (y_46_re <= 3.7e-7) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_im, x_46_re))) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.0265], N[(-1.0 / N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / t$95$0), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.7e-7], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -0.0265:\\
\;\;\;\;\frac{-1}{\frac{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{t\_0}}{-1}}\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -0.0264999999999999993Initial program 45.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites74.2%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.9
Applied rewrites84.9%
Applied rewrites89.5%
if -0.0264999999999999993 < y.re < 3.70000000000000004e-7Initial program 34.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6442.8
Applied rewrites42.8%
Taylor expanded in y.re around 0
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6483.6
Applied rewrites83.6%
if 3.70000000000000004e-7 < y.re Initial program 38.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.6
Applied rewrites61.6%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -0.0265)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) t_0) -1.0))
(if (<= y.re 2.1e-39)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (* (log (hypot x.im x.re)) y.im)))
(* t_0 (pow (hypot x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.0265) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0);
} else if (y_46_re <= 2.1e-39) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -0.0265) {
tmp = -1.0 / ((Math.pow(Math.hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0);
} else if (y_46_re <= 2.1e-39) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -0.0265: tmp = -1.0 / ((math.pow(math.hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0) elif y_46_re <= 2.1e-39: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -0.0265) tmp = Float64(-1.0 / Float64(Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / t_0) / -1.0)); elseif (y_46_re <= 2.1e-39) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -0.0265) tmp = -1.0 / (((hypot(x_46_re, x_46_im) ^ -y_46_re) / t_0) / -1.0); elseif (y_46_re <= 2.1e-39) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.0265], N[(-1.0 / N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / t$95$0), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-39], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -0.0265:\\
\;\;\;\;\frac{-1}{\frac{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{t\_0}}{-1}}\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-39}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.0264999999999999993Initial program 45.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites74.2%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.9
Applied rewrites84.9%
Applied rewrites89.5%
if -0.0264999999999999993 < y.re < 2.09999999999999993e-39Initial program 35.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6463.6
Applied rewrites63.6%
if 2.09999999999999993e-39 < y.re Initial program 37.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.f6460.0
Applied rewrites60.0%
Final simplification68.2%
(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.8e-11)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) t_1) -1.0))
(if (<= y.re 1.66e-41)
(/ 1.0 (/ 1.0 (* 1.0 (sin (fma y.im (log (hypot x.im x.re)) t_0)))))
(/ 1.0 (/ 1.0 (* t_1 (pow (hypot x.im x.re) y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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.8e-11) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / t_1) / -1.0);
} else if (y_46_re <= 1.66e-41) {
tmp = 1.0 / (1.0 / (1.0 * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0))));
} else {
tmp = 1.0 / (1.0 / (t_1 * pow(hypot(x_46_im, x_46_re), y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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.8e-11) tmp = Float64(-1.0 / Float64(Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / t_1) / -1.0)); elseif (y_46_re <= 1.66e-41) tmp = Float64(1.0 / Float64(1.0 / Float64(1.0 * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0))))); else tmp = Float64(1.0 / Float64(1.0 / Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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.8e-11], N[(-1.0 / N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / t$95$1), $MachinePrecision] / -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.66e-41], N[(1.0 / N[(1.0 / N[(1.0 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\frac{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{t\_1}}{-1}}\\
\mathbf{elif}\;y.re \leq 1.66 \cdot 10^{-41}:\\
\;\;\;\;\frac{1}{\frac{1}{1 \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -3.7999999999999998e-11Initial program 45.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites75.0%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6484.0
Applied rewrites84.0%
Applied rewrites88.4%
if -3.7999999999999998e-11 < y.re < 1.65999999999999993e-41Initial program 34.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites84.6%
Taylor expanded in y.im around 0
Applied rewrites57.9%
Taylor expanded in y.re around 0
Applied rewrites57.9%
if 1.65999999999999993e-41 < y.re Initial program 37.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites50.1%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6459.7
Applied rewrites59.7%
Final simplification65.3%
(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) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -3.8e-11)
t_1
(if (<= y.re 1.66e-41)
(/ 1.0 (/ 1.0 (* 1.0 (sin (fma y.im (log (hypot x.im x.re)) t_0)))))
(/ 1.0 (/ 1.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 = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -3.8e-11) {
tmp = t_1;
} else if (y_46_re <= 1.66e-41) {
tmp = 1.0 / (1.0 / (1.0 * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0))));
} else {
tmp = 1.0 / (1.0 / t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -3.8e-11) tmp = t_1; elseif (y_46_re <= 1.66e-41) tmp = Float64(1.0 / Float64(1.0 / Float64(1.0 * sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0))))); else tmp = Float64(1.0 / Float64(1.0 / t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.8e-11], t$95$1, If[LessEqual[y$46$re, 1.66e-41], N[(1.0 / N[(1.0 / N[(1.0 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.66 \cdot 10^{-41}:\\
\;\;\;\;\frac{1}{\frac{1}{1 \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_1}}\\
\end{array}
\end{array}
if y.re < -3.7999999999999998e-11Initial program 45.6%
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.f6484.0
Applied rewrites84.0%
if -3.7999999999999998e-11 < y.re < 1.65999999999999993e-41Initial program 34.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites84.6%
Taylor expanded in y.im around 0
Applied rewrites57.9%
Taylor expanded in y.re around 0
Applied rewrites57.9%
if 1.65999999999999993e-41 < y.re Initial program 37.5%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites50.1%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6459.7
Applied rewrites59.7%
Final simplification65.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.re 3.8e-186)
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(/ 1.0 (/ 1.0 (* (pow x.re y.re) (sin (fma y.im (log x.re) t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_re <= 3.8e-186) {
tmp = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 / (1.0 / (pow(x_46_re, y_46_re) * sin(fma(y_46_im, log(x_46_re), t_0))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_re <= 3.8e-186) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(1.0 / Float64(1.0 / Float64((x_46_re ^ y_46_re) * sin(fma(y_46_im, log(x_46_re), t_0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$re, 3.8e-186], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.re \leq 3.8 \cdot 10^{-186}:\\
\;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{{x.re}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right)}}\\
\end{array}
\end{array}
if x.re < 3.79999999999999974e-186Initial program 38.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.f6454.4
Applied rewrites54.4%
if 3.79999999999999974e-186 < x.re Initial program 38.2%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites74.0%
Taylor expanded in y.im around 0
Applied rewrites64.7%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f6460.3
Applied rewrites60.3%
Final simplification56.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (sin (* (atan2 x.im x.re) y.re)) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -2.85e-168)
t_0
(if (<= y.re 2.6e-150)
(/ 1.0 (/ 1.0 (sin (* (log (hypot x.im x.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 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.85e-168) {
tmp = t_0;
} else if (y_46_re <= 2.6e-150) {
tmp = 1.0 / (1.0 / sin((log(hypot(x_46_im, x_46_re)) * y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.85e-168) {
tmp = t_0;
} else if (y_46_re <= 2.6e-150) {
tmp = 1.0 / (1.0 / Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -2.85e-168: tmp = t_0 elif y_46_re <= 2.6e-150: tmp = 1.0 / (1.0 / math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.85e-168) tmp = t_0; elseif (y_46_re <= 2.6e-150) tmp = Float64(1.0 / Float64(1.0 / sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.85e-168) tmp = t_0; elseif (y_46_re <= 2.6e-150) tmp = 1.0 / (1.0 / sin((log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.85e-168], t$95$0, If[LessEqual[y$46$re, 2.6e-150], N[(1.0 / N[(1.0 / N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.85 \cdot 10^{-168}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{-150}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.85000000000000004e-168 or 2.5999999999999998e-150 < y.re Initial program 40.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.f6458.8
Applied rewrites58.8%
if -2.85000000000000004e-168 < y.re < 2.5999999999999998e-150Initial program 31.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites82.1%
Taylor expanded in y.im around 0
Applied rewrites65.8%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.9
Applied rewrites54.9%
Final simplification57.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (* (atan2 x.im x.re) y.re) (pow (hypot x.im x.re) y.re))))
(if (<= y.re -2.85e-168)
t_0
(if (<= y.re 2.6e-150)
(/ 1.0 (/ 1.0 (sin (* (log (hypot x.im x.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 = (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.85e-168) {
tmp = t_0;
} else if (y_46_re <= 2.6e-150) {
tmp = 1.0 / (1.0 / sin((log(hypot(x_46_im, x_46_re)) * y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (Math.atan2(x_46_im, x_46_re) * y_46_re) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.85e-168) {
tmp = t_0;
} else if (y_46_re <= 2.6e-150) {
tmp = 1.0 / (1.0 / Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (math.atan2(x_46_im, x_46_re) * y_46_re) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -2.85e-168: tmp = t_0 elif y_46_re <= 2.6e-150: tmp = 1.0 / (1.0 / math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -2.85e-168) tmp = t_0; elseif (y_46_re <= 2.6e-150) tmp = Float64(1.0 / Float64(1.0 / sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -2.85e-168) tmp = t_0; elseif (y_46_re <= 2.6e-150) tmp = 1.0 / (1.0 / sin((log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.85e-168], t$95$0, If[LessEqual[y$46$re, 2.6e-150], N[(1.0 / N[(1.0 / N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.85 \cdot 10^{-168}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{-150}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.85000000000000004e-168 or 2.5999999999999998e-150 < y.re Initial program 40.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.f6458.8
Applied rewrites58.8%
Taylor expanded in y.re around 0
Applied rewrites56.2%
if -2.85000000000000004e-168 < y.re < 2.5999999999999998e-150Initial program 31.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites82.1%
Taylor expanded in y.im around 0
Applied rewrites65.8%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.9
Applied rewrites54.9%
Final simplification55.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))) (t_1 (* (pow x.re y.re) t_0)))
(if (<= x.re -4e+47)
t_1
(if (<= x.re 8e-223) (* (pow x.im y.re) 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = pow(x_46_re, y_46_re) * t_0;
double tmp;
if (x_46_re <= -4e+47) {
tmp = t_1;
} else if (x_46_re <= 8e-223) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
t_1 = (x_46re ** y_46re) * t_0
if (x_46re <= (-4d+47)) then
tmp = t_1
else if (x_46re <= 8d-223) then
tmp = (x_46im ** y_46re) * t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(x_46_re, y_46_re) * t_0;
double tmp;
if (x_46_re <= -4e+47) {
tmp = t_1;
} else if (x_46_re <= 8e-223) {
tmp = Math.pow(x_46_im, y_46_re) * 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.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_1 = math.pow(x_46_re, y_46_re) * t_0 tmp = 0 if x_46_re <= -4e+47: tmp = t_1 elif x_46_re <= 8e-223: tmp = math.pow(x_46_im, y_46_re) * t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64((x_46_re ^ y_46_re) * t_0) tmp = 0.0 if (x_46_re <= -4e+47) tmp = t_1; elseif (x_46_re <= 8e-223) tmp = Float64((x_46_im ^ y_46_re) * 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 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = (x_46_re ^ y_46_re) * t_0; tmp = 0.0; if (x_46_re <= -4e+47) tmp = t_1; elseif (x_46_re <= 8e-223) tmp = (x_46_im ^ y_46_re) * 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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[x$46$re, -4e+47], t$95$1, If[LessEqual[x$46$re, 8e-223], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {x.re}^{y.re} \cdot t\_0\\
\mathbf{if}\;x.re \leq -4 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.re \leq 8 \cdot 10^{-223}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.re < -4.0000000000000002e47 or 7.9999999999999998e-223 < x.re Initial program 33.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.f6445.3
Applied rewrites45.3%
Taylor expanded in x.im around 0
Applied rewrites41.0%
if -4.0000000000000002e47 < x.re < 7.9999999999999998e-223Initial program 47.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.f6455.0
Applied rewrites55.0%
Taylor expanded in x.re around 0
Applied rewrites46.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (* (pow x.im y.re) (sin t_0)))) (if (<= y.re -1.4e-10) t_1 (if (<= y.re 2.8e+26) 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(x_46_im, y_46_re) * sin(t_0);
double tmp;
if (y_46_re <= -1.4e-10) {
tmp = t_1;
} else if (y_46_re <= 2.8e+26) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46re
t_1 = (x_46im ** y_46re) * sin(t_0)
if (y_46re <= (-1.4d-10)) then
tmp = t_1
else if (y_46re <= 2.8d+26) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.pow(x_46_im, y_46_re) * Math.sin(t_0);
double tmp;
if (y_46_re <= -1.4e-10) {
tmp = t_1;
} else if (y_46_re <= 2.8e+26) {
tmp = 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 = math.pow(x_46_im, y_46_re) * math.sin(t_0) tmp = 0 if y_46_re <= -1.4e-10: tmp = t_1 elif y_46_re <= 2.8e+26: tmp = 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((x_46_im ^ y_46_re) * sin(t_0)) tmp = 0.0 if (y_46_re <= -1.4e-10) tmp = t_1; elseif (y_46_re <= 2.8e+26) tmp = 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 = (x_46_im ^ y_46_re) * sin(t_0); tmp = 0.0; if (y_46_re <= -1.4e-10) tmp = t_1; elseif (y_46_re <= 2.8e+26) tmp = 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[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.4e-10], t$95$1, If[LessEqual[y$46$re, 2.8e+26], t$95$0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {x.im}^{y.re} \cdot \sin t\_0\\
\mathbf{if}\;y.re \leq -1.4 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.40000000000000008e-10 or 2.8e26 < y.re Initial program 43.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.f6473.3
Applied rewrites73.3%
Taylor expanded in x.re around 0
Applied rewrites58.3%
if -1.40000000000000008e-10 < y.re < 2.8e26Initial program 33.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.f6427.2
Applied rewrites27.2%
Taylor expanded in y.re around 0
Applied rewrites24.1%
Final simplification40.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* (atan2 x.im x.re) y.re) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (Math.atan2(x_46_im, x_46_re) * y_46_re) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (math.atan2(x_46_im, x_46_re) * y_46_re) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_im, x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 38.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.f6448.6
Applied rewrites48.6%
Taylor expanded in y.re around 0
Applied rewrites46.6%
Final simplification46.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (sin (* (atan2 x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0 * sin((atan2(x_46im, x_46re) * y_46re))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 38.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.f6448.6
Applied rewrites48.6%
Taylor expanded in y.re around 0
Applied rewrites16.2%
(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 38.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.f6448.6
Applied rewrites48.6%
Taylor expanded in y.re around 0
Applied rewrites16.2%
Final simplification16.2%
herbie shell --seed 2024283
(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)))))