
(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 (* y.re (atan2 x.im x.re)))
(t_1 (sin (fma (log (hypot x.re x.im)) y.im t_0)))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(t_4 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -1.5)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.re 2.45e-24)
(* t_1 t_4)
(if (<= y.re 1.8e+48)
(* t_3 (sin t_0))
(if (<= y.re 9.2e+61)
(* y.re (* (atan2 x.im x.re) t_4))
(* t_1 (/ (pow (hypot x.re x.im) y.re) (+ 1.0 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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.5) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 2.45e-24) {
tmp = t_1 * t_4;
} else if (y_46_re <= 1.8e+48) {
tmp = t_3 * sin(t_0);
} else if (y_46_re <= 9.2e+61) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * t_4);
} else {
tmp = t_1 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + 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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) t_4 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -1.5) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_re <= 2.45e-24) tmp = Float64(t_1 * t_4); elseif (y_46_re <= 1.8e+48) tmp = Float64(t_3 * sin(t_0)); elseif (y_46_re <= 9.2e+61) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * t_4)); else tmp = Float64(t_1 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + 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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.5], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.45e-24], N[(t$95$1 * t$95$4), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+48], N[(t$95$3 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.2e+61], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
t_4 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -1.5:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{-24}:\\
\;\;\;\;t\_1 \cdot t\_4\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+48}:\\
\;\;\;\;t\_3 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{+61}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_2}\\
\end{array}
\end{array}
if y.re < -1.5Initial program 52.1%
Taylor expanded in y.re around 0 56.3%
unpow256.3%
unpow256.3%
hypot-undefine87.3%
Simplified87.3%
if -1.5 < y.re < 2.45e-24Initial program 35.5%
exp-diff35.5%
exp-to-pow35.5%
hypot-define35.5%
*-commutative35.5%
exp-prod35.4%
fma-define35.4%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.re around 0 78.2%
rec-exp78.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
if 2.45e-24 < y.re < 1.79999999999999992e48Initial program 59.9%
Taylor expanded in y.im around 0 86.8%
if 1.79999999999999992e48 < y.re < 9.1999999999999998e61Initial program 0.0%
Taylor expanded in y.im around 0 1.0%
Taylor expanded in y.re around 0 67.8%
*-commutative67.8%
distribute-lft-neg-in67.8%
Simplified67.8%
if 9.1999999999999998e61 < y.re Initial program 31.4%
exp-diff21.6%
exp-to-pow21.6%
hypot-define21.6%
*-commutative21.6%
exp-prod17.6%
fma-define17.6%
hypot-define39.2%
*-commutative39.2%
Simplified39.2%
Taylor expanded in y.im around 0 66.8%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 40.3%
fma-neg40.3%
hypot-define40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define77.5%
*-commutative77.5%
Simplified77.5%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_3 (* y.im (log (hypot x.im x.re)))))
(if (<= y.im -1.8e+23)
(* t_2 (sin (+ (fabs t_3) t_1)))
(if (<= y.im 3.65e-32)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_1))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)))
(if (<= y.im 2.5e+114)
(* t_2 (sin t_3))
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_3 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -1.8e+23) {
tmp = t_2 * sin((fabs(t_3) + t_1));
} else if (y_46_im <= 3.65e-32) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0));
} else if (y_46_im <= 2.5e+114) {
tmp = t_2 * sin(t_3);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) t_3 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -1.8e+23) tmp = Float64(t_2 * sin(Float64(abs(t_3) + t_1))); elseif (y_46_im <= 3.65e-32) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0))); elseif (y_46_im <= 2.5e+114) tmp = Float64(t_2 * sin(t_3)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.8e+23], N[(t$95$2 * N[Sin[N[(N[Abs[t$95$3], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.65e-32], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.5e+114], N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
t_3 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left|t\_3\right| + t\_1\right)\\
\mathbf{elif}\;y.im \leq 3.65 \cdot 10^{-32}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0}\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+114}:\\
\;\;\;\;t\_2 \cdot \sin t\_3\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -1.7999999999999999e23Initial program 37.6%
add-sqr-sqrt12.1%
sqrt-unprod16.9%
pow216.9%
*-commutative16.9%
hypot-define30.7%
Applied egg-rr30.7%
unpow230.7%
rem-sqrt-square62.0%
hypot-undefine41.2%
unpow241.2%
unpow241.2%
+-commutative41.2%
unpow241.2%
unpow241.2%
hypot-undefine62.0%
Simplified62.0%
if -1.7999999999999999e23 < y.im < 3.65000000000000024e-32Initial program 41.4%
exp-diff40.6%
exp-to-pow40.6%
hypot-define40.6%
*-commutative40.6%
exp-prod40.6%
fma-define40.6%
hypot-define88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in y.im around 0 90.3%
if 3.65000000000000024e-32 < y.im < 2.5e114Initial program 41.9%
Taylor expanded in y.re around 0 48.4%
unpow248.4%
unpow248.4%
hypot-undefine64.8%
Simplified64.8%
if 2.5e114 < y.im Initial program 39.6%
Taylor expanded in y.im around 0 58.9%
Taylor expanded in y.re around 0 71.2%
*-commutative71.2%
distribute-lft-neg-in71.2%
exp-prod73.5%
Simplified73.5%
Final simplification78.0%
(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 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(t_4 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -1.5)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.re 2.45e-24)
(* (sin (fma t_0 y.im t_1)) t_4)
(if (<= y.re 1.8e+48)
(* t_3 (sin t_1))
(if (<= y.re 9.2e+61)
(* y.re (* (atan2 x.im x.re) t_4))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_2))
(sin (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re))))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.5) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 2.45e-24) {
tmp = sin(fma(t_0, y_46_im, t_1)) * t_4;
} else if (y_46_re <= 1.8e+48) {
tmp = t_3 * sin(t_1);
} else if (y_46_re <= 9.2e+61) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * t_4);
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_2)) * sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) t_4 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -1.5) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_re <= 2.45e-24) tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * t_4); elseif (y_46_re <= 1.8e+48) tmp = Float64(t_3 * sin(t_1)); elseif (y_46_re <= 9.2e+61) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * t_4)); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_2)) * sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.5], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.45e-24], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[y$46$re, 1.8e+48], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.2e+61], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] * 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]), $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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
t_4 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -1.5:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{-24}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right) \cdot t\_4\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{+48}:\\
\;\;\;\;t\_3 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{+61}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_2} \cdot \sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right)\\
\end{array}
\end{array}
if y.re < -1.5Initial program 52.1%
Taylor expanded in y.re around 0 56.3%
unpow256.3%
unpow256.3%
hypot-undefine87.3%
Simplified87.3%
if -1.5 < y.re < 2.45e-24Initial program 35.5%
exp-diff35.5%
exp-to-pow35.5%
hypot-define35.5%
*-commutative35.5%
exp-prod35.4%
fma-define35.4%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.re around 0 78.2%
rec-exp78.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
if 2.45e-24 < y.re < 1.79999999999999992e48Initial program 59.9%
Taylor expanded in y.im around 0 86.8%
if 1.79999999999999992e48 < y.re < 9.1999999999999998e61Initial program 0.0%
Taylor expanded in y.im around 0 1.0%
Taylor expanded in y.re around 0 67.8%
*-commutative67.8%
distribute-lft-neg-in67.8%
Simplified67.8%
if 9.1999999999999998e61 < y.re Initial program 31.4%
exp-diff21.6%
exp-to-pow21.6%
hypot-define21.6%
*-commutative21.6%
exp-prod17.6%
fma-define17.6%
hypot-define39.2%
*-commutative39.2%
Simplified39.2%
Taylor expanded in y.im around 0 66.8%
Taylor expanded in y.re around inf 35.3%
+-commutative35.3%
associate-/l*35.3%
+-commutative35.3%
unpow235.3%
unpow235.3%
hypot-undefine66.8%
Simplified66.8%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (sin (fma (log (hypot x.re x.im)) y.im t_1))))
(if (<= y.im -5.4e+171)
(* t_3 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.im -3.5e+22)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(if (<= y.im 3.65e-32)
(* t_3 (pow (hypot x.im x.re) y.re))
(if (<= y.im 2.4e+99)
(/ (* t_2 (pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re)) t_0)
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
double tmp;
if (y_46_im <= -5.4e+171) {
tmp = t_3 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_im <= -3.5e+22) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else if (y_46_im <= 3.65e-32) {
tmp = t_3 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 2.4e+99) {
tmp = (t_2 * pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re)) / t_0;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) tmp = 0.0 if (y_46_im <= -5.4e+171) tmp = Float64(t_3 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_im <= -3.5e+22) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_2); elseif (y_46_im <= 3.65e-32) tmp = Float64(t_3 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 2.4e+99) tmp = Float64(Float64(t_2 * (sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re)) / t_0); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -5.4e+171], N[(t$95$3 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.5e+22], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 3.65e-32], N[(t$95$3 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.4e+99], N[(N[(t$95$2 * N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right)\\
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{+171}:\\
\;\;\;\;t\_3 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_2\\
\mathbf{elif}\;y.im \leq 3.65 \cdot 10^{-32}:\\
\;\;\;\;t\_3 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 2.4 \cdot 10^{+99}:\\
\;\;\;\;\frac{t\_2 \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -5.3999999999999996e171Initial program 42.9%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod28.6%
fma-define28.6%
hypot-define43.1%
*-commutative43.1%
Simplified43.1%
Taylor expanded in y.re around 0 68.1%
rec-exp68.1%
distribute-rgt-neg-in68.1%
Simplified68.1%
if -5.3999999999999996e171 < y.im < -3.5e22Initial program 32.7%
Taylor expanded in y.im around 0 58.7%
if -3.5e22 < y.im < 3.65000000000000024e-32Initial program 41.4%
exp-diff40.6%
exp-to-pow40.6%
hypot-define40.6%
*-commutative40.6%
exp-prod40.6%
fma-define40.6%
hypot-define88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in y.im around 0 62.7%
unpow262.7%
unpow262.7%
hypot-undefine89.0%
Simplified89.0%
if 3.65000000000000024e-32 < y.im < 2.4000000000000001e99Initial program 42.9%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod17.9%
fma-define17.9%
hypot-define32.4%
*-commutative32.4%
Simplified32.4%
Taylor expanded in y.im around 0 41.3%
Taylor expanded in y.im around 0 51.8%
Taylor expanded in y.im around inf 65.4%
if 2.4000000000000001e99 < y.im Initial program 39.2%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 68.7%
*-commutative68.7%
distribute-lft-neg-in68.7%
exp-prod70.8%
Simplified70.8%
Final simplification77.3%
(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 (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0)))
(t_2 (sin (fma (log (hypot x.re x.im)) y.im t_0))))
(if (<= y.im -2.85e+171)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.im -3.5e+22)
t_1
(if (<= y.im 4.8e+19)
(* t_2 (pow (hypot x.im x.re) y.re))
(if (<= y.im 1.5e+108)
t_1
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
double t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
double tmp;
if (y_46_im <= -2.85e+171) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_im <= -3.5e+22) {
tmp = t_1;
} else if (y_46_im <= 4.8e+19) {
tmp = t_2 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 1.5e+108) {
tmp = t_1;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)) t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) tmp = 0.0 if (y_46_im <= -2.85e+171) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_im <= -3.5e+22) tmp = t_1; elseif (y_46_im <= 4.8e+19) tmp = Float64(t_2 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 1.5e+108) tmp = t_1; else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(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[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2.85e+171], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.5e+22], t$95$1, If[LessEqual[y$46$im, 4.8e+19], N[(t$95$2 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.5e+108], t$95$1, N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $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(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_0\\
t_2 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
\mathbf{if}\;y.im \leq -2.85 \cdot 10^{+171}:\\
\;\;\;\;t\_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{+19}:\\
\;\;\;\;t\_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -2.85e171Initial program 42.9%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod28.6%
fma-define28.6%
hypot-define43.1%
*-commutative43.1%
Simplified43.1%
Taylor expanded in y.re around 0 68.1%
rec-exp68.1%
distribute-rgt-neg-in68.1%
Simplified68.1%
if -2.85e171 < y.im < -3.5e22 or 4.8e19 < y.im < 1.49999999999999992e108Initial program 39.2%
Taylor expanded in y.im around 0 63.4%
if -3.5e22 < y.im < 4.8e19Initial program 40.7%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod39.2%
fma-define39.2%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in y.im around 0 62.4%
unpow262.4%
unpow262.4%
hypot-undefine86.6%
Simplified86.6%
if 1.49999999999999992e108 < y.im Initial program 38.7%
Taylor expanded in y.im around 0 57.5%
Taylor expanded in y.re around 0 69.5%
*-commutative69.5%
distribute-lft-neg-in69.5%
exp-prod71.8%
Simplified71.8%
Final simplification77.2%
(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 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2)))
(t_4 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -1.5)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.re 2.45e-24)
(* (sin (fma (log (hypot x.re x.im)) y.im t_0)) t_4)
(if (<= y.re 1.6e+48)
(* t_3 t_1)
(if (<= y.re 7.1e+71)
(* y.re (* (atan2 x.im x.re) t_4))
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_2)) t_1)))))))
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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2));
double t_4 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.5) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 2.45e-24) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_4;
} else if (y_46_re <= 1.6e+48) {
tmp = t_3 * t_1;
} else if (y_46_re <= 7.1e+71) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * t_4);
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_2)) * t_1;
}
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 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) t_4 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -1.5) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_re <= 2.45e-24) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_4); elseif (y_46_re <= 1.6e+48) tmp = Float64(t_3 * t_1); elseif (y_46_re <= 7.1e+71) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * t_4)); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_2)) * t_1); 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.5], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.45e-24], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[y$46$re, 1.6e+48], N[(t$95$3 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 7.1e+71], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]]]]
\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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2}\\
t_4 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -1.5:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{-24}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot t\_4\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+48}:\\
\;\;\;\;t\_3 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 7.1 \cdot 10^{+71}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_2} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.5Initial program 52.1%
Taylor expanded in y.re around 0 56.3%
unpow256.3%
unpow256.3%
hypot-undefine87.3%
Simplified87.3%
if -1.5 < y.re < 2.45e-24Initial program 35.5%
exp-diff35.5%
exp-to-pow35.5%
hypot-define35.5%
*-commutative35.5%
exp-prod35.4%
fma-define35.4%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.re around 0 78.2%
rec-exp78.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
if 2.45e-24 < y.re < 1.6000000000000001e48Initial program 59.9%
Taylor expanded in y.im around 0 86.8%
if 1.6000000000000001e48 < y.re < 7.09999999999999986e71Initial program 0.0%
Taylor expanded in y.im around 0 0.8%
Taylor expanded in y.re around 0 51.3%
*-commutative51.3%
distribute-lft-neg-in51.3%
Simplified51.3%
if 7.09999999999999986e71 < y.re Initial program 32.0%
exp-diff22.0%
exp-to-pow22.0%
hypot-define22.0%
*-commutative22.0%
exp-prod18.0%
fma-define18.0%
hypot-define38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in y.im around 0 66.1%
Taylor expanded in y.im around 0 64.1%
Final simplification78.1%
(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 (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))))
(if (<= y.im -3.5e+22)
t_1
(if (<= y.im 3.6e+19)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(if (<= y.im 1.95e+109)
t_1
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
double tmp;
if (y_46_im <= -3.5e+22) {
tmp = t_1;
} else if (y_46_im <= 3.6e+19) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 1.95e+109) {
tmp = t_1;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)) tmp = 0.0 if (y_46_im <= -3.5e+22) tmp = t_1; elseif (y_46_im <= 3.6e+19) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 1.95e+109) tmp = t_1; else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(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[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 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$im, -3.5e+22], t$95$1, If[LessEqual[y$46$im, 3.6e+19], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.95e+109], t$95$1, N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $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(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_0\\
\mathbf{if}\;y.im \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 3.6 \cdot 10^{+19}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.95 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -3.5e22 or 3.6e19 < y.im < 1.95000000000000008e109Initial program 40.4%
Taylor expanded in y.im around 0 57.8%
if -3.5e22 < y.im < 3.6e19Initial program 40.7%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod39.2%
fma-define39.2%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in y.im around 0 62.4%
unpow262.4%
unpow262.4%
hypot-undefine86.6%
Simplified86.6%
if 1.95000000000000008e109 < y.im Initial program 38.7%
Taylor expanded in y.im around 0 57.5%
Taylor expanded in y.re around 0 69.5%
*-commutative69.5%
distribute-lft-neg-in69.5%
exp-prod71.8%
Simplified71.8%
Final simplification74.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_1))
(t_3 (pow (hypot x.re x.im) y.re))
(t_4 (* (/ t_3 (+ 1.0 t_0)) (sin (* (log (hypot x.re x.im)) y.im)))))
(if (<= y.im -1750000.0)
t_2
(if (<= y.im -4.2e-177)
t_4
(if (<= y.im 9.5e-211)
(* t_3 t_1)
(if (<= y.im 7.2e+19)
t_4
(if (<= y.im 1.2e+111)
t_2
(*
y.re
(*
(atan2 x.im x.re)
(pow (exp (- y.im)) (atan2 x.im x.re)))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
double t_3 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_4 = (t_3 / (1.0 + t_0)) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_im <= -1750000.0) {
tmp = t_2;
} else if (y_46_im <= -4.2e-177) {
tmp = t_4;
} else if (y_46_im <= 9.5e-211) {
tmp = t_3 * t_1;
} else if (y_46_im <= 7.2e+19) {
tmp = t_4;
} else if (y_46_im <= 1.2e+111) {
tmp = t_2;
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
double t_3 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_4 = (t_3 / (1.0 + t_0)) * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double tmp;
if (y_46_im <= -1750000.0) {
tmp = t_2;
} else if (y_46_im <= -4.2e-177) {
tmp = t_4;
} else if (y_46_im <= 9.5e-211) {
tmp = t_3 * t_1;
} else if (y_46_im <= 7.2e+19) {
tmp = t_4;
} else if (y_46_im <= 1.2e+111) {
tmp = t_2;
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1 t_3 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_4 = (t_3 / (1.0 + t_0)) * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) tmp = 0 if y_46_im <= -1750000.0: tmp = t_2 elif y_46_im <= -4.2e-177: tmp = t_4 elif y_46_im <= 9.5e-211: tmp = t_3 * t_1 elif y_46_im <= 7.2e+19: tmp = t_4 elif y_46_im <= 1.2e+111: tmp = t_2 else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_1) t_3 = hypot(x_46_re, x_46_im) ^ y_46_re t_4 = Float64(Float64(t_3 / Float64(1.0 + t_0)) * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) tmp = 0.0 if (y_46_im <= -1750000.0) tmp = t_2; elseif (y_46_im <= -4.2e-177) tmp = t_4; elseif (y_46_im <= 9.5e-211) tmp = Float64(t_3 * t_1); elseif (y_46_im <= 7.2e+19) tmp = t_4; elseif (y_46_im <= 1.2e+111) tmp = t_2; else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1; t_3 = hypot(x_46_re, x_46_im) ^ y_46_re; t_4 = (t_3 / (1.0 + t_0)) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); tmp = 0.0; if (y_46_im <= -1750000.0) tmp = t_2; elseif (y_46_im <= -4.2e-177) tmp = t_4; elseif (y_46_im <= 9.5e-211) tmp = t_3 * t_1; elseif (y_46_im <= 7.2e+19) tmp = t_4; elseif (y_46_im <= 1.2e+111) tmp = t_2; else tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1750000.0], t$95$2, If[LessEqual[y$46$im, -4.2e-177], t$95$4, If[LessEqual[y$46$im, 9.5e-211], N[(t$95$3 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 7.2e+19], t$95$4, If[LessEqual[y$46$im, 1.2e+111], t$95$2, N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_1\\
t_3 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_4 := \frac{t\_3}{1 + t\_0} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.im \leq -1750000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq -4.2 \cdot 10^{-177}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{-211}:\\
\;\;\;\;t\_3 \cdot t\_1\\
\mathbf{elif}\;y.im \leq 7.2 \cdot 10^{+19}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\end{array}
\end{array}
if y.im < -1.75e6 or 7.2e19 < y.im < 1.20000000000000003e111Initial program 40.7%
Taylor expanded in y.im around 0 57.6%
if -1.75e6 < y.im < -4.20000000000000002e-177 or 9.50000000000000008e-211 < y.im < 7.2e19Initial program 41.5%
exp-diff41.5%
exp-to-pow41.5%
hypot-define41.5%
*-commutative41.5%
exp-prod40.4%
fma-define40.4%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 86.4%
Taylor expanded in y.re around 0 41.2%
+-commutative41.2%
unpow241.2%
unpow241.2%
hypot-undefine79.7%
Simplified79.7%
if -4.20000000000000002e-177 < y.im < 9.50000000000000008e-211Initial program 38.1%
Taylor expanded in y.im around 0 60.3%
Taylor expanded in y.im around 0 60.3%
+-commutative60.3%
unpow260.3%
unpow260.3%
hypot-undefine77.2%
Simplified77.2%
if 1.20000000000000003e111 < y.im Initial program 38.7%
Taylor expanded in y.im around 0 57.5%
Taylor expanded in y.re around 0 69.5%
*-commutative69.5%
distribute-lft-neg-in69.5%
exp-prod71.8%
Simplified71.8%
Final simplification70.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1
(*
(/ t_0 (+ 1.0 (* (atan2 x.im x.re) y.im)))
(sin (* (log (hypot x.re x.im)) y.im))))
(t_2
(*
y.re
(* (atan2 x.im x.re) (pow (exp (- y.im)) (atan2 x.im x.re))))))
(if (<= y.im -3e+84)
t_2
(if (<= y.im -1.7e-175)
t_1
(if (<= y.im 1.9e-210)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.im 2.5e+20) 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 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = (t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
double t_2 = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(-y_46_im), atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -3e+84) {
tmp = t_2;
} else if (y_46_im <= -1.7e-175) {
tmp = t_1;
} else if (y_46_im <= 1.9e-210) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 2.5e+20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = (t_0 / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
double t_2 = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -3e+84) {
tmp = t_2;
} else if (y_46_im <= -1.7e-175) {
tmp = t_1;
} else if (y_46_im <= 1.9e-210) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 2.5e+20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = (t_0 / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) t_2 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -3e+84: tmp = t_2 elif y_46_im <= -1.7e-175: tmp = t_1 elif y_46_im <= 1.9e-210: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_im <= 2.5e+20: tmp = t_1 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(Float64(t_0 / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))) t_2 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -3e+84) tmp = t_2; elseif (y_46_im <= -1.7e-175) tmp = t_1; elseif (y_46_im <= 1.9e-210) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 2.5e+20) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; t_1 = (t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); t_2 = y_46_re * (atan2(x_46_im, x_46_re) * (exp(-y_46_im) ^ atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -3e+84) tmp = t_2; elseif (y_46_im <= -1.7e-175) tmp = t_1; elseif (y_46_im <= 1.9e-210) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_im <= 2.5e+20) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3e+84], t$95$2, If[LessEqual[y$46$im, -1.7e-175], t$95$1, If[LessEqual[y$46$im, 1.9e-210], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.5e+20], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \frac{t\_0}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
t_2 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{if}\;y.im \leq -3 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{-210}:\\
\;\;\;\;t\_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -2.99999999999999996e84 or 2.5e20 < y.im Initial program 42.3%
Taylor expanded in y.im around 0 58.4%
Taylor expanded in y.re around 0 55.2%
*-commutative55.2%
distribute-lft-neg-in55.2%
exp-prod56.8%
Simplified56.8%
if -2.99999999999999996e84 < y.im < -1.7e-175 or 1.90000000000000002e-210 < y.im < 2.5e20Initial program 38.9%
exp-diff36.2%
exp-to-pow36.2%
hypot-define36.2%
*-commutative36.2%
exp-prod35.3%
fma-define35.3%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y.im around 0 80.2%
Taylor expanded in y.re around 0 38.7%
+-commutative38.7%
unpow238.7%
unpow238.7%
hypot-undefine74.3%
Simplified74.3%
if -1.7e-175 < y.im < 1.90000000000000002e-210Initial program 38.1%
Taylor expanded in y.im around 0 60.3%
Taylor expanded in y.im around 0 60.3%
+-commutative60.3%
unpow260.3%
unpow260.3%
hypot-undefine77.2%
Simplified77.2%
Final simplification67.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -1.3e+75)
(*
t_0
(exp
(-
(*
y.re
(log (* x.im (- -1.0 (* 0.5 (* (/ x.re x.im) (/ x.re x.im)))))))
t_1)))
(if (<= x.im 5e-141)
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_1)) t_0)
(* t_0 (exp (- (* y.re (log x.im)) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.3e+75) {
tmp = t_0 * exp(((y_46_re * log((x_46_im * (-1.0 - (0.5 * ((x_46_re / x_46_im) * (x_46_re / x_46_im))))))) - t_1));
} else if (x_46_im <= 5e-141) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_1)) * t_0;
} else {
tmp = t_0 * exp(((y_46_re * log(x_46_im)) - t_1));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.3e+75) {
tmp = t_0 * Math.exp(((y_46_re * Math.log((x_46_im * (-1.0 - (0.5 * ((x_46_re / x_46_im) * (x_46_re / x_46_im))))))) - t_1));
} else if (x_46_im <= 5e-141) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_1)) * t_0;
} else {
tmp = t_0 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -1.3e+75: tmp = t_0 * math.exp(((y_46_re * math.log((x_46_im * (-1.0 - (0.5 * ((x_46_re / x_46_im) * (x_46_re / x_46_im))))))) - t_1)) elif x_46_im <= 5e-141: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_1)) * t_0 else: tmp = t_0 * math.exp(((y_46_re * math.log(x_46_im)) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -1.3e+75) tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(Float64(x_46_im * Float64(-1.0 - Float64(0.5 * Float64(Float64(x_46_re / x_46_im) * Float64(x_46_re / x_46_im))))))) - t_1))); elseif (x_46_im <= 5e-141) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_1)) * t_0); else tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_1 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -1.3e+75) tmp = t_0 * exp(((y_46_re * log((x_46_im * (-1.0 - (0.5 * ((x_46_re / x_46_im) * (x_46_re / x_46_im))))))) - t_1)); elseif (x_46_im <= 5e-141) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_1)) * t_0; else tmp = t_0 * exp(((y_46_re * log(x_46_im)) - t_1)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -1.3e+75], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im * N[(-1.0 - N[(0.5 * N[(N[(x$46$re / x$46$im), $MachinePrecision] * N[(x$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5e-141], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -1.3 \cdot 10^{+75}:\\
\;\;\;\;t\_0 \cdot e^{y.re \cdot \log \left(x.im \cdot \left(-1 - 0.5 \cdot \left(\frac{x.re}{x.im} \cdot \frac{x.re}{x.im}\right)\right)\right) - t\_1}\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{-141}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_1} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{y.re \cdot \log x.im - t\_1}\\
\end{array}
\end{array}
if x.im < -1.29999999999999992e75Initial program 30.2%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in x.im around -inf 72.2%
mul-1-neg72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
Simplified72.2%
pow272.2%
pow272.2%
add-sqr-sqrt72.2%
sqrt-div72.2%
sqrt-prod36.2%
add-sqr-sqrt64.6%
sqrt-prod0.0%
add-sqr-sqrt68.4%
sqrt-div68.4%
sqrt-prod32.4%
add-sqr-sqrt64.6%
sqrt-prod0.0%
add-sqr-sqrt78.0%
Applied egg-rr78.0%
if -1.29999999999999992e75 < x.im < 4.9999999999999999e-141Initial program 44.5%
exp-diff39.2%
exp-to-pow39.2%
hypot-define39.2%
*-commutative39.2%
exp-prod35.5%
fma-define35.5%
hypot-define60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in y.im around 0 45.9%
if 4.9999999999999999e-141 < x.im Initial program 41.0%
Taylor expanded in y.im around 0 54.2%
Taylor expanded in x.re around 0 59.6%
*-commutative59.6%
*-commutative59.6%
Simplified59.6%
Final simplification57.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -14000000.0) (not (<= y.re 7.1e+71)))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -14000000.0) || !(y_46_re <= 7.1e+71)) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -14000000.0) || !(y_46_re <= 7.1e+71)) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -14000000.0) or not (y_46_re <= 7.1e+71): tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -14000000.0) || !(y_46_re <= 7.1e+71)) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.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(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -14000000.0) || ~((y_46_re <= 7.1e+71))) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -14000000.0], N[Not[LessEqual[y$46$re, 7.1e+71]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + 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[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -14000000 \lor \neg \left(y.re \leq 7.1 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \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}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -1.4e7 or 7.09999999999999986e71 < y.re Initial program 42.9%
exp-diff29.4%
exp-to-pow29.4%
hypot-define29.4%
*-commutative29.4%
exp-prod26.1%
fma-define26.1%
hypot-define50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in y.im around 0 69.9%
Taylor expanded in y.im around 0 70.7%
if -1.4e7 < y.re < 7.09999999999999986e71Initial program 38.1%
Taylor expanded in y.im around 0 32.8%
Taylor expanded in y.re around 0 45.4%
*-commutative45.4%
distribute-lft-neg-in45.4%
Simplified45.4%
Final simplification57.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -410000.0) (not (<= y.re 1.05e+72))) (* (pow (hypot x.re x.im) y.re) (sin (* y.re (atan2 x.im x.re)))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -410000.0) || !(y_46_re <= 1.05e+72)) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -410000.0) || !(y_46_re <= 1.05e+72)) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -410000.0) or not (y_46_re <= 1.05e+72): tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -410000.0) || !(y_46_re <= 1.05e+72)) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -410000.0) || ~((y_46_re <= 1.05e+72))) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -410000.0], N[Not[LessEqual[y$46$re, 1.05e+72]], $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]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -410000 \lor \neg \left(y.re \leq 1.05 \cdot 10^{+72}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -4.1e5 or 1.0500000000000001e72 < y.re Initial program 42.9%
Taylor expanded in y.im around 0 71.5%
Taylor expanded in y.im around 0 67.4%
+-commutative67.4%
unpow267.4%
unpow267.4%
hypot-undefine67.4%
Simplified67.4%
if -4.1e5 < y.re < 1.0500000000000001e72Initial program 38.1%
Taylor expanded in y.im around 0 32.8%
Taylor expanded in y.re around 0 45.4%
*-commutative45.4%
distribute-lft-neg-in45.4%
Simplified45.4%
Final simplification55.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.25e+31) (not (<= y.im 57000000000.0))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (log1p (expm1 (* 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_im <= -3.25e+31) || !(y_46_im <= 57000000000.0)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = log1p(expm1((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_im <= -3.25e+31) || !(y_46_im <= 57000000000.0)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = Math.log1p(Math.expm1((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_im <= -3.25e+31) or not (y_46_im <= 57000000000.0): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) else: tmp = math.log1p(math.expm1((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_im <= -3.25e+31) || !(y_46_im <= 57000000000.0)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = log1p(expm1(Float64(y_46_re * atan(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$im, -3.25e+31], N[Not[LessEqual[y$46$im, 57000000000.0]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.25 \cdot 10^{+31} \lor \neg \left(y.im \leq 57000000000\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -3.2500000000000002e31 or 5.7e10 < y.im Initial program 40.3%
Taylor expanded in y.im around 0 58.0%
Taylor expanded in y.re around 0 52.8%
*-commutative52.8%
distribute-lft-neg-in52.8%
Simplified52.8%
if -3.2500000000000002e31 < y.im < 5.7e10Initial program 40.3%
Taylor expanded in y.im around 0 43.9%
Taylor expanded in y.re around 0 20.2%
*-commutative20.2%
distribute-lft-neg-in20.2%
Simplified20.2%
Taylor expanded in y.im around 0 19.5%
*-commutative19.5%
Simplified19.5%
log1p-expm1-u30.8%
Applied egg-rr30.8%
Final simplification41.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (expm1 (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -1.46e-6) (not (<= y.im 1.05e-67)))
(log (+ 1.0 t_0))
(log1p t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = expm1((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -1.46e-6) || !(y_46_im <= 1.05e-67)) {
tmp = log((1.0 + t_0));
} else {
tmp = log1p(t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.expm1((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -1.46e-6) || !(y_46_im <= 1.05e-67)) {
tmp = Math.log((1.0 + t_0));
} else {
tmp = Math.log1p(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -1.46e-6) or not (y_46_im <= 1.05e-67): tmp = math.log((1.0 + t_0)) else: tmp = math.log1p(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = expm1(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -1.46e-6) || !(y_46_im <= 1.05e-67)) tmp = log(Float64(1.0 + t_0)); else tmp = log1p(t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1.46e-6], N[Not[LessEqual[y$46$im, 1.05e-67]], $MachinePrecision]], N[Log[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision], N[Log[1 + t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -1.46 \cdot 10^{-6} \lor \neg \left(y.im \leq 1.05 \cdot 10^{-67}\right):\\
\;\;\;\;\log \left(1 + t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t\_0\right)\\
\end{array}
\end{array}
if y.im < -1.46e-6 or 1.0500000000000001e-67 < y.im Initial program 40.4%
Taylor expanded in y.im around 0 55.4%
Taylor expanded in y.re around 0 47.5%
*-commutative47.5%
distribute-lft-neg-in47.5%
Simplified47.5%
Taylor expanded in y.im around 0 7.9%
*-commutative7.9%
Simplified7.9%
log1p-expm1-u21.0%
log1p-undefine36.3%
Applied egg-rr36.3%
if -1.46e-6 < y.im < 1.0500000000000001e-67Initial program 40.2%
Taylor expanded in y.im around 0 45.0%
Taylor expanded in y.re around 0 21.9%
*-commutative21.9%
distribute-lft-neg-in21.9%
Simplified21.9%
Taylor expanded in y.im around 0 21.9%
*-commutative21.9%
Simplified21.9%
log1p-expm1-u30.7%
Applied egg-rr30.7%
Final simplification33.8%
(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)))
(if (<= y.im -800000.0)
(pow (pow t_0 3.0) 0.3333333333333333)
(if (<= y.im 1.16e-64) (log1p t_1) (log (+ 1.0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = expm1(t_0);
double tmp;
if (y_46_im <= -800000.0) {
tmp = pow(pow(t_0, 3.0), 0.3333333333333333);
} else if (y_46_im <= 1.16e-64) {
tmp = log1p(t_1);
} else {
tmp = log((1.0 + t_1));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.expm1(t_0);
double tmp;
if (y_46_im <= -800000.0) {
tmp = Math.pow(Math.pow(t_0, 3.0), 0.3333333333333333);
} else if (y_46_im <= 1.16e-64) {
tmp = Math.log1p(t_1);
} else {
tmp = Math.log((1.0 + t_1));
}
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) tmp = 0 if y_46_im <= -800000.0: tmp = math.pow(math.pow(t_0, 3.0), 0.3333333333333333) elif y_46_im <= 1.16e-64: tmp = math.log1p(t_1) else: tmp = math.log((1.0 + t_1)) 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) tmp = 0.0 if (y_46_im <= -800000.0) tmp = (t_0 ^ 3.0) ^ 0.3333333333333333; elseif (y_46_im <= 1.16e-64) tmp = log1p(t_1); else tmp = log(Float64(1.0 + t_1)); 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]}, If[LessEqual[y$46$im, -800000.0], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], If[LessEqual[y$46$im, 1.16e-64], N[Log[1 + t$95$1], $MachinePrecision], N[Log[N[(1.0 + t$95$1), $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)\\
\mathbf{if}\;y.im \leq -800000:\\
\;\;\;\;{\left({t\_0}^{3}\right)}^{0.3333333333333333}\\
\mathbf{elif}\;y.im \leq 1.16 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{log1p}\left(t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(1 + t\_1\right)\\
\end{array}
\end{array}
if y.im < -8e5Initial program 38.0%
Taylor expanded in y.im around 0 52.9%
Taylor expanded in y.re around 0 40.3%
*-commutative40.3%
distribute-lft-neg-in40.3%
Simplified40.3%
Taylor expanded in y.im around 0 7.4%
*-commutative7.4%
Simplified7.4%
add-cbrt-cube21.2%
pow1/329.0%
pow329.0%
Applied egg-rr29.0%
if -8e5 < y.im < 1.15999999999999992e-64Initial program 40.5%
Taylor expanded in y.im around 0 44.4%
Taylor expanded in y.re around 0 22.1%
*-commutative22.1%
distribute-lft-neg-in22.1%
Simplified22.1%
Taylor expanded in y.im around 0 21.3%
*-commutative21.3%
Simplified21.3%
log1p-expm1-u30.7%
Applied egg-rr30.7%
if 1.15999999999999992e-64 < y.im Initial program 41.9%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 54.2%
*-commutative54.2%
distribute-lft-neg-in54.2%
Simplified54.2%
Taylor expanded in y.im around 0 8.4%
*-commutative8.4%
Simplified8.4%
log1p-expm1-u21.8%
log1p-undefine42.6%
Applied egg-rr42.6%
Final simplification33.9%
(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 -1.6e+27) (not (<= y.re 5.7e-33)))
(log1p (expm1 t_0))
(/ t_0 (+ 1.0 (* (atan2 x.im x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.6e+27) || !(y_46_re <= 5.7e-33)) {
tmp = log1p(expm1(t_0));
} else {
tmp = t_0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.6e+27) || !(y_46_re <= 5.7e-33)) {
tmp = Math.log1p(Math.expm1(t_0));
} else {
tmp = t_0 / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -1.6e+27) or not (y_46_re <= 5.7e-33): tmp = math.log1p(math.expm1(t_0)) else: tmp = t_0 / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -1.6e+27) || !(y_46_re <= 5.7e-33)) tmp = log1p(expm1(t_0)); else tmp = Float64(t_0 / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.6e+27], N[Not[LessEqual[y$46$re, 5.7e-33]], $MachinePrecision]], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision], N[(t$95$0 / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $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 -1.6 \cdot 10^{+27} \lor \neg \left(y.re \leq 5.7 \cdot 10^{-33}\right):\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.re < -1.60000000000000008e27 or 5.70000000000000025e-33 < y.re Initial program 43.8%
Taylor expanded in y.im around 0 70.2%
Taylor expanded in y.re around 0 30.2%
*-commutative30.2%
distribute-lft-neg-in30.2%
Simplified30.2%
Taylor expanded in y.im around 0 9.2%
*-commutative9.2%
Simplified9.2%
log1p-expm1-u30.3%
Applied egg-rr30.3%
if -1.60000000000000008e27 < y.re < 5.70000000000000025e-33Initial program 36.3%
exp-diff35.5%
exp-to-pow35.5%
hypot-define35.5%
*-commutative35.5%
exp-prod35.4%
fma-define35.4%
hypot-define77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in y.im around 0 51.9%
Taylor expanded in y.im around 0 31.5%
Taylor expanded in y.re around 0 29.2%
Final simplification29.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re)))) (if (<= y.im 0.0035) (log1p (expm1 t_0)) (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_im <= 0.0035) {
tmp = log1p(expm1(t_0));
} 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_im <= 0.0035) {
tmp = Math.log1p(Math.expm1(t_0));
} 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_im <= 0.0035) tmp = log1p(expm1(t_0)); 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[LessEqual[y$46$im, 0.0035], N[Log[1 + N[(Exp[t$95$0] - 1), $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.im \leq 0.0035:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\end{array}
\end{array}
if y.im < 0.00350000000000000007Initial program 39.5%
Taylor expanded in y.im around 0 46.9%
Taylor expanded in y.re around 0 27.2%
*-commutative27.2%
distribute-lft-neg-in27.2%
Simplified27.2%
Taylor expanded in y.im around 0 16.0%
*-commutative16.0%
Simplified16.0%
log1p-expm1-u27.4%
Applied egg-rr27.4%
if 0.00350000000000000007 < y.im Initial program 42.4%
Taylor expanded in y.im around 0 61.2%
Taylor expanded in y.re around 0 60.1%
*-commutative60.1%
distribute-lft-neg-in60.1%
Simplified60.1%
Taylor expanded in y.im around 0 9.0%
*-commutative9.0%
Simplified9.0%
add-cbrt-cube32.0%
pow332.0%
Applied egg-rr32.0%
Final simplification28.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (* y.re (atan2 x.im x.re)) (+ 1.0 (* (atan2 x.im x.re) y.im))))
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)) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im));
}
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)) / (1.0d0 + (atan2(x_46im, x_46re) * y_46im))
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)) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im));
}
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)) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) 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)) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 40.3%
exp-diff31.7%
exp-to-pow31.7%
hypot-define31.7%
*-commutative31.7%
exp-prod30.1%
fma-define30.1%
hypot-define62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.im around 0 49.5%
Taylor expanded in y.re around 0 18.5%
Final simplification18.5%
(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 40.3%
Taylor expanded in y.im around 0 50.8%
Taylor expanded in y.re around 0 36.1%
*-commutative36.1%
distribute-lft-neg-in36.1%
Simplified36.1%
Taylor expanded in y.im around 0 14.1%
*-commutative14.1%
Simplified14.1%
Final simplification14.1%
herbie shell --seed 2024077
(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)))))