
(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 11 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 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re 2.6e-152)
(* t_2 (sin (pow (cbrt (fma y.im t_1 t_0)) 3.0)))
(if (<= y.re 8000000000000.0)
(/
(sin (fma t_1 y.im t_0))
(/ (pow (exp (atan2 x.im x.re)) y.im) (pow (hypot x.re x.im) y.re)))
(* t_2 (sin (pow (cbrt (* y.im (log (hypot 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= 2.6e-152) {
tmp = t_2 * sin(pow(cbrt(fma(y_46_im, t_1, t_0)), 3.0));
} else if (y_46_re <= 8000000000000.0) {
tmp = sin(fma(t_1, y_46_im, t_0)) / (pow(exp(atan2(x_46_im, x_46_re)), y_46_im) / pow(hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = t_2 * sin(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.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)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= 2.6e-152) tmp = Float64(t_2 * sin((cbrt(fma(y_46_im, t_1, t_0)) ^ 3.0))); elseif (y_46_re <= 8000000000000.0) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) / Float64((exp(atan(x_46_im, x_46_re)) ^ y_46_im) / (hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = Float64(t_2 * sin((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); end return 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]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2.6e-152], N[(t$95$2 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8000000000000.0], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq 2.6 \cdot 10^{-152}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t_1, t_0\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 8000000000000:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)}{\frac{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < 2.60000000000000013e-152Initial program 40.8%
Simplified85.1%
*-commutative85.1%
hypot-udef40.8%
fma-def40.8%
add-cube-cbrt42.4%
pow342.9%
*-commutative42.9%
hypot-udef88.8%
fma-def88.8%
Applied egg-rr88.8%
if 2.60000000000000013e-152 < y.re < 8e12Initial program 43.3%
*-commutative43.3%
exp-diff43.3%
associate-*r/43.3%
associate-/l*43.3%
fma-def43.3%
hypot-def57.8%
*-commutative57.8%
Simplified87.7%
if 8e12 < y.re Initial program 40.4%
Simplified70.2%
*-commutative70.2%
hypot-udef40.4%
fma-def40.4%
add-cube-cbrt42.6%
pow340.4%
*-commutative40.4%
hypot-udef74.5%
fma-def74.5%
Applied egg-rr74.5%
Taylor expanded in y.re around 0 21.3%
unpow1/346.8%
+-commutative46.8%
unpow246.8%
unpow246.8%
hypot-def83.0%
hypot-def46.8%
unpow246.8%
unpow246.8%
+-commutative46.8%
unpow246.8%
unpow246.8%
hypot-def83.0%
Simplified83.0%
Final simplification87.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -1050000.0) (not (<= y.im 6.7e-18)))
(*
(exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))
(sin (pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0)))
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* t_0 y.im)))))))
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 tmp;
if ((y_46_im <= -1050000.0) || !(y_46_im <= 6.7e-18)) {
tmp = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_0 * y_46_im)));
}
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)) tmp = 0.0 if ((y_46_im <= -1050000.0) || !(y_46_im <= 6.7e-18)) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_0 * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1050000.0], N[Not[LessEqual[y$46$im, 6.7e-18]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -1050000 \lor \neg \left(y.im \leq 6.7 \cdot 10^{-18}\right):\\
\;\;\;\;e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0 \cdot y.im\right)\right)\\
\end{array}
\end{array}
if y.im < -1.05e6 or 6.6999999999999998e-18 < y.im Initial program 31.6%
Simplified73.6%
*-commutative73.6%
hypot-udef31.6%
fma-def31.6%
add-cube-cbrt34.3%
pow334.3%
*-commutative34.3%
hypot-udef77.9%
fma-def77.9%
Applied egg-rr77.9%
Taylor expanded in y.re around 0 15.1%
unpow1/335.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def78.7%
hypot-def35.1%
unpow235.1%
unpow235.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def78.7%
Simplified78.7%
if -1.05e6 < y.im < 6.6999999999999998e-18Initial program 50.3%
exp-diff50.3%
+-rgt-identity50.3%
+-rgt-identity50.3%
exp-to-pow50.3%
hypot-def50.3%
*-commutative50.3%
exp-prod49.9%
+-commutative49.9%
*-commutative49.9%
Simplified91.3%
Taylor expanded in y.im around 0 91.7%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))))
(if (<= y.re 2e+15)
(* t_1 (sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(* t_1 (sin (pow (cbrt (* y.im (log (hypot 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));
double t_1 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= 2e+15) {
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(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0));
}
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(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= 2e+15) 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((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2e+15], 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[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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)\\
t_1 := e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq 2 \cdot 10^{+15}:\\
\;\;\;\;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(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < 2e15Initial program 41.2%
Simplified85.5%
if 2e15 < y.re Initial program 40.4%
Simplified70.2%
*-commutative70.2%
hypot-udef40.4%
fma-def40.4%
add-cube-cbrt42.6%
pow340.4%
*-commutative40.4%
hypot-udef74.5%
fma-def74.5%
Applied egg-rr74.5%
Taylor expanded in y.re around 0 21.3%
unpow1/346.8%
+-commutative46.8%
unpow246.8%
unpow246.8%
hypot-def83.0%
hypot-def46.8%
unpow246.8%
unpow246.8%
+-commutative46.8%
unpow246.8%
unpow246.8%
hypot-def83.0%
Simplified83.0%
Final simplification85.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* (atan2 x.im x.re) y.im)))
(if (or (<= y.im -500000.0) (not (<= y.im 4e-9)))
(* (exp (- (* y.re t_0) t_1)) (sin (* y.re (atan2 x.im x.re))))
(*
(sin (fma y.re (atan2 x.im x.re) (* t_0 y.im)))
(/ (pow (hypot x.re x.im) y.re) (+ t_1 1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if ((y_46_im <= -500000.0) || !(y_46_im <= 4e-9)) {
tmp = exp(((y_46_re * t_0) - t_1)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_0 * y_46_im))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_1 + 1.0));
}
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 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if ((y_46_im <= -500000.0) || !(y_46_im <= 4e-9)) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_1)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_0 * y_46_im))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_1 + 1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -500000.0], N[Not[LessEqual[y$46$im, 4e-9]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$1), $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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.im \leq -500000 \lor \neg \left(y.im \leq 4 \cdot 10^{-9}\right):\\
\;\;\;\;e^{y.re \cdot t_0 - t_1} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0 \cdot y.im\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_1 + 1}\\
\end{array}
\end{array}
if y.im < -5e5 or 4.00000000000000025e-9 < y.im Initial program 33.0%
Simplified73.2%
*-commutative73.2%
hypot-udef33.0%
fma-def33.0%
add-cube-cbrt34.9%
pow334.9%
*-commutative34.9%
hypot-udef76.8%
fma-def76.8%
Applied egg-rr76.8%
Taylor expanded in y.im around 0 69.8%
pow-base-169.8%
*-lft-identity69.8%
Simplified69.8%
if -5e5 < y.im < 4.00000000000000025e-9Initial program 48.8%
exp-diff48.8%
+-rgt-identity48.8%
+-rgt-identity48.8%
exp-to-pow48.8%
hypot-def48.8%
*-commutative48.8%
exp-prod48.3%
+-commutative48.3%
*-commutative48.3%
Simplified91.4%
Taylor expanded in y.im around 0 91.9%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -1050000.0) (not (<= y.im 4e-9)))
(*
(exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(*
(pow (hypot x.re x.im) y.re)
(sin (fma y.re (atan2 x.im x.re) (* t_0 y.im)))))))
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 tmp;
if ((y_46_im <= -1050000.0) || !(y_46_im <= 4e-9)) {
tmp = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_0 * y_46_im)));
}
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)) tmp = 0.0 if ((y_46_im <= -1050000.0) || !(y_46_im <= 4e-9)) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - 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((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_0 * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1050000.0], N[Not[LessEqual[y$46$im, 4e-9]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * t$95$0), $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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -1050000 \lor \neg \left(y.im \leq 4 \cdot 10^{-9}\right):\\
\;\;\;\;e^{y.re \cdot t_0 - \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}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_0 \cdot y.im\right)\right)\\
\end{array}
\end{array}
if y.im < -1.05e6 or 4.00000000000000025e-9 < y.im Initial program 32.4%
Simplified72.9%
*-commutative72.9%
hypot-udef32.4%
fma-def32.4%
add-cube-cbrt35.2%
pow335.2%
*-commutative35.2%
hypot-udef77.4%
fma-def77.4%
Applied egg-rr77.4%
Taylor expanded in y.im around 0 69.5%
pow-base-169.5%
*-lft-identity69.5%
Simplified69.5%
if -1.05e6 < y.im < 4.00000000000000025e-9Initial program 49.2%
exp-diff49.2%
+-rgt-identity49.2%
+-rgt-identity49.2%
exp-to-pow49.2%
hypot-def49.2%
*-commutative49.2%
exp-prod48.7%
+-commutative48.7%
*-commutative48.7%
Simplified91.5%
Taylor expanded in y.im around 0 91.7%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(*
(exp (- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))
(sin t_0))))
(if (<= y.re -4.9e-99)
t_1
(if (<= y.re 1.85e-94)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(if (or (<= y.re 175000.0) (not (<= y.re 9e+37)))
t_1
(* (sin (fabs 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
double tmp;
if (y_46_re <= -4.9e-99) {
tmp = t_1;
} else if (y_46_re <= 1.85e-94) {
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 if ((y_46_re <= 175000.0) || !(y_46_re <= 9e+37)) {
tmp = t_1;
} else {
tmp = sin(fabs(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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(t_0);
double tmp;
if (y_46_re <= -4.9e-99) {
tmp = t_1;
} else if (y_46_re <= 1.85e-94) {
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 if ((y_46_re <= 175000.0) || !(y_46_re <= 9e+37)) {
tmp = t_1;
} else {
tmp = Math.sin(Math.abs(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 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(t_0) tmp = 0 if y_46_re <= -4.9e-99: tmp = t_1 elif y_46_re <= 1.85e-94: 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)) elif (y_46_re <= 175000.0) or not (y_46_re <= 9e+37): tmp = t_1 else: tmp = math.sin(math.fabs(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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)) tmp = 0.0 if (y_46_re <= -4.9e-99) tmp = t_1; elseif (y_46_re <= 1.85e-94) 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))); elseif ((y_46_re <= 175000.0) || !(y_46_re <= 9e+37)) tmp = t_1; else tmp = Float64(sin(abs(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 = y_46_re * atan2(x_46_im, x_46_re); t_1 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0); tmp = 0.0; if (y_46_re <= -4.9e-99) tmp = t_1; elseif (y_46_re <= 1.85e-94) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); elseif ((y_46_re <= 175000.0) || ~((y_46_re <= 9e+37))) tmp = t_1; else tmp = sin(abs(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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -4.9e-99], t$95$1, If[LessEqual[y$46$re, 1.85e-94], 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], If[Or[LessEqual[y$46$re, 175000.0], N[Not[LessEqual[y$46$re, 9e+37]], $MachinePrecision]], t$95$1, N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * 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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\
\mathbf{if}\;y.re \leq -4.9 \cdot 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-94}:\\
\;\;\;\;\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{elif}\;y.re \leq 175000 \lor \neg \left(y.re \leq 9 \cdot 10^{+37}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.9000000000000003e-99 or 1.8499999999999999e-94 < y.re < 175000 or 8.99999999999999923e37 < y.re Initial program 41.2%
Simplified83.1%
*-commutative83.1%
hypot-udef41.2%
fma-def41.2%
add-cube-cbrt41.8%
pow341.8%
*-commutative41.8%
hypot-udef86.2%
fma-def86.2%
Applied egg-rr86.2%
Taylor expanded in y.im around 0 81.1%
pow-base-181.1%
*-lft-identity81.1%
Simplified81.1%
if -4.9000000000000003e-99 < y.re < 1.8499999999999999e-94Initial program 42.0%
exp-diff42.0%
+-rgt-identity42.0%
+-rgt-identity42.0%
exp-to-pow42.0%
hypot-def42.0%
*-commutative42.0%
exp-prod41.3%
+-commutative41.3%
*-commutative41.3%
Simplified83.8%
Taylor expanded in y.re around 0 38.1%
unpow238.1%
unpow238.1%
hypot-def75.5%
*-commutative75.5%
exp-prod74.8%
Simplified74.8%
if 175000 < y.re < 8.99999999999999923e37Initial program 30.0%
exp-diff30.0%
+-rgt-identity30.0%
+-rgt-identity30.0%
exp-to-pow30.0%
hypot-def30.0%
*-commutative30.0%
exp-prod30.0%
+-commutative30.0%
*-commutative30.0%
Simplified60.0%
Taylor expanded in y.im around 0 30.2%
unpow230.2%
unpow230.2%
hypot-def30.2%
Simplified30.2%
add-cube-cbrt40.2%
pow340.2%
*-commutative40.2%
Applied egg-rr40.2%
add-sqr-sqrt10.2%
sqrt-unprod70.2%
pow270.2%
Applied egg-rr70.2%
*-commutative70.2%
unpow270.2%
rem-sqrt-square70.2%
Simplified70.2%
unpow370.2%
add-cube-cbrt80.2%
*-commutative80.2%
Applied egg-rr80.2%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (pow (hypot x.im x.re) y.re))
(t_3 (* t_1 t_2)))
(if (<= y.re -9.6e-10)
t_3
(if (<= y.re 2.3e-16)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.re 600000000000.0)
t_3
(if (<= y.re 2.9e+33)
(* (sin (fabs t_0)) t_2)
(if (<= y.re 1.36e+72) (* t_1 (pow x.re y.re)) t_3)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_1 * t_2;
double tmp;
if (y_46_re <= -9.6e-10) {
tmp = t_3;
} else if (y_46_re <= 2.3e-16) {
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 if (y_46_re <= 600000000000.0) {
tmp = t_3;
} else if (y_46_re <= 2.9e+33) {
tmp = sin(fabs(t_0)) * t_2;
} else if (y_46_re <= 1.36e+72) {
tmp = t_1 * pow(x_46_re, y_46_re);
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_3 = t_1 * t_2;
double tmp;
if (y_46_re <= -9.6e-10) {
tmp = t_3;
} else if (y_46_re <= 2.3e-16) {
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 if (y_46_re <= 600000000000.0) {
tmp = t_3;
} else if (y_46_re <= 2.9e+33) {
tmp = Math.sin(Math.abs(t_0)) * t_2;
} else if (y_46_re <= 1.36e+72) {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_3;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_3 = t_1 * t_2 tmp = 0 if y_46_re <= -9.6e-10: tmp = t_3 elif y_46_re <= 2.3e-16: 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)) elif y_46_re <= 600000000000.0: tmp = t_3 elif y_46_re <= 2.9e+33: tmp = math.sin(math.fabs(t_0)) * t_2 elif y_46_re <= 1.36e+72: tmp = t_1 * math.pow(x_46_re, y_46_re) else: tmp = t_3 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re t_3 = Float64(t_1 * t_2) tmp = 0.0 if (y_46_re <= -9.6e-10) tmp = t_3; elseif (y_46_re <= 2.3e-16) 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))); elseif (y_46_re <= 600000000000.0) tmp = t_3; elseif (y_46_re <= 2.9e+33) tmp = Float64(sin(abs(t_0)) * t_2); elseif (y_46_re <= 1.36e+72) tmp = Float64(t_1 * (x_46_re ^ y_46_re)); else tmp = t_3; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; t_3 = t_1 * t_2; tmp = 0.0; if (y_46_re <= -9.6e-10) tmp = t_3; elseif (y_46_re <= 2.3e-16) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); elseif (y_46_re <= 600000000000.0) tmp = t_3; elseif (y_46_re <= 2.9e+33) tmp = sin(abs(t_0)) * t_2; elseif (y_46_re <= 1.36e+72) tmp = t_1 * (x_46_re ^ y_46_re); else tmp = t_3; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -9.6e-10], t$95$3, If[LessEqual[y$46$re, 2.3e-16], 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], If[LessEqual[y$46$re, 600000000000.0], t$95$3, If[LessEqual[y$46$re, 2.9e+33], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.36e+72], N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_3 := t_1 \cdot t_2\\
\mathbf{if}\;y.re \leq -9.6 \cdot 10^{-10}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{-16}:\\
\;\;\;\;\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{elif}\;y.re \leq 600000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot t_2\\
\mathbf{elif}\;y.re \leq 1.36 \cdot 10^{+72}:\\
\;\;\;\;t_1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y.re < -9.5999999999999999e-10 or 2.2999999999999999e-16 < y.re < 6e11 or 1.3599999999999999e72 < y.re Initial program 43.2%
exp-diff37.8%
+-rgt-identity37.8%
+-rgt-identity37.8%
exp-to-pow37.8%
hypot-def37.8%
*-commutative37.8%
exp-prod36.9%
+-commutative36.9%
*-commutative36.9%
Simplified73.0%
Taylor expanded in y.im around 0 76.7%
unpow276.7%
unpow276.7%
hypot-def79.4%
Simplified79.4%
if -9.5999999999999999e-10 < y.re < 2.2999999999999999e-16Initial program 40.6%
exp-diff40.6%
+-rgt-identity40.6%
+-rgt-identity40.6%
exp-to-pow40.6%
hypot-def40.6%
*-commutative40.6%
exp-prod40.0%
+-commutative40.0%
*-commutative40.0%
Simplified82.5%
Taylor expanded in y.re around 0 34.6%
unpow234.6%
unpow234.6%
hypot-def70.2%
*-commutative70.2%
exp-prod69.7%
Simplified69.7%
if 6e11 < y.re < 2.90000000000000025e33Initial program 0.0%
exp-diff0.0%
+-rgt-identity0.0%
+-rgt-identity0.0%
exp-to-pow0.0%
hypot-def0.0%
*-commutative0.0%
exp-prod0.0%
+-commutative0.0%
*-commutative0.0%
Simplified25.0%
Taylor expanded in y.im around 0 0.4%
unpow20.4%
unpow20.4%
hypot-def0.4%
Simplified0.4%
add-cube-cbrt0.4%
pow30.4%
*-commutative0.4%
Applied egg-rr0.4%
add-sqr-sqrt0.4%
sqrt-unprod75.4%
pow275.4%
Applied egg-rr75.4%
*-commutative75.4%
unpow275.4%
rem-sqrt-square75.4%
Simplified75.4%
unpow375.4%
add-cube-cbrt75.4%
*-commutative75.4%
Applied egg-rr75.4%
if 2.90000000000000025e33 < y.re < 1.3599999999999999e72Initial program 40.0%
exp-diff30.0%
+-rgt-identity30.0%
+-rgt-identity30.0%
exp-to-pow30.0%
hypot-def30.0%
*-commutative30.0%
exp-prod30.0%
+-commutative30.0%
*-commutative30.0%
Simplified60.0%
Taylor expanded in y.im around 0 60.3%
unpow260.3%
unpow260.3%
hypot-def60.3%
Simplified60.3%
Taylor expanded in x.im around 0 80.3%
Final simplification74.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (* t_2 t_0)))
(if (<= y.re -7.1e-10)
(* t_0 (sin (pow (cbrt t_1) 3.0)))
(if (<= y.re 2e-16)
(/
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
(if (<= y.re 960000000000.0)
t_3
(if (<= y.re 9.2e+35)
(* (sin (fabs t_1)) t_0)
(if (<= y.re 1.25e+72) (* t_2 (pow x.re y.re)) t_3)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = t_2 * t_0;
double tmp;
if (y_46_re <= -7.1e-10) {
tmp = t_0 * sin(pow(cbrt(t_1), 3.0));
} else if (y_46_re <= 2e-16) {
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 if (y_46_re <= 960000000000.0) {
tmp = t_3;
} else if (y_46_re <= 9.2e+35) {
tmp = sin(fabs(t_1)) * t_0;
} else if (y_46_re <= 1.25e+72) {
tmp = t_2 * pow(x_46_re, y_46_re);
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double t_3 = t_2 * t_0;
double tmp;
if (y_46_re <= -7.1e-10) {
tmp = t_0 * Math.sin(Math.pow(Math.cbrt(t_1), 3.0));
} else if (y_46_re <= 2e-16) {
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 if (y_46_re <= 960000000000.0) {
tmp = t_3;
} else if (y_46_re <= 9.2e+35) {
tmp = Math.sin(Math.abs(t_1)) * t_0;
} else if (y_46_re <= 1.25e+72) {
tmp = t_2 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(t_2 * t_0) tmp = 0.0 if (y_46_re <= -7.1e-10) tmp = Float64(t_0 * sin((cbrt(t_1) ^ 3.0))); elseif (y_46_re <= 2e-16) 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))); elseif (y_46_re <= 960000000000.0) tmp = t_3; elseif (y_46_re <= 9.2e+35) tmp = Float64(sin(abs(t_1)) * t_0); elseif (y_46_re <= 1.25e+72) tmp = Float64(t_2 * (x_46_re ^ y_46_re)); else tmp = t_3; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -7.1e-10], N[(t$95$0 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e-16], 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], If[LessEqual[y$46$re, 960000000000.0], t$95$3, If[LessEqual[y$46$re, 9.2e+35], N[(N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+72], N[(t$95$2 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
t_3 := t_2 \cdot t_0\\
\mathbf{if}\;y.re \leq -7.1 \cdot 10^{-10}:\\
\;\;\;\;t_0 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-16}:\\
\;\;\;\;\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{elif}\;y.re \leq 960000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{+35}:\\
\;\;\;\;\sin \left(\left|t_1\right|\right) \cdot t_0\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+72}:\\
\;\;\;\;t_2 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y.re < -7.1000000000000003e-10Initial program 41.8%
exp-diff35.8%
+-rgt-identity35.8%
+-rgt-identity35.8%
exp-to-pow35.8%
hypot-def35.8%
*-commutative35.8%
exp-prod35.8%
+-commutative35.8%
*-commutative35.8%
Simplified77.6%
Taylor expanded in y.im around 0 85.2%
unpow285.2%
unpow285.2%
hypot-def86.7%
Simplified86.7%
add-cube-cbrt89.7%
pow389.7%
*-commutative89.7%
Applied egg-rr89.7%
if -7.1000000000000003e-10 < y.re < 2e-16Initial program 40.6%
exp-diff40.6%
+-rgt-identity40.6%
+-rgt-identity40.6%
exp-to-pow40.6%
hypot-def40.6%
*-commutative40.6%
exp-prod40.0%
+-commutative40.0%
*-commutative40.0%
Simplified82.5%
Taylor expanded in y.re around 0 34.6%
unpow234.6%
unpow234.6%
hypot-def70.2%
*-commutative70.2%
exp-prod69.7%
Simplified69.7%
if 2e-16 < y.re < 9.6e11 or 1.24999999999999998e72 < y.re Initial program 45.4%
exp-diff40.9%
+-rgt-identity40.9%
+-rgt-identity40.9%
exp-to-pow40.9%
hypot-def40.9%
*-commutative40.9%
exp-prod38.6%
+-commutative38.6%
*-commutative38.6%
Simplified65.9%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-def68.2%
Simplified68.2%
if 9.6e11 < y.re < 9.1999999999999993e35Initial program 0.0%
exp-diff0.0%
+-rgt-identity0.0%
+-rgt-identity0.0%
exp-to-pow0.0%
hypot-def0.0%
*-commutative0.0%
exp-prod0.0%
+-commutative0.0%
*-commutative0.0%
Simplified25.0%
Taylor expanded in y.im around 0 0.4%
unpow20.4%
unpow20.4%
hypot-def0.4%
Simplified0.4%
add-cube-cbrt0.4%
pow30.4%
*-commutative0.4%
Applied egg-rr0.4%
add-sqr-sqrt0.4%
sqrt-unprod75.4%
pow275.4%
Applied egg-rr75.4%
*-commutative75.4%
unpow275.4%
rem-sqrt-square75.4%
Simplified75.4%
unpow375.4%
add-cube-cbrt75.4%
*-commutative75.4%
Applied egg-rr75.4%
if 9.1999999999999993e35 < y.re < 1.24999999999999998e72Initial program 40.0%
exp-diff30.0%
+-rgt-identity30.0%
+-rgt-identity30.0%
exp-to-pow30.0%
hypot-def30.0%
*-commutative30.0%
exp-prod30.0%
+-commutative30.0%
*-commutative30.0%
Simplified60.0%
Taylor expanded in y.im around 0 60.3%
unpow260.3%
unpow260.3%
hypot-def60.3%
Simplified60.3%
Taylor expanded in x.im around 0 80.3%
Final simplification75.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3000000.0)
0.0
(if (<= y.im 4900.0)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
0.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -3000000.0) {
tmp = 0.0;
} else if (y_46_im <= 4900.0) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 0.0;
}
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_im <= -3000000.0) {
tmp = 0.0;
} else if (y_46_im <= 4900.0) {
tmp = 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);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -3000000.0: tmp = 0.0 elif y_46_im <= 4900.0: tmp = 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) else: tmp = 0.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -3000000.0) tmp = 0.0; elseif (y_46_im <= 4900.0) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = 0.0; 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_im <= -3000000.0) tmp = 0.0; elseif (y_46_im <= 4900.0) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = 0.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -3000000.0], 0.0, If[LessEqual[y$46$im, 4900.0], 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], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3000000:\\
\;\;\;\;0\\
\mathbf{elif}\;y.im \leq 4900:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if y.im < -3e6 or 4900 < y.im Initial program 31.9%
exp-diff26.2%
+-rgt-identity26.2%
+-rgt-identity26.2%
exp-to-pow26.2%
hypot-def26.2%
*-commutative26.2%
exp-prod25.3%
+-commutative25.3%
*-commutative25.3%
Simplified60.4%
Taylor expanded in y.im around 0 43.4%
unpow243.4%
unpow243.4%
hypot-def33.6%
Simplified33.6%
add-cube-cbrt32.8%
pow333.6%
*-commutative33.6%
Applied egg-rr33.6%
Taylor expanded in y.re around 0 46.2%
Taylor expanded in x.im around 0 50.5%
if -3e6 < y.im < 4900Initial program 49.6%
exp-diff49.6%
+-rgt-identity49.6%
+-rgt-identity49.6%
exp-to-pow49.6%
hypot-def49.6%
*-commutative49.6%
exp-prod49.1%
+-commutative49.1%
*-commutative49.1%
Simplified91.6%
Taylor expanded in y.im around 0 46.6%
unpow246.6%
unpow246.6%
hypot-def55.7%
Simplified55.7%
Final simplification53.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -2.6e-53)
0.0
(if (<= y.re -9.2e-198)
t_0
(if (<= y.re 1.95e+34) 0.0 (* (sin t_0) (pow 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -2.6e-53) {
tmp = 0.0;
} else if (y_46_re <= -9.2e-198) {
tmp = t_0;
} else if (y_46_re <= 1.95e+34) {
tmp = 0.0;
} else {
tmp = sin(t_0) * pow(x_46_re, y_46_re);
}
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 <= (-2.6d-53)) then
tmp = 0.0d0
else if (y_46re <= (-9.2d-198)) then
tmp = t_0
else if (y_46re <= 1.95d+34) then
tmp = 0.0d0
else
tmp = sin(t_0) * (x_46re ** y_46re)
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 <= -2.6e-53) {
tmp = 0.0;
} else if (y_46_re <= -9.2e-198) {
tmp = t_0;
} else if (y_46_re <= 1.95e+34) {
tmp = 0.0;
} else {
tmp = Math.sin(t_0) * Math.pow(x_46_re, y_46_re);
}
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 <= -2.6e-53: tmp = 0.0 elif y_46_re <= -9.2e-198: tmp = t_0 elif y_46_re <= 1.95e+34: tmp = 0.0 else: tmp = math.sin(t_0) * math.pow(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(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.6e-53) tmp = 0.0; elseif (y_46_re <= -9.2e-198) tmp = t_0; elseif (y_46_re <= 1.95e+34) tmp = 0.0; else tmp = Float64(sin(t_0) * (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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -2.6e-53) tmp = 0.0; elseif (y_46_re <= -9.2e-198) tmp = t_0; elseif (y_46_re <= 1.95e+34) tmp = 0.0; else tmp = sin(t_0) * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e-53], 0.0, If[LessEqual[y$46$re, -9.2e-198], t$95$0, If[LessEqual[y$46$re, 1.95e+34], 0.0, N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{-53}:\\
\;\;\;\;0\\
\mathbf{elif}\;y.re \leq -9.2 \cdot 10^{-198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.59999999999999996e-53 or -9.20000000000000053e-198 < y.re < 1.9500000000000001e34Initial program 42.9%
exp-diff40.6%
+-rgt-identity40.6%
+-rgt-identity40.6%
exp-to-pow40.6%
hypot-def40.6%
*-commutative40.6%
exp-prod40.2%
+-commutative40.2%
*-commutative40.2%
Simplified80.1%
Taylor expanded in y.im around 0 43.3%
unpow243.3%
unpow243.3%
hypot-def42.2%
Simplified42.2%
add-cube-cbrt43.2%
pow343.2%
*-commutative43.2%
Applied egg-rr43.2%
Taylor expanded in y.re around 0 43.3%
Taylor expanded in x.im around 0 44.0%
if -2.59999999999999996e-53 < y.re < -9.20000000000000053e-198Initial program 28.1%
exp-diff28.1%
+-rgt-identity28.1%
+-rgt-identity28.1%
exp-to-pow28.1%
hypot-def28.1%
*-commutative28.1%
exp-prod28.2%
+-commutative28.2%
*-commutative28.2%
Simplified81.3%
Taylor expanded in y.im around 0 26.4%
unpow226.4%
unpow226.4%
hypot-def32.7%
Simplified32.7%
Taylor expanded in y.re around 0 22.1%
fma-def22.1%
unpow222.1%
unpow222.1%
unpow222.1%
Simplified22.1%
Taylor expanded in y.re around 0 32.7%
if 1.9500000000000001e34 < y.re Initial program 43.2%
exp-diff36.4%
+-rgt-identity36.4%
+-rgt-identity36.4%
exp-to-pow36.4%
hypot-def36.4%
*-commutative36.4%
exp-prod34.1%
+-commutative34.1%
*-commutative34.1%
Simplified59.1%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-def66.1%
Simplified66.1%
Taylor expanded in x.im around 0 61.7%
Final simplification45.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 0.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 0.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 0.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 0.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 41.1%
exp-diff38.3%
+-rgt-identity38.3%
+-rgt-identity38.3%
exp-to-pow38.3%
hypot-def38.3%
*-commutative38.3%
exp-prod37.7%
+-commutative37.7%
*-commutative37.7%
Simplified76.6%
Taylor expanded in y.im around 0 45.1%
unpow245.1%
unpow245.1%
hypot-def45.1%
Simplified45.1%
add-cube-cbrt45.0%
pow344.6%
*-commutative44.6%
Applied egg-rr44.6%
Taylor expanded in y.re around 0 37.0%
Taylor expanded in x.im around 0 39.3%
Final simplification39.3%
herbie shell --seed 2023187
(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)))))