
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (<= x.re 5.4e-55)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_1 y.im t_0)))
(*
(exp (- (* y.re (log x.re)) (* (atan2 x.im x.re) y.im)))
(sin (+ t_0 (pow (cbrt (* t_1 y.im)) 3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (x_46_re <= 5.4e-55) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_1, y_46_im, t_0));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((t_0 + pow(cbrt((t_1 * y_46_im)), 3.0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (x_46_re <= 5.4e-55) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_1, y_46_im, t_0))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(t_0 + (cbrt(Float64(t_1 * y_46_im)) ^ 3.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 5.4e-55], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[Power[N[Power[N[(t$95$1 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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}\;x.re \leq 5.4 \cdot 10^{-55}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 + {\left(\sqrt[3]{t_1 \cdot y.im}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.re < 5.40000000000000008e-55Initial program 40.6%
fma-neg40.6%
hypot-def40.6%
distribute-rgt-neg-out40.6%
fma-def40.6%
hypot-def83.0%
*-commutative83.0%
Simplified83.0%
if 5.40000000000000008e-55 < x.re Initial program 29.9%
add-cube-cbrt32.3%
pow332.5%
*-commutative32.5%
hypot-udef56.1%
Applied egg-rr56.1%
Taylor expanded in x.re around inf 80.6%
Final simplification82.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 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (sin (fma (log (hypot x.re x.im)) y.im t_2))))
(if (<= y.re -13.2)
(*
t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(if (<= y.re 0.21)
(* t_3 (/ t_0 (pow (exp y.im) (atan2 x.im x.re))))
(* t_3 (/ t_0 (+ t_1 1.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2));
double tmp;
if (y_46_re <= -13.2) {
tmp = t_2 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else if (y_46_re <= 0.21) {
tmp = t_3 * (t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = t_3 * (t_0 / (t_1 + 1.0));
}
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(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) tmp = 0.0 if (y_46_re <= -13.2) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1))); elseif (y_46_re <= 0.21) tmp = Float64(t_3 * Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(t_3 * Float64(t_0 / Float64(t_1 + 1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -13.2], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.21], N[(t$95$3 * N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(t$95$0 / N[(t$95$1 + 1.0), $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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_2\right)\right)\\
\mathbf{if}\;y.re \leq -13.2:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\
\mathbf{elif}\;y.re \leq 0.21:\\
\;\;\;\;t_3 \cdot \frac{t_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \frac{t_0}{t_1 + 1}\\
\end{array}
\end{array}
if y.re < -13.199999999999999Initial program 30.8%
Taylor expanded in y.im around 0 80.9%
Taylor expanded in y.re around 0 84.8%
if -13.199999999999999 < y.re < 0.209999999999999992Initial program 39.2%
exp-diff39.2%
exp-to-pow39.2%
hypot-def39.2%
*-commutative39.2%
exp-prod39.2%
fma-def39.3%
hypot-def81.0%
*-commutative81.0%
Simplified81.0%
if 0.209999999999999992 < y.re Initial program 37.8%
exp-diff31.1%
exp-to-pow31.1%
hypot-def31.1%
*-commutative31.1%
exp-prod31.1%
fma-def31.1%
hypot-def55.4%
*-commutative55.4%
Simplified55.4%
Taylor expanded in y.im around 0 70.4%
Final simplification78.7%
(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 (fma (log (hypot x.re x.im)) y.im t_1))))
(if (<= y.re -175000000.0)
(*
t_1
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(if (<= y.re 1.8e-14)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_2 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
double tmp;
if (y_46_re <= -175000000.0) {
tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else if (y_46_re <= 1.8e-14) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_2 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) tmp = 0.0 if (y_46_re <= -175000000.0) tmp = Float64(t_1 * 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))); elseif (y_46_re <= 1.8e-14) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_2 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$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[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$re, -175000000.0], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.8e-14], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $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 \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
\mathbf{if}\;y.re \leq -175000000:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-14}:\\
\;\;\;\;t_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1}\\
\end{array}
\end{array}
if y.re < -1.75e8Initial program 31.4%
Taylor expanded in y.im around 0 82.5%
Taylor expanded in y.re around 0 86.4%
if -1.75e8 < y.re < 1.7999999999999999e-14Initial program 38.8%
exp-diff38.8%
exp-to-pow38.8%
hypot-def38.8%
*-commutative38.8%
exp-prod38.8%
fma-def38.8%
hypot-def80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in y.re around 0 79.9%
rec-exp79.9%
distribute-rgt-neg-in79.9%
Simplified79.9%
if 1.7999999999999999e-14 < y.re Initial program 38.1%
exp-diff31.6%
exp-to-pow31.6%
hypot-def31.6%
*-commutative31.6%
exp-prod31.6%
fma-def31.6%
hypot-def56.6%
*-commutative56.6%
Simplified56.6%
Taylor expanded in y.im around 0 70.7%
Final simplification78.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -7.5e+16)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 3.6e-6)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(if (<= y.im 9.5e+167)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -7.5e+16) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 3.6e-6) {
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 <= 9.5e+167) {
tmp = 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);
} 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;
}
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 <= -7.5e+16) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= 3.6e-6) 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 <= 9.5e+167) 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))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); 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
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, -7.5e+16], 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, 3.6e-6], 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, 9.5e+167], 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], 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}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -7.5 \cdot 10^{+16}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\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 9.5 \cdot 10^{+167}:\\
\;\;\;\;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{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.im < -7.5e16Initial program 25.8%
Taylor expanded in y.im around 0 46.3%
Taylor expanded in y.re around 0 61.7%
distribute-lft-neg-in61.7%
Simplified61.7%
Taylor expanded in y.re around 0 61.7%
*-commutative61.7%
neg-mul-161.7%
distribute-rgt-neg-in61.7%
exp-prod63.1%
Simplified63.1%
if -7.5e16 < y.im < 3.59999999999999984e-6Initial program 45.7%
exp-diff44.1%
exp-to-pow44.1%
hypot-def44.1%
*-commutative44.1%
exp-prod44.1%
fma-def44.1%
hypot-def90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y.im around 0 67.5%
unpow267.5%
unpow267.5%
hypot-def91.2%
Simplified91.2%
if 3.59999999999999984e-6 < y.im < 9.5000000000000006e167Initial program 29.2%
Taylor expanded in y.im around 0 68.9%
if 9.5000000000000006e167 < y.im Initial program 37.0%
Taylor expanded in y.im around 0 52.3%
Taylor expanded in y.re around 0 78.1%
distribute-lft-neg-in78.1%
Simplified78.1%
Final simplification79.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1
(*
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))
(sin (* y.im (log (hypot x.im x.re))))))
(t_2 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im -7200000000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -5.2e-184)
t_1
(if (<= y.im 2.05e-194)
(* (pow (hypot x.im x.re) y.re) t_2)
(if (<= y.im 6.4)
t_1
(if (<= y.im 4.6e+167)
(*
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(*
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 t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_2 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -7200000000.0) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -5.2e-184) {
tmp = t_1;
} else if (y_46_im <= 2.05e-194) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_2;
} else if (y_46_im <= 6.4) {
tmp = t_1;
} else if (y_46_im <= 4.6e+167) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} 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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_2 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -7200000000.0) {
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)));
} else if (y_46_im <= -5.2e-184) {
tmp = t_1;
} else if (y_46_im <= 2.05e-194) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_2;
} else if (y_46_im <= 6.4) {
tmp = t_1;
} else if (y_46_im <= 4.6e+167) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} 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): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_2 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -7200000000.0: 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))) elif y_46_im <= -5.2e-184: tmp = t_1 elif y_46_im <= 2.05e-194: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_2 elif y_46_im <= 6.4: tmp = t_1 elif y_46_im <= 4.6e+167: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2 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) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) t_2 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -7200000000.0) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= -5.2e-184) tmp = t_1; elseif (y_46_im <= 2.05e-194) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_2); elseif (y_46_im <= 6.4) tmp = t_1; elseif (y_46_im <= 4.6e+167) 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); 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) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_2 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -7200000000.0) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= -5.2e-184) tmp = t_1; elseif (y_46_im <= 2.05e-194) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_2; elseif (y_46_im <= 6.4) tmp = t_1; elseif (y_46_im <= 4.6e+167) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2; 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_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $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]}, Block[{t$95$2 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -7200000000.0], 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, -5.2e-184], t$95$1, If[LessEqual[y$46$im, 2.05e-194], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 6.4], t$95$1, If[LessEqual[y$46$im, 4.6e+167], 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], 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}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -7200000000:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq -5.2 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 2.05 \cdot 10^{-194}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t_2\\
\mathbf{elif}\;y.im \leq 6.4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{+167}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_2\\
\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.im < -7.2e9Initial program 28.2%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in y.re around 0 61.3%
distribute-lft-neg-in61.3%
Simplified61.3%
Taylor expanded in y.re around 0 61.3%
*-commutative61.3%
neg-mul-161.3%
distribute-rgt-neg-in61.3%
exp-prod62.7%
Simplified62.7%
if -7.2e9 < y.im < -5.19999999999999957e-184 or 2.0500000000000001e-194 < y.im < 6.4000000000000004Initial program 36.3%
exp-diff35.0%
exp-to-pow35.0%
hypot-def35.0%
*-commutative35.0%
exp-prod35.0%
fma-def35.0%
hypot-def88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in y.im around 0 89.9%
Taylor expanded in y.re around 0 37.4%
+-commutative37.0%
unpow237.0%
unpow237.0%
hypot-def86.5%
hypot-def37.0%
unpow237.0%
unpow237.0%
+-commutative37.0%
unpow237.0%
unpow237.0%
hypot-def86.5%
Simplified87.5%
if -5.19999999999999957e-184 < y.im < 2.0500000000000001e-194Initial program 58.4%
Taylor expanded in y.im around 0 64.1%
Taylor expanded in y.im around 0 64.1%
unpow264.1%
unpow264.1%
hypot-def76.9%
Simplified76.9%
if 6.4000000000000004 < y.im < 4.59999999999999976e167Initial program 28.9%
Taylor expanded in y.im around 0 69.1%
if 4.59999999999999976e167 < y.im Initial program 37.0%
Taylor expanded in y.im around 0 52.3%
Taylor expanded in y.re around 0 78.1%
distribute-lft-neg-in78.1%
Simplified78.1%
Final simplification75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(/ (pow (hypot x.re x.im) y.re) (+ (* (atan2 x.im x.re) y.im) 1.0))
(sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -12500000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -1.7e-184)
t_0
(if (<= y.im 1.28e-194)
(* (pow (hypot x.im x.re) y.re) (sin (* y.re (atan2 x.im x.re))))
(if (<= y.im 280000000000.0)
t_0
(*
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 t_0 = (pow(hypot(x_46_re, x_46_im), y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -12500000.0) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -1.7e-184) {
tmp = t_0;
} else if (y_46_im <= 1.28e-194) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 280000000000.0) {
tmp = t_0;
} 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 t_0 = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / ((Math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -12500000.0) {
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)));
} else if (y_46_im <= -1.7e-184) {
tmp = t_0;
} else if (y_46_im <= 1.28e-194) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 280000000000.0) {
tmp = t_0;
} 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): t_0 = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / ((math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -12500000.0: 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))) elif y_46_im <= -1.7e-184: tmp = t_0 elif y_46_im <= 1.28e-194: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_im <= 280000000000.0: tmp = t_0 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) t_0 = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + 1.0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -12500000.0) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= -1.7e-184) tmp = t_0; elseif (y_46_im <= 1.28e-194) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 280000000000.0) tmp = t_0; 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) t_0 = ((hypot(x_46_re, x_46_im) ^ y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -12500000.0) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= -1.7e-184) tmp = t_0; elseif (y_46_im <= 1.28e-194) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_im <= 280000000000.0) tmp = t_0; 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_] := Block[{t$95$0 = N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + 1.0), $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]}, If[LessEqual[y$46$im, -12500000.0], 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, -1.7e-184], t$95$0, If[LessEqual[y$46$im, 1.28e-194], 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[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 280000000000.0], t$95$0, 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}
t_0 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + 1} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -12500000:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-184}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.28 \cdot 10^{-194}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.im \leq 280000000000:\\
\;\;\;\;t_0\\
\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.im < -1.25e7Initial program 28.2%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in y.re around 0 61.3%
distribute-lft-neg-in61.3%
Simplified61.3%
Taylor expanded in y.re around 0 61.3%
*-commutative61.3%
neg-mul-161.3%
distribute-rgt-neg-in61.3%
exp-prod62.7%
Simplified62.7%
if -1.25e7 < y.im < -1.70000000000000002e-184 or 1.2800000000000001e-194 < y.im < 2.8e11Initial program 35.8%
exp-diff34.5%
exp-to-pow34.5%
hypot-def34.5%
*-commutative34.5%
exp-prod34.5%
fma-def34.5%
hypot-def86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.im around 0 90.4%
Taylor expanded in y.re around 0 36.8%
+-commutative36.4%
unpow236.4%
unpow236.4%
hypot-def87.2%
hypot-def36.4%
unpow236.4%
unpow236.4%
+-commutative36.4%
unpow236.4%
unpow236.4%
hypot-def87.2%
Simplified88.1%
if -1.70000000000000002e-184 < y.im < 1.2800000000000001e-194Initial program 58.4%
Taylor expanded in y.im around 0 64.1%
Taylor expanded in y.im around 0 64.1%
unpow264.1%
unpow264.1%
hypot-def76.9%
Simplified76.9%
if 2.8e11 < y.im Initial program 32.4%
Taylor expanded in y.im around 0 60.6%
Taylor expanded in y.re around 0 62.4%
distribute-lft-neg-in62.4%
Simplified62.4%
Final simplification73.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (* t_0 (sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -1300000000000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -3.8e-184)
t_1
(if (<= y.im 8e-194)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(if (<= y.im 215000000.0)
t_1
(*
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 t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = t_0 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1300000000000.0) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re)));
} else if (y_46_im <= -3.8e-184) {
tmp = t_1;
} else if (y_46_im <= 8e-194) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 215000000.0) {
tmp = t_1;
} 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 t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = t_0 * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1300000000000.0) {
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)));
} else if (y_46_im <= -3.8e-184) {
tmp = t_1;
} else if (y_46_im <= 8e-194) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 215000000.0) {
tmp = t_1;
} 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): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = t_0 * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -1300000000000.0: 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))) elif y_46_im <= -3.8e-184: tmp = t_1 elif y_46_im <= 8e-194: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_im <= 215000000.0: tmp = t_1 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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = Float64(t_0 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -1300000000000.0) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_im <= -3.8e-184) tmp = t_1; elseif (y_46_im <= 8e-194) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 215000000.0) tmp = t_1; 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) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = t_0 * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -1300000000000.0) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re))); elseif (y_46_im <= -3.8e-184) tmp = t_1; elseif (y_46_im <= 8e-194) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_im <= 215000000.0) tmp = t_1; 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_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * 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$im, -1300000000000.0], 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, -3.8e-184], t$95$1, If[LessEqual[y$46$im, 8e-194], 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, 215000000.0], t$95$1, 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}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := t_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -1300000000000:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{-194}:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.im \leq 215000000:\\
\;\;\;\;t_1\\
\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.im < -1.3e12Initial program 28.2%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in y.re around 0 61.3%
distribute-lft-neg-in61.3%
Simplified61.3%
Taylor expanded in y.re around 0 61.3%
*-commutative61.3%
neg-mul-161.3%
distribute-rgt-neg-in61.3%
exp-prod62.7%
Simplified62.7%
if -1.3e12 < y.im < -3.80000000000000017e-184 or 8.00000000000000014e-194 < y.im < 2.15e8Initial program 35.8%
exp-diff34.5%
exp-to-pow34.5%
hypot-def34.5%
*-commutative34.5%
exp-prod34.5%
fma-def34.5%
hypot-def86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y.im around 0 64.4%
unpow264.4%
unpow264.4%
hypot-def89.4%
Simplified89.4%
Taylor expanded in y.re around 0 36.4%
+-commutative36.4%
unpow236.4%
unpow236.4%
hypot-def87.2%
hypot-def36.4%
unpow236.4%
unpow236.4%
+-commutative36.4%
unpow236.4%
unpow236.4%
hypot-def87.2%
Simplified87.2%
if -3.80000000000000017e-184 < y.im < 8.00000000000000014e-194Initial program 58.4%
Taylor expanded in y.im around 0 64.1%
Taylor expanded in y.im around 0 64.1%
unpow264.1%
unpow264.1%
hypot-def76.9%
Simplified76.9%
if 2.15e8 < y.im Initial program 32.4%
Taylor expanded in y.im around 0 60.6%
Taylor expanded in y.re around 0 62.4%
distribute-lft-neg-in62.4%
Simplified62.4%
Final simplification72.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -6.2e+24) (not (<= y.re 3.7e-95))) (* (pow (hypot x.im x.re) 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 <= -6.2e+24) || !(y_46_re <= 3.7e-95)) {
tmp = pow(hypot(x_46_im, x_46_re), 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 <= -6.2e+24) || !(y_46_re <= 3.7e-95)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), 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 <= -6.2e+24) or not (y_46_re <= 3.7e-95): tmp = math.pow(math.hypot(x_46_im, x_46_re), 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 <= -6.2e+24) || !(y_46_re <= 3.7e-95)) tmp = Float64((hypot(x_46_im, x_46_re) ^ 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 <= -6.2e+24) || ~((y_46_re <= 3.7e-95))) tmp = (hypot(x_46_im, x_46_re) ^ 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, -6.2e+24], N[Not[LessEqual[y$46$re, 3.7e-95]], $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[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 -6.2 \cdot 10^{+24} \lor \neg \left(y.re \leq 3.7 \cdot 10^{-95}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\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 < -6.20000000000000022e24 or 3.69999999999999994e-95 < y.re Initial program 36.5%
Taylor expanded in y.im around 0 68.1%
Taylor expanded in y.im around 0 67.4%
unpow267.4%
unpow267.4%
hypot-def68.2%
Simplified68.2%
if -6.20000000000000022e24 < y.re < 3.69999999999999994e-95Initial program 37.8%
Taylor expanded in y.im around 0 41.7%
Taylor expanded in y.re around 0 58.9%
distribute-lft-neg-in58.9%
Simplified58.9%
Final simplification63.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 (<= x.re -2.6e+147)
(sqrt (pow t_0 2.0))
(if (<= x.re -4.5e-39)
(cbrt (pow t_0 3.0))
(if (<= x.re -1.25e-231)
(log1p t_1)
(if (<= x.re 0.0011)
(log (+ 1.0 t_1))
(* (pow x.re y.re) (sin (* y.im (log 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 = expm1(t_0);
double tmp;
if (x_46_re <= -2.6e+147) {
tmp = sqrt(pow(t_0, 2.0));
} else if (x_46_re <= -4.5e-39) {
tmp = cbrt(pow(t_0, 3.0));
} else if (x_46_re <= -1.25e-231) {
tmp = log1p(t_1);
} else if (x_46_re <= 0.0011) {
tmp = log((1.0 + t_1));
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.expm1(t_0);
double tmp;
if (x_46_re <= -2.6e+147) {
tmp = Math.sqrt(Math.pow(t_0, 2.0));
} else if (x_46_re <= -4.5e-39) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else if (x_46_re <= -1.25e-231) {
tmp = Math.log1p(t_1);
} else if (x_46_re <= 0.0011) {
tmp = Math.log((1.0 + t_1));
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(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 = expm1(t_0) tmp = 0.0 if (x_46_re <= -2.6e+147) tmp = sqrt((t_0 ^ 2.0)); elseif (x_46_re <= -4.5e-39) tmp = cbrt((t_0 ^ 3.0)); elseif (x_46_re <= -1.25e-231) tmp = log1p(t_1); elseif (x_46_re <= 0.0011) tmp = log(Float64(1.0 + t_1)); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(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[(Exp[t$95$0] - 1), $MachinePrecision]}, If[LessEqual[x$46$re, -2.6e+147], N[Sqrt[N[Power[t$95$0, 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$re, -4.5e-39], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[x$46$re, -1.25e-231], N[Log[1 + t$95$1], $MachinePrecision], If[LessEqual[x$46$re, 0.0011], N[Log[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[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 := \mathsf{expm1}\left(t_0\right)\\
\mathbf{if}\;x.re \leq -2.6 \cdot 10^{+147}:\\
\;\;\;\;\sqrt{{t_0}^{2}}\\
\mathbf{elif}\;x.re \leq -4.5 \cdot 10^{-39}:\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\mathbf{elif}\;x.re \leq -1.25 \cdot 10^{-231}:\\
\;\;\;\;\mathsf{log1p}\left(t_1\right)\\
\mathbf{elif}\;x.re \leq 0.0011:\\
\;\;\;\;\log \left(1 + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -2.5999999999999999e147Initial program 3.2%
Taylor expanded in y.im around 0 46.2%
Taylor expanded in y.re around 0 38.0%
distribute-lft-neg-in38.0%
Simplified38.0%
Taylor expanded in y.im around 0 10.2%
add-sqr-sqrt6.5%
sqrt-unprod33.1%
pow233.1%
Applied egg-rr33.1%
if -2.5999999999999999e147 < x.re < -4.5000000000000001e-39Initial program 58.2%
Taylor expanded in y.im around 0 67.2%
Taylor expanded in y.re around 0 54.3%
distribute-lft-neg-in54.3%
Simplified54.3%
Taylor expanded in y.im around 0 12.6%
add-cbrt-cube48.4%
pow348.4%
Applied egg-rr48.4%
if -4.5000000000000001e-39 < x.re < -1.25000000000000006e-231Initial program 53.3%
Taylor expanded in y.im around 0 79.3%
Taylor expanded in y.re around 0 47.9%
distribute-lft-neg-in47.9%
Simplified47.9%
Taylor expanded in y.im around 0 27.6%
log1p-expm1-u47.3%
Applied egg-rr47.3%
if -1.25000000000000006e-231 < x.re < 0.00110000000000000007Initial program 40.2%
Taylor expanded in y.im around 0 56.4%
Taylor expanded in y.re around 0 50.0%
distribute-lft-neg-in50.0%
Simplified50.0%
Taylor expanded in y.im around 0 12.7%
log1p-expm1-u24.9%
log1p-udef31.8%
Applied egg-rr31.8%
if 0.00110000000000000007 < x.re Initial program 27.7%
exp-diff24.8%
exp-to-pow24.8%
hypot-def24.8%
*-commutative24.8%
exp-prod19.0%
fma-def19.0%
hypot-def61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in y.im around 0 47.6%
unpow247.6%
unpow247.6%
hypot-def62.9%
Simplified62.9%
Taylor expanded in x.im around 0 62.1%
fma-def62.1%
Simplified62.1%
Taylor expanded in y.re around 0 62.5%
Final simplification45.2%
(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 (<= x.re -4.1e+100)
(* (sin t_0) (pow x.re y.re))
(if (<= x.re -2.55e-39)
(cbrt (pow t_0 3.0))
(if (<= x.re -3.6e-226)
(log1p t_1)
(if (<= x.re 0.00092)
(log (+ 1.0 t_1))
(* (pow x.re y.re) (sin (* y.im (log 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 = expm1(t_0);
double tmp;
if (x_46_re <= -4.1e+100) {
tmp = sin(t_0) * pow(x_46_re, y_46_re);
} else if (x_46_re <= -2.55e-39) {
tmp = cbrt(pow(t_0, 3.0));
} else if (x_46_re <= -3.6e-226) {
tmp = log1p(t_1);
} else if (x_46_re <= 0.00092) {
tmp = log((1.0 + t_1));
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.expm1(t_0);
double tmp;
if (x_46_re <= -4.1e+100) {
tmp = Math.sin(t_0) * Math.pow(x_46_re, y_46_re);
} else if (x_46_re <= -2.55e-39) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else if (x_46_re <= -3.6e-226) {
tmp = Math.log1p(t_1);
} else if (x_46_re <= 0.00092) {
tmp = Math.log((1.0 + t_1));
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(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 = expm1(t_0) tmp = 0.0 if (x_46_re <= -4.1e+100) tmp = Float64(sin(t_0) * (x_46_re ^ y_46_re)); elseif (x_46_re <= -2.55e-39) tmp = cbrt((t_0 ^ 3.0)); elseif (x_46_re <= -3.6e-226) tmp = log1p(t_1); elseif (x_46_re <= 0.00092) tmp = log(Float64(1.0 + t_1)); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(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[(Exp[t$95$0] - 1), $MachinePrecision]}, If[LessEqual[x$46$re, -4.1e+100], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -2.55e-39], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[x$46$re, -3.6e-226], N[Log[1 + t$95$1], $MachinePrecision], If[LessEqual[x$46$re, 0.00092], N[Log[N[(1.0 + t$95$1), $MachinePrecision]], $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[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 := \mathsf{expm1}\left(t_0\right)\\
\mathbf{if}\;x.re \leq -4.1 \cdot 10^{+100}:\\
\;\;\;\;\sin t_0 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;x.re \leq -2.55 \cdot 10^{-39}:\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\mathbf{elif}\;x.re \leq -3.6 \cdot 10^{-226}:\\
\;\;\;\;\mathsf{log1p}\left(t_1\right)\\
\mathbf{elif}\;x.re \leq 0.00092:\\
\;\;\;\;\log \left(1 + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -4.1000000000000003e100Initial program 15.0%
exp-diff12.5%
exp-to-pow12.5%
hypot-def12.5%
*-commutative12.5%
exp-prod12.5%
fma-def12.5%
hypot-def72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in y.im around 0 51.0%
unpow251.0%
unpow251.0%
hypot-def59.2%
Simplified59.2%
Taylor expanded in x.im around 0 0.0%
fma-def0.0%
Simplified0.0%
Taylor expanded in y.im around 0 40.0%
if -4.1000000000000003e100 < x.re < -2.54999999999999994e-39Initial program 59.1%
Taylor expanded in y.im around 0 63.4%
Taylor expanded in y.re around 0 53.3%
distribute-lft-neg-in53.3%
Simplified53.3%
Taylor expanded in y.im around 0 15.6%
add-cbrt-cube52.9%
pow352.9%
Applied egg-rr52.9%
if -2.54999999999999994e-39 < x.re < -3.59999999999999994e-226Initial program 53.3%
Taylor expanded in y.im around 0 79.3%
Taylor expanded in y.re around 0 47.9%
distribute-lft-neg-in47.9%
Simplified47.9%
Taylor expanded in y.im around 0 27.6%
log1p-expm1-u47.3%
Applied egg-rr47.3%
if -3.59999999999999994e-226 < x.re < 9.2000000000000003e-4Initial program 40.2%
Taylor expanded in y.im around 0 56.4%
Taylor expanded in y.re around 0 50.0%
distribute-lft-neg-in50.0%
Simplified50.0%
Taylor expanded in y.im around 0 12.7%
log1p-expm1-u24.9%
log1p-udef31.8%
Applied egg-rr31.8%
if 9.2000000000000003e-4 < x.re Initial program 27.7%
exp-diff24.8%
exp-to-pow24.8%
hypot-def24.8%
*-commutative24.8%
exp-prod19.0%
fma-def19.0%
hypot-def61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in y.im around 0 47.6%
unpow247.6%
unpow247.6%
hypot-def62.9%
Simplified62.9%
Taylor expanded in x.im around 0 62.1%
fma-def62.1%
Simplified62.1%
Taylor expanded in y.re around 0 62.5%
Final simplification46.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.2e+26) (not (<= y.re 200.0))) (* (sin (* y.re (atan2 x.im x.re))) (pow x.re y.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 <= -1.2e+26) || !(y_46_re <= 200.0)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_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;
}
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 ((y_46re <= (-1.2d+26)) .or. (.not. (y_46re <= 200.0d0))) then
tmp = sin((y_46re * atan2(x_46im, x_46re))) * (x_46re ** y_46re)
else
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
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 ((y_46_re <= -1.2e+26) || !(y_46_re <= 200.0)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_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 <= -1.2e+26) or not (y_46_re <= 200.0): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_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 <= -1.2e+26) || !(y_46_re <= 200.0)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_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 <= -1.2e+26) || ~((y_46_re <= 200.0))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_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, -1.2e+26], N[Not[LessEqual[y$46$re, 200.0]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $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 -1.2 \cdot 10^{+26} \lor \neg \left(y.re \leq 200\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\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.20000000000000002e26 or 200 < y.re Initial program 35.8%
exp-diff30.0%
exp-to-pow30.0%
hypot-def30.0%
*-commutative30.0%
exp-prod27.5%
fma-def27.5%
hypot-def60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in y.im around 0 74.3%
unpow274.3%
unpow274.3%
hypot-def74.3%
Simplified74.3%
Taylor expanded in x.im around 0 26.1%
fma-def26.1%
Simplified26.1%
Taylor expanded in y.im around 0 53.0%
if -1.20000000000000002e26 < y.re < 200Initial program 38.2%
Taylor expanded in y.im around 0 40.3%
Taylor expanded in y.re around 0 55.2%
distribute-lft-neg-in55.2%
Simplified55.2%
Final simplification54.2%
(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 -2e-50) (not (<= y.im 2.9e-100)))
(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 <= -2e-50) || !(y_46_im <= 2.9e-100)) {
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 <= -2e-50) || !(y_46_im <= 2.9e-100)) {
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 <= -2e-50) or not (y_46_im <= 2.9e-100): 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 <= -2e-50) || !(y_46_im <= 2.9e-100)) 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, -2e-50], N[Not[LessEqual[y$46$im, 2.9e-100]], $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 -2 \cdot 10^{-50} \lor \neg \left(y.im \leq 2.9 \cdot 10^{-100}\right):\\
\;\;\;\;\log \left(1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t_0\right)\\
\end{array}
\end{array}
if y.im < -2.00000000000000002e-50 or 2.89999999999999975e-100 < y.im Initial program 30.3%
Taylor expanded in y.im around 0 54.0%
Taylor expanded in y.re around 0 48.7%
distribute-lft-neg-in48.7%
Simplified48.7%
Taylor expanded in y.im around 0 6.5%
log1p-expm1-u17.9%
log1p-udef38.0%
Applied egg-rr38.0%
if -2.00000000000000002e-50 < y.im < 2.89999999999999975e-100Initial program 51.0%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in y.re around 0 32.6%
distribute-lft-neg-in32.6%
Simplified32.6%
Taylor expanded in y.im around 0 32.6%
log1p-expm1-u43.8%
Applied egg-rr43.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))))
(if (or (<= y.im -8.8e+33) (not (<= y.im 2.05e-79)))
(cbrt (pow t_0 3.0))
(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_im <= -8.8e+33) || !(y_46_im <= 2.05e-79)) {
tmp = cbrt(pow(t_0, 3.0));
} 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_im <= -8.8e+33) || !(y_46_im <= 2.05e-79)) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} 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_im <= -8.8e+33) || !(y_46_im <= 2.05e-79)) tmp = cbrt((t_0 ^ 3.0)); 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$im, -8.8e+33], N[Not[LessEqual[y$46$im, 2.05e-79]], $MachinePrecision]], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $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.im \leq -8.8 \cdot 10^{+33} \lor \neg \left(y.im \leq 2.05 \cdot 10^{-79}\right):\\
\;\;\;\;\sqrt[3]{{t_0}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\end{array}
\end{array}
if y.im < -8.79999999999999975e33 or 2.04999999999999997e-79 < y.im Initial program 29.6%
Taylor expanded in y.im around 0 54.6%
Taylor expanded in y.re around 0 54.2%
distribute-lft-neg-in54.2%
Simplified54.2%
Taylor expanded in y.im around 0 7.0%
add-cbrt-cube30.7%
pow330.7%
Applied egg-rr30.7%
if -8.79999999999999975e33 < y.im < 2.04999999999999997e-79Initial program 47.1%
Taylor expanded in y.im around 0 57.4%
Taylor expanded in y.re around 0 29.1%
distribute-lft-neg-in29.1%
Simplified29.1%
Taylor expanded in y.im around 0 25.7%
log1p-expm1-u39.4%
Applied egg-rr39.4%
Final simplification34.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (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) {
return log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log1p(Math.expm1((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 math.log1p(math.expm1((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 log1p(expm1(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_] := 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}
\\
\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 37.1%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 43.4%
distribute-lft-neg-in43.4%
Simplified43.4%
Taylor expanded in y.im around 0 15.0%
log1p-expm1-u26.4%
Applied egg-rr26.4%
Final simplification26.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 37.1%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 43.4%
distribute-lft-neg-in43.4%
Simplified43.4%
Taylor expanded in y.im around 0 15.0%
Final simplification15.0%
herbie shell --seed 2024017
(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)))))