
(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 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (- (* t_3 y.re) (* y.im (atan2 x.im x.re))))))
(if (<= y.im -1.8e+104)
(* t_4 (sin (fma t_3 y.im t_1)))
(if (<= y.im 1.12e+108)
(*
t_4
(fma
-0.5
(* (* (* y.im y.im) (pow t_0 2.0)) t_2)
(fma y.im (* t_0 (cos t_1)) t_2)))
(* t_4 (sin (fabs t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(((t_3 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.8e+104) {
tmp = t_4 * sin(fma(t_3, y_46_im, t_1));
} else if (y_46_im <= 1.12e+108) {
tmp = t_4 * fma(-0.5, (((y_46_im * y_46_im) * pow(t_0, 2.0)) * t_2), fma(y_46_im, (t_0 * cos(t_1)), t_2));
} else {
tmp = t_4 * sin(fabs(t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = log(hypot(x_46_re, x_46_im)) t_4 = exp(Float64(Float64(t_3 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1.8e+104) tmp = Float64(t_4 * sin(fma(t_3, y_46_im, t_1))); elseif (y_46_im <= 1.12e+108) tmp = Float64(t_4 * fma(-0.5, Float64(Float64(Float64(y_46_im * y_46_im) * (t_0 ^ 2.0)) * t_2), fma(y_46_im, Float64(t_0 * cos(t_1)), t_2))); else tmp = Float64(t_4 * sin(abs(t_1))); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.8e+104], N[(t$95$4 * N[Sin[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.12e+108], N[(t$95$4 * N[(-0.5 * N[(N[(N[(y$46$im * y$46$im), $MachinePrecision] * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(y$46$im * N[(t$95$0 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{t_3 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{+104}:\\
\;\;\;\;t_4 \cdot \sin \left(\mathsf{fma}\left(t_3, y.im, t_1\right)\right)\\
\mathbf{elif}\;y.im \leq 1.12 \cdot 10^{+108}:\\
\;\;\;\;t_4 \cdot \mathsf{fma}\left(-0.5, \left(\left(y.im \cdot y.im\right) \cdot {t_0}^{2}\right) \cdot t_2, \mathsf{fma}\left(y.im, t_0 \cdot \cos t_1, t_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \sin \left(\left|t_1\right|\right)\\
\end{array}
\end{array}
if y.im < -1.8e104Initial program 36.2%
Simplified72.7%
if -1.8e104 < y.im < 1.11999999999999994e108Initial program 35.4%
Simplified80.8%
*-commutative80.8%
add-sqr-sqrt43.5%
sqrt-unprod57.1%
pow257.1%
Applied egg-rr57.1%
*-commutative57.1%
unpow257.1%
rem-sqrt-square74.4%
Simplified74.4%
Taylor expanded in y.im around 0 36.5%
fma-def36.5%
Simplified86.1%
if 1.11999999999999994e108 < y.im Initial program 33.0%
Simplified73.6%
*-commutative73.6%
add-sqr-sqrt41.1%
sqrt-unprod49.2%
pow249.2%
Applied egg-rr49.2%
*-commutative49.2%
unpow249.2%
rem-sqrt-square76.3%
Simplified76.3%
Taylor expanded in y.im around 0 81.3%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* y.re t_2) t_0)))
(t_4 (* y.re (atan2 x.im x.re))))
(if (<= (* t_3 (sin (+ t_4 (* y.im t_2)))) -0.5)
(* t_3 (fabs (sin (* y.im (log (hypot x.im x.re))))))
(* (exp (- (* t_1 y.re) t_0)) (sin (fma t_1 y.im t_4))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((y_46_re * t_2) - t_0));
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((t_3 * sin((t_4 + (y_46_im * t_2)))) <= -0.5) {
tmp = t_3 * fabs(sin((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else {
tmp = exp(((t_1 * y_46_re) - t_0)) * sin(fma(t_1, y_46_im, t_4));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(y_46_re * t_2) - t_0)) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_3 * sin(Float64(t_4 + Float64(y_46_im * t_2)))) <= -0.5) tmp = Float64(t_3 * abs(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); else tmp = Float64(exp(Float64(Float64(t_1 * y_46_re) - t_0)) * sin(fma(t_1, y_46_im, t_4))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Sin[N[(t$95$4 + N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.5], N[(t$95$3 * N[Abs[N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{y.re \cdot t_2 - t_0}\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;t_3 \cdot \sin \left(t_4 + y.im \cdot t_2\right) \leq -0.5:\\
\;\;\;\;t_3 \cdot \left|\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{t_1 \cdot y.re - t_0} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, t_4\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.5Initial program 33.5%
add-sqr-sqrt0.0%
sqrt-unprod60.1%
pow260.1%
*-commutative60.1%
hypot-udef60.1%
fma-def60.1%
Applied egg-rr60.1%
unpow260.1%
rem-sqrt-square60.1%
fma-udef60.1%
log-pow16.7%
+-commutative16.7%
*-commutative16.7%
log-pow60.1%
fma-udef60.1%
hypot-def60.1%
unpow260.1%
unpow260.1%
+-commutative60.1%
unpow260.1%
unpow260.1%
hypot-def60.1%
Simplified60.1%
Taylor expanded in y.re around 0 60.1%
unpow260.1%
unpow260.1%
hypot-def60.1%
Simplified60.1%
if -0.5 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 35.3%
Simplified83.3%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -230.0) (not (<= y.im 90.0)))
(*
(exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re))))
(sin (fabs (* y.re (atan2 x.im x.re)))))
(*
(pow (hypot x.im x.re) y.re)
(sin (fma y.re (atan2 x.im x.re) (* y.im t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -230.0) || !(y_46_im <= 90.0)) {
tmp = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(fabs((y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -230.0) || !(y_46_im <= 90.0)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(abs(Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -230.0], N[Not[LessEqual[y$46$im, 90.0]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $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] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -230 \lor \neg \left(y.im \leq 90\right):\\
\;\;\;\;e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\left|y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right|\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_0\right)\right)\\
\end{array}
\end{array}
if y.im < -230 or 90 < y.im Initial program 29.3%
Simplified69.3%
*-commutative69.3%
add-sqr-sqrt33.2%
sqrt-unprod53.6%
pow253.6%
Applied egg-rr53.6%
*-commutative53.6%
unpow253.6%
rem-sqrt-square73.0%
Simplified73.0%
Taylor expanded in y.im around 0 71.1%
if -230 < y.im < 90Initial program 41.6%
exp-diff41.6%
+-rgt-identity41.6%
+-rgt-identity41.6%
exp-to-pow41.7%
hypot-def41.7%
*-commutative41.7%
exp-prod41.6%
+-commutative41.6%
*-commutative41.6%
Simplified89.0%
Taylor expanded in y.im around 0 66.3%
unpow266.3%
unpow266.3%
hypot-def88.6%
Simplified88.6%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (hypot x.re x.im))))
(if (<= y.re -57000000000.0)
(*
t_1
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(if (<= y.re 1.75e+70)
(/ (sin (fma t_2 y.im t_1)) (exp t_0))
(*
(pow (hypot x.im x.re) y.re)
(sin (fma y.re (atan2 x.im x.re) (* y.im 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_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -57000000000.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.75e+70) {
tmp = sin(fma(t_2, y_46_im, t_1)) / exp(t_0);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_2)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -57000000000.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.75e+70) tmp = Float64(sin(fma(t_2, y_46_im, t_1)) / exp(t_0)); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * 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$im * N[ArcTan[x$46$im / x$46$re], $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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -57000000000.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.75e+70], N[(N[Sin[N[(t$95$2 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $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] + N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -57000000000:\\
\;\;\;\;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.75 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_2, y.im, t_1\right)\right)}{e^{t_0}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_2\right)\right)\\
\end{array}
\end{array}
if y.re < -5.7e10Initial program 28.1%
Taylor expanded in y.im around 0 82.5%
Taylor expanded in y.re around 0 84.3%
if -5.7e10 < y.re < 1.75000000000000001e70Initial program 41.4%
*-commutative41.4%
exp-diff40.0%
associate-*r/40.0%
associate-/l*40.0%
fma-def40.0%
hypot-def49.2%
*-commutative49.2%
Simplified78.3%
Taylor expanded in y.re around 0 79.3%
if 1.75000000000000001e70 < y.re Initial program 25.9%
exp-diff18.5%
+-rgt-identity18.5%
+-rgt-identity18.5%
exp-to-pow18.5%
hypot-def18.5%
*-commutative18.5%
exp-prod18.5%
+-commutative18.5%
*-commutative18.5%
Simplified53.7%
Taylor expanded in y.im around 0 55.7%
unpow255.7%
unpow255.7%
hypot-def55.7%
Simplified55.7%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (atan2 x.im x.re)))
(t_1 (* (sin (* y.im (log (hypot x.im x.re)))) (pow (exp y.im) t_0))))
(if (<= y.im -1.72e+36)
t_1
(if (<= y.im 20000000000.0)
(*
(pow (hypot x.im x.re) y.re)
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.re x.im))))))
(if (<= y.im 5e+107)
t_1
(* (* y.re (atan2 x.im x.re)) (exp (* y.im t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(y_46_im), t_0);
double tmp;
if (y_46_im <= -1.72e+36) {
tmp = t_1;
} else if (y_46_im <= 20000000000.0) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_re, x_46_im)))));
} else if (y_46_im <= 5e+107) {
tmp = t_1;
} else {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * exp((y_46_im * t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(-atan(x_46_im, x_46_re)) t_1 = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ t_0)) tmp = 0.0 if (y_46_im <= -1.72e+36) tmp = t_1; elseif (y_46_im <= 20000000000.0) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_re, x_46_im)))))); elseif (y_46_im <= 5e+107) tmp = t_1; else tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * exp(Float64(y_46_im * t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])}, Block[{t$95$1 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.72e+36], t$95$1, If[LessEqual[y$46$im, 20000000000.0], 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] + N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5e+107], t$95$1, N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{t_0}\\
\mathbf{if}\;y.im \leq -1.72 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 20000000000:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.im \cdot t_0}\\
\end{array}
\end{array}
if y.im < -1.7199999999999999e36 or 2e10 < y.im < 5.0000000000000002e107Initial program 32.5%
exp-diff26.5%
+-rgt-identity26.5%
+-rgt-identity26.5%
exp-to-pow26.5%
hypot-def26.5%
*-commutative26.5%
exp-prod26.5%
+-commutative26.5%
*-commutative26.5%
Simplified58.1%
div-inv58.1%
pow-flip58.1%
Applied egg-rr58.1%
Taylor expanded in y.re around 0 30.3%
*-commutative30.3%
neg-mul-130.3%
distribute-rgt-neg-in30.3%
exp-prod30.3%
unpow230.3%
unpow230.3%
hypot-def64.3%
Simplified64.3%
if -1.7199999999999999e36 < y.im < 2e10Initial program 37.6%
exp-diff37.7%
+-rgt-identity37.7%
+-rgt-identity37.7%
exp-to-pow37.7%
hypot-def37.7%
*-commutative37.7%
exp-prod37.6%
+-commutative37.6%
*-commutative37.6%
Simplified85.6%
Taylor expanded in y.im around 0 65.2%
unpow265.2%
unpow265.2%
hypot-def84.9%
Simplified84.9%
if 5.0000000000000002e107 < y.im Initial program 32.1%
Taylor expanded in y.im around 0 63.5%
Taylor expanded in x.re around inf 26.5%
Taylor expanded in y.re around 0 74.1%
*-commutative74.1%
*-commutative74.1%
distribute-rgt-neg-in74.1%
Simplified74.1%
Final simplification76.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* (sin (* y.im (log (hypot x.im x.re)))) (pow (exp y.im) t_0)))
(t_3
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -0.225)
(* t_1 t_3)
(if (<= y.re -3.15e-65)
t_2
(if (<= y.re -5.6e-98)
(* t_1 (exp (* y.im t_0)))
(if (<= y.re 2.46e+64) t_2 (* (sin t_1) t_3)))))))
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);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(y_46_im), t_0);
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.225) {
tmp = t_1 * t_3;
} else if (y_46_re <= -3.15e-65) {
tmp = t_2;
} else if (y_46_re <= -5.6e-98) {
tmp = t_1 * exp((y_46_im * t_0));
} else if (y_46_re <= 2.46e+64) {
tmp = t_2;
} else {
tmp = sin(t_1) * t_3;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.exp(y_46_im), t_0);
double t_3 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -0.225) {
tmp = t_1 * t_3;
} else if (y_46_re <= -3.15e-65) {
tmp = t_2;
} else if (y_46_re <= -5.6e-98) {
tmp = t_1 * Math.exp((y_46_im * t_0));
} else if (y_46_re <= 2.46e+64) {
tmp = t_2;
} else {
tmp = Math.sin(t_1) * t_3;
}
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) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.exp(y_46_im), t_0) t_3 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -0.225: tmp = t_1 * t_3 elif y_46_re <= -3.15e-65: tmp = t_2 elif y_46_re <= -5.6e-98: tmp = t_1 * math.exp((y_46_im * t_0)) elif y_46_re <= 2.46e+64: tmp = t_2 else: tmp = math.sin(t_1) * t_3 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)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ t_0)) 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))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -0.225) tmp = Float64(t_1 * t_3); elseif (y_46_re <= -3.15e-65) tmp = t_2; elseif (y_46_re <= -5.6e-98) tmp = Float64(t_1 * exp(Float64(y_46_im * t_0))); elseif (y_46_re <= 2.46e+64) tmp = t_2; else tmp = Float64(sin(t_1) * t_3); 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); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ t_0); t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -0.225) tmp = t_1 * t_3; elseif (y_46_re <= -3.15e-65) tmp = t_2; elseif (y_46_re <= -5.6e-98) tmp = t_1 * exp((y_46_im * t_0)); elseif (y_46_re <= 2.46e+64) tmp = t_2; else tmp = sin(t_1) * t_3; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], t$95$0], $MachinePrecision]), $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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.225], N[(t$95$1 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, -3.15e-65], t$95$2, If[LessEqual[y$46$re, -5.6e-98], N[(t$95$1 * N[Exp[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.46e+64], t$95$2, N[(N[Sin[t$95$1], $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{t_0}\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -0.225:\\
\;\;\;\;t_1 \cdot t_3\\
\mathbf{elif}\;y.re \leq -3.15 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -5.6 \cdot 10^{-98}:\\
\;\;\;\;t_1 \cdot e^{y.im \cdot t_0}\\
\mathbf{elif}\;y.re \leq 2.46 \cdot 10^{+64}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sin t_1 \cdot t_3\\
\end{array}
\end{array}
if y.re < -0.225000000000000006Initial program 28.3%
Taylor expanded in y.im around 0 81.8%
Taylor expanded in y.re around 0 83.5%
if -0.225000000000000006 < y.re < -3.1499999999999998e-65 or -5.5999999999999998e-98 < y.re < 2.4600000000000001e64Initial program 41.9%
exp-diff41.2%
+-rgt-identity41.2%
+-rgt-identity41.2%
exp-to-pow41.2%
hypot-def41.2%
*-commutative41.2%
exp-prod41.2%
+-commutative41.2%
*-commutative41.2%
Simplified80.2%
div-inv80.2%
pow-flip80.2%
Applied egg-rr80.2%
Taylor expanded in y.re around 0 31.3%
*-commutative31.3%
neg-mul-131.3%
distribute-rgt-neg-in31.3%
exp-prod31.2%
unpow231.2%
unpow231.2%
hypot-def65.7%
Simplified65.7%
if -3.1499999999999998e-65 < y.re < -5.5999999999999998e-98Initial program 33.1%
Taylor expanded in y.im around 0 34.7%
Taylor expanded in x.re around inf 16.7%
Taylor expanded in y.re around 0 77.6%
*-commutative77.6%
*-commutative77.6%
distribute-rgt-neg-in77.6%
Simplified77.6%
if 2.4600000000000001e64 < y.re Initial program 25.9%
Taylor expanded in y.im around 0 53.7%
Final simplification67.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* (sin (* y.im (log (hypot x.im x.re)))) (pow (exp y.im) t_0))))
(if (<= y.re -0.245)
(*
t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(if (<= y.re -1.05e-65)
t_2
(if (<= y.re -3.8e-99)
(* t_1 (exp (* y.im t_0)))
(if (<= y.re 1.65e+95)
t_2
(* (sin t_1) (pow (hypot x.im x.re) y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(y_46_im), t_0);
double tmp;
if (y_46_re <= -0.245) {
tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= -1.05e-65) {
tmp = t_2;
} else if (y_46_re <= -3.8e-99) {
tmp = t_1 * exp((y_46_im * t_0));
} else if (y_46_re <= 1.65e+95) {
tmp = t_2;
} else {
tmp = sin(t_1) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.exp(y_46_im), t_0);
double tmp;
if (y_46_re <= -0.245) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= -1.05e-65) {
tmp = t_2;
} else if (y_46_re <= -3.8e-99) {
tmp = t_1 * Math.exp((y_46_im * t_0));
} else if (y_46_re <= 1.65e+95) {
tmp = t_2;
} else {
tmp = Math.sin(t_1) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = -math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.exp(y_46_im), t_0) tmp = 0 if y_46_re <= -0.245: tmp = t_1 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= -1.05e-65: tmp = t_2 elif y_46_re <= -3.8e-99: tmp = t_1 * math.exp((y_46_im * t_0)) elif y_46_re <= 1.65e+95: tmp = t_2 else: tmp = math.sin(t_1) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(-atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ t_0)) tmp = 0.0 if (y_46_re <= -0.245) 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))))) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= -1.05e-65) tmp = t_2; elseif (y_46_re <= -3.8e-99) tmp = Float64(t_1 * exp(Float64(y_46_im * t_0))); elseif (y_46_re <= 1.65e+95) tmp = t_2; else tmp = Float64(sin(t_1) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = -atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ t_0); tmp = 0.0; if (y_46_re <= -0.245) tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_re <= -1.05e-65) tmp = t_2; elseif (y_46_re <= -3.8e-99) tmp = t_1 * exp((y_46_im * t_0)); elseif (y_46_re <= 1.65e+95) tmp = t_2; else tmp = sin(t_1) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.245], 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.05e-65], t$95$2, If[LessEqual[y$46$re, -3.8e-99], N[(t$95$1 * N[Exp[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.65e+95], t$95$2, N[(N[Sin[t$95$1], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{t_0}\\
\mathbf{if}\;y.re \leq -0.245:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -3.8 \cdot 10^{-99}:\\
\;\;\;\;t_1 \cdot e^{y.im \cdot t_0}\\
\mathbf{elif}\;y.re \leq 1.65 \cdot 10^{+95}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.245Initial program 28.3%
Taylor expanded in y.im around 0 81.8%
Taylor expanded in y.re around 0 83.5%
if -0.245 < y.re < -1.05000000000000001e-65 or -3.7999999999999997e-99 < y.re < 1.6499999999999999e95Initial program 41.8%
exp-diff40.3%
+-rgt-identity40.3%
+-rgt-identity40.3%
exp-to-pow40.3%
hypot-def40.3%
*-commutative40.3%
exp-prod40.3%
+-commutative40.3%
*-commutative40.3%
Simplified79.9%
div-inv79.9%
pow-flip79.9%
Applied egg-rr79.9%
Taylor expanded in y.re around 0 31.3%
*-commutative31.3%
neg-mul-131.3%
distribute-rgt-neg-in31.3%
exp-prod31.3%
unpow231.3%
unpow231.3%
hypot-def65.0%
Simplified65.0%
if -1.05000000000000001e-65 < y.re < -3.7999999999999997e-99Initial program 33.1%
Taylor expanded in y.im around 0 34.7%
Taylor expanded in x.re around inf 16.7%
Taylor expanded in y.re around 0 77.6%
*-commutative77.6%
*-commutative77.6%
distribute-rgt-neg-in77.6%
Simplified77.6%
if 1.6499999999999999e95 < y.re Initial program 25.5%
exp-diff19.6%
+-rgt-identity19.6%
+-rgt-identity19.6%
exp-to-pow19.6%
hypot-def19.6%
*-commutative19.6%
exp-prod19.6%
+-commutative19.6%
*-commutative19.6%
Simplified52.9%
Taylor expanded in y.im around 0 55.0%
unpow255.0%
unpow255.0%
hypot-def55.0%
Simplified55.0%
Taylor expanded in y.re around inf 49.1%
Final simplification66.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= x.re -1.9e-188)
(* (sin t_1) (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re 1.06e-291)
(*
t_1
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(if (<= x.re 4.6e-216)
(*
(exp (* y.im (- (atan2 x.im x.re))))
(+ t_1 (* (atan2 x.im x.re) (* (* y.re y.re) (log x.re)))))
(if (<= x.re 8e-183)
(* t_1 (exp (- (* y.re (log x.re)) t_0)))
(*
(pow (hypot x.im x.re) y.re)
(sin (+ t_1 (* 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_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1.9e-188) {
tmp = sin(t_1) * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.06e-291) {
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 (x_46_re <= 4.6e-216) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * (t_1 + (atan2(x_46_im, x_46_re) * ((y_46_re * y_46_re) * log(x_46_re))));
} else if (x_46_re <= 8e-183) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_1 + (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_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1.9e-188) {
tmp = Math.sin(t_1) * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.06e-291) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
} else if (x_46_re <= 4.6e-216) {
tmp = Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))) * (t_1 + (Math.atan2(x_46_im, x_46_re) * ((y_46_re * y_46_re) * Math.log(x_46_re))));
} else if (x_46_re <= 8e-183) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((t_1 + (y_46_im * Math.log(x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -1.9e-188: tmp = math.sin(t_1) * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= 1.06e-291: tmp = t_1 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) elif x_46_re <= 4.6e-216: tmp = math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) * (t_1 + (math.atan2(x_46_im, x_46_re) * ((y_46_re * y_46_re) * math.log(x_46_re)))) elif x_46_re <= 8e-183: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((t_1 + (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_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -1.9e-188) tmp = Float64(sin(t_1) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= 1.06e-291) 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 (x_46_re <= 4.6e-216) tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * Float64(t_1 + Float64(atan(x_46_im, x_46_re) * Float64(Float64(y_46_re * y_46_re) * log(x_46_re))))); elseif (x_46_re <= 8e-183) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -1.9e-188) tmp = sin(t_1) * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= 1.06e-291) tmp = t_1 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); elseif (x_46_re <= 4.6e-216) tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * (t_1 + (atan2(x_46_im, x_46_re) * ((y_46_re * y_46_re) * log(x_46_re)))); elseif (x_46_re <= 8e-183) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((t_1 + (y_46_im * log(x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.9e-188], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.06e-291], 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[x$46$re, 4.6e-216], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 8e-183], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -1.9 \cdot 10^{-188}:\\
\;\;\;\;\sin t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 1.06 \cdot 10^{-291}:\\
\;\;\;\;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}\;x.re \leq 4.6 \cdot 10^{-216}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(t_1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(\left(y.re \cdot y.re\right) \cdot \log x.re\right)\right)\\
\mathbf{elif}\;x.re \leq 8 \cdot 10^{-183}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -1.9e-188Initial program 37.5%
Taylor expanded in y.im around 0 49.4%
Taylor expanded in x.re around -inf 61.2%
mul-1-neg61.2%
Simplified61.2%
if -1.9e-188 < x.re < 1.05999999999999992e-291Initial program 43.5%
Taylor expanded in y.im around 0 57.3%
Taylor expanded in y.re around 0 62.4%
if 1.05999999999999992e-291 < x.re < 4.59999999999999993e-216Initial program 28.6%
Taylor expanded in y.im around 0 50.7%
Taylor expanded in x.re around inf 51.1%
Taylor expanded in y.re around 0 50.9%
distribute-lft-out65.1%
distribute-rgt-neg-in65.1%
associate-*r*65.1%
unpow265.1%
*-commutative65.1%
Simplified65.1%
if 4.59999999999999993e-216 < x.re < 8.00000000000000004e-183Initial program 33.3%
Taylor expanded in y.im around 0 34.3%
Taylor expanded in x.re around inf 42.6%
Taylor expanded in y.re around 0 59.2%
if 8.00000000000000004e-183 < x.re Initial program 30.2%
exp-diff29.1%
+-rgt-identity29.1%
+-rgt-identity29.1%
exp-to-pow29.1%
hypot-def29.1%
*-commutative29.1%
exp-prod29.1%
+-commutative29.1%
*-commutative29.1%
Simplified71.4%
Taylor expanded in y.im around 0 54.3%
unpow254.3%
unpow254.3%
hypot-def63.9%
Simplified63.9%
Taylor expanded in x.im around 0 60.4%
Final simplification61.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (* y.im (log x.im))))
(if (<= x.im -5e-310)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 1.15e-131)
(* (pow (hypot x.im x.re) y.re) (sin (+ t_1 t_3)))
(if (or (<= x.im 1.45e-11) (not (<= x.im 7.8e+149)))
(* t_2 (exp (- (* y.re (log x.im)) t_0)))
(* (pow x.im y.re) (sin (fma y.re (atan2 x.im x.re) t_3))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = y_46_im * log(x_46_im);
double tmp;
if (x_46_im <= -5e-310) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 1.15e-131) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_1 + t_3));
} else if ((x_46_im <= 1.45e-11) || !(x_46_im <= 7.8e+149)) {
tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = pow(x_46_im, y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), t_3));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(y_46_im * log(x_46_im)) tmp = 0.0 if (x_46_im <= -5e-310) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 1.15e-131) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_1 + t_3))); elseif ((x_46_im <= 1.45e-11) || !(x_46_im <= 7.8e+149)) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); else tmp = Float64((x_46_im ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), t_3))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -5e-310], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.15e-131], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$1 + t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$im, 1.45e-11], N[Not[LessEqual[x$46$im, 7.8e+149]], $MachinePrecision]], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
t_3 := y.im \cdot \log x.im\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.15 \cdot 10^{-131}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t_1 + t_3\right)\\
\mathbf{elif}\;x.im \leq 1.45 \cdot 10^{-11} \lor \neg \left(x.im \leq 7.8 \cdot 10^{+149}\right):\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - t_0}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_3\right)\right)\\
\end{array}
\end{array}
if x.im < -4.999999999999985e-310Initial program 42.0%
Taylor expanded in y.im around 0 49.2%
Taylor expanded in x.im around -inf 55.5%
mul-1-neg55.5%
Simplified55.5%
if -4.999999999999985e-310 < x.im < 1.15000000000000011e-131Initial program 21.9%
exp-diff21.9%
+-rgt-identity21.9%
+-rgt-identity21.9%
exp-to-pow21.9%
hypot-def21.9%
*-commutative21.9%
exp-prod21.9%
+-commutative21.9%
*-commutative21.9%
Simplified74.6%
Taylor expanded in y.im around 0 48.9%
unpow248.9%
unpow248.9%
hypot-def67.5%
Simplified67.5%
Taylor expanded in x.re around 0 56.5%
if 1.15000000000000011e-131 < x.im < 1.45e-11 or 7.7999999999999998e149 < x.im Initial program 22.7%
Taylor expanded in y.im around 0 56.8%
Taylor expanded in x.re around 0 72.0%
if 1.45e-11 < x.im < 7.7999999999999998e149Initial program 55.0%
exp-diff55.0%
+-rgt-identity55.0%
+-rgt-identity55.0%
exp-to-pow55.0%
hypot-def55.0%
*-commutative55.0%
exp-prod55.0%
+-commutative55.0%
*-commutative55.0%
Simplified68.8%
Taylor expanded in y.im around 0 55.5%
unpow255.5%
unpow255.5%
hypot-def62.2%
Simplified62.2%
Taylor expanded in x.re around 0 54.1%
*-commutative54.1%
+-commutative54.1%
*-commutative54.1%
fma-def54.2%
Simplified54.2%
Final simplification59.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -4e-310)
(* (sin t_0) (exp (- (* y.re (log (- x.re))) (* y.im (atan2 x.im x.re)))))
(* (pow (hypot x.im x.re) y.re) (sin (+ t_0 (* 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 tmp;
if (x_46_re <= -4e-310) {
tmp = sin(t_0) * exp(((y_46_re * log(-x_46_re)) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((t_0 + (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 tmp;
if (x_46_re <= -4e-310) {
tmp = Math.sin(t_0) * Math.exp(((y_46_re * Math.log(-x_46_re)) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((t_0 + (y_46_im * Math.log(x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -4e-310: tmp = math.sin(t_0) * math.exp(((y_46_re * math.log(-x_46_re)) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((t_0 + (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)) tmp = 0.0 if (x_46_re <= -4e-310) tmp = Float64(sin(t_0) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - Float64(y_46_im * atan(x_46_im, x_46_re))))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(t_0 + Float64(y_46_im * log(x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -4e-310) tmp = sin(t_0) * exp(((y_46_re * log(-x_46_re)) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((t_0 + (y_46_im * log(x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -4e-310], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\sin t_0 \cdot e^{y.re \cdot \log \left(-x.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t_0 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -3.999999999999988e-310Initial program 39.2%
Taylor expanded in y.im around 0 51.3%
Taylor expanded in x.re around -inf 58.6%
mul-1-neg58.6%
Simplified58.6%
if -3.999999999999988e-310 < x.re Initial program 30.7%
exp-diff29.0%
+-rgt-identity29.0%
+-rgt-identity29.0%
exp-to-pow29.0%
hypot-def29.0%
*-commutative29.0%
exp-prod29.0%
+-commutative29.0%
*-commutative29.0%
Simplified68.8%
Taylor expanded in y.im around 0 52.2%
unpow252.2%
unpow252.2%
hypot-def61.2%
Simplified61.2%
Taylor expanded in x.im around 0 56.4%
Final simplification57.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.im (log (hypot x.im x.re)))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* t_1 (exp (* y.im (- (atan2 x.im x.re))))))
(t_3 (sin t_1)))
(if (<= y.im -3.3)
t_2
(if (<= y.im -2.3e-83)
t_0
(if (<= y.im 4e-113)
(* t_3 (pow (hypot x.im x.re) y.re))
(if (<= y.im 4e-91)
t_0
(if (<= y.im 1.02e+18)
(* t_3 (pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re))
t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_3 = sin(t_1);
double tmp;
if (y_46_im <= -3.3) {
tmp = t_2;
} else if (y_46_im <= -2.3e-83) {
tmp = t_0;
} else if (y_46_im <= 4e-113) {
tmp = t_3 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 4e-91) {
tmp = t_0;
} else if (y_46_im <= 1.02e+18) {
tmp = t_3 * pow(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} 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.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
double t_3 = Math.sin(t_1);
double tmp;
if (y_46_im <= -3.3) {
tmp = t_2;
} else if (y_46_im <= -2.3e-83) {
tmp = t_0;
} else if (y_46_im <= 4e-113) {
tmp = t_3 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_im <= 4e-91) {
tmp = t_0;
} else if (y_46_im <= 1.02e+18) {
tmp = t_3 * Math.pow(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re);
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) t_3 = math.sin(t_1) tmp = 0 if y_46_im <= -3.3: tmp = t_2 elif y_46_im <= -2.3e-83: tmp = t_0 elif y_46_im <= 4e-113: tmp = t_3 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_im <= 4e-91: tmp = t_0 elif y_46_im <= 1.02e+18: tmp = t_3 * math.pow(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))), y_46_re) else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) t_3 = sin(t_1) tmp = 0.0 if (y_46_im <= -3.3) tmp = t_2; elseif (y_46_im <= -2.3e-83) tmp = t_0; elseif (y_46_im <= 4e-113) tmp = Float64(t_3 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_im <= 4e-91) tmp = t_0; elseif (y_46_im <= 1.02e+18) tmp = Float64(t_3 * (sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) ^ y_46_re)); 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 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); t_3 = sin(t_1); tmp = 0.0; if (y_46_im <= -3.3) tmp = t_2; elseif (y_46_im <= -2.3e-83) tmp = t_0; elseif (y_46_im <= 4e-113) tmp = t_3 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_im <= 4e-91) tmp = t_0; elseif (y_46_im <= 1.02e+18) tmp = t_3 * (sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))) ^ y_46_re); 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[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $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[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[y$46$im, -3.3], t$95$2, If[LessEqual[y$46$im, -2.3e-83], t$95$0, If[LessEqual[y$46$im, 4e-113], 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, 4e-91], t$95$0, If[LessEqual[y$46$im, 1.02e+18], N[(t$95$3 * N[Power[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := t_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_3 := \sin t_1\\
\mathbf{if}\;y.im \leq -3.3:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-83}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{-113}:\\
\;\;\;\;t_3 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{-91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{+18}:\\
\;\;\;\;t_3 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.im < -3.2999999999999998 or 1.02e18 < y.im Initial program 29.4%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in x.re around inf 21.0%
Taylor expanded in y.re around 0 58.9%
*-commutative58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
Simplified58.9%
if -3.2999999999999998 < y.im < -2.2999999999999999e-83 or 3.99999999999999991e-113 < y.im < 4.00000000000000009e-91Initial program 42.0%
exp-diff42.0%
+-rgt-identity42.0%
+-rgt-identity42.0%
exp-to-pow42.0%
hypot-def42.0%
*-commutative42.0%
exp-prod42.0%
+-commutative42.0%
*-commutative42.0%
Simplified94.5%
Taylor expanded in y.im around 0 54.0%
unpow254.0%
unpow254.0%
hypot-def92.3%
Simplified92.3%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-def71.8%
Simplified71.8%
if -2.2999999999999999e-83 < y.im < 3.99999999999999991e-113Initial program 39.8%
exp-diff39.8%
+-rgt-identity39.8%
+-rgt-identity39.8%
exp-to-pow39.9%
hypot-def39.9%
*-commutative39.9%
exp-prod39.9%
+-commutative39.9%
*-commutative39.9%
Simplified86.0%
Taylor expanded in y.im around 0 63.4%
unpow263.4%
unpow263.4%
hypot-def86.0%
Simplified86.0%
Taylor expanded in y.re around inf 64.1%
if 4.00000000000000009e-91 < y.im < 1.02e18Initial program 44.2%
exp-diff44.3%
+-rgt-identity44.3%
+-rgt-identity44.3%
exp-to-pow44.3%
hypot-def44.3%
*-commutative44.3%
exp-prod44.2%
+-commutative44.2%
*-commutative44.2%
Simplified88.2%
div-inv88.2%
pow-flip88.2%
Applied egg-rr88.2%
Taylor expanded in y.im around 0 56.6%
*-commutative56.6%
+-commutative56.6%
unpow256.6%
unpow256.6%
Simplified56.6%
Final simplification61.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.im (log (hypot x.im x.re)))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* t_1 (exp (* y.im (- (atan2 x.im x.re))))))
(t_3 (* (sin t_1) (pow (hypot x.im x.re) y.re))))
(if (<= y.im -1.8)
t_2
(if (<= y.im -4e-79)
t_0
(if (<= y.im 3.9e-113)
t_3
(if (<= y.im 9e-91) t_0 (if (<= y.im 1.02e+18) t_3 t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_3 = sin(t_1) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.8) {
tmp = t_2;
} else if (y_46_im <= -4e-79) {
tmp = t_0;
} else if (y_46_im <= 3.9e-113) {
tmp = t_3;
} else if (y_46_im <= 9e-91) {
tmp = t_0;
} else if (y_46_im <= 1.02e+18) {
tmp = t_3;
} 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.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
double t_3 = Math.sin(t_1) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.8) {
tmp = t_2;
} else if (y_46_im <= -4e-79) {
tmp = t_0;
} else if (y_46_im <= 3.9e-113) {
tmp = t_3;
} else if (y_46_im <= 9e-91) {
tmp = t_0;
} else if (y_46_im <= 1.02e+18) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) t_3 = math.sin(t_1) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_im <= -1.8: tmp = t_2 elif y_46_im <= -4e-79: tmp = t_0 elif y_46_im <= 3.9e-113: tmp = t_3 elif y_46_im <= 9e-91: tmp = t_0 elif y_46_im <= 1.02e+18: tmp = t_3 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) t_3 = Float64(sin(t_1) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_im <= -1.8) tmp = t_2; elseif (y_46_im <= -4e-79) tmp = t_0; elseif (y_46_im <= 3.9e-113) tmp = t_3; elseif (y_46_im <= 9e-91) tmp = t_0; elseif (y_46_im <= 1.02e+18) tmp = t_3; 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 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); t_3 = sin(t_1) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_im <= -1.8) tmp = t_2; elseif (y_46_im <= -4e-79) tmp = t_0; elseif (y_46_im <= 3.9e-113) tmp = t_3; elseif (y_46_im <= 9e-91) tmp = t_0; elseif (y_46_im <= 1.02e+18) tmp = t_3; 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[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $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[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t$95$1], $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.8], t$95$2, If[LessEqual[y$46$im, -4e-79], t$95$0, If[LessEqual[y$46$im, 3.9e-113], t$95$3, If[LessEqual[y$46$im, 9e-91], t$95$0, If[LessEqual[y$46$im, 1.02e+18], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := t_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_3 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1.8:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq -4 \cdot 10^{-79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 3.9 \cdot 10^{-113}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{-91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{+18}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.im < -1.80000000000000004 or 1.02e18 < y.im Initial program 29.4%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in x.re around inf 21.0%
Taylor expanded in y.re around 0 58.9%
*-commutative58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
Simplified58.9%
if -1.80000000000000004 < y.im < -4e-79 or 3.8999999999999999e-113 < y.im < 8.99999999999999952e-91Initial program 42.0%
exp-diff42.0%
+-rgt-identity42.0%
+-rgt-identity42.0%
exp-to-pow42.0%
hypot-def42.0%
*-commutative42.0%
exp-prod42.0%
+-commutative42.0%
*-commutative42.0%
Simplified94.5%
Taylor expanded in y.im around 0 54.0%
unpow254.0%
unpow254.0%
hypot-def92.3%
Simplified92.3%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-def71.8%
Simplified71.8%
if -4e-79 < y.im < 3.8999999999999999e-113 or 8.99999999999999952e-91 < y.im < 1.02e18Initial program 40.9%
exp-diff41.0%
+-rgt-identity41.0%
+-rgt-identity41.0%
exp-to-pow41.0%
hypot-def41.0%
*-commutative41.0%
exp-prod40.9%
+-commutative40.9%
*-commutative40.9%
Simplified86.5%
Taylor expanded in y.im around 0 67.9%
unpow267.9%
unpow267.9%
hypot-def85.9%
Simplified85.9%
Taylor expanded in y.re around inf 61.4%
Final simplification60.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* t_0 (exp (* y.im (- (atan2 x.im x.re))))))
(t_2 (* (sin t_0) (pow x.re y.re))))
(if (<= y.re -8.2e+46)
t_2
(if (<= y.re -4.5e-278)
t_1
(if (<= y.re 5e-220)
(sin (* y.im (log (hypot x.im x.re))))
(if (<= y.re 9e+136) t_1 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
double t_2 = sin(t_0) * pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -8.2e+46) {
tmp = t_2;
} else if (y_46_re <= -4.5e-278) {
tmp = t_1;
} else if (y_46_re <= 5e-220) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 9e+136) {
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.sin(t_0) * Math.pow(x_46_re, y_46_re);
double tmp;
if (y_46_re <= -8.2e+46) {
tmp = t_2;
} else if (y_46_re <= -4.5e-278) {
tmp = t_1;
} else if (y_46_re <= 5e-220) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 9e+136) {
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 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) t_2 = math.sin(t_0) * math.pow(x_46_re, y_46_re) tmp = 0 if y_46_re <= -8.2e+46: tmp = t_2 elif y_46_re <= -4.5e-278: tmp = t_1 elif y_46_re <= 5e-220: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) elif y_46_re <= 9e+136: 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) t_2 = Float64(sin(t_0) * (x_46_re ^ y_46_re)) tmp = 0.0 if (y_46_re <= -8.2e+46) tmp = t_2; elseif (y_46_re <= -4.5e-278) tmp = t_1; elseif (y_46_re <= 5e-220) tmp = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_re <= 9e+136) 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 = y_46_re * atan2(x_46_im, x_46_re); t_1 = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); t_2 = sin(t_0) * (x_46_re ^ y_46_re); tmp = 0.0; if (y_46_re <= -8.2e+46) tmp = t_2; elseif (y_46_re <= -4.5e-278) tmp = t_1; elseif (y_46_re <= 5e-220) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_re <= 9e+136) 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e+46], t$95$2, If[LessEqual[y$46$re, -4.5e-278], t$95$1, If[LessEqual[y$46$re, 5e-220], N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 9e+136], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_2 := \sin t_0 \cdot {x.re}^{y.re}\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -4.5 \cdot 10^{-278}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-220}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.re < -8.19999999999999999e46 or 8.9999999999999999e136 < y.re Initial program 27.1%
Taylor expanded in y.im around 0 70.9%
Taylor expanded in x.re around inf 25.2%
Taylor expanded in y.im around 0 51.5%
*-commutative51.5%
*-commutative51.5%
Simplified51.5%
if -8.19999999999999999e46 < y.re < -4.4999999999999998e-278 or 5.0000000000000002e-220 < y.re < 8.9999999999999999e136Initial program 40.5%
Taylor expanded in y.im around 0 36.5%
Taylor expanded in x.re around inf 20.7%
Taylor expanded in y.re around 0 49.9%
*-commutative49.9%
*-commutative49.9%
distribute-rgt-neg-in49.9%
Simplified49.9%
if -4.4999999999999998e-278 < y.re < 5.0000000000000002e-220Initial program 37.4%
exp-diff37.4%
+-rgt-identity37.4%
+-rgt-identity37.4%
exp-to-pow37.4%
hypot-def37.4%
*-commutative37.4%
exp-prod37.4%
+-commutative37.4%
*-commutative37.4%
Simplified86.5%
Taylor expanded in y.im around 0 35.1%
unpow235.1%
unpow235.1%
hypot-def64.7%
Simplified64.7%
Taylor expanded in y.re around 0 29.4%
unpow229.4%
unpow229.4%
hypot-def64.7%
Simplified64.7%
Final simplification51.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -8.5e-41) (not (<= y.re 1.8e+19))) (* (sin (* y.re (atan2 x.im x.re))) (pow x.re y.re)) (sin (* y.im (log (hypot x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8.5e-41) || !(y_46_re <= 1.8e+19)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8.5e-41) || !(y_46_re <= 1.8e+19)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -8.5e-41) or not (y_46_re <= 1.8e+19): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re) else: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -8.5e-41) || !(y_46_re <= 1.8e+19)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); else tmp = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -8.5e-41) || ~((y_46_re <= 1.8e+19))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -8.5e-41], N[Not[LessEqual[y$46$re, 1.8e+19]], $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[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.5 \cdot 10^{-41} \lor \neg \left(y.re \leq 1.8 \cdot 10^{+19}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -8.4999999999999996e-41 or 1.8e19 < y.re Initial program 28.4%
Taylor expanded in y.im around 0 61.8%
Taylor expanded in x.re around inf 24.1%
Taylor expanded in y.im around 0 43.4%
*-commutative43.4%
*-commutative43.4%
Simplified43.4%
if -8.4999999999999996e-41 < y.re < 1.8e19Initial program 42.9%
exp-diff42.1%
+-rgt-identity42.1%
+-rgt-identity42.1%
exp-to-pow42.1%
hypot-def42.1%
*-commutative42.1%
exp-prod42.1%
+-commutative42.1%
*-commutative42.1%
Simplified83.1%
Taylor expanded in y.im around 0 38.6%
unpow238.6%
unpow238.6%
hypot-def51.3%
Simplified51.3%
Taylor expanded in y.re around 0 19.2%
unpow219.2%
unpow219.2%
hypot-def34.2%
Simplified34.2%
Final simplification39.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (sin (* y.im (log (hypot x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_im * log(hypot(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.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)
\end{array}
Initial program 35.2%
exp-diff31.3%
+-rgt-identity31.3%
+-rgt-identity31.3%
exp-to-pow31.3%
hypot-def31.3%
*-commutative31.3%
exp-prod31.3%
+-commutative31.3%
*-commutative31.3%
Simplified71.1%
Taylor expanded in y.im around 0 50.5%
unpow250.5%
unpow250.5%
hypot-def58.0%
Simplified58.0%
Taylor expanded in y.re around 0 9.6%
unpow29.6%
unpow29.6%
hypot-def17.7%
Simplified17.7%
Final simplification17.7%
herbie shell --seed 2023196
(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)))))