
(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 18 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)))
(if (<= y.re -9.2e-13)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 5e-9)
(*
(sin (fma (atan2 x.im x.re) y.re (* (log (hypot x.im x.re)) y.im)))
(exp (* (- y.im) (atan2 x.im x.re))))
(/
1.0
(*
(fma (atan2 x.im x.re) y.im 1.0)
(/
(pow (hypot x.re x.im) (- y.re))
(sin (fma (log (hypot x.re x.im)) 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;
double tmp;
if (y_46_re <= -9.2e-13) {
tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 5e-9) {
tmp = sin(fma(atan2(x_46_im, x_46_re), y_46_re, (log(hypot(x_46_im, x_46_re)) * y_46_im))) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 1.0 / (fma(atan2(x_46_im, x_46_re), y_46_im, 1.0) * (pow(hypot(x_46_re, x_46_im), -y_46_re) / sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, 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 (y_46_re <= -9.2e-13) tmp = Float64(sin(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(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 5e-9) tmp = Float64(sin(fma(atan(x_46_im, x_46_re), y_46_re, 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)))); else tmp = Float64(1.0 / Float64(fma(atan(x_46_im, x_46_re), y_46_im, 1.0) * Float64((hypot(x_46_re, x_46_im) ^ Float64(-y_46_re)) / sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -9.2e-13], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e-9], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + 1.0), $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], (-y$46$re)], $MachinePrecision] / 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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-13}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)}}\\
\end{array}
\end{array}
if y.re < -9.19999999999999917e-13Initial program 50.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.0
Applied rewrites86.0%
if -9.19999999999999917e-13 < y.re < 5.0000000000000001e-9Initial program 40.1%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6440.1
Applied rewrites40.1%
lift-+.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.1
lift-hypot.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f6480.1
Applied rewrites80.1%
if 5.0000000000000001e-9 < y.re Initial program 41.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites60.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-atan2.f6473.7
Applied rewrites73.7%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites73.7%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -9.2e-13)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 5e-9)
(*
(sin (fma (atan2 x.im x.re) y.re (* (log (hypot x.im x.re)) y.im)))
(exp (* (- y.im) (atan2 x.im x.re))))
(/
(*
(pow (hypot x.re x.im) y.re)
(sin (fma (log (hypot x.re x.im)) y.im t_0)))
(fma (atan2 x.im x.re) y.im 1.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 (y_46_re <= -9.2e-13) {
tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 5e-9) {
tmp = sin(fma(atan2(x_46_im, x_46_re), y_46_re, (log(hypot(x_46_im, x_46_re)) * y_46_im))) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))) / fma(atan2(x_46_im, x_46_re), y_46_im, 1.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 (y_46_re <= -9.2e-13) tmp = Float64(sin(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(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 5e-9) tmp = Float64(sin(fma(atan(x_46_im, x_46_re), y_46_re, 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)))); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))) / fma(atan(x_46_im, x_46_re), y_46_im, 1.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[y$46$re, -9.2e-13], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e-9], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 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]), $MachinePrecision] / N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-13}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right)}\\
\end{array}
\end{array}
if y.re < -9.19999999999999917e-13Initial program 50.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.0
Applied rewrites86.0%
if -9.19999999999999917e-13 < y.re < 5.0000000000000001e-9Initial program 40.1%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6440.1
Applied rewrites40.1%
lift-+.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.1
lift-hypot.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f6480.1
Applied rewrites80.1%
if 5.0000000000000001e-9 < y.re Initial program 41.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites60.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-atan2.f6473.7
Applied rewrites73.7%
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
lower-/.f6473.7
Applied rewrites73.7%
Final simplification80.5%
(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))))
(if (<= y.re -9.2e-13)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 5e-9)
(*
(sin (fma (atan2 x.im x.re) y.re (* t_1 y.im)))
(exp (* (- y.im) (atan2 x.im x.re))))
(/
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 tmp;
if (y_46_re <= -9.2e-13) {
tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 5e-9) {
tmp = sin(fma(atan2(x_46_im, x_46_re), y_46_re, (t_1 * y_46_im))) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} 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)) tmp = 0.0 if (y_46_re <= -9.2e-13) tmp = Float64(sin(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(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 5e-9) tmp = Float64(sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(t_1 * y_46_im))) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); 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]}, If[LessEqual[y$46$re, -9.2e-13], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e-9], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(t$95$1 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $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)\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-13}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_1 \cdot y.im\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\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 < -9.19999999999999917e-13Initial program 50.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.0
Applied rewrites86.0%
if -9.19999999999999917e-13 < y.re < 5.0000000000000001e-9Initial program 40.1%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6440.1
Applied rewrites40.1%
lift-+.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.1
lift-hypot.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f6480.1
Applied rewrites80.1%
if 5.0000000000000001e-9 < y.re Initial program 41.1%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites60.3%
Taylor expanded in y.im around 0
Applied rewrites69.9%
Final simplification79.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -9.2e-13)
t_0
(if (<= y.re 0.035)
(*
(sin (fma (atan2 x.im x.re) y.re (* (log (hypot x.im x.re)) y.im)))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -9.2e-13) {
tmp = t_0;
} else if (y_46_re <= 0.035) {
tmp = sin(fma(atan2(x_46_im, x_46_re), y_46_re, (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;
}
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)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -9.2e-13) tmp = t_0; elseif (y_46_re <= 0.035) tmp = Float64(sin(fma(atan(x_46_im, x_46_re), y_46_re, 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)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.2e-13], t$95$0, If[LessEqual[y$46$re, 0.035], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $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 e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.035:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.19999999999999917e-13 or 0.035000000000000003 < y.re Initial program 47.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.8
Applied rewrites78.8%
if -9.19999999999999917e-13 < y.re < 0.035000000000000003Initial program 39.2%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6439.2
Applied rewrites39.2%
lift-+.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.7
lift-hypot.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-hypot.f6478.7
Applied rewrites78.7%
Final simplification78.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (atan2 x.im x.re) y.re))
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))))
(if (<= y.re -5.6e-42)
t_0
(if (<= y.re 0.0038)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -5.6e-42) {
tmp = t_0;
} else if (y_46_re <= 0.0038) {
tmp = sin((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;
}
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.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -5.6e-42) {
tmp = t_0;
} else if (y_46_re <= 0.0038) {
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)));
} 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.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -5.6e-42: tmp = t_0 elif y_46_re <= 0.0038: 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))) 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)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_re <= -5.6e-42) tmp = t_0; elseif (y_46_re <= 0.0038) 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)))); 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)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -5.6e-42) tmp = t_0; elseif (y_46_re <= 0.0038) tmp = sin((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; 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[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e-42], t$95$0, If[LessEqual[y$46$re, 0.0038], 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], 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 e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.0038:\\
\;\;\;\;\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}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.59999999999999996e-42 or 0.00379999999999999999 < y.re Initial program 47.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6477.3
Applied rewrites77.3%
if -5.59999999999999996e-42 < y.re < 0.00379999999999999999Initial program 38.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6422.9
Applied rewrites22.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6460.1
Applied rewrites60.1%
Final simplification69.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 -7.9e-42)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) t_0) -1.0))
(if (<= y.re 1.5e-9)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(* t_0 (pow (pow (hypot x.re x.im) (* 0.5 y.re)) 2.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -7.9e-42) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0);
} else if (y_46_re <= 1.5e-9) {
tmp = sin((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 * pow(pow(hypot(x_46_re, x_46_im), (0.5 * y_46_re)), 2.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));
double tmp;
if (y_46_re <= -7.9e-42) {
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 <= 1.5e-9) {
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)));
} else {
tmp = t_0 * Math.pow(Math.pow(Math.hypot(x_46_re, x_46_im), (0.5 * y_46_re)), 2.0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -7.9e-42: tmp = -1.0 / ((math.pow(math.hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0) elif y_46_re <= 1.5e-9: 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))) else: tmp = t_0 * math.pow(math.pow(math.hypot(x_46_re, x_46_im), (0.5 * y_46_re)), 2.0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -7.9e-42) 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 <= 1.5e-9) 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)))); else tmp = Float64(t_0 * ((hypot(x_46_re, x_46_im) ^ Float64(0.5 * y_46_re)) ^ 2.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -7.9e-42) tmp = -1.0 / (((hypot(x_46_re, x_46_im) ^ -y_46_re) / t_0) / -1.0); elseif (y_46_re <= 1.5e-9) tmp = sin((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 * ((hypot(x_46_re, x_46_im) ^ (0.5 * y_46_re)) ^ 2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.9e-42], 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, 1.5e-9], 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], N[(t$95$0 * N[Power[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision], 2.0], $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 -7.9 \cdot 10^{-42}:\\
\;\;\;\;\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 1.5 \cdot 10^{-9}:\\
\;\;\;\;\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}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\right)}^{2}\\
\end{array}
\end{array}
if y.re < -7.89999999999999968e-42Initial program 49.4%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites64.4%
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.f6473.9
Applied rewrites73.9%
/-rgt-identityN/A
frac-2negN/A
neg-sub0N/A
metadata-evalN/A
div-subN/A
Applied rewrites77.3%
if -7.89999999999999968e-42 < y.re < 1.49999999999999999e-9Initial program 39.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6422.6
Applied rewrites22.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
if 1.49999999999999999e-9 < y.re Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.6
Applied rewrites60.6%
Applied rewrites60.6%
Applied rewrites60.6%
Final simplification65.5%
(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 -7.9e-42)
(/ -1.0 (/ (/ (pow (hypot x.re x.im) (- y.re)) t_0) -1.0))
(if (<= y.re 1.5e-9)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im x.re))))
(* t_0 (pow (hypot x.re x.im) 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 <= -7.9e-42) {
tmp = -1.0 / ((pow(hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0);
} else if (y_46_re <= 1.5e-9) {
tmp = sin((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 * pow(hypot(x_46_re, x_46_im), 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 <= -7.9e-42) {
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 <= 1.5e-9) {
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)));
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), 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 <= -7.9e-42: tmp = -1.0 / ((math.pow(math.hypot(x_46_re, x_46_im), -y_46_re) / t_0) / -1.0) elif y_46_re <= 1.5e-9: 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))) else: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), 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 <= -7.9e-42) 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 <= 1.5e-9) 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)))); else tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ 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 <= -7.9e-42) tmp = -1.0 / (((hypot(x_46_re, x_46_im) ^ -y_46_re) / t_0) / -1.0); elseif (y_46_re <= 1.5e-9) tmp = sin((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 * (hypot(x_46_re, x_46_im) ^ 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, -7.9e-42], 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, 1.5e-9], 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], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 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 -7.9 \cdot 10^{-42}:\\
\;\;\;\;\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 1.5 \cdot 10^{-9}:\\
\;\;\;\;\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}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -7.89999999999999968e-42Initial program 49.4%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites64.4%
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.f6473.9
Applied rewrites73.9%
/-rgt-identityN/A
frac-2negN/A
neg-sub0N/A
metadata-evalN/A
div-subN/A
Applied rewrites77.3%
if -7.89999999999999968e-42 < y.re < 1.49999999999999999e-9Initial program 39.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6422.6
Applied rewrites22.6%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
if 1.49999999999999999e-9 < y.re Initial program 41.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.6
Applied rewrites60.6%
Final simplification65.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (* t_0 (exp (* (- y.im) (atan2 x.im x.re))))))
(if (<= y.im -7e+138)
t_1
(if (<= y.im 5e-102)
(* t_0 (pow (hypot x.re x.im) y.re))
(if (<= y.im 3.8e-14)
(/
(sin (* (log (hypot x.im x.re)) y.im))
(fma (atan2 x.im x.re) y.im 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 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -7e+138) {
tmp = t_1;
} else if (y_46_im <= 5e-102) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 3.8e-14) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) / fma(atan2(x_46_im, x_46_re), y_46_im, 1.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(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -7e+138) tmp = t_1; elseif (y_46_im <= 5e-102) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 3.8e-14) tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) / fma(atan(x_46_im, x_46_re), y_46_im, 1.0)); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -7e+138], t$95$1, If[LessEqual[y$46$im, 5e-102], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.8e-14], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] / N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + 1.0), $MachinePrecision]), $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 := t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -7 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{-102}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 3.8 \cdot 10^{-14}:\\
\;\;\;\;\frac{\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -6.9999999999999996e138 or 3.8000000000000002e-14 < y.im Initial program 37.4%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6430.1
Applied rewrites30.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6462.0
Applied rewrites62.0%
if -6.9999999999999996e138 < y.im < 5.00000000000000026e-102Initial program 48.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.9
Applied rewrites64.9%
if 5.00000000000000026e-102 < y.im < 3.8000000000000002e-14Initial program 44.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites89.6%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-atan2.f6489.6
Applied rewrites89.6%
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
lower-/.f6489.7
Applied rewrites89.7%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.6
Applied rewrites65.6%
Final simplification63.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (* t_0 (exp (* (- y.im) (atan2 x.im x.re))))))
(if (<= y.im -2.25e+139)
t_1
(if (<= y.im 6.2e+65) (* t_0 (pow (hypot x.re x.im) y.re)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -2.25e+139) {
tmp = t_1;
} else if (y_46_im <= 6.2e+65) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -2.25e+139) {
tmp = t_1;
} else if (y_46_im <= 6.2e+65) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_1 = t_0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -2.25e+139: tmp = t_1 elif y_46_im <= 6.2e+65: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64(t_0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -2.25e+139) tmp = t_1; elseif (y_46_im <= 6.2e+65) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); t_1 = t_0 * exp((-y_46_im * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -2.25e+139) tmp = t_1; elseif (y_46_im <= 6.2e+65) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.25e+139], t$95$1, If[LessEqual[y$46$im, 6.2e+65], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $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 := t\_0 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -2.25 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{+65}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -2.25e139 or 6.19999999999999981e65 < y.im Initial program 37.4%
Taylor expanded in y.im around inf
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6432.0
Applied rewrites32.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6466.1
Applied rewrites66.1%
if -2.25e139 < y.im < 6.19999999999999981e65Initial program 46.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.1
Applied rewrites58.1%
Final simplification61.0%
(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.im -3.3e+216)
(/ 1.0 (pow (* t_0 t_0) -0.5))
(if (<= y.im 8e+101)
(* t_1 (pow (hypot x.re x.im) y.re))
(*
(pow (* (+ (/ (* 0.5 (* x.im x.im)) (* x.re x.re)) 1.0) x.re) y.re)
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (y_46_im <= -3.3e+216) {
tmp = 1.0 / pow((t_0 * t_0), -0.5);
} else if (y_46_im <= 8e+101) {
tmp = t_1 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = pow(((((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re)) + 1.0) * x_46_re), y_46_re) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double tmp;
if (y_46_im <= -3.3e+216) {
tmp = 1.0 / Math.pow((t_0 * t_0), -0.5);
} else if (y_46_im <= 8e+101) {
tmp = t_1 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.pow(((((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re)) + 1.0) * x_46_re), y_46_re) * 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.sin(t_0) tmp = 0 if y_46_im <= -3.3e+216: tmp = 1.0 / math.pow((t_0 * t_0), -0.5) elif y_46_im <= 8e+101: tmp = t_1 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.pow(((((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re)) + 1.0) * x_46_re), y_46_re) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) tmp = 0.0 if (y_46_im <= -3.3e+216) tmp = Float64(1.0 / (Float64(t_0 * t_0) ^ -0.5)); elseif (y_46_im <= 8e+101) tmp = Float64(t_1 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64((Float64(Float64(Float64(Float64(0.5 * Float64(x_46_im * x_46_im)) / Float64(x_46_re * x_46_re)) + 1.0) * x_46_re) ^ y_46_re) * 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 = sin(t_0); tmp = 0.0; if (y_46_im <= -3.3e+216) tmp = 1.0 / ((t_0 * t_0) ^ -0.5); elseif (y_46_im <= 8e+101) tmp = t_1 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = (((((0.5 * (x_46_im * x_46_im)) / (x_46_re * x_46_re)) + 1.0) * x_46_re) ^ y_46_re) * 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[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$im, -3.3e+216], N[(1.0 / N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8e+101], N[(t$95$1 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(N[(0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.im \leq -3.3 \cdot 10^{+216}:\\
\;\;\;\;\frac{1}{{\left(t\_0 \cdot t\_0\right)}^{-0.5}}\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{+101}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(\frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re} + 1\right) \cdot x.re\right)}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if y.im < -3.3e216Initial program 37.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites37.6%
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.f6410.4
Applied rewrites10.4%
Taylor expanded in y.re around 0
Applied rewrites7.3%
Applied rewrites30.5%
if -3.3e216 < y.im < 7.9999999999999998e101Initial program 43.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.1
Applied rewrites57.1%
if 7.9999999999999998e101 < y.im Initial program 45.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6429.0
Applied rewrites29.0%
Taylor expanded in x.re around inf
Applied rewrites43.6%
Final simplification52.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.im -6.5e+229)
(/ 1.0 (pow (* t_0 t_0) -0.5))
(if (<= y.im -1.12e+105)
(* (pow (+ (* (/ (* x.re x.re) x.im) 0.5) x.im) y.re) t_1)
(if (<= y.im 3.7e-23)
(* t_0 (pow (hypot x.re x.im) y.re))
(* (pow (+ (* (/ (* x.im x.im) x.re) 0.5) x.re) y.re) t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (y_46_im <= -6.5e+229) {
tmp = 1.0 / pow((t_0 * t_0), -0.5);
} else if (y_46_im <= -1.12e+105) {
tmp = pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) * t_1;
} else if (y_46_im <= 3.7e-23) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = pow(((((x_46_im * x_46_im) / x_46_re) * 0.5) + x_46_re), y_46_re) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double tmp;
if (y_46_im <= -6.5e+229) {
tmp = 1.0 / Math.pow((t_0 * t_0), -0.5);
} else if (y_46_im <= -1.12e+105) {
tmp = Math.pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) * t_1;
} else if (y_46_im <= 3.7e-23) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.pow(((((x_46_im * x_46_im) / x_46_re) * 0.5) + x_46_re), y_46_re) * 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.sin(t_0) tmp = 0 if y_46_im <= -6.5e+229: tmp = 1.0 / math.pow((t_0 * t_0), -0.5) elif y_46_im <= -1.12e+105: tmp = math.pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) * t_1 elif y_46_im <= 3.7e-23: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.pow(((((x_46_im * x_46_im) / x_46_re) * 0.5) + x_46_re), y_46_re) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) tmp = 0.0 if (y_46_im <= -6.5e+229) tmp = Float64(1.0 / (Float64(t_0 * t_0) ^ -0.5)); elseif (y_46_im <= -1.12e+105) tmp = Float64((Float64(Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re) * t_1); elseif (y_46_im <= 3.7e-23) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64((Float64(Float64(Float64(Float64(x_46_im * x_46_im) / x_46_re) * 0.5) + x_46_re) ^ y_46_re) * 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 = sin(t_0); tmp = 0.0; if (y_46_im <= -6.5e+229) tmp = 1.0 / ((t_0 * t_0) ^ -0.5); elseif (y_46_im <= -1.12e+105) tmp = (((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re) * t_1; elseif (y_46_im <= 3.7e-23) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = (((((x_46_im * x_46_im) / x_46_re) * 0.5) + x_46_re) ^ y_46_re) * 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[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$im, -6.5e+229], N[(1.0 / N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.12e+105], N[(N[Power[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 3.7e-23], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+229}:\\
\;\;\;\;\frac{1}{{\left(t\_0 \cdot t\_0\right)}^{-0.5}}\\
\mathbf{elif}\;y.im \leq -1.12 \cdot 10^{+105}:\\
\;\;\;\;{\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5 + x.im\right)}^{y.re} \cdot t\_1\\
\mathbf{elif}\;y.im \leq 3.7 \cdot 10^{-23}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x.im \cdot x.im}{x.re} \cdot 0.5 + x.re\right)}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if y.im < -6.4999999999999997e229Initial program 36.4%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites41.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.f6411.2
Applied rewrites11.2%
Taylor expanded in y.re around 0
Applied rewrites7.8%
Applied rewrites33.0%
if -6.4999999999999997e229 < y.im < -1.12e105Initial program 36.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.8
Applied rewrites58.8%
Taylor expanded in x.re around 0
Applied rewrites61.0%
if -1.12e105 < y.im < 3.7000000000000003e-23Initial program 47.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.7
Applied rewrites58.7%
Taylor expanded in y.re around 0
Applied rewrites59.7%
if 3.7000000000000003e-23 < y.im Initial program 40.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6432.9
Applied rewrites32.9%
Taylor expanded in x.im around 0
Applied rewrites40.8%
Final simplification52.6%
(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.re x.re) x.im) 0.5) x.im) y.re) (sin t_0))))
(if (<= y.im -6.5e+229)
(/ 1.0 (pow (* t_0 t_0) -0.5))
(if (<= y.im -1.12e+105)
t_1
(if (<= y.im 7.8e-34) (* t_0 (pow (hypot x.re x.im) y.re)) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) * sin(t_0);
double tmp;
if (y_46_im <= -6.5e+229) {
tmp = 1.0 / pow((t_0 * t_0), -0.5);
} else if (y_46_im <= -1.12e+105) {
tmp = t_1;
} else if (y_46_im <= 7.8e-34) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) * Math.sin(t_0);
double tmp;
if (y_46_im <= -6.5e+229) {
tmp = 1.0 / Math.pow((t_0 * t_0), -0.5);
} else if (y_46_im <= -1.12e+105) {
tmp = t_1;
} else if (y_46_im <= 7.8e-34) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.pow(((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im), y_46_re) * math.sin(t_0) tmp = 0 if y_46_im <= -6.5e+229: tmp = 1.0 / math.pow((t_0 * t_0), -0.5) elif y_46_im <= -1.12e+105: tmp = t_1 elif y_46_im <= 7.8e-34: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((Float64(Float64(Float64(Float64(x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re) * sin(t_0)) tmp = 0.0 if (y_46_im <= -6.5e+229) tmp = Float64(1.0 / (Float64(t_0 * t_0) ^ -0.5)); elseif (y_46_im <= -1.12e+105) tmp = t_1; elseif (y_46_im <= 7.8e-34) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = (((((x_46_re * x_46_re) / x_46_im) * 0.5) + x_46_im) ^ y_46_re) * sin(t_0); tmp = 0.0; if (y_46_im <= -6.5e+229) tmp = 1.0 / ((t_0 * t_0) ^ -0.5); elseif (y_46_im <= -1.12e+105) tmp = t_1; elseif (y_46_im <= 7.8e-34) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.5e+229], N[(1.0 / N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.12e+105], t$95$1, If[LessEqual[y$46$im, 7.8e-34], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {\left(\frac{x.re \cdot x.re}{x.im} \cdot 0.5 + x.im\right)}^{y.re} \cdot \sin t\_0\\
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+229}:\\
\;\;\;\;\frac{1}{{\left(t\_0 \cdot t\_0\right)}^{-0.5}}\\
\mathbf{elif}\;y.im \leq -1.12 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 7.8 \cdot 10^{-34}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -6.4999999999999997e229Initial program 36.4%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites41.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.f6411.2
Applied rewrites11.2%
Taylor expanded in y.re around 0
Applied rewrites7.8%
Applied rewrites33.0%
if -6.4999999999999997e229 < y.im < -1.12e105 or 7.79999999999999982e-34 < y.im Initial program 40.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.4
Applied rewrites40.4%
Taylor expanded in x.re around 0
Applied rewrites42.6%
if -1.12e105 < y.im < 7.79999999999999982e-34Initial program 46.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.2
Applied rewrites59.2%
Taylor expanded in y.re around 0
Applied rewrites60.2%
Final simplification51.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* t_0 (pow (hypot x.re x.im) y.re))))
(if (<= y.re -5.8e-168)
t_1
(if (<= y.re 1.95e-259)
(/ 1.0 (pow (* t_0 t_0) -0.5))
(if (<= y.re 7.8e+123) t_1 (* (pow x.im y.re) (sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -5.8e-168) {
tmp = t_1;
} else if (y_46_re <= 1.95e-259) {
tmp = 1.0 / pow((t_0 * t_0), -0.5);
} else if (y_46_re <= 7.8e+123) {
tmp = t_1;
} else {
tmp = pow(x_46_im, y_46_re) * sin(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;
double t_1 = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -5.8e-168) {
tmp = t_1;
} else if (y_46_re <= 1.95e-259) {
tmp = 1.0 / Math.pow((t_0 * t_0), -0.5);
} else if (y_46_re <= 7.8e+123) {
tmp = t_1;
} else {
tmp = Math.pow(x_46_im, y_46_re) * Math.sin(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 t_1 = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -5.8e-168: tmp = t_1 elif y_46_re <= 1.95e-259: tmp = 1.0 / math.pow((t_0 * t_0), -0.5) elif y_46_re <= 7.8e+123: tmp = t_1 else: tmp = math.pow(x_46_im, y_46_re) * math.sin(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -5.8e-168) tmp = t_1; elseif (y_46_re <= 1.95e-259) tmp = Float64(1.0 / (Float64(t_0 * t_0) ^ -0.5)); elseif (y_46_re <= 7.8e+123) tmp = t_1; else tmp = Float64((x_46_im ^ y_46_re) * sin(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; t_1 = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -5.8e-168) tmp = t_1; elseif (y_46_re <= 1.95e-259) tmp = 1.0 / ((t_0 * t_0) ^ -0.5); elseif (y_46_re <= 7.8e+123) tmp = t_1; else tmp = (x_46_im ^ y_46_re) * sin(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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.8e-168], t$95$1, If[LessEqual[y$46$re, 1.95e-259], N[(1.0 / N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.8e+123], t$95$1, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5.8 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-259}:\\
\;\;\;\;\frac{1}{{\left(t\_0 \cdot t\_0\right)}^{-0.5}}\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < -5.7999999999999997e-168 or 1.95000000000000008e-259 < y.re < 7.79999999999999986e123Initial program 46.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.0
Applied rewrites54.0%
Taylor expanded in y.re around 0
Applied rewrites52.6%
if -5.7999999999999997e-168 < y.re < 1.95000000000000008e-259Initial program 36.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites72.6%
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.f649.5
Applied rewrites9.5%
Taylor expanded in y.re around 0
Applied rewrites9.5%
Applied rewrites33.0%
if 7.79999999999999986e123 < y.re Initial program 35.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.0
Applied rewrites55.0%
Taylor expanded in x.re around 0
Applied rewrites58.6%
Final simplification50.6%
(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 -6.5e-7) t_1 (if (<= y.re 1.02e-10) 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 <= -6.5e-7) {
tmp = t_1;
} else if (y_46_re <= 1.02e-10) {
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 <= (-6.5d-7)) then
tmp = t_1
else if (y_46re <= 1.02d-10) 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 <= -6.5e-7) {
tmp = t_1;
} else if (y_46_re <= 1.02e-10) {
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 <= -6.5e-7: tmp = t_1 elif y_46_re <= 1.02e-10: 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 <= -6.5e-7) tmp = t_1; elseif (y_46_re <= 1.02e-10) 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 <= -6.5e-7) tmp = t_1; elseif (y_46_re <= 1.02e-10) 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, -6.5e-7], t$95$1, If[LessEqual[y$46$re, 1.02e-10], 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 -6.5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -6.50000000000000024e-7 or 1.01999999999999997e-10 < y.re Initial program 46.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.7
Applied rewrites69.7%
Taylor expanded in x.re around 0
Applied rewrites51.6%
if -6.50000000000000024e-7 < y.re < 1.01999999999999997e-10Initial program 40.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6425.0
Applied rewrites25.0%
Taylor expanded in y.re around 0
Applied rewrites24.6%
Final simplification38.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re 7.8e+123)
(* t_0 (pow (hypot x.re x.im) y.re))
(* (pow x.im y.re) (sin t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= 7.8e+123) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = pow(x_46_im, y_46_re) * sin(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;
double tmp;
if (y_46_re <= 7.8e+123) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re) * Math.sin(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 tmp = 0 if y_46_re <= 7.8e+123: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.pow(x_46_im, y_46_re) * math.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) tmp = 0.0 if (y_46_re <= 7.8e+123) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64((x_46_im ^ y_46_re) * sin(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; tmp = 0.0; if (y_46_re <= 7.8e+123) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); else tmp = (x_46_im ^ y_46_re) * sin(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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, 7.8e+123], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq 7.8 \cdot 10^{+123}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin t\_0\\
\end{array}
\end{array}
if y.re < 7.79999999999999986e123Initial program 44.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6446.9
Applied rewrites46.9%
Taylor expanded in y.re around 0
Applied rewrites45.7%
if 7.79999999999999986e123 < y.re Initial program 35.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.0
Applied rewrites55.0%
Taylor expanded in x.re around 0
Applied rewrites58.6%
Final simplification47.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))) (if (<= x.re 7.5e-160) (* (pow x.im y.re) t_0) (* (pow x.re y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 7.5e-160) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= 7.5d-160) then
tmp = (x_46im ** y_46re) * t_0
else
tmp = (x_46re ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= 7.5e-160) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_re <= 7.5e-160: tmp = math.pow(x_46_im, y_46_re) * t_0 else: tmp = math.pow(x_46_re, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_re <= 7.5e-160) tmp = Float64((x_46_im ^ y_46_re) * t_0); else tmp = Float64((x_46_re ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_re <= 7.5e-160) tmp = (x_46_im ^ y_46_re) * t_0; else tmp = (x_46_re ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 7.5e-160], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.re \leq 7.5 \cdot 10^{-160}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < 7.50000000000000023e-160Initial program 42.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.8
Applied rewrites47.8%
Taylor expanded in x.re around 0
Applied rewrites33.9%
if 7.50000000000000023e-160 < x.re Initial program 44.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.0
Applied rewrites48.0%
Taylor expanded in x.im around 0
Applied rewrites44.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 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.9
Applied rewrites47.9%
Taylor expanded in y.re around 0
Applied rewrites15.5%
(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 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.9
Applied rewrites47.9%
Taylor expanded in y.re around 0
Applied rewrites15.4%
Final simplification15.4%
herbie shell --seed 2024255
(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)))))