
(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 20 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 (* y.re (atan2 x.im x.re)))
(t_2 (sin (fma t_0 y.im t_1)))
(t_3 (exp (fma t_0 y.re (* y.im (- (atan2 x.im x.re)))))))
(if (<= x.re -6e+109)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
t_2)
(if (<= x.re -1.45e-205)
(* t_3 (sin (pow (cbrt (fma y.im t_0 t_1)) 3.0)))
(* t_2 t_3)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(fma(t_0, y_46_im, t_1));
double t_3 = exp(fma(t_0, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -6e+109) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * t_2;
} else if (x_46_re <= -1.45e-205) {
tmp = t_3 * sin(pow(cbrt(fma(y_46_im, t_0, t_1)), 3.0));
} else {
tmp = t_2 * t_3;
}
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(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(fma(t_0, y_46_im, t_1)) t_3 = exp(fma(t_0, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) tmp = 0.0 if (x_46_re <= -6e+109) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * t_2); elseif (x_46_re <= -1.45e-205) tmp = Float64(t_3 * sin((cbrt(fma(y_46_im, t_0, t_1)) ^ 3.0))); else tmp = Float64(t_2 * t_3); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $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[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(t$95$0 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -6e+109], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[x$46$re, -1.45e-205], N[(t$95$3 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + t$95$1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right)\\
t_3 := e^{\mathsf{fma}\left(t\_0, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)}\\
\mathbf{if}\;x.re \leq -6 \cdot 10^{+109}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot t\_2\\
\mathbf{elif}\;x.re \leq -1.45 \cdot 10^{-205}:\\
\;\;\;\;t\_3 \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t\_0, t\_1\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_3\\
\end{array}
\end{array}
if x.re < -6.00000000000000031e109Initial program 22.6%
exp-diff22.6%
exp-to-pow22.7%
hypot-define22.7%
*-commutative22.7%
exp-prod22.7%
fma-define22.7%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
if -6.00000000000000031e109 < x.re < -1.45000000000000009e-205Initial program 55.6%
fmm-def55.6%
hypot-define55.6%
distribute-rgt-neg-out55.6%
fma-define55.6%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
add-cube-cbrt90.3%
pow389.2%
fma-undefine89.2%
*-commutative89.2%
fma-define89.2%
*-commutative89.2%
Applied egg-rr89.2%
if -1.45000000000000009e-205 < x.re Initial program 38.1%
fmm-def38.1%
hypot-define38.1%
distribute-rgt-neg-out38.1%
fma-define38.1%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Final simplification84.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(exp (fma t_0 y.re (* y.im (- (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp(fma(t_0, y_46_re, (y_46_im * -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(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(fma(t_0, y_46_re, Float64(y_46_im * Float64(-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[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(t$95$0 * y$46$re + N[(y$46$im * (-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)\\
\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\mathsf{fma}\left(t\_0, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)}
\end{array}
\end{array}
Initial program 41.4%
fmm-def41.4%
hypot-define41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define80.6%
*-commutative80.6%
Simplified80.6%
Final simplification80.6%
(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 (* y.im (- (atan2 x.im x.re)))))
(if (<= y.re -7.5e-6)
(* (exp (fma t_1 y.re t_2)) (sin t_0))
(if (<= y.re 0.00135)
(* (sin (pow (cbrt (fma y.im t_1 t_0)) 3.0)) (exp t_2))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re))))
(sin
(*
y.re
(+
(atan2 x.im x.re)
(* y.im (/ (log (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 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_im * -atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -7.5e-6) {
tmp = exp(fma(t_1, y_46_re, t_2)) * sin(t_0);
} else if (y_46_re <= 0.00135) {
tmp = sin(pow(cbrt(fma(y_46_im, t_1, t_0)), 3.0)) * exp(t_2);
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(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 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -7.5e-6) tmp = Float64(exp(fma(t_1, y_46_re, t_2)) * sin(t_0)); elseif (y_46_re <= 0.00135) tmp = Float64(sin((cbrt(fma(y_46_im, t_1, t_0)) ^ 3.0)) * exp(t_2)); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) / y_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e-6], N[(N[Exp[N[(t$95$1 * y$46$re + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.00135], N[(N[Sin[N[Power[N[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{-6}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, t\_2\right)} \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 0.00135:\\
\;\;\;\;\sin \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_0\right)}\right)}^{3}\right) \cdot e^{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -7.50000000000000019e-6Initial program 48.4%
fmm-def48.4%
hypot-define48.4%
distribute-rgt-neg-out48.4%
fma-define48.4%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 89.1%
if -7.50000000000000019e-6 < y.re < 0.0013500000000000001Initial program 40.4%
fmm-def40.4%
hypot-define40.4%
distribute-rgt-neg-out40.4%
fma-define40.4%
hypot-define81.7%
*-commutative81.7%
Simplified81.7%
add-cube-cbrt86.1%
pow384.6%
fma-undefine84.6%
*-commutative84.6%
fma-define84.6%
*-commutative84.6%
Applied egg-rr84.6%
Taylor expanded in y.re around 0 83.6%
*-commutative83.6%
neg-mul-183.6%
distribute-rgt-neg-in83.6%
Simplified83.6%
if 0.0013500000000000001 < y.re Initial program 36.1%
exp-diff32.7%
exp-to-pow32.8%
hypot-define32.8%
*-commutative32.8%
exp-prod32.8%
fma-define32.8%
hypot-define58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in y.re around inf 32.8%
+-commutative32.8%
associate-/l*32.8%
unpow232.8%
unpow232.8%
hypot-undefine58.6%
Simplified58.6%
Taylor expanded in y.im around 0 67.3%
*-commutative67.3%
Simplified67.3%
Final simplification81.3%
(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))))
(if (or (<= y.im -1600.0) (not (<= y.im 15.5)))
(* (exp (fma t_1 y.re (* y.im (- (atan2 x.im x.re))))) (sin t_0))
(*
(sin (fma t_1 y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -1600.0) || !(y_46_im <= 15.5)) {
tmp = exp(fma(t_1, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * sin(t_0);
} else {
tmp = sin(fma(t_1, y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -1600.0) || !(y_46_im <= 15.5)) tmp = Float64(exp(fma(t_1, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * sin(t_0)); else tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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]}, If[Or[LessEqual[y$46$im, -1600.0], N[Not[LessEqual[y$46$im, 15.5]], $MachinePrecision]], N[(N[Exp[N[(t$95$1 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $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)\\
\mathbf{if}\;y.im \leq -1600 \lor \neg \left(y.im \leq 15.5\right):\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < -1600 or 15.5 < y.im Initial program 41.9%
fmm-def41.9%
hypot-define41.9%
distribute-rgt-neg-out41.9%
fma-define41.9%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.im around 0 70.6%
if -1600 < y.im < 15.5Initial program 40.9%
exp-diff40.8%
exp-to-pow40.9%
hypot-define40.9%
*-commutative40.9%
exp-prod40.9%
fma-define40.9%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.im around 0 91.9%
*-commutative91.7%
Simplified91.9%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -1600.0) (not (<= y.im 340.0)))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* y.im (- (atan2 x.im x.re)))))
(sin (* y.re (atan2 x.im x.re))))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re))))
(sin
(*
y.re
(+ (atan2 x.im x.re) (* y.im (/ (log (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 tmp;
if ((y_46_im <= -1600.0) || !(y_46_im <= 340.0)) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(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) tmp = 0.0 if ((y_46_im <= -1600.0) || !(y_46_im <= 340.0)) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) / y_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1600.0], N[Not[LessEqual[y$46$im, 340.0]], $MachinePrecision]], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1600 \lor \neg \left(y.im \leq 340\right):\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -1600 or 340 < y.im Initial program 41.9%
fmm-def41.9%
hypot-define41.9%
distribute-rgt-neg-out41.9%
fma-define41.9%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.im around 0 70.6%
if -1600 < y.im < 340Initial program 40.9%
exp-diff40.8%
exp-to-pow40.9%
hypot-define40.9%
*-commutative40.9%
exp-prod40.9%
fma-define40.9%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.re around inf 40.9%
+-commutative40.9%
associate-/l*40.9%
unpow240.9%
unpow240.9%
hypot-undefine91.5%
Simplified91.5%
Taylor expanded in y.im around 0 91.7%
*-commutative91.7%
Simplified91.7%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -3200.0) (not (<= y.im 360.0)))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* y.im (- (atan2 x.im x.re)))))
(sin (* y.re (atan2 x.im x.re))))
(*
(sin
(* y.re (+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re)))))
(/ 1.0 (/ 1.0 (pow (hypot x.re x.im) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3200.0) || !(y_46_im <= 360.0)) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re))))) * (1.0 / (1.0 / pow(hypot(x_46_re, x_46_im), y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -3200.0) || !(y_46_im <= 360.0)) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) / y_46_re))))) * Float64(1.0 / Float64(1.0 / (hypot(x_46_re, x_46_im) ^ y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -3200.0], N[Not[LessEqual[y$46$im, 360.0]], $MachinePrecision]], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $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$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3200 \lor \neg \left(y.im \leq 360\right):\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right) \cdot \frac{1}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.im < -3200 or 360 < y.im Initial program 41.9%
fmm-def41.9%
hypot-define41.9%
distribute-rgt-neg-out41.9%
fma-define41.9%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.im around 0 70.6%
if -3200 < y.im < 360Initial program 40.9%
exp-diff40.8%
exp-to-pow40.9%
hypot-define40.9%
*-commutative40.9%
exp-prod40.9%
fma-define40.9%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.re around inf 40.9%
+-commutative40.9%
associate-/l*40.9%
unpow240.9%
unpow240.9%
hypot-undefine91.5%
Simplified91.5%
clear-num91.6%
inv-pow91.6%
Applied egg-rr91.6%
unpow-191.6%
hypot-undefine62.9%
unpow262.9%
unpow262.9%
+-commutative62.9%
unpow262.9%
unpow262.9%
hypot-undefine91.6%
Simplified91.6%
Taylor expanded in y.im around 0 62.3%
+-commutative62.3%
unpow262.3%
unpow262.3%
hypot-define90.4%
Simplified90.4%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (log (hypot x.im x.re)))
(t_2 (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.im -0.008)
(/ 1.0 (/ t_2 (sin (* y.im t_1))))
(if (<= y.im 350.0)
(*
(sin (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_1 y.re)))))
(/ 1.0 (/ 1.0 t_0)))
(* (/ t_0 t_2) (sin (* 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 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = pow(exp(y_46_im), atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -0.008) {
tmp = 1.0 / (t_2 / sin((y_46_im * t_1)));
} else if (y_46_im <= 350.0) {
tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re))))) * (1.0 / (1.0 / t_0));
} else {
tmp = (t_0 / t_2) * sin((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_2 = Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -0.008) {
tmp = 1.0 / (t_2 / Math.sin((y_46_im * t_1)));
} else if (y_46_im <= 350.0) {
tmp = Math.sin((y_46_re * (Math.atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re))))) * (1.0 / (1.0 / t_0));
} else {
tmp = (t_0 / t_2) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.log(math.hypot(x_46_im, x_46_re)) t_2 = math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -0.008: tmp = 1.0 / (t_2 / math.sin((y_46_im * t_1))) elif y_46_im <= 350.0: tmp = math.sin((y_46_re * (math.atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re))))) * (1.0 / (1.0 / t_0)) else: tmp = (t_0 / t_2) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = log(hypot(x_46_im, x_46_re)) t_2 = exp(y_46_im) ^ atan(x_46_im, x_46_re) tmp = 0.0 if (y_46_im <= -0.008) tmp = Float64(1.0 / Float64(t_2 / sin(Float64(y_46_im * t_1)))); elseif (y_46_im <= 350.0) tmp = Float64(sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_1 / y_46_re))))) * Float64(1.0 / Float64(1.0 / t_0))); else tmp = Float64(Float64(t_0 / t_2) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; t_1 = log(hypot(x_46_im, x_46_re)); t_2 = exp(y_46_im) ^ atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -0.008) tmp = 1.0 / (t_2 / sin((y_46_im * t_1))); elseif (y_46_im <= 350.0) tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re))))) * (1.0 / (1.0 / t_0)); else tmp = (t_0 / t_2) * sin((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -0.008], N[(1.0 / N[(t$95$2 / N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 350.0], N[(N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$1 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / t$95$2), $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := {\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -0.008:\\
\;\;\;\;\frac{1}{\frac{t\_2}{\sin \left(y.im \cdot t\_1\right)}}\\
\mathbf{elif}\;y.im \leq 350:\\
\;\;\;\;\sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_1}{y.re}\right)\right) \cdot \frac{1}{\frac{1}{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_2} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.im < -0.0080000000000000002Initial program 41.6%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod35.3%
fma-define35.3%
hypot-define54.4%
*-commutative54.4%
Simplified54.4%
associate-*l/54.4%
clear-num54.4%
add-sqr-sqrt1.5%
sqrt-unprod12.9%
sqr-neg12.9%
sqrt-unprod12.9%
add-sqr-sqrt12.9%
exp-prod19.1%
*-commutative19.1%
exp-prod20.6%
add-sqr-sqrt20.6%
sqrt-unprod20.6%
sqr-neg20.6%
sqrt-unprod10.9%
add-sqr-sqrt54.9%
*-commutative54.9%
Applied egg-rr54.9%
Taylor expanded in y.re around 0 34.5%
exp-prod38.4%
+-commutative38.4%
unpow238.4%
unpow238.4%
hypot-undefine59.1%
hypot-undefine38.4%
unpow238.4%
unpow238.4%
+-commutative38.4%
unpow238.4%
unpow238.4%
hypot-undefine59.1%
Simplified59.1%
if -0.0080000000000000002 < y.im < 350Initial program 40.7%
exp-diff40.7%
exp-to-pow40.8%
hypot-define40.8%
*-commutative40.8%
exp-prod40.8%
fma-define40.8%
hypot-define92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in y.re around inf 40.8%
+-commutative40.8%
associate-/l*40.7%
unpow240.7%
unpow240.7%
hypot-undefine92.3%
Simplified92.3%
clear-num92.3%
inv-pow92.3%
Applied egg-rr92.3%
unpow-192.3%
hypot-undefine63.1%
unpow263.1%
unpow263.1%
+-commutative63.1%
unpow263.1%
unpow263.1%
hypot-undefine92.3%
Simplified92.3%
Taylor expanded in y.im around 0 63.1%
+-commutative63.1%
unpow263.1%
unpow263.1%
hypot-define91.7%
Simplified91.7%
if 350 < y.im Initial program 42.4%
exp-diff36.4%
exp-to-pow36.4%
hypot-define36.4%
*-commutative36.4%
exp-prod36.4%
fma-define36.4%
hypot-define61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in y.im around 0 66.8%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (sin (* y.im t_0)))
(t_2 (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.im -0.0002)
(/ 1.0 (/ t_2 t_1))
(if (<= y.im 4.8e-10)
(*
(sin (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re)))))
(/ 1.0 (/ 1.0 (pow (hypot x.re x.im) y.re))))
(/ t_1 t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = sin((y_46_im * t_0));
double t_2 = pow(exp(y_46_im), atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -0.0002) {
tmp = 1.0 / (t_2 / t_1);
} else if (y_46_im <= 4.8e-10) {
tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * (1.0 / (1.0 / pow(hypot(x_46_re, x_46_im), y_46_re)));
} else {
tmp = t_1 / t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_1 = Math.sin((y_46_im * t_0));
double t_2 = Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -0.0002) {
tmp = 1.0 / (t_2 / t_1);
} else if (y_46_im <= 4.8e-10) {
tmp = Math.sin((y_46_re * (Math.atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * (1.0 / (1.0 / Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re)));
} else {
tmp = t_1 / t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) t_1 = math.sin((y_46_im * t_0)) t_2 = math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -0.0002: tmp = 1.0 / (t_2 / t_1) elif y_46_im <= 4.8e-10: tmp = math.sin((y_46_re * (math.atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * (1.0 / (1.0 / math.pow(math.hypot(x_46_re, x_46_im), y_46_re))) else: tmp = t_1 / t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_im * t_0)) t_2 = exp(y_46_im) ^ atan(x_46_im, x_46_re) tmp = 0.0 if (y_46_im <= -0.0002) tmp = Float64(1.0 / Float64(t_2 / t_1)); elseif (y_46_im <= 4.8e-10) tmp = Float64(sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re))))) * Float64(1.0 / Float64(1.0 / (hypot(x_46_re, x_46_im) ^ y_46_re)))); else tmp = Float64(t_1 / t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)); t_1 = sin((y_46_im * t_0)); t_2 = exp(y_46_im) ^ atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -0.0002) tmp = 1.0 / (t_2 / t_1); elseif (y_46_im <= 4.8e-10) tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * (1.0 / (1.0 / (hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = t_1 / t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -0.0002], N[(1.0 / N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.8e-10], N[(N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \sin \left(y.im \cdot t\_0\right)\\
t_2 := {\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -0.0002:\\
\;\;\;\;\frac{1}{\frac{t\_2}{t\_1}}\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;\sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right) \cdot \frac{1}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_2}\\
\end{array}
\end{array}
if y.im < -2.0000000000000001e-4Initial program 41.6%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod35.3%
fma-define35.3%
hypot-define54.4%
*-commutative54.4%
Simplified54.4%
associate-*l/54.4%
clear-num54.4%
add-sqr-sqrt1.5%
sqrt-unprod12.9%
sqr-neg12.9%
sqrt-unprod12.9%
add-sqr-sqrt12.9%
exp-prod19.1%
*-commutative19.1%
exp-prod20.6%
add-sqr-sqrt20.6%
sqrt-unprod20.6%
sqr-neg20.6%
sqrt-unprod10.9%
add-sqr-sqrt54.9%
*-commutative54.9%
Applied egg-rr54.9%
Taylor expanded in y.re around 0 34.5%
exp-prod38.4%
+-commutative38.4%
unpow238.4%
unpow238.4%
hypot-undefine59.1%
hypot-undefine38.4%
unpow238.4%
unpow238.4%
+-commutative38.4%
unpow238.4%
unpow238.4%
hypot-undefine59.1%
Simplified59.1%
if -2.0000000000000001e-4 < y.im < 4.8e-10Initial program 41.4%
exp-diff41.4%
exp-to-pow41.4%
hypot-define41.4%
*-commutative41.4%
exp-prod41.5%
fma-define41.5%
hypot-define92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y.re around inf 41.4%
+-commutative41.4%
associate-/l*41.4%
unpow241.4%
unpow241.4%
hypot-undefine92.1%
Simplified92.1%
clear-num92.2%
inv-pow92.2%
Applied egg-rr92.2%
unpow-192.2%
hypot-undefine64.1%
unpow264.1%
unpow264.1%
+-commutative64.1%
unpow264.1%
unpow264.1%
hypot-undefine92.2%
Simplified92.2%
Taylor expanded in y.im around 0 64.1%
+-commutative64.1%
unpow264.1%
unpow264.1%
hypot-define92.2%
Simplified92.2%
if 4.8e-10 < y.im Initial program 41.2%
exp-diff35.3%
exp-to-pow35.3%
hypot-define35.3%
*-commutative35.3%
exp-prod35.3%
fma-define35.3%
hypot-define62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in y.re around 0 35.5%
unpow235.5%
unpow235.5%
hypot-undefine62.6%
exp-prod66.6%
Simplified66.6%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (sin (* y.im t_0)))
(t_2 (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.im -0.048)
(/ 1.0 (/ t_2 t_1))
(if (<= y.im 1.35e-11)
(*
(sin (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re)))))
(pow (hypot x.im x.re) y.re))
(/ t_1 t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = sin((y_46_im * t_0));
double t_2 = pow(exp(y_46_im), atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -0.048) {
tmp = 1.0 / (t_2 / t_1);
} else if (y_46_im <= 1.35e-11) {
tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 / t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_1 = Math.sin((y_46_im * t_0));
double t_2 = Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -0.048) {
tmp = 1.0 / (t_2 / t_1);
} else if (y_46_im <= 1.35e-11) {
tmp = Math.sin((y_46_re * (Math.atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 / t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) t_1 = math.sin((y_46_im * t_0)) t_2 = math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -0.048: tmp = 1.0 / (t_2 / t_1) elif y_46_im <= 1.35e-11: tmp = math.sin((y_46_re * (math.atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_1 / t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_im * t_0)) t_2 = exp(y_46_im) ^ atan(x_46_im, x_46_re) tmp = 0.0 if (y_46_im <= -0.048) tmp = Float64(1.0 / Float64(t_2 / t_1)); elseif (y_46_im <= 1.35e-11) tmp = Float64(sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re))))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_1 / t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)); t_1 = sin((y_46_im * t_0)); t_2 = exp(y_46_im) ^ atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -0.048) tmp = 1.0 / (t_2 / t_1); elseif (y_46_im <= 1.35e-11) tmp = sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re))))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_1 / t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -0.048], N[(1.0 / N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.35e-11], N[(N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \sin \left(y.im \cdot t\_0\right)\\
t_2 := {\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -0.048:\\
\;\;\;\;\frac{1}{\frac{t\_2}{t\_1}}\\
\mathbf{elif}\;y.im \leq 1.35 \cdot 10^{-11}:\\
\;\;\;\;\sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_2}\\
\end{array}
\end{array}
if y.im < -0.048000000000000001Initial program 41.6%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod35.3%
fma-define35.3%
hypot-define54.4%
*-commutative54.4%
Simplified54.4%
associate-*l/54.4%
clear-num54.4%
add-sqr-sqrt1.5%
sqrt-unprod12.9%
sqr-neg12.9%
sqrt-unprod12.9%
add-sqr-sqrt12.9%
exp-prod19.1%
*-commutative19.1%
exp-prod20.6%
add-sqr-sqrt20.6%
sqrt-unprod20.6%
sqr-neg20.6%
sqrt-unprod10.9%
add-sqr-sqrt54.9%
*-commutative54.9%
Applied egg-rr54.9%
Taylor expanded in y.re around 0 34.5%
exp-prod38.4%
+-commutative38.4%
unpow238.4%
unpow238.4%
hypot-undefine59.1%
hypot-undefine38.4%
unpow238.4%
unpow238.4%
+-commutative38.4%
unpow238.4%
unpow238.4%
hypot-undefine59.1%
Simplified59.1%
if -0.048000000000000001 < y.im < 1.35000000000000002e-11Initial program 41.4%
exp-diff41.4%
exp-to-pow41.4%
hypot-define41.4%
*-commutative41.4%
exp-prod41.5%
fma-define41.5%
hypot-define92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y.re around inf 41.4%
+-commutative41.4%
associate-/l*41.4%
unpow241.4%
unpow241.4%
hypot-undefine92.1%
Simplified92.1%
Taylor expanded in y.im around 0 64.1%
unpow264.1%
unpow264.1%
hypot-undefine92.1%
Simplified92.1%
if 1.35000000000000002e-11 < y.im Initial program 41.2%
exp-diff35.3%
exp-to-pow35.3%
hypot-define35.3%
*-commutative35.3%
exp-prod35.3%
fma-define35.3%
hypot-define62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in y.re around 0 35.5%
unpow235.5%
unpow235.5%
hypot-undefine62.6%
exp-prod66.6%
Simplified66.6%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.49) (not (<= y.re 1.8e-107)))
(*
(pow (hypot x.im x.re) y.re)
(sin (* y.re (log1p (expm1 (atan2 x.im x.re))))))
(*
(exp (* y.im (- (atan2 x.im x.re))))
(sin (* 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 tmp;
if ((y_46_re <= -0.49) || !(y_46_re <= 1.8e-107)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_re * log1p(expm1(atan2(x_46_im, x_46_re)))));
} else {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * sin((y_46_im * log(hypot(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 <= -0.49) || !(y_46_re <= 1.8e-107)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((y_46_re * Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
} else {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * Math.log(Math.hypot(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 <= -0.49) or not (y_46_re <= 1.8e-107): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((y_46_re * math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) else: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * math.log(math.hypot(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 <= -0.49) || !(y_46_re <= 1.8e-107)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_re * log1p(expm1(atan(x_46_im, x_46_re)))))); else tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * sin(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_] := If[Or[LessEqual[y$46$re, -0.49], N[Not[LessEqual[y$46$re, 1.8e-107]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.49 \lor \neg \left(y.re \leq 1.8 \cdot 10^{-107}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -0.48999999999999999 or 1.79999999999999988e-107 < y.re Initial program 44.7%
exp-diff39.1%
exp-to-pow39.1%
hypot-define39.1%
*-commutative39.1%
exp-prod39.1%
fma-define39.1%
hypot-define69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in y.im around 0 64.8%
unpow264.8%
unpow264.8%
hypot-undefine66.8%
Simplified66.8%
log1p-expm1-u68.2%
Applied egg-rr68.2%
if -0.48999999999999999 < y.re < 1.79999999999999988e-107Initial program 37.3%
fmm-def37.3%
hypot-define37.3%
distribute-rgt-neg-out37.3%
fma-define37.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 31.3%
*-commutative31.3%
unpow231.3%
unpow231.3%
hypot-undefine70.2%
*-commutative70.2%
neg-mul-170.2%
distribute-rgt-neg-in70.2%
Simplified70.2%
Final simplification69.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.08) (not (<= y.re 1.8e-107)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(exp (* y.im (- (atan2 x.im x.re))))
(sin (* 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 tmp;
if ((y_46_re <= -0.08) || !(y_46_re <= 1.8e-107)) {
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 = exp((y_46_im * -atan2(x_46_im, x_46_re))) * sin((y_46_im * log(hypot(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 <= -0.08) || !(y_46_re <= 1.8e-107)) {
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 = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * Math.log(Math.hypot(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 <= -0.08) or not (y_46_re <= 1.8e-107): 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 = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * math.log(math.hypot(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 <= -0.08) || !(y_46_re <= 1.8e-107)) 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 = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * log(hypot(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 <= -0.08) || ~((y_46_re <= 1.8e-107))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * sin((y_46_im * log(hypot(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, -0.08], N[Not[LessEqual[y$46$re, 1.8e-107]], $MachinePrecision]], 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], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.08 \lor \neg \left(y.re \leq 1.8 \cdot 10^{-107}\right):\\
\;\;\;\;\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}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -0.0800000000000000017 or 1.79999999999999988e-107 < y.re Initial program 44.7%
exp-diff39.1%
exp-to-pow39.1%
hypot-define39.1%
*-commutative39.1%
exp-prod39.1%
fma-define39.1%
hypot-define69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in y.im around 0 64.8%
unpow264.8%
unpow264.8%
hypot-undefine66.8%
Simplified66.8%
if -0.0800000000000000017 < y.re < 1.79999999999999988e-107Initial program 37.3%
fmm-def37.3%
hypot-define37.3%
distribute-rgt-neg-out37.3%
fma-define37.3%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 31.3%
*-commutative31.3%
unpow231.3%
unpow231.3%
hypot-undefine70.2%
*-commutative70.2%
neg-mul-170.2%
distribute-rgt-neg-in70.2%
Simplified70.2%
Final simplification68.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.95e-32) (not (<= y.re 3.9e-199))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (log (pow (exp 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 tmp;
if ((y_46_re <= -3.95e-32) || !(y_46_re <= 3.9e-199)) {
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 = log(pow(exp(y_46_re), 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 <= -3.95e-32) || !(y_46_re <= 3.9e-199)) {
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 = Math.log(Math.pow(Math.exp(y_46_re), 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 <= -3.95e-32) or not (y_46_re <= 3.9e-199): 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 = math.log(math.pow(math.exp(y_46_re), 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 <= -3.95e-32) || !(y_46_re <= 3.9e-199)) 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 = log((exp(y_46_re) ^ 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 <= -3.95e-32) || ~((y_46_re <= 3.9e-199))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = log((exp(y_46_re) ^ 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, -3.95e-32], N[Not[LessEqual[y$46$re, 3.9e-199]], $MachinePrecision]], 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], N[Log[N[Power[N[Exp[y$46$re], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.95 \cdot 10^{-32} \lor \neg \left(y.re \leq 3.9 \cdot 10^{-199}\right):\\
\;\;\;\;\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}:\\
\;\;\;\;\log \left({\left(e^{y.re}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.re < -3.94999999999999991e-32 or 3.9000000000000001e-199 < y.re Initial program 44.1%
exp-diff39.4%
exp-to-pow39.4%
hypot-define39.4%
*-commutative39.4%
exp-prod39.4%
fma-define39.4%
hypot-define71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y.im around 0 56.6%
unpow256.6%
unpow256.6%
hypot-undefine59.6%
Simplified59.6%
if -3.94999999999999991e-32 < y.re < 3.9000000000000001e-199Initial program 36.2%
exp-diff36.2%
exp-to-pow36.2%
hypot-define36.2%
*-commutative36.2%
exp-prod35.9%
fma-define35.9%
hypot-define80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in y.im around 0 21.3%
unpow221.3%
unpow221.3%
hypot-undefine12.1%
Simplified12.1%
Taylor expanded in x.re around 0 6.8%
Taylor expanded in y.re around 0 12.1%
*-commutative12.1%
add-log-exp29.5%
*-commutative29.5%
exp-prod29.5%
Applied egg-rr29.5%
Final simplification49.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (expm1 t_0)) (t_2 (sin t_0)))
(if (<= y.re -1.22e-22)
(* t_2 (pow x.re y.re))
(if (<= y.re 1.2e-199)
(log (+ 1.0 t_1))
(if (<= y.re 1e+48) (log1p t_1) (* t_2 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = expm1(t_0);
double t_2 = sin(t_0);
double tmp;
if (y_46_re <= -1.22e-22) {
tmp = t_2 * pow(x_46_re, y_46_re);
} else if (y_46_re <= 1.2e-199) {
tmp = log((1.0 + t_1));
} else if (y_46_re <= 1e+48) {
tmp = log1p(t_1);
} else {
tmp = t_2 * 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.expm1(t_0);
double t_2 = Math.sin(t_0);
double tmp;
if (y_46_re <= -1.22e-22) {
tmp = t_2 * Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 1.2e-199) {
tmp = Math.log((1.0 + t_1));
} else if (y_46_re <= 1e+48) {
tmp = Math.log1p(t_1);
} else {
tmp = t_2 * 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 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.expm1(t_0) t_2 = math.sin(t_0) tmp = 0 if y_46_re <= -1.22e-22: tmp = t_2 * math.pow(x_46_re, y_46_re) elif y_46_re <= 1.2e-199: tmp = math.log((1.0 + t_1)) elif y_46_re <= 1e+48: tmp = math.log1p(t_1) else: tmp = t_2 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = expm1(t_0) t_2 = sin(t_0) tmp = 0.0 if (y_46_re <= -1.22e-22) tmp = Float64(t_2 * (x_46_re ^ y_46_re)); elseif (y_46_re <= 1.2e-199) tmp = log(Float64(1.0 + t_1)); elseif (y_46_re <= 1e+48) tmp = log1p(t_1); else tmp = Float64(t_2 * (x_46_im ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Exp[t$95$0] - 1), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -1.22e-22], N[(t$95$2 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-199], N[Log[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1e+48], N[Log[1 + t$95$1], $MachinePrecision], N[(t$95$2 * N[Power[x$46$im, 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 := \mathsf{expm1}\left(t\_0\right)\\
t_2 := \sin t\_0\\
\mathbf{if}\;y.re \leq -1.22 \cdot 10^{-22}:\\
\;\;\;\;t\_2 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-199}:\\
\;\;\;\;\log \left(1 + t\_1\right)\\
\mathbf{elif}\;y.re \leq 10^{+48}:\\
\;\;\;\;\mathsf{log1p}\left(t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.2200000000000001e-22Initial program 47.8%
exp-diff39.1%
exp-to-pow39.1%
hypot-define39.1%
*-commutative39.1%
exp-prod39.1%
fma-define39.1%
hypot-define72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in y.im around 0 75.7%
unpow275.7%
unpow275.7%
hypot-undefine77.1%
Simplified77.1%
Taylor expanded in x.im around 0 62.7%
if -1.2200000000000001e-22 < y.re < 1.19999999999999998e-199Initial program 36.9%
exp-diff36.9%
exp-to-pow36.9%
hypot-define36.9%
*-commutative36.9%
exp-prod36.6%
fma-define36.6%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y.im around 0 21.1%
unpow221.1%
unpow221.1%
hypot-undefine12.0%
Simplified12.0%
Taylor expanded in x.re around 0 6.8%
Taylor expanded in y.re around 0 12.0%
*-commutative12.0%
log1p-expm1-u12.0%
log1p-undefine29.2%
Applied egg-rr29.2%
if 1.19999999999999998e-199 < y.re < 1.00000000000000004e48Initial program 38.5%
exp-diff38.5%
exp-to-pow38.5%
hypot-define38.5%
*-commutative38.5%
exp-prod38.5%
fma-define38.5%
hypot-define75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y.im around 0 27.8%
unpow227.8%
unpow227.8%
hypot-undefine35.2%
Simplified35.2%
Taylor expanded in x.re around 0 16.7%
Taylor expanded in y.re around 0 23.4%
*-commutative23.4%
log1p-expm1-u31.8%
Applied egg-rr31.8%
if 1.00000000000000004e48 < y.re Initial program 44.2%
exp-diff39.5%
exp-to-pow39.5%
hypot-define39.5%
*-commutative39.5%
exp-prod39.5%
fma-define39.5%
hypot-define62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in y.im around 0 65.2%
unpow265.2%
unpow265.2%
hypot-undefine65.2%
Simplified65.2%
Taylor expanded in x.re around 0 60.9%
Final simplification44.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (expm1 t_0))
(t_2 (* (sin t_0) (pow x.im y.re))))
(if (<= y.re -1.8e+153)
t_2
(if (<= y.re 2.5e-200)
(log (+ 1.0 t_1))
(if (<= y.re 1.3e+52) (log1p t_1) t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = expm1(t_0);
double t_2 = sin(t_0) * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.8e+153) {
tmp = t_2;
} else if (y_46_re <= 2.5e-200) {
tmp = log((1.0 + t_1));
} else if (y_46_re <= 1.3e+52) {
tmp = log1p(t_1);
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.expm1(t_0);
double t_2 = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.8e+153) {
tmp = t_2;
} else if (y_46_re <= 2.5e-200) {
tmp = Math.log((1.0 + t_1));
} else if (y_46_re <= 1.3e+52) {
tmp = Math.log1p(t_1);
} else {
tmp = t_2;
}
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.expm1(t_0) t_2 = math.sin(t_0) * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -1.8e+153: tmp = t_2 elif y_46_re <= 2.5e-200: tmp = math.log((1.0 + t_1)) elif y_46_re <= 1.3e+52: tmp = math.log1p(t_1) else: tmp = t_2 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 = expm1(t_0) t_2 = Float64(sin(t_0) * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.8e+153) tmp = t_2; elseif (y_46_re <= 2.5e-200) tmp = log(Float64(1.0 + t_1)); elseif (y_46_re <= 1.3e+52) tmp = log1p(t_1); else tmp = t_2; 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[(Exp[t$95$0] - 1), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e+153], t$95$2, If[LessEqual[y$46$re, 2.5e-200], N[Log[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.3e+52], N[Log[1 + t$95$1], $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \mathsf{expm1}\left(t\_0\right)\\
t_2 := \sin t\_0 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-200}:\\
\;\;\;\;\log \left(1 + t\_1\right)\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{log1p}\left(t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.8e153 or 1.3e52 < y.re Initial program 44.9%
exp-diff37.2%
exp-to-pow37.2%
hypot-define37.2%
*-commutative37.2%
exp-prod37.2%
fma-define37.2%
hypot-define62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in y.im around 0 71.9%
unpow271.9%
unpow271.9%
hypot-undefine71.9%
Simplified71.9%
Taylor expanded in x.re around 0 58.1%
if -1.8e153 < y.re < 2.49999999999999996e-200Initial program 40.6%
exp-diff38.9%
exp-to-pow38.9%
hypot-define38.9%
*-commutative38.9%
exp-prod38.7%
fma-define38.7%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 35.2%
unpow235.2%
unpow235.2%
hypot-undefine29.4%
Simplified29.4%
Taylor expanded in x.re around 0 15.8%
Taylor expanded in y.re around 0 13.5%
*-commutative13.5%
log1p-expm1-u15.0%
log1p-undefine32.0%
Applied egg-rr32.0%
if 2.49999999999999996e-200 < y.re < 1.3e52Initial program 38.5%
exp-diff38.5%
exp-to-pow38.5%
hypot-define38.5%
*-commutative38.5%
exp-prod38.5%
fma-define38.5%
hypot-define75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y.im around 0 27.8%
unpow227.8%
unpow227.8%
hypot-undefine35.2%
Simplified35.2%
Taylor expanded in x.re around 0 16.7%
Taylor expanded in y.re around 0 23.4%
*-commutative23.4%
log1p-expm1-u31.8%
Applied egg-rr31.8%
Final simplification39.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (expm1 t_0))
(t_2 (* t_0 (pow x.im y.re))))
(if (<= y.re -1.75e+152)
t_2
(if (<= y.re 7e-201)
(log (+ 1.0 t_1))
(if (<= y.re 4.1e+15) (log1p t_1) t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = expm1(t_0);
double t_2 = t_0 * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.75e+152) {
tmp = t_2;
} else if (y_46_re <= 7e-201) {
tmp = log((1.0 + t_1));
} else if (y_46_re <= 4.1e+15) {
tmp = log1p(t_1);
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.expm1(t_0);
double t_2 = t_0 * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.75e+152) {
tmp = t_2;
} else if (y_46_re <= 7e-201) {
tmp = Math.log((1.0 + t_1));
} else if (y_46_re <= 4.1e+15) {
tmp = Math.log1p(t_1);
} else {
tmp = t_2;
}
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.expm1(t_0) t_2 = t_0 * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -1.75e+152: tmp = t_2 elif y_46_re <= 7e-201: tmp = math.log((1.0 + t_1)) elif y_46_re <= 4.1e+15: tmp = math.log1p(t_1) else: tmp = t_2 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 = expm1(t_0) t_2 = Float64(t_0 * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.75e+152) tmp = t_2; elseif (y_46_re <= 7e-201) tmp = log(Float64(1.0 + t_1)); elseif (y_46_re <= 4.1e+15) tmp = log1p(t_1); else tmp = t_2; 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[(Exp[t$95$0] - 1), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.75e+152], t$95$2, If[LessEqual[y$46$re, 7e-201], N[Log[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 4.1e+15], N[Log[1 + t$95$1], $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \mathsf{expm1}\left(t\_0\right)\\
t_2 := t\_0 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.75 \cdot 10^{+152}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{-201}:\\
\;\;\;\;\log \left(1 + t\_1\right)\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{log1p}\left(t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.74999999999999991e152 or 4.1e15 < y.re Initial program 41.7%
exp-diff34.5%
exp-to-pow34.5%
hypot-define34.5%
*-commutative34.5%
exp-prod34.5%
fma-define34.5%
hypot-define60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in y.im around 0 68.0%
unpow268.0%
unpow268.0%
hypot-undefine68.0%
Simplified68.0%
Taylor expanded in x.re around 0 55.2%
Taylor expanded in y.re around 0 31.2%
Taylor expanded in y.re around 0 45.7%
if -1.74999999999999991e152 < y.re < 7.00000000000000016e-201Initial program 40.6%
exp-diff38.9%
exp-to-pow38.9%
hypot-define38.9%
*-commutative38.9%
exp-prod38.7%
fma-define38.7%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 35.2%
unpow235.2%
unpow235.2%
hypot-undefine29.4%
Simplified29.4%
Taylor expanded in x.re around 0 15.8%
Taylor expanded in y.re around 0 13.5%
*-commutative13.5%
log1p-expm1-u15.0%
log1p-undefine32.0%
Applied egg-rr32.0%
if 7.00000000000000016e-201 < y.re < 4.1e15Initial program 43.0%
exp-diff43.0%
exp-to-pow43.1%
hypot-define43.1%
*-commutative43.1%
exp-prod43.1%
fma-define43.1%
hypot-define80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in y.im around 0 29.1%
unpow229.1%
unpow229.1%
hypot-undefine37.4%
Simplified37.4%
Taylor expanded in x.re around 0 16.6%
Taylor expanded in y.re around 0 25.9%
*-commutative25.9%
log1p-expm1-u31.6%
Applied egg-rr31.6%
Final simplification36.4%
(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 -2.9e+42) (not (<= y.re 7600.0)))
(* t_0 (pow x.im y.re))
(cbrt (pow t_0 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 tmp;
if ((y_46_re <= -2.9e+42) || !(y_46_re <= 7600.0)) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = cbrt(pow(t_0, 3.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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -2.9e+42) || !(y_46_re <= 7600.0)) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.cbrt(Math.pow(t_0, 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)) tmp = 0.0 if ((y_46_re <= -2.9e+42) || !(y_46_re <= 7600.0)) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = cbrt((t_0 ^ 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]}, If[Or[LessEqual[y$46$re, -2.9e+42], N[Not[LessEqual[y$46$re, 7600.0]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $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.9 \cdot 10^{+42} \lor \neg \left(y.re \leq 7600\right):\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\end{array}
\end{array}
if y.re < -2.89999999999999981e42 or 7600 < y.re Initial program 42.0%
exp-diff34.8%
exp-to-pow34.8%
hypot-define34.8%
*-commutative34.8%
exp-prod34.8%
fma-define34.8%
hypot-define63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
unpow269.8%
hypot-undefine69.8%
Simplified69.8%
Taylor expanded in x.re around 0 51.4%
Taylor expanded in y.re around 0 31.5%
Taylor expanded in y.re around 0 44.2%
if -2.89999999999999981e42 < y.re < 7600Initial program 41.0%
exp-diff41.0%
exp-to-pow41.0%
hypot-define41.0%
*-commutative41.0%
exp-prod40.8%
fma-define40.8%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 25.2%
unpow225.2%
unpow225.2%
hypot-undefine23.3%
Simplified23.3%
Taylor expanded in x.re around 0 11.4%
Taylor expanded in y.re around 0 18.0%
*-commutative18.0%
add-cbrt-cube25.8%
pow325.8%
Applied egg-rr25.8%
Final simplification33.8%
(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 -235000000.0) (not (<= y.re 4.2e+15)))
(* t_0 (pow x.im y.re))
(log1p (expm1 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 <= -235000000.0) || !(y_46_re <= 4.2e+15)) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = log1p(expm1(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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -235000000.0) || !(y_46_re <= 4.2e+15)) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.log1p(Math.expm1(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 <= -235000000.0) or not (y_46_re <= 4.2e+15): tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = math.log1p(math.expm1(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 <= -235000000.0) || !(y_46_re <= 4.2e+15)) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = log1p(expm1(t_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]}, If[Or[LessEqual[y$46$re, -235000000.0], N[Not[LessEqual[y$46$re, 4.2e+15]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[t$95$0] - 1), $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 -235000000 \lor \neg \left(y.re \leq 4.2 \cdot 10^{+15}\right):\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -2.35e8 or 4.2e15 < y.re Initial program 44.6%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in y.im around 0 71.6%
unpow271.6%
unpow271.6%
hypot-undefine71.6%
Simplified71.6%
Taylor expanded in x.re around 0 52.3%
Taylor expanded in y.re around 0 34.2%
Taylor expanded in y.re around 0 45.1%
if -2.35e8 < y.re < 4.2e15Initial program 38.9%
exp-diff38.9%
exp-to-pow38.9%
hypot-define38.9%
*-commutative38.9%
exp-prod38.8%
fma-define38.8%
hypot-define79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in y.im around 0 23.9%
unpow223.9%
unpow223.9%
hypot-undefine21.9%
Simplified21.9%
Taylor expanded in x.re around 0 10.7%
Taylor expanded in y.re around 0 17.2%
*-commutative17.2%
log1p-expm1-u19.2%
Applied egg-rr19.2%
Final simplification30.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 7.4e+136) (* (* y.re (atan2 x.im x.re)) (pow x.im y.re)) (* y.re (log (exp (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 (x_46_re <= 7.4e+136) {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * pow(x_46_im, y_46_re);
} else {
tmp = y_46_re * log(exp(atan2(x_46_im, x_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) :: tmp
if (x_46re <= 7.4d+136) then
tmp = (y_46re * atan2(x_46im, x_46re)) * (x_46im ** y_46re)
else
tmp = y_46re * log(exp(atan2(x_46im, x_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 tmp;
if (x_46_re <= 7.4e+136) {
tmp = (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(x_46_im, y_46_re);
} else {
tmp = y_46_re * Math.log(Math.exp(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 x_46_re <= 7.4e+136: tmp = (y_46_re * math.atan2(x_46_im, x_46_re)) * math.pow(x_46_im, y_46_re) else: tmp = y_46_re * math.log(math.exp(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 (x_46_re <= 7.4e+136) tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (x_46_im ^ y_46_re)); else tmp = Float64(y_46_re * log(exp(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 (x_46_re <= 7.4e+136) tmp = (y_46_re * atan2(x_46_im, x_46_re)) * (x_46_im ^ y_46_re); else tmp = y_46_re * log(exp(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[LessEqual[x$46$re, 7.4e+136], N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[Log[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 7.4 \cdot 10^{+136}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \log \left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if x.re < 7.4000000000000002e136Initial program 46.7%
exp-diff43.1%
exp-to-pow43.1%
hypot-define43.1%
*-commutative43.1%
exp-prod43.0%
fma-define43.0%
hypot-define73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in y.im around 0 45.0%
unpow245.0%
unpow245.0%
hypot-undefine43.6%
Simplified43.6%
Taylor expanded in x.re around 0 31.7%
Taylor expanded in y.re around 0 22.2%
Taylor expanded in y.re around 0 28.1%
if 7.4000000000000002e136 < x.re Initial program 6.0%
exp-diff6.0%
exp-to-pow6.0%
hypot-define6.0%
*-commutative6.0%
exp-prod6.0%
fma-define6.0%
hypot-define76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in y.im around 0 43.0%
unpow243.0%
unpow243.0%
hypot-undefine43.9%
Simplified43.9%
Taylor expanded in x.re around 0 10.0%
Taylor expanded in y.re around 0 20.9%
add-log-exp41.2%
Applied egg-rr41.2%
(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 -1050.0) (not (<= y.re 0.8)))
(* 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 <= -1050.0) || !(y_46_re <= 0.8)) {
tmp = 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 <= (-1050.0d0)) .or. (.not. (y_46re <= 0.8d0))) then
tmp = 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 <= -1050.0) || !(y_46_re <= 0.8)) {
tmp = 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 <= -1050.0) or not (y_46_re <= 0.8): tmp = 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 <= -1050.0) || !(y_46_re <= 0.8)) tmp = Float64(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 <= -1050.0) || ~((y_46_re <= 0.8))) tmp = 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, -1050.0], N[Not[LessEqual[y$46$re, 0.8]], $MachinePrecision]], N[(t$95$0 * 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 -1050 \lor \neg \left(y.re \leq 0.8\right):\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1050 or 0.80000000000000004 < y.re Initial program 42.5%
exp-diff35.8%
exp-to-pow35.8%
hypot-define35.8%
*-commutative35.8%
exp-prod35.8%
fma-define35.8%
hypot-define65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y.im around 0 70.1%
unpow270.1%
unpow270.1%
hypot-undefine70.1%
Simplified70.1%
Taylor expanded in x.re around 0 50.5%
Taylor expanded in y.re around 0 32.8%
Taylor expanded in y.re around 0 43.8%
if -1050 < y.re < 0.80000000000000004Initial program 40.5%
exp-diff40.5%
exp-to-pow40.5%
hypot-define40.5%
*-commutative40.5%
exp-prod40.3%
fma-define40.3%
hypot-define81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in y.im around 0 22.3%
unpow222.3%
unpow222.3%
hypot-undefine20.3%
Simplified20.3%
Taylor expanded in x.re around 0 9.9%
Taylor expanded in y.re around 0 18.1%
Final simplification30.1%
(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 41.4%
exp-diff38.3%
exp-to-pow38.3%
hypot-define38.3%
*-commutative38.3%
exp-prod38.2%
fma-define38.2%
hypot-define74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around 0 44.7%
unpow244.7%
unpow244.7%
hypot-undefine43.6%
Simplified43.6%
Taylor expanded in x.re around 0 28.9%
Taylor expanded in y.re around 0 12.7%
herbie shell --seed 2024139
(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)))))