
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))))
(if (or (<= y.im -2.15e+247) (not (<= y.im -5.4e+36)))
(* t_1 (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
t_1
(sin
(fabs
(fma (atan2 x.im x.re) y.re (* y.im (log (hypot x.im x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((y_46_im <= -2.15e+247) || !(y_46_im <= -5.4e+36)) {
tmp = t_1 * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * sin(fabs(fma(atan2(x_46_im, x_46_re), y_46_re, (y_46_im * log(hypot(x_46_im, x_46_re))))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if ((y_46_im <= -2.15e+247) || !(y_46_im <= -5.4e+36)) tmp = Float64(t_1 * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * sin(abs(fma(atan(x_46_im, x_46_re), y_46_re, Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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]}, If[Or[LessEqual[y$46$im, -2.15e+247], N[Not[LessEqual[y$46$im, -5.4e+36]], $MachinePrecision]], N[(t$95$1 * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Abs[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -2.15 \cdot 10^{+247} \lor \neg \left(y.im \leq -5.4 \cdot 10^{+36}\right):\\
\;\;\;\;t_1 \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(\left|\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\right)\\
\end{array}
\end{array}
if y.im < -2.1499999999999999e247 or -5.4000000000000002e36 < y.im Initial program 46.2%
Simplified87.4%
if -2.1499999999999999e247 < y.im < -5.4000000000000002e36Initial program 21.8%
Simplified48.6%
fma-udef48.6%
hypot-udef21.8%
*-commutative21.8%
add-sqr-sqrt11.1%
sqrt-unprod25.1%
pow225.1%
fma-def25.1%
hypot-udef46.6%
Applied egg-rr46.6%
unpow246.6%
rem-sqrt-square80.0%
fma-def80.0%
+-commutative80.0%
fma-def80.0%
hypot-def35.1%
unpow235.1%
unpow235.1%
+-commutative35.1%
*-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def80.0%
Simplified80.0%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (cbrt (fma t_0 y.im (* y.re (atan2 x.im x.re))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (* t_1 (pow t_1 2.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = cbrt(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((t_1 * pow(t_1, 2.0)));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = cbrt(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(t_1 * (t_1 ^ 2.0)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $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[(t$95$1 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sqrt[3]{\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_1 \cdot {t_1}^{2}\right)
\end{array}
\end{array}
Initial program 43.3%
Simplified82.9%
fma-udef82.9%
hypot-udef43.3%
*-commutative43.3%
add-cube-cbrt42.8%
Applied egg-rr84.4%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (pow (cbrt (fma t_0 y.im (* y.re (atan2 x.im x.re)))) 3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(pow(cbrt(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))), 3.0));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, 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((cbrt(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) ^ 3.0))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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[Power[N[Power[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right)
\end{array}
\end{array}
Initial program 43.3%
Simplified82.9%
fma-udef82.9%
hypot-udef43.3%
*-commutative43.3%
add-cube-cbrt42.8%
pow342.8%
hypot-udef84.0%
*-commutative84.0%
fma-udef84.0%
*-commutative84.0%
Applied egg-rr84.0%
Final simplification84.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (fma t_0 y.im (* y.re (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_re, x_46_im));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, 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(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 43.3%
Simplified82.9%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1
(*
(exp (- (* (log (hypot x.re x.im)) y.re) t_0))
(sin (* y.re (atan2 x.im x.re)))))
(t_2 (sin (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -6.2e-99)
t_1
(if (<= y.re 3.7e-98)
(/ t_2 (pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.re 2.6e+59)
t_1
(*
t_2
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.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_im;
double t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -6.2e-99) {
tmp = t_1;
} else if (y_46_re <= 3.7e-98) {
tmp = t_2 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else if (y_46_re <= 2.6e+59) {
tmp = t_1;
} else {
tmp = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - 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_im;
double t_1 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -6.2e-99) {
tmp = t_1;
} else if (y_46_re <= 3.7e-98) {
tmp = t_2 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else if (y_46_re <= 2.6e+59) {
tmp = t_1;
} else {
tmp = t_2 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - 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_im t_1 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -6.2e-99: tmp = t_1 elif y_46_re <= 3.7e-98: tmp = t_2 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) elif y_46_re <= 2.6e+59: tmp = t_1 else: tmp = t_2 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_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_im) t_1 = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) t_2 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -6.2e-99) tmp = t_1; elseif (y_46_re <= 3.7e-98) tmp = Float64(t_2 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); elseif (y_46_re <= 2.6e+59) tmp = t_1; else tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - 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_im; t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -6.2e-99) tmp = t_1; elseif (y_46_re <= 3.7e-98) tmp = t_2 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); elseif (y_46_re <= 2.6e+59) tmp = t_1; else tmp = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - 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$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6.2e-99], t$95$1, If[LessEqual[y$46$re, 3.7e-98], N[(t$95$2 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.6e+59], t$95$1, N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{-98}:\\
\;\;\;\;\frac{t_2}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
\end{array}
\end{array}
if y.re < -6.1999999999999997e-99 or 3.7e-98 < y.re < 2.59999999999999999e59Initial program 47.0%
Simplified84.2%
Taylor expanded in y.im around 0 82.3%
if -6.1999999999999997e-99 < y.re < 3.7e-98Initial program 34.6%
exp-diff34.6%
+-rgt-identity34.6%
+-rgt-identity34.6%
exp-to-pow34.6%
hypot-def34.6%
*-commutative34.6%
exp-prod34.1%
fma-def34.1%
hypot-def84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in y.re around 0 28.2%
unpow228.2%
unpow228.2%
hypot-def72.2%
*-commutative72.2%
exp-prod71.4%
Simplified71.4%
if 2.59999999999999999e59 < y.re Initial program 51.9%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-def74.2%
Simplified74.2%
Final simplification76.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= x.re -1e-308)
(*
(exp (- (* (log (hypot x.re x.im)) y.re) t_0))
(sin (- t_1 (* y.im (log (/ -1.0 x.re))))))
(/ (sin (+ t_1 (* y.im (log x.re)))) (exp (- t_0 (* y.re (log x.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_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1e-308) {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((t_1 - (y_46_im * log((-1.0 / x_46_re)))));
} else {
tmp = sin((t_1 + (y_46_im * log(x_46_re)))) / exp((t_0 - (y_46_re * log(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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1e-308) {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * Math.sin((t_1 - (y_46_im * Math.log((-1.0 / x_46_re)))));
} else {
tmp = Math.sin((t_1 + (y_46_im * Math.log(x_46_re)))) / Math.exp((t_0 - (y_46_re * Math.log(x_46_re))));
}
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_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -1e-308: tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * math.sin((t_1 - (y_46_im * math.log((-1.0 / x_46_re))))) else: tmp = math.sin((t_1 + (y_46_im * math.log(x_46_re)))) / math.exp((t_0 - (y_46_re * math.log(x_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_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -1e-308) tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin(Float64(t_1 - Float64(y_46_im * log(Float64(-1.0 / x_46_re)))))); else tmp = Float64(sin(Float64(t_1 + Float64(y_46_im * log(x_46_re)))) / exp(Float64(t_0 - Float64(y_46_re * log(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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -1e-308) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - t_0)) * sin((t_1 - (y_46_im * log((-1.0 / x_46_re))))); else tmp = sin((t_1 + (y_46_im * log(x_46_re)))) / exp((t_0 - (y_46_re * log(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1e-308], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(t$95$0 - N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{-308}:\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \sin \left(t_1 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(t_1 + y.im \cdot \log x.re\right)}{e^{t_0 - y.re \cdot \log x.re}}\\
\end{array}
\end{array}
if x.re < -9.9999999999999991e-309Initial program 48.7%
Simplified86.8%
Taylor expanded in x.re around -inf 76.7%
+-commutative76.7%
mul-1-neg76.7%
*-commutative76.7%
unsub-neg76.7%
*-commutative76.7%
Simplified76.7%
if -9.9999999999999991e-309 < x.re Initial program 39.0%
exp-diff38.3%
+-rgt-identity38.3%
+-rgt-identity38.3%
exp-to-pow38.3%
hypot-def38.3%
*-commutative38.3%
exp-prod35.6%
fma-def35.6%
hypot-def71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in x.re around inf 66.9%
associate-/l*66.9%
+-commutative66.9%
mul-1-neg66.9%
unsub-neg66.9%
*-commutative66.9%
log-rec66.9%
*-commutative66.9%
*-commutative66.9%
div-exp71.1%
*-commutative71.1%
Simplified71.1%
Final simplification73.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -6.8e-96) (not (<= y.re 1.08e-95)))
(*
(exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -6.8e-96) || !(y_46_re <= 1.08e-95)) {
tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(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 <= -6.8e-96) || !(y_46_re <= 1.08e-95)) {
tmp = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(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 <= -6.8e-96) or not (y_46_re <= 1.08e-95): tmp = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(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 <= -6.8e-96) || !(y_46_re <= 1.08e-95)) tmp = Float64(exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(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 <= -6.8e-96) || ~((y_46_re <= 1.08e-95))) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (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, -6.8e-96], N[Not[LessEqual[y$46$re, 1.08e-95]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6.8 \cdot 10^{-96} \lor \neg \left(y.re \leq 1.08 \cdot 10^{-95}\right):\\
\;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -6.8000000000000002e-96 or 1.08e-95 < y.re Initial program 48.7%
Simplified81.4%
Taylor expanded in y.im around 0 77.0%
if -6.8000000000000002e-96 < y.re < 1.08e-95Initial program 34.6%
exp-diff34.6%
+-rgt-identity34.6%
+-rgt-identity34.6%
exp-to-pow34.6%
hypot-def34.6%
*-commutative34.6%
exp-prod34.1%
fma-def34.1%
hypot-def84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in y.re around 0 28.2%
unpow228.2%
unpow228.2%
hypot-def72.2%
*-commutative72.2%
exp-prod71.4%
Simplified71.4%
Final simplification74.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (or (<= y.im -1700000.0) (not (<= y.im 1.8e-75)))
(* t_1 (log (exp t_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((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if ((y_46_im <= -1700000.0) || !(y_46_im <= 1.8e-75)) {
tmp = t_1 * log(exp(t_0));
} else {
tmp = t_0 * 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((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if ((y_46_im <= -1700000.0) || !(y_46_im <= 1.8e-75)) {
tmp = t_1 * Math.log(Math.exp(t_0));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if (y_46_im <= -1700000.0) or not (y_46_im <= 1.8e-75): tmp = t_1 * math.log(math.exp(t_0)) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if ((y_46_im <= -1700000.0) || !(y_46_im <= 1.8e-75)) tmp = Float64(t_1 * log(exp(t_0))); else tmp = Float64(t_0 * 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((y_46_re * atan2(x_46_im, x_46_re))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if ((y_46_im <= -1700000.0) || ~((y_46_im <= 1.8e-75))) tmp = t_1 * log(exp(t_0)); else tmp = t_0 * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1700000.0], N[Not[LessEqual[y$46$im, 1.8e-75]], $MachinePrecision]], N[(t$95$1 * N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1700000 \lor \neg \left(y.im \leq 1.8 \cdot 10^{-75}\right):\\
\;\;\;\;t_1 \cdot \log \left(e^{t_0}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot t_1\\
\end{array}
\end{array}
if y.im < -1.7e6 or 1.8e-75 < y.im Initial program 36.9%
exp-diff33.0%
+-rgt-identity33.0%
+-rgt-identity33.0%
exp-to-pow33.0%
hypot-def33.0%
*-commutative33.0%
exp-prod30.1%
fma-def30.1%
hypot-def58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in y.im around 0 40.4%
*-commutative40.4%
unpow240.4%
unpow240.4%
hypot-def34.3%
Simplified34.3%
add-log-exp42.0%
*-commutative42.0%
Applied egg-rr53.9%
if -1.7e6 < y.im < 1.8e-75Initial program 50.0%
exp-diff50.0%
+-rgt-identity50.0%
+-rgt-identity50.0%
exp-to-pow50.0%
hypot-def50.0%
*-commutative50.0%
exp-prod50.0%
fma-def50.0%
hypot-def91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y.im around 0 50.8%
*-commutative50.8%
unpow250.8%
unpow250.8%
hypot-def59.1%
Simplified59.1%
Final simplification56.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.re -4.4e-42)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 9e-32)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(* t_0 (pow (sqrt (+ (* x.re x.re) (* x.im 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((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -4.4e-42) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 9e-32) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * 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((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -4.4e-42) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 9e-32) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * 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((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -4.4e-42: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 9e-32: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * 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(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -4.4e-42) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 9e-32) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = Float64(t_0 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * 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((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -4.4e-42) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 9e-32) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0 * (sqrt(((x_46_re * x_46_re) + (x_46_im * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.4e-42], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9e-32], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -4.4 \cdot 10^{-42}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{-32}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.4000000000000001e-42Initial program 36.2%
exp-diff32.8%
+-rgt-identity32.8%
+-rgt-identity32.8%
exp-to-pow32.8%
hypot-def32.8%
*-commutative32.8%
exp-prod32.3%
fma-def32.3%
hypot-def71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in y.im around 0 75.0%
*-commutative75.0%
unpow275.0%
unpow275.0%
hypot-def76.6%
Simplified76.6%
if -4.4000000000000001e-42 < y.re < 9.00000000000000009e-32Initial program 39.8%
exp-diff39.8%
+-rgt-identity39.8%
+-rgt-identity39.8%
exp-to-pow39.8%
hypot-def39.8%
*-commutative39.8%
exp-prod39.4%
fma-def39.4%
hypot-def85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.re around 0 29.6%
unpow229.6%
unpow229.6%
hypot-def68.8%
*-commutative68.8%
exp-prod68.0%
Simplified68.0%
if 9.00000000000000009e-32 < y.re Initial program 53.8%
exp-diff50.0%
+-rgt-identity50.0%
+-rgt-identity50.0%
exp-to-pow50.0%
hypot-def50.0%
*-commutative50.0%
exp-prod46.3%
fma-def46.3%
hypot-def61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y.im around 0 63.9%
*-commutative63.9%
+-commutative63.9%
unpow263.9%
unpow263.9%
Simplified63.9%
Final simplification68.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -2400000.0) (not (<= y.im 2.6e-12)))
(log (pow (exp t_0) (pow x.re y.re)))
(* t_0 (pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2400000.0) || !(y_46_im <= 2.6e-12)) {
tmp = log(pow(exp(t_0), pow(x_46_re, y_46_re)));
} else {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2400000.0) || !(y_46_im <= 2.6e-12)) {
tmp = Math.log(Math.pow(Math.exp(t_0), Math.pow(x_46_re, y_46_re)));
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -2400000.0) or not (y_46_im <= 2.6e-12): tmp = math.log(math.pow(math.exp(t_0), math.pow(x_46_re, y_46_re))) else: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -2400000.0) || !(y_46_im <= 2.6e-12)) tmp = log((exp(t_0) ^ (x_46_re ^ y_46_re))); else tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_im <= -2400000.0) || ~((y_46_im <= 2.6e-12))) tmp = log((exp(t_0) ^ (x_46_re ^ y_46_re))); else tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2400000.0], N[Not[LessEqual[y$46$im, 2.6e-12]], $MachinePrecision]], N[Log[N[Power[N[Exp[t$95$0], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -2400000 \lor \neg \left(y.im \leq 2.6 \cdot 10^{-12}\right):\\
\;\;\;\;\log \left({\left(e^{t_0}\right)}^{\left({x.re}^{y.re}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.4e6 or 2.59999999999999983e-12 < y.im Initial program 37.2%
exp-diff33.0%
+-rgt-identity33.0%
+-rgt-identity33.0%
exp-to-pow33.0%
hypot-def33.0%
*-commutative33.0%
exp-prod29.9%
fma-def29.9%
hypot-def55.7%
*-commutative55.7%
Simplified55.7%
Taylor expanded in y.im around 0 38.4%
*-commutative38.4%
unpow238.4%
unpow238.4%
hypot-def31.8%
Simplified31.8%
Taylor expanded in x.im around 0 27.7%
add-log-exp35.5%
*-commutative35.5%
exp-prod49.7%
Applied egg-rr49.7%
if -2.4e6 < y.im < 2.59999999999999983e-12Initial program 48.8%
exp-diff48.8%
+-rgt-identity48.8%
+-rgt-identity48.8%
exp-to-pow48.8%
hypot-def48.8%
*-commutative48.8%
exp-prod48.8%
fma-def48.8%
hypot-def91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in y.im around 0 51.9%
*-commutative51.9%
unpow251.9%
unpow251.9%
hypot-def59.7%
Simplified59.7%
Final simplification54.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re))
(t_2
(*
t_1
(*
-0.16666666666666666
(* (pow y.re 3.0) (pow (atan2 x.im x.re) 3.0)))))
(t_3 (log (exp t_0))))
(if (<= y.im -1.12e+146)
t_2
(if (<= y.im -4.25e+46)
(* t_3 (pow x.re y.re))
(if (<= y.im -1.05e+29)
t_2
(if (<= y.im 3.1e-12) (* t_0 t_1) (* t_3 (pow 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((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_2 = t_1 * (-0.16666666666666666 * (pow(y_46_re, 3.0) * pow(atan2(x_46_im, x_46_re), 3.0)));
double t_3 = log(exp(t_0));
double tmp;
if (y_46_im <= -1.12e+146) {
tmp = t_2;
} else if (y_46_im <= -4.25e+46) {
tmp = t_3 * pow(x_46_re, y_46_re);
} else if (y_46_im <= -1.05e+29) {
tmp = t_2;
} else if (y_46_im <= 3.1e-12) {
tmp = t_0 * t_1;
} else {
tmp = t_3 * pow(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((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_2 = t_1 * (-0.16666666666666666 * (Math.pow(y_46_re, 3.0) * Math.pow(Math.atan2(x_46_im, x_46_re), 3.0)));
double t_3 = Math.log(Math.exp(t_0));
double tmp;
if (y_46_im <= -1.12e+146) {
tmp = t_2;
} else if (y_46_im <= -4.25e+46) {
tmp = t_3 * Math.pow(x_46_re, y_46_re);
} else if (y_46_im <= -1.05e+29) {
tmp = t_2;
} else if (y_46_im <= 3.1e-12) {
tmp = t_0 * t_1;
} else {
tmp = t_3 * Math.pow(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((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_2 = t_1 * (-0.16666666666666666 * (math.pow(y_46_re, 3.0) * math.pow(math.atan2(x_46_im, x_46_re), 3.0))) t_3 = math.log(math.exp(t_0)) tmp = 0 if y_46_im <= -1.12e+146: tmp = t_2 elif y_46_im <= -4.25e+46: tmp = t_3 * math.pow(x_46_re, y_46_re) elif y_46_im <= -1.05e+29: tmp = t_2 elif y_46_im <= 3.1e-12: tmp = t_0 * t_1 else: tmp = t_3 * math.pow(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(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re t_2 = Float64(t_1 * Float64(-0.16666666666666666 * Float64((y_46_re ^ 3.0) * (atan(x_46_im, x_46_re) ^ 3.0)))) t_3 = log(exp(t_0)) tmp = 0.0 if (y_46_im <= -1.12e+146) tmp = t_2; elseif (y_46_im <= -4.25e+46) tmp = Float64(t_3 * (x_46_re ^ y_46_re)); elseif (y_46_im <= -1.05e+29) tmp = t_2; elseif (y_46_im <= 3.1e-12) tmp = Float64(t_0 * t_1); else tmp = Float64(t_3 * (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((y_46_re * atan2(x_46_im, x_46_re))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; t_2 = t_1 * (-0.16666666666666666 * ((y_46_re ^ 3.0) * (atan2(x_46_im, x_46_re) ^ 3.0))); t_3 = log(exp(t_0)); tmp = 0.0; if (y_46_im <= -1.12e+146) tmp = t_2; elseif (y_46_im <= -4.25e+46) tmp = t_3 * (x_46_re ^ y_46_re); elseif (y_46_im <= -1.05e+29) tmp = t_2; elseif (y_46_im <= 3.1e-12) tmp = t_0 * t_1; else tmp = t_3 * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(-0.16666666666666666 * N[(N[Power[y$46$re, 3.0], $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.12e+146], t$95$2, If[LessEqual[y$46$im, -4.25e+46], N[(t$95$3 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.05e+29], t$95$2, If[LessEqual[y$46$im, 3.1e-12], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$3 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_2 := t_1 \cdot \left(-0.16666666666666666 \cdot \left({y.re}^{3} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}\right)\right)\\
t_3 := \log \left(e^{t_0}\right)\\
\mathbf{if}\;y.im \leq -1.12 \cdot 10^{+146}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq -4.25 \cdot 10^{+46}:\\
\;\;\;\;t_3 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.im \leq -1.05 \cdot 10^{+29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{-12}:\\
\;\;\;\;t_0 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.1199999999999999e146 or -4.2499999999999998e46 < y.im < -1.0500000000000001e29Initial program 25.7%
exp-diff25.7%
+-rgt-identity25.7%
+-rgt-identity25.7%
exp-to-pow25.7%
hypot-def25.7%
*-commutative25.7%
exp-prod25.2%
fma-def25.2%
hypot-def59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in y.im around 0 32.5%
*-commutative32.5%
unpow232.5%
unpow232.5%
hypot-def23.9%
Simplified23.9%
Taylor expanded in y.re around 0 27.0%
fma-def27.0%
cube-prod30.2%
Simplified30.2%
Taylor expanded in y.re around inf 49.3%
if -1.1199999999999999e146 < y.im < -4.2499999999999998e46Initial program 37.4%
exp-diff37.4%
+-rgt-identity37.4%
+-rgt-identity37.4%
exp-to-pow37.4%
hypot-def37.4%
*-commutative37.4%
exp-prod29.8%
fma-def29.8%
hypot-def35.8%
*-commutative35.8%
Simplified35.8%
Taylor expanded in y.im around 0 42.3%
*-commutative42.3%
unpow242.3%
unpow242.3%
hypot-def42.6%
Simplified42.6%
Taylor expanded in x.im around 0 42.6%
add-log-exp42.3%
*-commutative42.3%
Applied egg-rr54.0%
if -1.0500000000000001e29 < y.im < 3.1000000000000001e-12Initial program 47.8%
exp-diff47.1%
+-rgt-identity47.1%
+-rgt-identity47.1%
exp-to-pow47.1%
hypot-def47.1%
*-commutative47.1%
exp-prod47.1%
fma-def47.1%
hypot-def89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.im around 0 52.2%
*-commutative52.2%
unpow252.2%
unpow252.2%
hypot-def59.7%
Simplified59.7%
if 3.1000000000000001e-12 < y.im Initial program 43.9%
exp-diff37.9%
+-rgt-identity37.9%
+-rgt-identity37.9%
exp-to-pow37.9%
hypot-def37.9%
*-commutative37.9%
exp-prod34.4%
fma-def34.4%
hypot-def60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y.im around 0 38.6%
*-commutative38.6%
unpow238.6%
unpow238.6%
hypot-def30.6%
Simplified30.6%
Taylor expanded in x.re around 0 27.2%
add-log-exp49.6%
*-commutative49.6%
Applied egg-rr49.6%
Final simplification55.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im 3.1e-12)
(* t_0 (pow (hypot x.im x.re) y.re))
(* (log (exp t_0)) (pow 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((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 3.1e-12) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = log(exp(t_0)) * pow(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((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 3.1e-12) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.log(Math.exp(t_0)) * Math.pow(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((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= 3.1e-12: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.log(math.exp(t_0)) * math.pow(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(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= 3.1e-12) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(log(exp(t_0)) * (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((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= 3.1e-12) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = log(exp(t_0)) * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 3.1e-12], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq 3.1 \cdot 10^{-12}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{t_0}\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.im < 3.1000000000000001e-12Initial program 43.1%
exp-diff42.6%
+-rgt-identity42.6%
+-rgt-identity42.6%
exp-to-pow42.6%
hypot-def42.6%
*-commutative42.6%
exp-prod41.8%
fma-def41.8%
hypot-def79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in y.im around 0 48.0%
*-commutative48.0%
unpow248.0%
unpow248.0%
hypot-def52.1%
Simplified52.1%
if 3.1000000000000001e-12 < y.im Initial program 43.9%
exp-diff37.9%
+-rgt-identity37.9%
+-rgt-identity37.9%
exp-to-pow37.9%
hypot-def37.9%
*-commutative37.9%
exp-prod34.4%
fma-def34.4%
hypot-def60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y.im around 0 38.6%
*-commutative38.6%
unpow238.6%
unpow238.6%
hypot-def30.6%
Simplified30.6%
Taylor expanded in x.re around 0 27.2%
add-log-exp49.6%
*-commutative49.6%
Applied egg-rr49.6%
Final simplification51.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im 5.1e+118)
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (pow (sqrt (+ (* x.re x.re) (* x.im 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((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 5.1e+118) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * 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((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= 5.1e+118) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * 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((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= 5.1e+118: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * 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(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= 5.1e+118) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * 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((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= 5.1e+118) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * (sqrt(((x_46_re * x_46_re) + (x_46_im * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 5.1e+118], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq 5.1 \cdot 10^{+118}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < 5.10000000000000002e118Initial program 42.9%
exp-diff42.4%
+-rgt-identity42.4%
+-rgt-identity42.4%
exp-to-pow42.4%
hypot-def42.4%
*-commutative42.4%
exp-prod41.2%
fma-def41.2%
hypot-def78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in y.im around 0 46.9%
*-commutative46.9%
unpow246.9%
unpow246.9%
hypot-def50.7%
Simplified50.7%
if 5.10000000000000002e118 < y.im Initial program 45.2%
exp-diff36.6%
+-rgt-identity36.6%
+-rgt-identity36.6%
exp-to-pow36.6%
hypot-def36.6%
*-commutative36.6%
exp-prod34.1%
fma-def34.1%
hypot-def55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y.im around 0 39.5%
*-commutative39.5%
+-commutative39.5%
unpow239.5%
unpow239.5%
Simplified39.5%
Final simplification48.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 43.3%
exp-diff41.4%
+-rgt-identity41.4%
+-rgt-identity41.4%
exp-to-pow41.4%
hypot-def41.4%
*-commutative41.4%
exp-prod39.9%
fma-def39.9%
hypot-def74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in y.im around 0 45.5%
*-commutative45.5%
unpow245.5%
unpow245.5%
hypot-def46.5%
Simplified46.5%
Final simplification46.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -4e-5) (not (<= y.re 105000000.0)))
(* (sin t_0) (pow x.im 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4e-5) || !(y_46_re <= 105000000.0)) {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
} else {
tmp = 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 = y_46re * atan2(x_46im, x_46re)
if ((y_46re <= (-4d-5)) .or. (.not. (y_46re <= 105000000.0d0))) then
tmp = sin(t_0) * (x_46im ** y_46re)
else
tmp = 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -4e-5) || !(y_46_re <= 105000000.0)) {
tmp = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -4e-5) or not (y_46_re <= 105000000.0): tmp = math.sin(t_0) * math.pow(x_46_im, y_46_re) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -4e-5) || !(y_46_re <= 105000000.0)) tmp = Float64(sin(t_0) * (x_46_im ^ y_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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -4e-5) || ~((y_46_re <= 105000000.0))) tmp = sin(t_0) * (x_46_im ^ y_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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -4e-5], N[Not[LessEqual[y$46$re, 105000000.0]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -4 \cdot 10^{-5} \lor \neg \left(y.re \leq 105000000\right):\\
\;\;\;\;\sin t_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -4.00000000000000033e-5 or 1.05e8 < y.re Initial program 48.3%
exp-diff44.2%
+-rgt-identity44.2%
+-rgt-identity44.2%
exp-to-pow44.2%
hypot-def44.2%
*-commutative44.2%
exp-prod41.7%
fma-def41.7%
hypot-def66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 72.6%
*-commutative72.6%
unpow272.6%
unpow272.6%
hypot-def72.6%
Simplified72.6%
Taylor expanded in x.re around 0 64.5%
if -4.00000000000000033e-5 < y.re < 1.05e8Initial program 38.9%
exp-diff38.9%
+-rgt-identity38.9%
+-rgt-identity38.9%
exp-to-pow38.9%
hypot-def38.9%
*-commutative38.9%
exp-prod38.3%
fma-def38.3%
hypot-def81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in y.im around 0 21.6%
*-commutative21.6%
unpow221.6%
unpow221.6%
hypot-def23.4%
Simplified23.4%
Taylor expanded in x.im around 0 8.4%
Taylor expanded in y.re around 0 21.1%
Final simplification41.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_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 = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 43.3%
exp-diff41.4%
+-rgt-identity41.4%
+-rgt-identity41.4%
exp-to-pow41.4%
hypot-def41.4%
*-commutative41.4%
exp-prod39.9%
fma-def39.9%
hypot-def74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in y.im around 0 45.5%
*-commutative45.5%
unpow245.5%
unpow245.5%
hypot-def46.5%
Simplified46.5%
Taylor expanded in x.im around 0 32.7%
Taylor expanded in y.re around 0 13.6%
Final simplification13.6%
herbie shell --seed 2023224
(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)))))