
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (sin (+ (* t_2 y.im) t_1))) (- INFINITY))
(* t_3 (fabs (sin (fma y.im (log (hypot x.im x.re)) t_1))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im 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_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * sin(((t_2 * y_46_im) + t_1))) <= -((double) INFINITY)) {
tmp = t_3 * fabs(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * sin(Float64(Float64(t_2 * y_46_im) + t_1))) <= Float64(-Inf)) tmp = Float64(t_3 * abs(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[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[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-Infinity)], 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] + t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \sin \left(t\_2 \cdot y.im + t\_1\right) \leq -\infty:\\
\;\;\;\;t\_3 \cdot \left|\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_1\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\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)))) < -inf.0Initial program 27.3%
fma-def27.3%
hypot-udef27.3%
*-commutative27.3%
add-sqr-sqrt0.0%
sqrt-unprod72.7%
pow272.7%
fma-udef72.7%
*-commutative72.7%
*-commutative72.7%
fma-def72.7%
Applied egg-rr72.7%
unpow272.7%
rem-sqrt-square72.7%
*-commutative72.7%
hypot-def72.7%
unpow272.7%
unpow272.7%
+-commutative72.7%
fma-def72.7%
fma-def72.7%
unpow272.7%
unpow272.7%
hypot-def72.7%
Simplified72.7%
if -inf.0 < (*.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 39.1%
fma-neg39.1%
hypot-def39.1%
distribute-rgt-neg-out39.1%
fma-def39.1%
hypot-def83.0%
*-commutative83.0%
Simplified83.0%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(if (<=
(*
(exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_2 y.im) t_1)))
(- INFINITY))
(fabs
(*
(sin t_1)
(/ (pow (hypot x.im x.re) y.re) (pow (exp (atan2 x.im x.re)) y.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im 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_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double tmp;
if ((exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_2 * y_46_im) + t_1))) <= -((double) INFINITY)) {
tmp = fabs((sin(t_1) * (pow(hypot(x_46_im, x_46_re), y_46_re) / pow(exp(atan2(x_46_im, x_46_re)), y_46_im))));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_2 * y_46_im) + t_1))) <= Float64(-Inf)) tmp = abs(Float64(sin(t_1) * Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / (exp(atan(x_46_im, x_46_re)) ^ y_46_im)))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Exp[N[(N[(t$95$2 * 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$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[Abs[N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
\mathbf{if}\;e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_2 \cdot y.im + t\_1\right) \leq -\infty:\\
\;\;\;\;\left|\sin t\_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\right|\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\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)))) < -inf.0Initial program 27.3%
Taylor expanded in y.im around 0 31.8%
add-sqr-sqrt22.7%
sqrt-unprod72.7%
pow272.7%
Applied egg-rr63.7%
Simplified63.7%
if -inf.0 < (*.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 39.1%
fma-neg39.1%
hypot-def39.1%
distribute-rgt-neg-out39.1%
fma-def39.1%
hypot-def83.0%
*-commutative83.0%
Simplified83.0%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -49000000.0)
(* t_1 (sin (fabs t_0)))
(if (<= y.re 2.65)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(* t_1 (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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -49000000.0) {
tmp = t_1 * sin(fabs(t_0));
} else if (y_46_re <= 2.65) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -49000000.0) tmp = Float64(t_1 * sin(abs(t_0))); elseif (y_46_re <= 2.65) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(t_1 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -49000000.0], N[(t$95$1 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.65], 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[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -49000000:\\
\;\;\;\;t\_1 \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 2.65:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -4.9e7Initial program 35.5%
Taylor expanded in y.im around 0 75.9%
*-commutative75.9%
add-sqr-sqrt48.5%
sqrt-unprod45.2%
pow245.2%
*-commutative45.2%
Applied egg-rr45.2%
unpow245.2%
rem-sqrt-square82.4%
Simplified82.4%
if -4.9e7 < y.re < 2.64999999999999991Initial program 41.7%
exp-diff41.7%
exp-to-pow41.7%
hypot-def41.7%
*-commutative41.7%
exp-prod41.4%
fma-def41.4%
hypot-def82.5%
*-commutative82.5%
Simplified82.5%
if 2.64999999999999991 < y.re Initial program 32.1%
Taylor expanded in y.re around 0 33.9%
unpow233.9%
unpow233.9%
hypot-def73.2%
Simplified73.2%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (fabs t_0)))))
(if (<= y.re -11000000.0)
t_1
(if (<= y.re 7.2e-16)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 8e+206)
t_1
(*
(pow (hypot x.im x.re) y.re)
(+ (sin t_0) (* y.im (* (log (hypot x.im x.re)) (cos 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 t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fabs(t_0));
double tmp;
if (y_46_re <= -11000000.0) {
tmp = t_1;
} else if (y_46_re <= 7.2e-16) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 8e+206) {
tmp = t_1;
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * (sin(t_0) + (y_46_im * (log(hypot(x_46_im, x_46_re)) * cos(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)) t_1 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(abs(t_0))) tmp = 0.0 if (y_46_re <= -11000000.0) tmp = t_1; elseif (y_46_re <= 7.2e-16) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 8e+206) tmp = t_1; else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * Float64(sin(t_0) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) * cos(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]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -11000000.0], t$95$1, If[LessEqual[y$46$re, 7.2e-16], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8e+206], t$95$1, N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{if}\;y.re \leq -11000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{-16}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \left(\sin t\_0 + y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \cos t\_0\right)\right)\\
\end{array}
\end{array}
if y.re < -1.1e7 or 7.19999999999999965e-16 < y.re < 8.0000000000000003e206Initial program 35.3%
Taylor expanded in y.im around 0 66.7%
*-commutative66.7%
add-sqr-sqrt40.2%
sqrt-unprod51.0%
pow251.0%
*-commutative51.0%
Applied egg-rr51.0%
unpow251.0%
rem-sqrt-square80.5%
Simplified80.5%
if -1.1e7 < y.re < 7.19999999999999965e-16Initial program 42.6%
exp-diff42.6%
exp-to-pow42.6%
hypot-def42.6%
*-commutative42.6%
exp-prod42.2%
fma-def42.2%
hypot-def83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y.re around 0 82.2%
rec-exp82.2%
distribute-rgt-neg-in82.2%
Simplified82.2%
if 8.0000000000000003e206 < y.re Initial program 23.8%
exp-diff19.0%
exp-to-pow19.0%
hypot-def19.0%
*-commutative19.0%
exp-prod19.0%
fma-def19.0%
hypot-def47.6%
*-commutative47.6%
Simplified47.6%
Taylor expanded in y.im around 0 66.7%
unpow266.7%
unpow266.7%
hypot-def66.7%
Simplified66.7%
Taylor expanded in y.im around 0 66.7%
unpow266.7%
unpow266.7%
hypot-def76.2%
Simplified76.2%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (fabs t_0)))))
(if (<= y.re -11000000.0)
t_1
(if (<= y.re 7.2e-16)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (or (<= y.re 4.6e+224) (not (<= y.re 1.5e+266)))
t_1
(*
(pow (hypot x.im 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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fabs(t_0));
double tmp;
if (y_46_re <= -11000000.0) {
tmp = t_1;
} else if (y_46_re <= 7.2e-16) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if ((y_46_re <= 4.6e+224) || !(y_46_re <= 1.5e+266)) {
tmp = t_1;
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(abs(t_0))) tmp = 0.0 if (y_46_re <= -11000000.0) tmp = t_1; elseif (y_46_re <= 7.2e-16) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif ((y_46_re <= 4.6e+224) || !(y_46_re <= 1.5e+266)) tmp = t_1; else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -11000000.0], t$95$1, If[LessEqual[y$46$re, 7.2e-16], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, 4.6e+224], N[Not[LessEqual[y$46$re, 1.5e+266]], $MachinePrecision]], t$95$1, N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{if}\;y.re \leq -11000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{-16}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 4.6 \cdot 10^{+224} \lor \neg \left(y.re \leq 1.5 \cdot 10^{+266}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.1e7 or 7.19999999999999965e-16 < y.re < 4.60000000000000039e224 or 1.4999999999999999e266 < y.re Initial program 33.9%
Taylor expanded in y.im around 0 65.2%
*-commutative65.2%
add-sqr-sqrt39.3%
sqrt-unprod49.1%
pow249.1%
*-commutative49.1%
Applied egg-rr49.1%
unpow249.1%
rem-sqrt-square79.5%
Simplified79.5%
if -1.1e7 < y.re < 7.19999999999999965e-16Initial program 42.6%
exp-diff42.6%
exp-to-pow42.6%
hypot-def42.6%
*-commutative42.6%
exp-prod42.2%
fma-def42.2%
hypot-def83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y.re around 0 82.2%
rec-exp82.2%
distribute-rgt-neg-in82.2%
Simplified82.2%
if 4.60000000000000039e224 < y.re < 1.4999999999999999e266Initial program 27.3%
exp-diff27.3%
exp-to-pow27.3%
hypot-def27.3%
*-commutative27.3%
exp-prod27.3%
fma-def27.3%
hypot-def54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in y.im around 0 72.7%
unpow272.7%
unpow272.7%
hypot-def72.7%
Simplified72.7%
Taylor expanded in y.re around 0 36.4%
+-commutative36.4%
unpow236.4%
unpow236.4%
hypot-def90.9%
hypot-def36.4%
unpow236.4%
unpow236.4%
+-commutative36.4%
unpow236.4%
unpow236.4%
hypot-def90.9%
Simplified90.9%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -15200000.0)
(* t_1 (sin (fabs t_0)))
(if (<= y.re 0.015)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -15200000.0) {
tmp = t_1 * sin(fabs(t_0));
} else if (y_46_re <= 0.015) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -15200000.0) tmp = Float64(t_1 * sin(abs(t_0))); elseif (y_46_re <= 0.015) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -15200000.0], N[(t$95$1 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.015], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -15200000:\\
\;\;\;\;t\_1 \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 0.015:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.52e7Initial program 35.5%
Taylor expanded in y.im around 0 75.9%
*-commutative75.9%
add-sqr-sqrt48.5%
sqrt-unprod45.2%
pow245.2%
*-commutative45.2%
Applied egg-rr45.2%
unpow245.2%
rem-sqrt-square82.4%
Simplified82.4%
if -1.52e7 < y.re < 0.014999999999999999Initial program 41.7%
exp-diff41.7%
exp-to-pow41.7%
hypot-def41.7%
*-commutative41.7%
exp-prod41.4%
fma-def41.4%
hypot-def82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.re around 0 80.4%
rec-exp80.4%
distribute-rgt-neg-in80.4%
Simplified80.4%
if 0.014999999999999999 < y.re Initial program 32.1%
Taylor expanded in y.re around 0 33.9%
unpow233.9%
unpow233.9%
hypot-def73.2%
Simplified73.2%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -11000000.0)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 3.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(*
(pow (hypot x.im 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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -11000000.0) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 3.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -11000000.0) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 3.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -11000000.0], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 3.0], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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}\;y.re \leq -11000000:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 3:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.1e7Initial program 35.5%
Taylor expanded in y.im around 0 75.9%
Taylor expanded in y.re around 0 82.4%
if -1.1e7 < y.re < 3Initial program 42.2%
exp-diff42.2%
exp-to-pow42.2%
hypot-def42.2%
*-commutative42.2%
exp-prod41.9%
fma-def41.9%
hypot-def82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.re around 0 80.5%
rec-exp80.5%
distribute-rgt-neg-in80.5%
Simplified80.5%
if 3 < y.re Initial program 30.9%
exp-diff23.6%
exp-to-pow23.6%
hypot-def23.6%
*-commutative23.6%
exp-prod23.6%
fma-def23.6%
hypot-def49.1%
*-commutative49.1%
Simplified49.1%
Taylor expanded in y.im around 0 60.0%
unpow260.0%
unpow260.0%
hypot-def60.0%
Simplified60.0%
Taylor expanded in y.re around 0 30.9%
+-commutative30.9%
unpow230.9%
unpow230.9%
hypot-def70.9%
hypot-def30.9%
unpow230.9%
unpow230.9%
+-commutative30.9%
unpow230.9%
unpow230.9%
hypot-def70.9%
Simplified70.9%
Final simplification78.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -3600.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im 4e-59)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -3600.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 <= 4e-59) {
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 {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -3600.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 <= 4e-59) 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)); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3600.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, 4e-59], 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], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -3600:\\
\;\;\;\;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 4 \cdot 10^{-59}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\end{array}
\end{array}
if y.im < -3600Initial program 36.4%
Taylor expanded in y.im around 0 50.5%
Taylor expanded in y.re around 0 57.0%
*-commutative57.0%
distribute-rgt-neg-in57.0%
exp-prod58.5%
Simplified58.5%
if -3600 < y.im < 4.0000000000000001e-59Initial program 36.2%
exp-diff36.2%
exp-to-pow36.2%
hypot-def36.2%
*-commutative36.2%
exp-prod36.2%
fma-def36.2%
hypot-def89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y.im around 0 56.3%
unpow256.3%
unpow256.3%
hypot-def87.4%
Simplified87.4%
if 4.0000000000000001e-59 < y.im Initial program 43.1%
Taylor expanded in y.im around 0 61.2%
Taylor expanded in y.re around 0 65.5%
Final simplification74.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (* t_0 (sin (* y.im (log (hypot x.im x.re))))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.im -45000000000000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -2.6e-263)
t_1
(if (<= y.im 7.8e-219)
(* (sin t_2) t_0)
(if (<= y.im 2.7e-143)
t_1
(if (<= y.im 1.2e-80)
(* t_0 (sin (- t_2 (* y.im (log (/ -1.0 x.re))))))
(if (<= y.im 4e+99)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
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 = 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 t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -45000000000000.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 <= -2.6e-263) {
tmp = t_1;
} else if (y_46_im <= 7.8e-219) {
tmp = sin(t_2) * t_0;
} else if (y_46_im <= 2.7e-143) {
tmp = t_1;
} else if (y_46_im <= 1.2e-80) {
tmp = t_0 * sin((t_2 - (y_46_im * log((-1.0 / x_46_re)))));
} else if (y_46_im <= 4e+99) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * 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.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 t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -45000000000000.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 <= -2.6e-263) {
tmp = t_1;
} else if (y_46_im <= 7.8e-219) {
tmp = Math.sin(t_2) * t_0;
} else if (y_46_im <= 2.7e-143) {
tmp = t_1;
} else if (y_46_im <= 1.2e-80) {
tmp = t_0 * Math.sin((t_2 - (y_46_im * Math.log((-1.0 / x_46_re)))));
} else if (y_46_im <= 4e+99) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * 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.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)))) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -45000000000000.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 <= -2.6e-263: tmp = t_1 elif y_46_im <= 7.8e-219: tmp = math.sin(t_2) * t_0 elif y_46_im <= 2.7e-143: tmp = t_1 elif y_46_im <= 1.2e-80: tmp = t_0 * math.sin((t_2 - (y_46_im * math.log((-1.0 / x_46_re))))) elif y_46_im <= 4e+99: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * 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 = 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))))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -45000000000000.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 <= -2.6e-263) tmp = t_1; elseif (y_46_im <= 7.8e-219) tmp = Float64(sin(t_2) * t_0); elseif (y_46_im <= 2.7e-143) tmp = t_1; elseif (y_46_im <= 1.2e-80) tmp = Float64(t_0 * sin(Float64(t_2 - Float64(y_46_im * log(Float64(-1.0 / x_46_re)))))); elseif (y_46_im <= 4e+99) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * 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 = 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)))); t_2 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -45000000000000.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 <= -2.6e-263) tmp = t_1; elseif (y_46_im <= 7.8e-219) tmp = sin(t_2) * t_0; elseif (y_46_im <= 2.7e-143) tmp = t_1; elseif (y_46_im <= 1.2e-80) tmp = t_0 * sin((t_2 - (y_46_im * log((-1.0 / x_46_re))))); elseif (y_46_im <= 4e+99) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * 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[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]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -45000000000000.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, -2.6e-263], t$95$1, If[LessEqual[y$46$im, 7.8e-219], N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 2.7e-143], t$95$1, If[LessEqual[y$46$im, 1.2e-80], N[(t$95$0 * N[Sin[N[(t$95$2 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4e+99], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $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 := {\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)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -45000000000000:\\
\;\;\;\;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 -2.6 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 7.8 \cdot 10^{-219}:\\
\;\;\;\;\sin t\_2 \cdot t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{-80}:\\
\;\;\;\;t\_0 \cdot \sin \left(t\_2 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{elif}\;y.im \leq 4 \cdot 10^{+99}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \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 < -4.5e13Initial program 37.0%
Taylor expanded in y.im around 0 51.3%
Taylor expanded in y.re around 0 57.9%
*-commutative57.9%
distribute-rgt-neg-in57.9%
exp-prod59.4%
Simplified59.4%
if -4.5e13 < y.im < -2.6e-263 or 7.79999999999999974e-219 < y.im < 2.70000000000000009e-143Initial program 37.1%
exp-diff37.1%
exp-to-pow37.1%
hypot-def37.1%
*-commutative37.1%
exp-prod37.1%
fma-def37.1%
hypot-def86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in y.im around 0 55.4%
unpow255.4%
unpow255.4%
hypot-def84.0%
Simplified84.0%
Taylor expanded in y.re around 0 35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def83.2%
hypot-def35.1%
unpow235.1%
unpow235.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-def83.2%
Simplified83.2%
if -2.6e-263 < y.im < 7.79999999999999974e-219Initial program 27.5%
Taylor expanded in y.im around 0 39.9%
Taylor expanded in y.im around 0 39.9%
unpow239.9%
unpow239.9%
hypot-def79.8%
Simplified79.8%
if 2.70000000000000009e-143 < y.im < 1.2e-80Initial program 45.8%
exp-diff45.8%
exp-to-pow45.8%
hypot-def45.8%
*-commutative45.8%
exp-prod45.8%
fma-def45.8%
hypot-def91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in y.im around 0 69.6%
unpow269.6%
unpow269.6%
hypot-def91.9%
Simplified91.9%
Taylor expanded in x.re around -inf 84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
Simplified84.4%
if 1.2e-80 < y.im < 3.9999999999999999e99Initial program 44.2%
Taylor expanded in y.im around 0 58.2%
Taylor expanded in y.re around 0 67.1%
if 3.9999999999999999e99 < y.im Initial program 41.9%
Taylor expanded in y.im around 0 63.7%
Taylor expanded in y.re around 0 66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
Simplified66.2%
Final simplification72.3%
(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))))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.im -3200000000000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -2.55e-263)
t_1
(if (<= y.im 5.3e-222)
(* (sin t_2) t_0)
(if (<= y.im 2.7e-143)
t_1
(if (<= y.im 4.4e-85)
(* t_0 (sin (- t_2 (* y.im (log (/ -1.0 x.re))))))
(if (<= y.im 5.8e+30)
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 t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -3200000000000.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 <= -2.55e-263) {
tmp = t_1;
} else if (y_46_im <= 5.3e-222) {
tmp = sin(t_2) * t_0;
} else if (y_46_im <= 2.7e-143) {
tmp = t_1;
} else if (y_46_im <= 4.4e-85) {
tmp = t_0 * sin((t_2 - (y_46_im * log((-1.0 / x_46_re)))));
} else if (y_46_im <= 5.8e+30) {
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 t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -3200000000000.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 <= -2.55e-263) {
tmp = t_1;
} else if (y_46_im <= 5.3e-222) {
tmp = Math.sin(t_2) * t_0;
} else if (y_46_im <= 2.7e-143) {
tmp = t_1;
} else if (y_46_im <= 4.4e-85) {
tmp = t_0 * Math.sin((t_2 - (y_46_im * Math.log((-1.0 / x_46_re)))));
} else if (y_46_im <= 5.8e+30) {
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)))) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_im <= -3200000000000.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 <= -2.55e-263: tmp = t_1 elif y_46_im <= 5.3e-222: tmp = math.sin(t_2) * t_0 elif y_46_im <= 2.7e-143: tmp = t_1 elif y_46_im <= 4.4e-85: tmp = t_0 * math.sin((t_2 - (y_46_im * math.log((-1.0 / x_46_re))))) elif y_46_im <= 5.8e+30: 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))))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -3200000000000.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 <= -2.55e-263) tmp = t_1; elseif (y_46_im <= 5.3e-222) tmp = Float64(sin(t_2) * t_0); elseif (y_46_im <= 2.7e-143) tmp = t_1; elseif (y_46_im <= 4.4e-85) tmp = Float64(t_0 * sin(Float64(t_2 - Float64(y_46_im * log(Float64(-1.0 / x_46_re)))))); elseif (y_46_im <= 5.8e+30) 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)))); t_2 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_im <= -3200000000000.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 <= -2.55e-263) tmp = t_1; elseif (y_46_im <= 5.3e-222) tmp = sin(t_2) * t_0; elseif (y_46_im <= 2.7e-143) tmp = t_1; elseif (y_46_im <= 4.4e-85) tmp = t_0 * sin((t_2 - (y_46_im * log((-1.0 / x_46_re))))); elseif (y_46_im <= 5.8e+30) 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]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3200000000000.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, -2.55e-263], t$95$1, If[LessEqual[y$46$im, 5.3e-222], N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 2.7e-143], t$95$1, If[LessEqual[y$46$im, 4.4e-85], N[(t$95$0 * N[Sin[N[(t$95$2 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.8e+30], 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)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -3200000000000:\\
\;\;\;\;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 -2.55 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5.3 \cdot 10^{-222}:\\
\;\;\;\;\sin t\_2 \cdot t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 4.4 \cdot 10^{-85}:\\
\;\;\;\;t\_0 \cdot \sin \left(t\_2 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+30}:\\
\;\;\;\;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 < -3.2e12Initial program 37.0%
Taylor expanded in y.im around 0 51.3%
Taylor expanded in y.re around 0 57.9%
*-commutative57.9%
distribute-rgt-neg-in57.9%
exp-prod59.4%
Simplified59.4%
if -3.2e12 < y.im < -2.54999999999999985e-263 or 5.29999999999999981e-222 < y.im < 2.70000000000000009e-143 or 4.4e-85 < y.im < 5.7999999999999996e30Initial program 39.3%
exp-diff38.4%
exp-to-pow38.4%
hypot-def38.4%
*-commutative38.4%
exp-prod38.4%
fma-def38.4%
hypot-def84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in y.im around 0 56.2%
unpow256.2%
unpow256.2%
hypot-def81.4%
Simplified81.4%
Taylor expanded in y.re around 0 36.0%
+-commutative36.0%
unpow236.0%
unpow236.0%
hypot-def80.0%
hypot-def36.0%
unpow236.0%
unpow236.0%
+-commutative36.0%
unpow236.0%
unpow236.0%
hypot-def80.0%
Simplified80.0%
if -2.54999999999999985e-263 < y.im < 5.29999999999999981e-222Initial program 27.5%
Taylor expanded in y.im around 0 39.9%
Taylor expanded in y.im around 0 39.9%
unpow239.9%
unpow239.9%
hypot-def79.8%
Simplified79.8%
if 2.70000000000000009e-143 < y.im < 4.4e-85Initial program 45.8%
exp-diff45.8%
exp-to-pow45.8%
hypot-def45.8%
*-commutative45.8%
exp-prod45.8%
fma-def45.8%
hypot-def91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in y.im around 0 69.6%
unpow269.6%
unpow269.6%
hypot-def91.9%
Simplified91.9%
Taylor expanded in x.re around -inf 84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
Simplified84.4%
if 5.7999999999999996e30 < y.im Initial program 41.2%
Taylor expanded in y.im around 0 61.6%
Taylor expanded in y.re around 0 63.7%
*-commutative63.7%
distribute-rgt-neg-in63.7%
Simplified63.7%
Final simplification72.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 -1800000000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -2.6e-263)
t_1
(if (<= y.im 3.5e-219)
(* (sin (* y.re (atan2 x.im x.re))) t_0)
(if (<= y.im 5.8e+30)
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 <= -1800000000.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 <= -2.6e-263) {
tmp = t_1;
} else if (y_46_im <= 3.5e-219) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_im <= 5.8e+30) {
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 <= -1800000000.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 <= -2.6e-263) {
tmp = t_1;
} else if (y_46_im <= 3.5e-219) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_im <= 5.8e+30) {
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 <= -1800000000.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 <= -2.6e-263: tmp = t_1 elif y_46_im <= 3.5e-219: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 elif y_46_im <= 5.8e+30: 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 <= -1800000000.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 <= -2.6e-263) tmp = t_1; elseif (y_46_im <= 3.5e-219) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); elseif (y_46_im <= 5.8e+30) 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 <= -1800000000.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 <= -2.6e-263) tmp = t_1; elseif (y_46_im <= 3.5e-219) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_0; elseif (y_46_im <= 5.8e+30) 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, -1800000000.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, -2.6e-263], t$95$1, If[LessEqual[y$46$im, 3.5e-219], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 5.8e+30], 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 -1800000000:\\
\;\;\;\;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 -2.6 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 3.5 \cdot 10^{-219}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+30}:\\
\;\;\;\;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.8e9Initial program 37.0%
Taylor expanded in y.im around 0 51.3%
Taylor expanded in y.re around 0 57.9%
*-commutative57.9%
distribute-rgt-neg-in57.9%
exp-prod59.4%
Simplified59.4%
if -1.8e9 < y.im < -2.6e-263 or 3.50000000000000011e-219 < y.im < 5.7999999999999996e30Initial program 40.0%
exp-diff39.2%
exp-to-pow39.2%
hypot-def39.2%
*-commutative39.2%
exp-prod39.2%
fma-def39.2%
hypot-def85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y.im around 0 57.7%
unpow257.7%
unpow257.7%
hypot-def82.5%
Simplified82.5%
Taylor expanded in y.re around 0 33.8%
+-commutative33.8%
unpow233.8%
unpow233.8%
hypot-def76.4%
hypot-def33.8%
unpow233.8%
unpow233.8%
+-commutative33.8%
unpow233.8%
unpow233.8%
hypot-def76.4%
Simplified76.4%
if -2.6e-263 < y.im < 3.50000000000000011e-219Initial program 27.5%
Taylor expanded in y.im around 0 39.9%
Taylor expanded in y.im around 0 39.9%
unpow239.9%
unpow239.9%
hypot-def79.8%
Simplified79.8%
if 5.7999999999999996e30 < y.im Initial program 41.2%
Taylor expanded in y.im around 0 61.6%
Taylor expanded in y.re around 0 63.7%
*-commutative63.7%
distribute-rgt-neg-in63.7%
Simplified63.7%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))
(if (<= y.im -35000000.0)
t_0
(if (<= y.im -1.86e-62)
(sin (* y.im (log (hypot x.im x.re))))
(if (<= y.im 2e+31)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -35000000.0) {
tmp = t_0;
} else if (y_46_im <= -1.86e-62) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 2e+31) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -35000000.0) {
tmp = t_0;
} else if (y_46_im <= -1.86e-62) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 2e+31) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) tmp = 0 if y_46_im <= -35000000.0: tmp = t_0 elif y_46_im <= -1.86e-62: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) elif y_46_im <= 2e+31: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))))) tmp = 0.0 if (y_46_im <= -35000000.0) tmp = t_0; elseif (y_46_im <= -1.86e-62) tmp = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_im <= 2e+31) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); tmp = 0.0; if (y_46_im <= -35000000.0) tmp = t_0; elseif (y_46_im <= -1.86e-62) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_im <= 2e+31) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[(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]}, If[LessEqual[y$46$im, -35000000.0], t$95$0, If[LessEqual[y$46$im, -1.86e-62], 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$im, 2e+31], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{if}\;y.im \leq -35000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.86 \cdot 10^{-62}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+31}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -3.5e7 or 1.9999999999999999e31 < y.im Initial program 38.9%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in y.re around 0 60.5%
*-commutative60.5%
distribute-rgt-neg-in60.5%
Simplified60.5%
if -3.5e7 < y.im < -1.86000000000000001e-62Initial program 15.7%
exp-diff15.7%
exp-to-pow15.7%
hypot-def15.7%
*-commutative15.7%
exp-prod15.7%
fma-def15.7%
hypot-def83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y.im around 0 31.3%
unpow231.3%
unpow231.3%
hypot-def74.2%
Simplified74.2%
Taylor expanded in y.re around 0 6.1%
unpow26.1%
unpow26.1%
hypot-def47.8%
Simplified47.8%
if -1.86000000000000001e-62 < y.im < 1.9999999999999999e31Initial program 42.1%
Taylor expanded in y.im around 0 49.6%
Taylor expanded in y.im around 0 48.0%
unpow248.0%
unpow248.0%
hypot-def63.9%
Simplified63.9%
Final simplification60.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -35000000.0)
(* y.re (* (atan2 x.im x.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.im -1.8e-62)
(sin (* y.im (log (hypot x.im x.re))))
(if (<= y.im 6.9e+31)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im 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_im <= -35000000.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.8e-62) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 6.9e+31) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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_im <= -35000000.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.8e-62) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 6.9e+31) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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_im <= -35000000.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.8e-62: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) elif y_46_im <= 6.9e+31: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 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_im <= -35000000.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.8e-62) tmp = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_im <= 6.9e+31) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(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_im <= -35000000.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.8e-62) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); elseif (y_46_im <= 6.9e+31) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, 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[LessEqual[y$46$im, -35000000.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.8e-62], 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$im, 6.9e+31], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(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.im \leq -35000000:\\
\;\;\;\;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.8 \cdot 10^{-62}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 6.9 \cdot 10^{+31}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;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 < -3.5e7Initial program 37.0%
Taylor expanded in y.im around 0 51.3%
Taylor expanded in y.re around 0 57.9%
*-commutative57.9%
distribute-rgt-neg-in57.9%
exp-prod59.4%
Simplified59.4%
if -3.5e7 < y.im < -1.8e-62Initial program 15.7%
exp-diff15.7%
exp-to-pow15.7%
hypot-def15.7%
*-commutative15.7%
exp-prod15.7%
fma-def15.7%
hypot-def83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y.im around 0 31.3%
unpow231.3%
unpow231.3%
hypot-def74.2%
Simplified74.2%
Taylor expanded in y.re around 0 6.1%
unpow26.1%
unpow26.1%
hypot-def47.8%
Simplified47.8%
if -1.8e-62 < y.im < 6.8999999999999999e31Initial program 42.1%
Taylor expanded in y.im around 0 49.6%
Taylor expanded in y.im around 0 48.0%
unpow248.0%
unpow248.0%
hypot-def63.9%
Simplified63.9%
if 6.8999999999999999e31 < y.im Initial program 41.2%
Taylor expanded in y.im around 0 61.6%
Taylor expanded in y.re around 0 63.7%
*-commutative63.7%
distribute-rgt-neg-in63.7%
Simplified63.7%
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) (exp (* (atan2 x.im x.re) (- y.im)))))))
(if (<= y.im -35000000.0)
t_1
(if (<= y.im -2.8e-210)
t_0
(if (<= y.im 4.6e-223)
(* y.re (atan2 x.im x.re))
(if (<= y.im 1.85e-122) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -35000000.0) {
tmp = t_1;
} else if (y_46_im <= -2.8e-210) {
tmp = t_0;
} else if (y_46_im <= 4.6e-223) {
tmp = y_46_re * atan2(x_46_im, x_46_re);
} else if (y_46_im <= 1.85e-122) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_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) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -35000000.0) {
tmp = t_1;
} else if (y_46_im <= -2.8e-210) {
tmp = t_0;
} else if (y_46_im <= 4.6e-223) {
tmp = y_46_re * Math.atan2(x_46_im, x_46_re);
} else if (y_46_im <= 1.85e-122) {
tmp = t_0;
} else {
tmp = t_1;
}
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) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) tmp = 0 if y_46_im <= -35000000.0: tmp = t_1 elif y_46_im <= -2.8e-210: tmp = t_0 elif y_46_im <= 4.6e-223: tmp = y_46_re * math.atan2(x_46_im, x_46_re) elif y_46_im <= 1.85e-122: tmp = t_0 else: tmp = t_1 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 * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))) tmp = 0.0 if (y_46_im <= -35000000.0) tmp = t_1; elseif (y_46_im <= -2.8e-210) tmp = t_0; elseif (y_46_im <= 4.6e-223) tmp = Float64(y_46_re * atan(x_46_im, x_46_re)); elseif (y_46_im <= 1.85e-122) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); tmp = 0.0; if (y_46_im <= -35000000.0) tmp = t_1; elseif (y_46_im <= -2.8e-210) tmp = t_0; elseif (y_46_im <= 4.6e-223) tmp = y_46_re * atan2(x_46_im, x_46_re); elseif (y_46_im <= 1.85e-122) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$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[(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]}, If[LessEqual[y$46$im, -35000000.0], t$95$1, If[LessEqual[y$46$im, -2.8e-210], t$95$0, If[LessEqual[y$46$im, 4.6e-223], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.85e-122], t$95$0, t$95$1]]]]]]
\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 \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{if}\;y.im \leq -35000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -2.8 \cdot 10^{-210}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{-223}:\\
\;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{elif}\;y.im \leq 1.85 \cdot 10^{-122}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3.5e7 or 1.8499999999999999e-122 < y.im Initial program 40.2%
Taylor expanded in y.im around 0 56.4%
Taylor expanded in y.re around 0 52.8%
*-commutative52.8%
distribute-rgt-neg-in52.8%
Simplified52.8%
if -3.5e7 < y.im < -2.8e-210 or 4.5999999999999999e-223 < y.im < 1.8499999999999999e-122Initial program 35.7%
exp-diff35.7%
exp-to-pow35.7%
hypot-def35.7%
*-commutative35.7%
exp-prod35.7%
fma-def35.7%
hypot-def89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y.im around 0 55.5%
unpow255.5%
unpow255.5%
hypot-def86.5%
Simplified86.5%
Taylor expanded in y.re around 0 16.5%
unpow216.5%
unpow216.5%
hypot-def40.3%
Simplified40.3%
if -2.8e-210 < y.im < 4.5999999999999999e-223Initial program 35.1%
Taylor expanded in y.im around 0 45.4%
Taylor expanded in y.re around 0 46.1%
*-commutative46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
Taylor expanded in y.im around 0 46.1%
*-commutative46.1%
Simplified46.1%
Final simplification48.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -2.3e-246) (* y.re (* (atan2 x.im x.re) (- 1.0 (* (atan2 x.im x.re) y.im)))) (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 (x_46_re <= -2.3e-246) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im)));
} 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 (x_46_re <= -2.3e-246) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * (1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} 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 x_46_re <= -2.3e-246: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * (1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im))) 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 (x_46_re <= -2.3e-246) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)))); 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 (x_46_re <= -2.3e-246) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im))); 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[LessEqual[x$46$re, -2.3e-246], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.3 \cdot 10^{-246}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if x.re < -2.2999999999999998e-246Initial program 38.0%
Taylor expanded in y.im around 0 53.5%
Taylor expanded in y.re around 0 51.3%
*-commutative51.3%
distribute-rgt-neg-in51.3%
Simplified51.3%
Taylor expanded in y.im around 0 23.4%
mul-1-neg23.4%
*-commutative23.4%
distribute-rgt-neg-in23.4%
Simplified23.4%
if -2.2999999999999998e-246 < x.re Initial program 38.3%
exp-diff34.6%
exp-to-pow34.6%
hypot-def34.6%
*-commutative34.6%
exp-prod33.5%
fma-def33.5%
hypot-def68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in y.im around 0 46.1%
unpow246.1%
unpow246.1%
hypot-def58.6%
Simplified58.6%
Taylor expanded in y.re around 0 9.3%
unpow29.3%
unpow29.3%
hypot-def21.3%
Simplified21.3%
Final simplification22.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (- 1.0 (* (atan2 x.im x.re) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * (atan2(x_46im, x_46re) * (1.0d0 - (atan2(x_46im, x_46re) * y_46im)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * (Math.atan2(x_46_im, x_46_re) * (1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * (math.atan2(x_46_im, x_46_re) * (1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (atan2(x_46_im, x_46_re) * y_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)
\end{array}
Initial program 38.1%
Taylor expanded in y.im around 0 50.0%
Taylor expanded in y.re around 0 39.7%
*-commutative39.7%
distribute-rgt-neg-in39.7%
Simplified39.7%
Taylor expanded in y.im around 0 16.0%
mul-1-neg16.0%
*-commutative16.0%
distribute-rgt-neg-in16.0%
Simplified16.0%
Final simplification16.0%
(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 38.1%
Taylor expanded in y.im around 0 50.0%
Taylor expanded in y.re around 0 39.7%
*-commutative39.7%
distribute-rgt-neg-in39.7%
Simplified39.7%
Taylor expanded in y.im around 0 14.4%
*-commutative14.4%
Simplified14.4%
Final simplification14.4%
herbie shell --seed 2024031
(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)))))