
(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 (* (atan2 x.im x.re) y.im))
(t_1 (log (hypot x.re x.im)))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_4 (exp (- (* t_3 y.re) t_0))))
(if (<= (* t_4 (sin (+ (* t_3 y.im) t_2))) (- INFINITY))
(*
t_4
(fabs
(sin (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.im x.re)))))))
(* (exp (- (* y.re t_1) t_0)) (sin (fma t_1 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_4 = exp(((t_3 * y_46_re) - t_0));
double tmp;
if ((t_4 * sin(((t_3 * y_46_im) + t_2))) <= -((double) INFINITY)) {
tmp = t_4 * fabs(sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_im, x_46_re))))));
} else {
tmp = exp(((y_46_re * t_1) - t_0)) * sin(fma(t_1, y_46_im, t_2));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_4 = exp(Float64(Float64(t_3 * y_46_re) - t_0)) tmp = 0.0 if (Float64(t_4 * sin(Float64(Float64(t_3 * y_46_im) + t_2))) <= Float64(-Inf)) tmp = Float64(t_4 * abs(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))); else tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * sin(fma(t_1, 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$4 = N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$4 * N[Sin[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$4 * N[Abs[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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_4 := e^{t_3 \cdot y.re - t_0}\\
\mathbf{if}\;t_4 \cdot \sin \left(t_3 \cdot y.im + t_2\right) \leq -\infty:\\
\;\;\;\;t_4 \cdot \left|\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_0} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, t_2\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 36.8%
fma-def36.8%
hypot-udef36.8%
*-commutative36.8%
add-sqr-sqrt0.0%
sqrt-unprod63.2%
pow263.2%
fma-udef63.2%
*-commutative63.2%
*-commutative63.2%
fma-def63.2%
Applied egg-rr63.2%
unpow263.2%
rem-sqrt-square63.2%
hypot-def63.2%
unpow263.2%
unpow263.2%
+-commutative63.2%
*-commutative63.2%
fma-def63.2%
+-commutative63.2%
fma-def63.2%
unpow263.2%
unpow263.2%
hypot-def63.2%
Simplified63.2%
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 40.6%
Simplified86.9%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 40.3%
Simplified83.2%
Final simplification83.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 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_2))))
(if (<= y.im -1.95e-18)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.im 34000.0)
(*
(sin (fma t_0 y.im t_1))
(/ (pow (hypot x.re x.im) y.re) (+ t_2 1.0)))
(if (<= y.im 1.7e+251)
(* t_3 (sin t_1))
(if (<= y.im 1e+300)
(* (exp (- (* y.re t_0) t_2)) (sin (+ t_1 (* y.im (log x.re)))))
(* t_3 (sin (pow (cbrt t_1) 3.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 t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2));
double tmp;
if (y_46_im <= -1.95e-18) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 34000.0) {
tmp = sin(fma(t_0, y_46_im, t_1)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0));
} else if (y_46_im <= 1.7e+251) {
tmp = t_3 * sin(t_1);
} else if (y_46_im <= 1e+300) {
tmp = exp(((y_46_re * t_0) - t_2)) * sin((t_1 + (y_46_im * log(x_46_re))));
} else {
tmp = t_3 * sin(pow(cbrt(t_1), 3.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)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_2)) tmp = 0.0 if (y_46_im <= -1.95e-18) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_im <= 34000.0) tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_2 + 1.0))); elseif (y_46_im <= 1.7e+251) tmp = Float64(t_3 * sin(t_1)); elseif (y_46_im <= 1e+300) tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_2)) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); else tmp = Float64(t_3 * sin((cbrt(t_1) ^ 3.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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(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] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.95e-18], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 34000.0], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.7e+251], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1e+300], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_2}\\
\mathbf{if}\;y.im \leq -1.95 \cdot 10^{-18}:\\
\;\;\;\;t_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 34000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_2 + 1}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+251}:\\
\;\;\;\;t_3 \cdot \sin t_1\\
\mathbf{elif}\;y.im \leq 10^{+300}:\\
\;\;\;\;e^{y.re \cdot t_0 - t_2} \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < -1.95000000000000002e-18Initial program 44.6%
Taylor expanded in y.re around 0 46.4%
unpow233.9%
unpow233.9%
hypot-def55.8%
Simplified70.0%
if -1.95000000000000002e-18 < y.im < 34000Initial program 43.7%
exp-diff43.7%
+-rgt-identity43.7%
+-rgt-identity43.7%
exp-to-pow43.7%
hypot-def43.7%
*-commutative43.7%
exp-prod43.7%
fma-def43.7%
hypot-def93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in y.im around 0 92.1%
if 34000 < y.im < 1.70000000000000006e251Initial program 28.7%
Taylor expanded in y.im around 0 69.2%
if 1.70000000000000006e251 < y.im < 1.0000000000000001e300Initial program 50.0%
Simplified80.0%
Taylor expanded in x.im around 0 90.0%
if 1.0000000000000001e300 < y.im Initial program 25.0%
Taylor expanded in y.im around 0 75.0%
*-commutative75.0%
add-cube-cbrt75.0%
unpow3100.0%
Applied egg-rr100.0%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_2))))
(if (<= y.im -2.4e-18)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.im 155.0)
(*
(sin (fma t_0 y.im t_1))
(/ (pow (hypot x.re x.im) y.re) (+ t_2 1.0)))
(if (or (<= y.im 1.7e+251) (not (<= y.im 1e+300)))
(* t_3 (sin t_1))
(* (exp (- (* y.re t_0) t_2)) (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 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2));
double tmp;
if (y_46_im <= -2.4e-18) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 155.0) {
tmp = sin(fma(t_0, y_46_im, t_1)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_2 + 1.0));
} else if ((y_46_im <= 1.7e+251) || !(y_46_im <= 1e+300)) {
tmp = t_3 * sin(t_1);
} else {
tmp = exp(((y_46_re * t_0) - t_2)) * sin((t_1 + (y_46_im * log(x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_2)) tmp = 0.0 if (y_46_im <= -2.4e-18) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_im <= 155.0) tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_2 + 1.0))); elseif ((y_46_im <= 1.7e+251) || !(y_46_im <= 1e+300)) tmp = Float64(t_3 * sin(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_2)) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(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] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2.4e-18], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 155.0], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 1.7e+251], N[Not[LessEqual[y$46$im, 1e+300]], $MachinePrecision]], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_2}\\
\mathbf{if}\;y.im \leq -2.4 \cdot 10^{-18}:\\
\;\;\;\;t_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 155:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_2 + 1}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+251} \lor \neg \left(y.im \leq 10^{+300}\right):\\
\;\;\;\;t_3 \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot t_0 - t_2} \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if y.im < -2.39999999999999994e-18Initial program 44.6%
Taylor expanded in y.re around 0 46.4%
unpow233.9%
unpow233.9%
hypot-def55.8%
Simplified70.0%
if -2.39999999999999994e-18 < y.im < 155Initial program 43.7%
exp-diff43.7%
+-rgt-identity43.7%
+-rgt-identity43.7%
exp-to-pow43.7%
hypot-def43.7%
*-commutative43.7%
exp-prod43.7%
fma-def43.7%
hypot-def93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in y.im around 0 92.1%
if 155 < y.im < 1.70000000000000006e251 or 1.0000000000000001e300 < y.im Initial program 28.5%
Taylor expanded in y.im around 0 69.6%
if 1.70000000000000006e251 < y.im < 1.0000000000000001e300Initial program 50.0%
Simplified80.0%
Taylor expanded in x.im around 0 90.0%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(sin t_1)))
(t_3 (log (hypot x.re x.im))))
(if (<= y.im -460.0)
t_2
(if (<= y.im 390.0)
(* (sin (fma t_3 y.im t_1)) (pow (hypot x.re x.im) y.re))
(if (or (<= y.im 1.7e+251) (not (<= y.im 1.05e+300)))
t_2
(* (exp (- (* y.re t_3) t_0)) (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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * sin(t_1);
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_im <= -460.0) {
tmp = t_2;
} else if (y_46_im <= 390.0) {
tmp = sin(fma(t_3, y_46_im, t_1)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 1.7e+251) || !(y_46_im <= 1.05e+300)) {
tmp = t_2;
} else {
tmp = exp(((y_46_re * t_3) - t_0)) * sin((t_1 + (y_46_im * log(x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)) * sin(t_1)) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_im <= -460.0) tmp = t_2; elseif (y_46_im <= 390.0) tmp = Float64(sin(fma(t_3, y_46_im, t_1)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif ((y_46_im <= 1.7e+251) || !(y_46_im <= 1.05e+300)) tmp = t_2; else tmp = Float64(exp(Float64(Float64(y_46_re * t_3) - t_0)) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -460.0], t$95$2, If[LessEqual[y$46$im, 390.0], N[(N[Sin[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 1.7e+251], N[Not[LessEqual[y$46$im, 1.05e+300]], $MachinePrecision]], t$95$2, N[(N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_0} \cdot \sin t_1\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -460:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 390:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_3, y.im, t_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+251} \lor \neg \left(y.im \leq 1.05 \cdot 10^{+300}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot t_3 - t_0} \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if y.im < -460 or 390 < y.im < 1.70000000000000006e251 or 1.05000000000000006e300 < y.im Initial program 36.3%
Taylor expanded in y.im around 0 67.8%
if -460 < y.im < 390Initial program 43.3%
exp-diff43.3%
+-rgt-identity43.3%
+-rgt-identity43.3%
exp-to-pow43.3%
hypot-def43.3%
*-commutative43.3%
exp-prod43.3%
fma-def43.3%
hypot-def92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in y.im around 0 91.2%
if 1.70000000000000006e251 < y.im < 1.05000000000000006e300Initial program 50.0%
Simplified80.0%
Taylor expanded in x.im around 0 90.0%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0)))
(t_3 (log (hypot x.re x.im))))
(if (<= y.im -460.0)
(* t_2 (sin (fabs t_1)))
(if (<= y.im 226.0)
(* (sin (fma t_3 y.im t_1)) (pow (hypot x.re x.im) y.re))
(if (or (<= y.im 1.6e+251) (not (<= y.im 1.1e+300)))
(* t_2 (sin t_1))
(* (exp (- (* y.re t_3) t_0)) (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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0));
double t_3 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_im <= -460.0) {
tmp = t_2 * sin(fabs(t_1));
} else if (y_46_im <= 226.0) {
tmp = sin(fma(t_3, y_46_im, t_1)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 1.6e+251) || !(y_46_im <= 1.1e+300)) {
tmp = t_2 * sin(t_1);
} else {
tmp = exp(((y_46_re * t_3) - t_0)) * sin((t_1 + (y_46_im * log(x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)) t_3 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_im <= -460.0) tmp = Float64(t_2 * sin(abs(t_1))); elseif (y_46_im <= 226.0) tmp = Float64(sin(fma(t_3, y_46_im, t_1)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif ((y_46_im <= 1.6e+251) || !(y_46_im <= 1.1e+300)) tmp = Float64(t_2 * sin(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * t_3) - t_0)) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(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] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -460.0], N[(t$95$2 * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 226.0], N[(N[Sin[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 1.6e+251], N[Not[LessEqual[y$46$im, 1.1e+300]], $MachinePrecision]], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_0}\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -460:\\
\;\;\;\;t_2 \cdot \sin \left(\left|t_1\right|\right)\\
\mathbf{elif}\;y.im \leq 226:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_3, y.im, t_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+251} \lor \neg \left(y.im \leq 1.1 \cdot 10^{+300}\right):\\
\;\;\;\;t_2 \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot t_3 - t_0} \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if y.im < -460Initial program 45.5%
Taylor expanded in y.im around 0 65.7%
*-commutative65.7%
add-cube-cbrt67.5%
unpow367.5%
add-sqr-sqrt38.2%
sqrt-unprod49.3%
pow249.3%
unpow349.3%
add-cube-cbrt47.5%
Applied egg-rr47.5%
unpow247.5%
rem-sqrt-square71.1%
Simplified71.1%
if -460 < y.im < 226Initial program 43.3%
exp-diff43.3%
+-rgt-identity43.3%
+-rgt-identity43.3%
exp-to-pow43.3%
hypot-def43.3%
*-commutative43.3%
exp-prod43.3%
fma-def43.3%
hypot-def92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in y.im around 0 91.2%
if 226 < y.im < 1.5999999999999999e251 or 1.1000000000000001e300 < y.im Initial program 28.5%
Taylor expanded in y.im around 0 69.6%
if 1.5999999999999999e251 < y.im < 1.1000000000000001e300Initial program 50.0%
Simplified80.0%
Taylor expanded in x.im around 0 90.0%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_2))))
(if (<= y.im -2e-18)
(* t_3 (sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.im 145000.0)
(* (sin (fma t_0 y.im t_1)) (pow (hypot x.re x.im) y.re))
(if (or (<= y.im 1.7e+251) (not (<= y.im 1.5e+301)))
(* t_3 (sin t_1))
(* (exp (- (* y.re t_0) t_2)) (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 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2));
double tmp;
if (y_46_im <= -2e-18) {
tmp = t_3 * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_im <= 145000.0) {
tmp = sin(fma(t_0, y_46_im, t_1)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 1.7e+251) || !(y_46_im <= 1.5e+301)) {
tmp = t_3 * sin(t_1);
} else {
tmp = exp(((y_46_re * t_0) - t_2)) * sin((t_1 + (y_46_im * log(x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_2)) tmp = 0.0 if (y_46_im <= -2e-18) tmp = Float64(t_3 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_im <= 145000.0) tmp = Float64(sin(fma(t_0, y_46_im, t_1)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif ((y_46_im <= 1.7e+251) || !(y_46_im <= 1.5e+301)) tmp = Float64(t_3 * sin(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * t_0) - t_2)) * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(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] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2e-18], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 145000.0], N[(N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 1.7e+251], N[Not[LessEqual[y$46$im, 1.5e+301]], $MachinePrecision]], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision]], $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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_2}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{-18}:\\
\;\;\;\;t_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 145000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+251} \lor \neg \left(y.im \leq 1.5 \cdot 10^{+301}\right):\\
\;\;\;\;t_3 \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot t_0 - t_2} \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if y.im < -2.0000000000000001e-18Initial program 44.6%
Taylor expanded in y.re around 0 46.4%
unpow233.9%
unpow233.9%
hypot-def55.8%
Simplified70.0%
if -2.0000000000000001e-18 < y.im < 145000Initial program 43.7%
exp-diff43.7%
+-rgt-identity43.7%
+-rgt-identity43.7%
exp-to-pow43.7%
hypot-def43.7%
*-commutative43.7%
exp-prod43.7%
fma-def43.7%
hypot-def93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in y.im around 0 92.0%
if 145000 < y.im < 1.70000000000000006e251 or 1.5e301 < y.im Initial program 28.5%
Taylor expanded in y.im around 0 69.6%
if 1.70000000000000006e251 < y.im < 1.5e301Initial program 50.0%
Simplified80.0%
Taylor expanded in x.im around 0 90.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))))
(if (or (<= y.im -2200.0) (not (<= y.im 64000.0)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -2200.0) || !(y_46_im <= 64000.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))) * sin(t_0);
} else {
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);
}
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 <= -2200.0) || !(y_46_im <= 64000.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))) * sin(t_0)); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2200.0], N[Not[LessEqual[y$46$im, 64000.0]], $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] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -2200 \lor \neg \left(y.im \leq 64000\right):\\
\;\;\;\;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 t_0\\
\mathbf{else}:\\
\;\;\;\;\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.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2200 or 64000 < y.im Initial program 37.3%
Taylor expanded in y.im around 0 65.7%
if -2200 < y.im < 64000Initial program 43.3%
exp-diff43.3%
+-rgt-identity43.3%
+-rgt-identity43.3%
exp-to-pow43.3%
hypot-def43.3%
*-commutative43.3%
exp-prod43.3%
fma-def43.3%
hypot-def92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in y.im around 0 91.2%
Final simplification78.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (log (- x.im)))
(t_3 (* (atan2 x.im x.re) y.im))
(t_4 (exp (- (* y.re t_2) t_3))))
(if (<= x.im -6e+76)
(* t_4 (sin (+ t_0 (* y.im t_2))))
(if (<= x.im -1.1e-270)
(* (sin (* y.im (log (hypot x.im x.re)))) t_4)
(if (<= x.im 2.9e-18)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_3))
t_1)
(* t_1 (exp (- (* y.re (log x.im)) 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_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = log(-x_46_im);
double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = exp(((y_46_re * t_2) - t_3));
double tmp;
if (x_46_im <= -6e+76) {
tmp = t_4 * sin((t_0 + (y_46_im * t_2)));
} else if (x_46_im <= -1.1e-270) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4;
} else if (x_46_im <= 2.9e-18) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3)) * t_1;
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = Math.log(-x_46_im);
double t_3 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = Math.exp(((y_46_re * t_2) - t_3));
double tmp;
if (x_46_im <= -6e+76) {
tmp = t_4 * Math.sin((t_0 + (y_46_im * t_2)));
} else if (x_46_im <= -1.1e-270) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_4;
} else if (x_46_im <= 2.9e-18) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3)) * t_1;
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_3));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) t_2 = math.log(-x_46_im) t_3 = math.atan2(x_46_im, x_46_re) * y_46_im t_4 = math.exp(((y_46_re * t_2) - t_3)) tmp = 0 if x_46_im <= -6e+76: tmp = t_4 * math.sin((t_0 + (y_46_im * t_2))) elif x_46_im <= -1.1e-270: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_4 elif x_46_im <= 2.9e-18: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3)) * t_1 else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_3)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = log(Float64(-x_46_im)) t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_4 = exp(Float64(Float64(y_46_re * t_2) - t_3)) tmp = 0.0 if (x_46_im <= -6e+76) tmp = Float64(t_4 * sin(Float64(t_0 + Float64(y_46_im * t_2)))); elseif (x_46_im <= -1.1e-270) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4); elseif (x_46_im <= 2.9e-18) 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) - t_3)) * t_1); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_3))); 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 = sin(t_0); t_2 = log(-x_46_im); t_3 = atan2(x_46_im, x_46_re) * y_46_im; t_4 = exp(((y_46_re * t_2) - t_3)); tmp = 0.0; if (x_46_im <= -6e+76) tmp = t_4 * sin((t_0 + (y_46_im * t_2))); elseif (x_46_im <= -1.1e-270) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4; elseif (x_46_im <= 2.9e-18) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3)) * t_1; else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -6e+76], N[(t$95$4 * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -1.1e-270], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[x$46$im, 2.9e-18], 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] - t$95$3), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := \log \left(-x.im\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_4 := e^{y.re \cdot t_2 - t_3}\\
\mathbf{if}\;x.im \leq -6 \cdot 10^{+76}:\\
\;\;\;\;t_4 \cdot \sin \left(t_0 + y.im \cdot t_2\right)\\
\mathbf{elif}\;x.im \leq -1.1 \cdot 10^{-270}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_4\\
\mathbf{elif}\;x.im \leq 2.9 \cdot 10^{-18}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_3} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_3}\\
\end{array}
\end{array}
if x.im < -5.9999999999999996e76Initial program 17.0%
Taylor expanded in x.im around -inf 17.0%
mul-1-neg69.0%
Simplified17.0%
Taylor expanded in x.im around -inf 79.5%
mul-1-neg69.0%
Simplified79.5%
if -5.9999999999999996e76 < x.im < -1.0999999999999999e-270Initial program 59.3%
Taylor expanded in x.im around -inf 54.6%
mul-1-neg49.0%
Simplified54.6%
Taylor expanded in y.re around 0 52.8%
unpow252.8%
unpow252.8%
hypot-def63.6%
Simplified63.6%
if -1.0999999999999999e-270 < x.im < 2.9e-18Initial program 49.1%
Taylor expanded in y.im around 0 57.6%
if 2.9e-18 < x.im Initial program 32.3%
Taylor expanded in y.im around 0 64.4%
Taylor expanded in x.re around 0 75.6%
Final simplification69.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (log (- x.im)))
(t_3 (* (atan2 x.im x.re) y.im))
(t_4 (exp (- (* y.re t_2) t_3))))
(if (<= x.im -4.4e+78)
(* t_4 (sin (+ t_0 (* y.im t_2))))
(if (<= x.im -3e-309)
(* (sin (* y.im (log (hypot x.im x.re)))) t_4)
(if (<= x.im 2.9e-157)
(* t_1 (exp (- (* y.re (log (- x.re))) t_3)))
(if (<= x.im 3.3e-23)
(* t_1 (exp (- (* y.re (log x.re)) t_3)))
(* t_1 (exp (- (* y.re (log x.im)) 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_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = log(-x_46_im);
double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = exp(((y_46_re * t_2) - t_3));
double tmp;
if (x_46_im <= -4.4e+78) {
tmp = t_4 * sin((t_0 + (y_46_im * t_2)));
} else if (x_46_im <= -3e-309) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4;
} else if (x_46_im <= 2.9e-157) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_3));
} else if (x_46_im <= 3.3e-23) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_3));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = Math.log(-x_46_im);
double t_3 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_4 = Math.exp(((y_46_re * t_2) - t_3));
double tmp;
if (x_46_im <= -4.4e+78) {
tmp = t_4 * Math.sin((t_0 + (y_46_im * t_2)));
} else if (x_46_im <= -3e-309) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_4;
} else if (x_46_im <= 2.9e-157) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_3));
} else if (x_46_im <= 3.3e-23) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_3));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_3));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) t_2 = math.log(-x_46_im) t_3 = math.atan2(x_46_im, x_46_re) * y_46_im t_4 = math.exp(((y_46_re * t_2) - t_3)) tmp = 0 if x_46_im <= -4.4e+78: tmp = t_4 * math.sin((t_0 + (y_46_im * t_2))) elif x_46_im <= -3e-309: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_4 elif x_46_im <= 2.9e-157: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_3)) elif x_46_im <= 3.3e-23: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_3)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_3)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = log(Float64(-x_46_im)) t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_4 = exp(Float64(Float64(y_46_re * t_2) - t_3)) tmp = 0.0 if (x_46_im <= -4.4e+78) tmp = Float64(t_4 * sin(Float64(t_0 + Float64(y_46_im * t_2)))); elseif (x_46_im <= -3e-309) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4); elseif (x_46_im <= 2.9e-157) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_3))); elseif (x_46_im <= 3.3e-23) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_3))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_3))); 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 = sin(t_0); t_2 = log(-x_46_im); t_3 = atan2(x_46_im, x_46_re) * y_46_im; t_4 = exp(((y_46_re * t_2) - t_3)); tmp = 0.0; if (x_46_im <= -4.4e+78) tmp = t_4 * sin((t_0 + (y_46_im * t_2))); elseif (x_46_im <= -3e-309) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_4; elseif (x_46_im <= 2.9e-157) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_3)); elseif (x_46_im <= 3.3e-23) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_3)); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4.4e+78], N[(t$95$4 * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -3e-309], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision], If[LessEqual[x$46$im, 2.9e-157], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.3e-23], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := \log \left(-x.im\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_4 := e^{y.re \cdot t_2 - t_3}\\
\mathbf{if}\;x.im \leq -4.4 \cdot 10^{+78}:\\
\;\;\;\;t_4 \cdot \sin \left(t_0 + y.im \cdot t_2\right)\\
\mathbf{elif}\;x.im \leq -3 \cdot 10^{-309}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_4\\
\mathbf{elif}\;x.im \leq 2.9 \cdot 10^{-157}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_3}\\
\mathbf{elif}\;x.im \leq 3.3 \cdot 10^{-23}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_3}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_3}\\
\end{array}
\end{array}
if x.im < -4.40000000000000028e78Initial program 17.0%
Taylor expanded in x.im around -inf 17.0%
mul-1-neg69.0%
Simplified17.0%
Taylor expanded in x.im around -inf 79.5%
mul-1-neg69.0%
Simplified79.5%
if -4.40000000000000028e78 < x.im < -3.000000000000001e-309Initial program 58.6%
Taylor expanded in x.im around -inf 53.0%
mul-1-neg48.0%
Simplified53.0%
Taylor expanded in y.re around 0 51.3%
unpow251.3%
unpow251.3%
hypot-def62.6%
Simplified62.6%
if -3.000000000000001e-309 < x.im < 2.89999999999999988e-157Initial program 47.2%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in x.re around -inf 42.0%
mul-1-neg42.0%
Simplified42.0%
if 2.89999999999999988e-157 < x.im < 3.30000000000000021e-23Initial program 50.0%
Taylor expanded in y.im around 0 54.6%
Taylor expanded in x.re around inf 44.5%
if 3.30000000000000021e-23 < x.im Initial program 32.3%
Taylor expanded in y.im around 0 64.4%
Taylor expanded in x.re around 0 75.6%
Final simplification66.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -4.1e-307)
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 4.6e-158)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.im 1.48e-22)
(* t_1 (exp (- (* y.re (log x.re)) t_0)))
(* t_1 (exp (- (* y.re (log x.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) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -4.1e-307) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 4.6e-158) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_im <= 1.48e-22) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -4.1e-307) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 4.6e-158) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_im <= 1.48e-22) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -4.1e-307: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 4.6e-158: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_im <= 1.48e-22: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_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) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -4.1e-307) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 4.6e-158) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_im <= 1.48e-22) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -4.1e-307) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 4.6e-158) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_im <= 1.48e-22) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4.1e-307], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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, 4.6e-158], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.48e-22], 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[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -4.1 \cdot 10^{-307}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 4.6 \cdot 10^{-158}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.48 \cdot 10^{-22}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -4.10000000000000032e-307Initial program 41.8%
Taylor expanded in x.im around -inf 38.4%
mul-1-neg56.5%
Simplified38.4%
Taylor expanded in y.re around 0 35.9%
unpow235.9%
unpow235.9%
hypot-def65.0%
Simplified65.0%
if -4.10000000000000032e-307 < x.im < 4.5999999999999998e-158Initial program 47.2%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in x.re around -inf 42.0%
mul-1-neg42.0%
Simplified42.0%
if 4.5999999999999998e-158 < x.im < 1.4800000000000001e-22Initial program 50.0%
Taylor expanded in y.im around 0 54.6%
Taylor expanded in x.re around inf 44.5%
if 1.4800000000000001e-22 < x.im Initial program 32.3%
Taylor expanded in y.im around 0 64.4%
Taylor expanded in x.re around 0 75.6%
Final simplification64.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -5e-310)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (or (<= x.im 1.65e-156) (not (<= x.im 2.85e-21)))
(* t_1 (exp (- (* y.re (log x.im)) t_0)))
(* t_1 (exp (- (* y.re (log x.re)) 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) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -5e-310) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if ((x_46_im <= 1.65e-156) || !(x_46_im <= 2.85e-21)) {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-5d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else if ((x_46im <= 1.65d-156) .or. (.not. (x_46im <= 2.85d-21))) then
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -5e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if ((x_46_im <= 1.65e-156) || !(x_46_im <= 2.85e-21)) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -5e-310: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif (x_46_im <= 1.65e-156) or not (x_46_im <= 2.85e-21): tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - 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) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -5e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif ((x_46_im <= 1.65e-156) || !(x_46_im <= 2.85e-21)) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -5e-310) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif ((x_46_im <= 1.65e-156) || ~((x_46_im <= 2.85e-21))) tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -5e-310], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$im, 1.65e-156], N[Not[LessEqual[x$46$im, 2.85e-21]], $MachinePrecision]], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 1.65 \cdot 10^{-156} \lor \neg \left(x.im \leq 2.85 \cdot 10^{-21}\right):\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.im < -4.999999999999985e-310Initial program 41.8%
Taylor expanded in y.im around 0 52.1%
Taylor expanded in x.im around -inf 56.5%
mul-1-neg56.5%
Simplified56.5%
if -4.999999999999985e-310 < x.im < 1.6499999999999999e-156 or 2.8499999999999998e-21 < x.im Initial program 35.2%
Taylor expanded in y.im around 0 63.4%
Taylor expanded in x.re around 0 69.0%
if 1.6499999999999999e-156 < x.im < 2.8499999999999998e-21Initial program 50.0%
Taylor expanded in y.im around 0 54.6%
Taylor expanded in x.re around inf 44.5%
Final simplification59.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -5e-310)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(* t_1 (exp (- (* y.re (log x.re)) 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) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-5d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46re)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -5e-310: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - 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) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -5e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -5e-310) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5e-310], 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[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 45.6%
Taylor expanded in y.im around 0 64.9%
Taylor expanded in x.re around -inf 62.9%
mul-1-neg62.9%
Simplified62.9%
if -4.999999999999985e-310 < x.re Initial program 35.1%
Taylor expanded in y.im around 0 48.5%
Taylor expanded in x.re around inf 52.9%
Final simplification57.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -5e-310)
(* t_1 (exp (- (* y.re (log x.im)) t_0)))
(* t_1 (exp (- (* y.re (log x.re)) 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) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-5d-310)) then
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -5e-310: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - 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) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -5e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -5e-310) tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5e-310], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 45.6%
Taylor expanded in y.im around 0 64.9%
Taylor expanded in x.re around 0 30.2%
if -4.999999999999985e-310 < x.re Initial program 35.1%
Taylor expanded in y.im around 0 48.5%
Taylor expanded in x.re around inf 52.9%
Final simplification41.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (exp (- (* y.re (log x.im)) (* (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 sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - (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 = sin((y_46re * atan2(x_46im, x_46re))) * exp(((y_46re * log(x_46im)) - (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 Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_im)) - (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 math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_im)) - (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(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - 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 = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 40.3%
Taylor expanded in y.im around 0 56.6%
Taylor expanded in x.re around 0 28.6%
Final simplification28.6%
herbie shell --seed 2023230
(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)))))