
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (log (hypot x.im x.re)))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -1.62e-12)
(* t_2 (sin (* t_1 y.im)))
(if (<= y.re 4e-38)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (pow (pow (fma y.im t_1 t_0) -1.0) -1.0)))
(* t_2 (fma (* 1.0 t_1) y.im (sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -1.62e-12) {
tmp = t_2 * sin((t_1 * y_46_im));
} else if (y_46_re <= 4e-38) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(pow(pow(fma(y_46_im, t_1, t_0), -1.0), -1.0));
} else {
tmp = t_2 * fma((1.0 * t_1), y_46_im, sin(t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -1.62e-12) tmp = Float64(t_2 * sin(Float64(t_1 * y_46_im))); elseif (y_46_re <= 4e-38) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(((fma(y_46_im, t_1, t_0) ^ -1.0) ^ -1.0))); else tmp = Float64(t_2 * fma(Float64(1.0 * t_1), y_46_im, sin(t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.62e-12], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e-38], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(1.0 * t$95$1), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.62 \cdot 10^{-12}:\\
\;\;\;\;t\_2 \cdot \sin \left(t\_1 \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{-38}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_1, t\_0\right)\right)}^{-1}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(1 \cdot t\_1, y.im, \sin t\_0\right)\\
\end{array}
\end{array}
if y.re < -1.62e-12Initial program 39.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6488.3
Applied rewrites88.3%
if -1.62e-12 < y.re < 3.9999999999999998e-38Initial program 39.5%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6481.5
Applied rewrites81.5%
if 3.9999999999999998e-38 < y.re Initial program 53.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.2%
Taylor expanded in y.re around 0
Applied rewrites78.8%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -1.62e-12) (not (<= y.re 29000.0)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* t_0 y.im)))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (pow (pow (fma y.im t_0 (* (atan2 x.im x.re) y.re)) -1.0) -1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -1.62e-12) || !(y_46_re <= 29000.0)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((t_0 * y_46_im));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(pow(pow(fma(y_46_im, t_0, (atan2(x_46_im, x_46_re) * y_46_re)), -1.0), -1.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -1.62e-12) || !(y_46_re <= 29000.0)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(t_0 * y_46_im))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(((fma(y_46_im, t_0, Float64(atan(x_46_im, x_46_re) * y_46_re)) ^ -1.0) ^ -1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.62e-12], N[Not[LessEqual[y$46$re, 29000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1.62 \cdot 10^{-12} \lor \neg \left(y.re \leq 29000\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -1.62e-12 or 29000 < y.re Initial program 45.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.3
Applied rewrites83.3%
if -1.62e-12 < y.re < 29000Initial program 40.6%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites51.7%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6479.0
Applied rewrites79.0%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -3e+17) (not (<= y.re 1.5e-37)))
(*
(pow (hypot x.im x.re) y.re)
(sin (fma (atan2 x.im x.re) y.re (* y.im t_0))))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (pow (pow (fma y.im t_0 (* (atan2 x.im x.re) y.re)) -1.0) -1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -3e+17) || !(y_46_re <= 1.5e-37)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_0)));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(pow(pow(fma(y_46_im, t_0, (atan2(x_46_im, x_46_re) * y_46_re)), -1.0), -1.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -3e+17) || !(y_46_re <= 1.5e-37)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * t_0)))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(((fma(y_46_im, t_0, Float64(atan(x_46_im, x_46_re) * y_46_re)) ^ -1.0) ^ -1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -3e+17], N[Not[LessEqual[y$46$re, 1.5e-37]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -3 \cdot 10^{+17} \lor \neg \left(y.re \leq 1.5 \cdot 10^{-37}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -3e17 or 1.5e-37 < y.re Initial program 46.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.3
Applied rewrites40.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6440.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.3
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6477.3
Applied rewrites77.3%
if -3e17 < y.re < 1.5e-37Initial program 39.6%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites51.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6481.0
Applied rewrites81.0%
Final simplification79.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.re -3e+17) (not (<= y.re 3.8e-32)))
(*
(pow (hypot x.im x.re) y.re)
(sin (fma (atan2 x.im x.re) y.re (* y.im t_0))))
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(fma (* 1.0 t_0) y.im (sin (* (atan2 x.im x.re) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -3e+17) || !(y_46_re <= 3.8e-32)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_0)));
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * fma((1.0 * t_0), y_46_im, sin((atan2(x_46_im, x_46_re) * y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -3e+17) || !(y_46_re <= 3.8e-32)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * t_0)))); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * fma(Float64(1.0 * t_0), y_46_im, sin(Float64(atan(x_46_im, x_46_re) * y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -3e+17], N[Not[LessEqual[y$46$re, 3.8e-32]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 * t$95$0), $MachinePrecision] * y$46$im + N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -3 \cdot 10^{+17} \lor \neg \left(y.re \leq 3.8 \cdot 10^{-32}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \mathsf{fma}\left(1 \cdot t\_0, y.im, \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\end{array}
\end{array}
if y.re < -3e17 or 3.80000000000000008e-32 < y.re Initial program 46.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.4
Applied rewrites40.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6440.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.4
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6478.4
Applied rewrites78.4%
if -3e17 < y.re < 3.80000000000000008e-32Initial program 40.3%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.4%
Taylor expanded in y.re around 0
Applied rewrites52.4%
Taylor expanded in y.re around 0
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6479.6
Applied rewrites79.6%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.im -6.5e+24)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(if (<= y.im 4.1e+77)
(*
(pow (hypot x.im x.re) y.re)
(sin (fma (atan2 x.im x.re) y.re (* y.im t_0))))
(* (sin (* t_0 y.im)) (exp (* (- y.im) (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -6.5e+24) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_im <= 4.1e+77) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_0)));
} else {
tmp = sin((t_0 * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -6.5e+24) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_im <= 4.1e+77) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * t_0)))); else tmp = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -6.5e+24], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.1e+77], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+24}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.im \leq 4.1 \cdot 10^{+77}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -6.4999999999999996e24Initial program 46.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.1
Applied rewrites63.1%
if -6.4999999999999996e24 < y.im < 4.1000000000000001e77Initial program 43.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6441.1
Applied rewrites41.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6441.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.1
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6485.9
Applied rewrites85.9%
if 4.1000000000000001e77 < y.im Initial program 38.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.9%
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
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6465.4
Applied rewrites65.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.8e-59) (not (<= y.re 2.7e-110)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.8e-59) || !(y_46_re <= 2.7e-110)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_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 tmp;
if ((y_46_re <= -1.8e-59) || !(y_46_re <= 2.7e-110)) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.8e-59) or not (y_46_re <= 2.7e-110): tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.8e-59) || !(y_46_re <= 2.7e-110)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.8e-59) || ~((y_46_re <= 2.7e-110))) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.8e-59], N[Not[LessEqual[y$46$re, 2.7e-110]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-59} \lor \neg \left(y.re \leq 2.7 \cdot 10^{-110}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -1.8e-59 or 2.6999999999999998e-110 < y.re Initial program 44.4%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6472.0
Applied rewrites72.0%
if -1.8e-59 < y.re < 2.6999999999999998e-110Initial program 40.8%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.9%
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
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6474.5
Applied rewrites74.5%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -5.5e+77)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (/ (* (* x.re x.re) y.im) x.im) (/ 0.5 x.im))))
(if (or (<= y.im -1.7e-177) (not (<= y.im 3e-260)))
(* t_0 (sin (* (log (hypot x.im x.re)) y.im)))
(* t_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) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -5.5e+77) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((((x_46_re * x_46_re) * y_46_im) / x_46_im) * (0.5 / x_46_im)));
} else if ((y_46_im <= -1.7e-177) || !(y_46_im <= 3e-260)) {
tmp = t_0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_0 * sin((atan2(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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -5.5e+77) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((((x_46_re * x_46_re) * y_46_im) / x_46_im) * (0.5 / x_46_im)));
} else if ((y_46_im <= -1.7e-177) || !(y_46_im <= 3e-260)) {
tmp = t_0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = t_0 * Math.sin((Math.atan2(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.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_im <= -5.5e+77: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((((x_46_re * x_46_re) * y_46_im) / x_46_im) * (0.5 / x_46_im))) elif (y_46_im <= -1.7e-177) or not (y_46_im <= 3e-260): tmp = t_0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = t_0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -5.5e+77) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(Float64(Float64(x_46_re * x_46_re) * y_46_im) / x_46_im) * Float64(0.5 / x_46_im)))); elseif ((y_46_im <= -1.7e-177) || !(y_46_im <= 3e-260)) tmp = Float64(t_0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(t_0 * sin(Float64(atan(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 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_im <= -5.5e+77) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((((x_46_re * x_46_re) * y_46_im) / x_46_im) * (0.5 / x_46_im))); elseif ((y_46_im <= -1.7e-177) || ~((y_46_im <= 3e-260))) tmp = t_0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = t_0 * sin((atan2(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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -5.5e+77], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * y$46$im), $MachinePrecision] / x$46$im), $MachinePrecision] * N[(0.5 / x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, -1.7e-177], N[Not[LessEqual[y$46$im, 3e-260]], $MachinePrecision]], N[(t$95$0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+77}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\left(x.re \cdot x.re\right) \cdot y.im}{x.im} \cdot \frac{0.5}{x.im}\right)\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-177} \lor \neg \left(y.im \leq 3 \cdot 10^{-260}\right):\\
\;\;\;\;t\_0 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\end{array}
\end{array}
if y.im < -5.50000000000000036e77Initial program 49.0%
Taylor expanded in x.im around -inf
+-commutativeN/A
associate-+l+N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
unpow2N/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites21.3%
Taylor expanded in x.re around inf
Applied rewrites29.9%
if -5.50000000000000036e77 < y.im < -1.7e-177 or 3.0000000000000001e-260 < y.im Initial program 39.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6430.1
Applied rewrites30.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.9
Applied rewrites63.9%
if -1.7e-177 < y.im < 3.0000000000000001e-260Initial program 52.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.8
Applied rewrites52.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.9
Applied rewrites82.9%
Final simplification60.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (log (hypot x.im x.re)) y.im))))
(if (or (<= y.re -1.65e+19) (not (<= y.re 29000.0)))
(* (pow (hypot x.im x.re) y.re) t_0)
(* t_0 (exp (* (- y.im) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if ((y_46_re <= -1.65e+19) || !(y_46_re <= 29000.0)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_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.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if ((y_46_re <= -1.65e+19) || !(y_46_re <= 29000.0)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
} else {
tmp = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if (y_46_re <= -1.65e+19) or not (y_46_re <= 29000.0): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 else: tmp = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if ((y_46_re <= -1.65e+19) || !(y_46_re <= 29000.0)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0); else tmp = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_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((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if ((y_46_re <= -1.65e+19) || ~((y_46_re <= 29000.0))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0; else tmp = t_0 * exp((-y_46_im * atan2(x_46_im, x_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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.65e+19], N[Not[LessEqual[y$46$re, 29000.0]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+19} \lor \neg \left(y.re \leq 29000\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -1.65e19 or 29000 < y.re Initial program 46.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6440.3
Applied rewrites40.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.9
Applied rewrites77.9%
if -1.65e19 < y.re < 29000Initial program 40.4%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.1%
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
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6463.7
Applied rewrites63.7%
Final simplification70.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.78e-59) (not (<= y.re 8e-205))) (* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re))) (* 1.0 (sin (* (log (hypot 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 tmp;
if ((y_46_re <= -1.78e-59) || !(y_46_re <= 8e-205)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.78e-59) || !(y_46_re <= 8e-205)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.78e-59) or not (y_46_re <= 8e-205): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = 1.0 * math.sin((math.log(math.hypot(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) tmp = 0.0 if ((y_46_re <= -1.78e-59) || !(y_46_re <= 8e-205)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.78e-59) || ~((y_46_re <= 8e-205))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.78e-59], N[Not[LessEqual[y$46$re, 8e-205]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.78 \cdot 10^{-59} \lor \neg \left(y.re \leq 8 \cdot 10^{-205}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -1.7800000000000001e-59 or 8e-205 < y.re Initial program 44.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6434.0
Applied rewrites34.0%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.3
Applied rewrites60.3%
if -1.7800000000000001e-59 < y.re < 8e-205Initial program 40.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6419.7
Applied rewrites19.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.4
Applied rewrites11.4%
Taylor expanded in y.re around 0
Applied rewrites11.4%
Taylor expanded in y.re around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6444.5
Applied rewrites44.5%
Final simplification55.7%
(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.im y.re) t_0))
(t_2 (* (pow x.re y.re) t_0)))
(if (<= y.re -4e+67)
t_2
(if (<= y.re -3.3e-59)
t_1
(if (<= y.re 8e-205)
(* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))
(if (<= y.re 1.45e-13)
(* 1.0 t_0)
(if (<= y.re 2.95e+188) t_1 t_2)))))))
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_im, y_46_re) * t_0;
double t_2 = pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -4e+67) {
tmp = t_2;
} else if (y_46_re <= -3.3e-59) {
tmp = t_1;
} else if (y_46_re <= 8e-205) {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 1.45e-13) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 2.95e+188) {
tmp = t_1;
} 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(x_46_im, y_46_re) * t_0;
double t_2 = Math.pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -4e+67) {
tmp = t_2;
} else if (y_46_re <= -3.3e-59) {
tmp = t_1;
} else if (y_46_re <= 8e-205) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 1.45e-13) {
tmp = 1.0 * t_0;
} else if (y_46_re <= 2.95e+188) {
tmp = t_1;
} else {
tmp = t_2;
}
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_im, y_46_re) * t_0 t_2 = math.pow(x_46_re, y_46_re) * t_0 tmp = 0 if y_46_re <= -4e+67: tmp = t_2 elif y_46_re <= -3.3e-59: tmp = t_1 elif y_46_re <= 8e-205: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) elif y_46_re <= 1.45e-13: tmp = 1.0 * t_0 elif y_46_re <= 2.95e+188: tmp = t_1 else: tmp = t_2 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_im ^ y_46_re) * t_0) t_2 = Float64((x_46_re ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -4e+67) tmp = t_2; elseif (y_46_re <= -3.3e-59) tmp = t_1; elseif (y_46_re <= 8e-205) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); elseif (y_46_re <= 1.45e-13) tmp = Float64(1.0 * t_0); elseif (y_46_re <= 2.95e+188) tmp = t_1; 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 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = (x_46_im ^ y_46_re) * t_0; t_2 = (x_46_re ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -4e+67) tmp = t_2; elseif (y_46_re <= -3.3e-59) tmp = t_1; elseif (y_46_re <= 8e-205) tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 1.45e-13) tmp = 1.0 * t_0; elseif (y_46_re <= 2.95e+188) tmp = t_1; 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[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$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -4e+67], t$95$2, If[LessEqual[y$46$re, -3.3e-59], t$95$1, If[LessEqual[y$46$re, 8e-205], 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], If[LessEqual[y$46$re, 1.45e-13], N[(1.0 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2.95e+188], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {x.im}^{y.re} \cdot t\_0\\
t_2 := {x.re}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -4 \cdot 10^{+67}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -3.3 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{-205}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-13}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2.95 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -3.99999999999999993e67 or 2.95e188 < y.re Initial program 43.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6437.9
Applied rewrites37.9%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6477.2
Applied rewrites77.2%
Taylor expanded in x.im around 0
Applied rewrites67.9%
if -3.99999999999999993e67 < y.re < -3.29999999999999982e-59 or 1.4499999999999999e-13 < y.re < 2.95e188Initial program 46.9%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6435.1
Applied rewrites35.1%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.1
Applied rewrites59.1%
Taylor expanded in x.re around 0
Applied rewrites48.1%
if -3.29999999999999982e-59 < y.re < 8e-205Initial program 40.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6419.7
Applied rewrites19.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.4
Applied rewrites11.4%
Taylor expanded in y.re around 0
Applied rewrites11.4%
Taylor expanded in y.re around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6444.5
Applied rewrites44.5%
if 8e-205 < y.re < 1.4499999999999999e-13Initial program 41.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.0
Applied rewrites25.0%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.6
Applied rewrites31.6%
Taylor expanded in y.re around 0
Applied rewrites31.6%
(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.im y.re) t_0)))
(if (<= y.re -3.3e-59)
t_1
(if (<= y.re 8e-205)
(* 1.0 (sin (* (log (hypot x.im x.re)) y.im)))
(if (<= y.re 1.45e-13) (* 1.0 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_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -3.3e-59) {
tmp = t_1;
} else if (y_46_re <= 8e-205) {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 1.45e-13) {
tmp = 1.0 * 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = Math.pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -3.3e-59) {
tmp = t_1;
} else if (y_46_re <= 8e-205) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else if (y_46_re <= 1.45e-13) {
tmp = 1.0 * 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_im, y_46_re) * t_0 tmp = 0 if y_46_re <= -3.3e-59: tmp = t_1 elif y_46_re <= 8e-205: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) elif y_46_re <= 1.45e-13: tmp = 1.0 * 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_im ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -3.3e-59) tmp = t_1; elseif (y_46_re <= 8e-205) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); elseif (y_46_re <= 1.45e-13) tmp = Float64(1.0 * 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_im ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -3.3e-59) tmp = t_1; elseif (y_46_re <= 8e-205) tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); elseif (y_46_re <= 1.45e-13) tmp = 1.0 * 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$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e-59], t$95$1, If[LessEqual[y$46$re, 8e-205], 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], If[LessEqual[y$46$re, 1.45e-13], N[(1.0 * 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.im}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{-205}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-13}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -3.29999999999999982e-59 or 1.4499999999999999e-13 < y.re Initial program 45.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6436.6
Applied rewrites36.6%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6468.7
Applied rewrites68.7%
Taylor expanded in x.re around 0
Applied rewrites48.0%
if -3.29999999999999982e-59 < y.re < 8e-205Initial program 40.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6419.7
Applied rewrites19.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.4
Applied rewrites11.4%
Taylor expanded in y.re around 0
Applied rewrites11.4%
Taylor expanded in y.re around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6444.5
Applied rewrites44.5%
if 8e-205 < y.re < 1.4499999999999999e-13Initial program 41.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.0
Applied rewrites25.0%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.6
Applied rewrites31.6%
Taylor expanded in y.re around 0
Applied rewrites31.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.78e-59) (not (<= y.re 8e-205))) (* 1.0 (sin (* (atan2 x.im x.re) y.re))) (* 1.0 (sin (* (log (hypot 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 tmp;
if ((y_46_re <= -1.78e-59) || !(y_46_re <= 8e-205)) {
tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.78e-59) || !(y_46_re <= 8e-205)) {
tmp = 1.0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.78e-59) or not (y_46_re <= 8e-205): tmp = 1.0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = 1.0 * math.sin((math.log(math.hypot(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) tmp = 0.0 if ((y_46_re <= -1.78e-59) || !(y_46_re <= 8e-205)) tmp = Float64(1.0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.78e-59) || ~((y_46_re <= 8e-205))) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.78e-59], N[Not[LessEqual[y$46$re, 8e-205]], $MachinePrecision]], N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.78 \cdot 10^{-59} \lor \neg \left(y.re \leq 8 \cdot 10^{-205}\right):\\
\;\;\;\;1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -1.7800000000000001e-59 or 8e-205 < y.re Initial program 44.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6434.0
Applied rewrites34.0%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.3
Applied rewrites60.3%
Taylor expanded in y.re around 0
Applied rewrites14.3%
if -1.7800000000000001e-59 < y.re < 8e-205Initial program 40.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6419.7
Applied rewrites19.7%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.4
Applied rewrites11.4%
Taylor expanded in y.re around 0
Applied rewrites11.4%
Taylor expanded in y.re around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6444.5
Applied rewrites44.5%
Final simplification23.2%
(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 43.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6429.8
Applied rewrites29.8%
Taylor expanded in y.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.9
Applied rewrites45.9%
Taylor expanded in y.re around 0
Applied rewrites13.5%
herbie shell --seed 2024313
(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)))))