
(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 16 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 (cbrt t_0))
(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) (* (atan2 x.im x.re) y.im))))
(t_5 (* t_4 (sin (+ (* t_3 y.im) t_2)))))
(if (<= t_5 1.0)
(* t_4 (sin (+ (* y.im (log (pow (exp (pow t_1 2.0)) t_1))) t_2)))
(if (<= t_5 INFINITY)
(* t_4 (sin (pow (cbrt t_2) 3.0)))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 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 = log(hypot(x_46_re, x_46_im));
double t_1 = cbrt(t_0);
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) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_5 = t_4 * sin(((t_3 * y_46_im) + t_2));
double tmp;
if (t_5 <= 1.0) {
tmp = t_4 * sin(((y_46_im * log(pow(exp(pow(t_1, 2.0)), t_1))) + t_2));
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_4 * sin(pow(cbrt(t_2), 3.0));
} 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_2));
}
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 = cbrt(t_0) 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) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_5 = Float64(t_4 * sin(Float64(Float64(t_3 * y_46_im) + t_2))) tmp = 0.0 if (t_5 <= 1.0) tmp = Float64(t_4 * sin(Float64(Float64(y_46_im * log((exp((t_1 ^ 2.0)) ^ t_1))) + t_2))); elseif (t_5 <= Inf) tmp = Float64(t_4 * sin((cbrt(t_2) ^ 3.0))); 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_2))); 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[Power[t$95$0, 1/3], $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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Sin[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 1.0], N[(t$95$4 * N[Sin[N[(N[(y$46$im * N[Log[N[Power[N[Exp[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision], t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(t$95$4 * N[Sin[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $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$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sqrt[3]{t\_0}\\
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 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_5 := t\_4 \cdot \sin \left(t\_3 \cdot y.im + t\_2\right)\\
\mathbf{if}\;t\_5 \leq 1:\\
\;\;\;\;t\_4 \cdot \sin \left(y.im \cdot \log \left({\left(e^{{t\_1}^{2}}\right)}^{t\_1}\right) + t\_2\right)\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_4 \cdot \sin \left({\left(\sqrt[3]{t\_2}\right)}^{3}\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\_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)))) < 1Initial program 85.7%
add-exp-log85.7%
hypot-define85.7%
add-cube-cbrt89.2%
exp-prod89.2%
pow289.2%
Applied egg-rr89.2%
if 1 < (*.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 43.3%
Taylor expanded in y.im around 0 63.3%
add-cube-cbrt66.7%
pow366.7%
Applied egg-rr66.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 0.0%
fma-neg0.0%
hypot-define0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 42.3%
fma-neg42.3%
hypot-define42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define77.0%
*-commutative77.0%
Simplified77.0%
Final simplification77.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.re -5e-44)
(* t_0 (sin (pow (cbrt t_1) 3.0)))
(if (<= y.re 9.5e-37)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_1))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_0 (fabs (sin t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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 t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -5e-44) {
tmp = t_0 * sin(pow(cbrt(t_1), 3.0));
} else if (y_46_re <= 9.5e-37) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * fabs(sin(t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -5e-44) tmp = Float64(t_0 * sin((cbrt(t_1) ^ 3.0))); elseif (y_46_re <= 9.5e-37) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_0 * abs(sin(t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-44], N[(t$95$0 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-37], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Abs[N[Sin[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-44}:\\
\;\;\;\;t\_0 \cdot \sin \left({\left(\sqrt[3]{t\_1}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-37}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left|\sin t\_1\right|\\
\end{array}
\end{array}
if y.re < -5.00000000000000039e-44Initial program 48.7%
Taylor expanded in y.im around 0 83.8%
add-cube-cbrt86.2%
pow386.2%
Applied egg-rr86.2%
if -5.00000000000000039e-44 < y.re < 9.49999999999999927e-37Initial program 34.1%
exp-diff34.1%
exp-to-pow34.1%
hypot-define34.1%
*-commutative34.1%
exp-prod33.9%
fma-define33.9%
hypot-define77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in y.re around 0 77.7%
rec-exp77.7%
distribute-lft-neg-in77.7%
Simplified77.7%
if 9.49999999999999927e-37 < y.re Initial program 48.4%
Taylor expanded in y.im around 0 69.4%
add-sqr-sqrt43.6%
sqrt-unprod67.9%
pow267.9%
Applied egg-rr67.9%
unpow267.9%
rem-sqrt-square69.5%
Simplified69.5%
Final simplification78.4%
(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
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -5e-44)
(* t_2 t_1)
(if (<= y.re 9.5e-37)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_2 (fabs t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = 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 <= -5e-44) {
tmp = t_2 * t_1;
} else if (y_46_re <= 9.5e-37) {
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_2 * fabs(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = 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 <= -5e-44) tmp = Float64(t_2 * t_1); elseif (y_46_re <= 9.5e-37) 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_2 * abs(t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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[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, -5e-44], N[(t$95$2 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-37], 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$2 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
t_2 := 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 -5 \cdot 10^{-44}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-37}:\\
\;\;\;\;\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\_2 \cdot \left|t\_1\right|\\
\end{array}
\end{array}
if y.re < -5.00000000000000039e-44Initial program 48.7%
Taylor expanded in y.im around 0 83.8%
if -5.00000000000000039e-44 < y.re < 9.49999999999999927e-37Initial program 34.1%
exp-diff34.1%
exp-to-pow34.1%
hypot-define34.1%
*-commutative34.1%
exp-prod33.9%
fma-define33.9%
hypot-define77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in y.re around 0 77.7%
rec-exp77.7%
distribute-lft-neg-in77.7%
Simplified77.7%
if 9.49999999999999927e-37 < y.re Initial program 48.4%
Taylor expanded in y.im around 0 69.4%
add-sqr-sqrt43.6%
sqrt-unprod67.9%
pow267.9%
Applied egg-rr67.9%
unpow267.9%
rem-sqrt-square69.5%
Simplified69.5%
Final simplification77.7%
(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 -1.7e-49)
(* t_1 (sin (fabs t_0)))
(if (<= y.re 9.5e-37)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (fabs (sin 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)));
double tmp;
if (y_46_re <= -1.7e-49) {
tmp = t_1 * sin(fabs(t_0));
} else if (y_46_re <= 9.5e-37) {
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 * fabs(sin(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 = 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 <= -1.7e-49) tmp = Float64(t_1 * sin(abs(t_0))); elseif (y_46_re <= 9.5e-37) 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 * abs(sin(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[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, -1.7e-49], N[(t$95$1 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-37], 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[Abs[N[Sin[t$95$0], $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 -1.7 \cdot 10^{-49}:\\
\;\;\;\;t\_1 \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-37}:\\
\;\;\;\;\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 \left|\sin t\_0\right|\\
\end{array}
\end{array}
if y.re < -1.70000000000000002e-49Initial program 48.2%
Taylor expanded in y.im around 0 82.8%
add-sqr-sqrt20.6%
sqrt-unprod23.2%
pow223.2%
Applied egg-rr49.1%
unpow223.2%
rem-sqrt-square48.6%
Simplified82.9%
if -1.70000000000000002e-49 < y.re < 9.49999999999999927e-37Initial program 34.4%
exp-diff34.4%
exp-to-pow34.4%
hypot-define34.4%
*-commutative34.4%
exp-prod34.2%
fma-define34.2%
hypot-define77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in y.re around 0 78.4%
rec-exp78.4%
distribute-lft-neg-in78.4%
Simplified78.4%
if 9.49999999999999927e-37 < y.re Initial program 48.4%
Taylor expanded in y.im around 0 69.4%
add-sqr-sqrt43.6%
sqrt-unprod67.9%
pow267.9%
Applied egg-rr67.9%
unpow267.9%
rem-sqrt-square69.5%
Simplified69.5%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -5e-44) (not (<= y.re 9.5e-37)))
(*
(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))
(exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -5e-44) || !(y_46_re <= 9.5e-37)) {
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)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -5e-44) || !(y_46_re <= 9.5e-37)) 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)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -5e-44], N[Not[LessEqual[y$46$re, 9.5e-37]], $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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-44} \lor \neg \left(y.re \leq 9.5 \cdot 10^{-37}\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 e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -5.00000000000000039e-44 or 9.49999999999999927e-37 < y.re Initial program 48.6%
Taylor expanded in y.im around 0 77.6%
if -5.00000000000000039e-44 < y.re < 9.49999999999999927e-37Initial program 34.1%
exp-diff34.1%
exp-to-pow34.1%
hypot-define34.1%
*-commutative34.1%
exp-prod33.9%
fma-define33.9%
hypot-define77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in y.re around 0 77.7%
rec-exp77.7%
distribute-lft-neg-in77.7%
Simplified77.7%
Final simplification77.7%
(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 -58000000000000.0) (not (<= y.im 2e+16)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re)))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -58000000000000.0) || !(y_46_im <= 2e+16)) {
tmp = t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
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);
}
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 <= -58000000000000.0) || !(y_46_im <= 2e+16)) tmp = Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else 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)); 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, -58000000000000.0], N[Not[LessEqual[y$46$im, 2e+16]], $MachinePrecision]], N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $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$im ^ 2 + x$46$re ^ 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 -58000000000000 \lor \neg \left(y.im \leq 2 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{t\_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\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.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -5.8e13 or 2e16 < y.im Initial program 31.3%
exp-diff22.8%
exp-to-pow22.8%
hypot-define22.8%
*-commutative22.8%
exp-prod21.8%
fma-define21.8%
hypot-define45.6%
*-commutative45.6%
Simplified45.6%
Taylor expanded in x.re around 0 29.8%
Taylor expanded in y.im around 0 35.8%
Taylor expanded in y.re around 0 59.5%
exp-prod61.7%
Simplified61.7%
if -5.8e13 < y.im < 2e16Initial program 53.4%
exp-diff52.6%
exp-to-pow52.6%
hypot-define52.6%
*-commutative52.6%
exp-prod52.6%
fma-define52.6%
hypot-define89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y.im around 0 68.4%
unpow268.4%
unpow268.4%
hypot-undefine90.3%
Simplified90.3%
Final simplification75.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (pow (hypot x.re x.im) y.re) (+ (* (atan2 x.im x.re) y.im) 1.0)))
(t_1 (* t_0 (sin (* y.im (log (hypot x.re x.im))))))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (/ t_2 (pow (exp y.im) (atan2 x.im x.re)))))
(if (<= y.im -55000000000.0)
t_3
(if (<= y.im -1.02e-200)
t_1
(if (<= y.im 5.7e-170)
(* (sin t_2) t_0)
(if (<= y.im 550000000000.0) t_1 t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0);
double t_1 = t_0 * sin((y_46_im * log(hypot(x_46_re, x_46_im))));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = t_2 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -55000000000.0) {
tmp = t_3;
} else if (y_46_im <= -1.02e-200) {
tmp = t_1;
} else if (y_46_im <= 5.7e-170) {
tmp = sin(t_2) * t_0;
} else if (y_46_im <= 550000000000.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / ((Math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0);
double t_1 = t_0 * Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im))));
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_3 = t_2 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -55000000000.0) {
tmp = t_3;
} else if (y_46_im <= -1.02e-200) {
tmp = t_1;
} else if (y_46_im <= 5.7e-170) {
tmp = Math.sin(t_2) * t_0;
} else if (y_46_im <= 550000000000.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / ((math.atan2(x_46_im, x_46_re) * y_46_im) + 1.0) t_1 = t_0 * math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) t_2 = y_46_re * math.atan2(x_46_im, x_46_re) t_3 = t_2 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_im <= -55000000000.0: tmp = t_3 elif y_46_im <= -1.02e-200: tmp = t_1 elif y_46_im <= 5.7e-170: tmp = math.sin(t_2) * t_0 elif y_46_im <= 550000000000.0: tmp = t_1 else: tmp = t_3 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(Float64(atan(x_46_im, x_46_re) * y_46_im) + 1.0)) t_1 = Float64(t_0 * sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im))))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = Float64(t_2 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -55000000000.0) tmp = t_3; elseif (y_46_im <= -1.02e-200) tmp = t_1; elseif (y_46_im <= 5.7e-170) tmp = Float64(sin(t_2) * t_0); elseif (y_46_im <= 550000000000.0) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (hypot(x_46_re, x_46_im) ^ y_46_re) / ((atan2(x_46_im, x_46_re) * y_46_im) + 1.0); t_1 = t_0 * sin((y_46_im * log(hypot(x_46_re, x_46_im)))); t_2 = y_46_re * atan2(x_46_im, x_46_re); t_3 = t_2 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); tmp = 0.0; if (y_46_im <= -55000000000.0) tmp = t_3; elseif (y_46_im <= -1.02e-200) tmp = t_1; elseif (y_46_im <= 5.7e-170) tmp = sin(t_2) * t_0; elseif (y_46_im <= 550000000000.0) tmp = t_1; else tmp = 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[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $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[(t$95$2 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -55000000000.0], t$95$3, If[LessEqual[y$46$im, -1.02e-200], t$95$1, If[LessEqual[y$46$im, 5.7e-170], N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 550000000000.0], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + 1}\\
t_1 := t\_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \frac{t\_2}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{if}\;y.im \leq -55000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq -1.02 \cdot 10^{-200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5.7 \cdot 10^{-170}:\\
\;\;\;\;\sin t\_2 \cdot t\_0\\
\mathbf{elif}\;y.im \leq 550000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.im < -5.5e10 or 5.5e11 < y.im Initial program 31.3%
exp-diff22.8%
exp-to-pow22.8%
hypot-define22.8%
*-commutative22.8%
exp-prod21.8%
fma-define21.8%
hypot-define45.6%
*-commutative45.6%
Simplified45.6%
Taylor expanded in x.re around 0 29.8%
Taylor expanded in y.im around 0 35.8%
Taylor expanded in y.re around 0 59.5%
exp-prod61.7%
Simplified61.7%
if -5.5e10 < y.im < -1.02e-200 or 5.7000000000000004e-170 < y.im < 5.5e11Initial program 53.3%
exp-diff52.2%
exp-to-pow52.2%
hypot-define52.2%
*-commutative52.2%
exp-prod52.2%
fma-define52.1%
hypot-define89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y.im around 0 90.9%
Taylor expanded in y.re around 0 42.8%
+-commutative28.5%
unpow228.5%
unpow228.5%
hypot-undefine45.6%
Simplified79.4%
if -1.02e-200 < y.im < 5.7000000000000004e-170Initial program 53.6%
exp-diff53.6%
exp-to-pow53.6%
hypot-define53.6%
*-commutative53.6%
exp-prod53.6%
fma-define53.6%
hypot-define89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y.im around 0 89.3%
Taylor expanded in y.im around 0 82.3%
Final simplification70.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.re))) t_0)))
(if (<= x.re 1.15e-212)
(* t_1 (exp (- (* y.re (log x.re)) t_0)))
(if (<= x.re 1e-165)
(*
(sin (* y.im (log (hypot x.re x.im))))
(/ (pow x.im y.re) (exp t_0)))
(* t_1 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = 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 if (x_46_re <= 1.15e-212) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
} else if (x_46_re <= 1e-165) {
tmp = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * (pow(x_46_im, y_46_re) / exp(t_0));
} else {
tmp = t_1 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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_re <= -5e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.15e-212) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else if (x_46_re <= 1e-165) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * (Math.pow(x_46_im, y_46_re) / Math.exp(t_0));
} else {
tmp = t_1 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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)) elif x_46_re <= 1.15e-212: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) elif x_46_re <= 1e-165: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * (math.pow(x_46_im, y_46_re) / math.exp(t_0)) else: tmp = t_1 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = 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))); elseif (x_46_re <= 1.15e-212) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); elseif (x_46_re <= 1e-165) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * Float64((x_46_im ^ y_46_re) / exp(t_0))); else tmp = Float64(t_1 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.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)); elseif (x_46_re <= 1.15e-212) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); elseif (x_46_re <= 1e-165) tmp = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * ((x_46_im ^ y_46_re) / exp(t_0)); else tmp = t_1 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.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], If[LessEqual[x$46$re, 1.15e-212], 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$re, 1e-165], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[x$46$im, y$46$re], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \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{elif}\;x.re \leq 1.15 \cdot 10^{-212}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{elif}\;x.re \leq 10^{-165}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \frac{{x.im}^{y.re}}{e^{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_0 + 1}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 44.9%
Taylor expanded in y.im around 0 60.6%
Taylor expanded in x.re around -inf 71.3%
mul-1-neg71.3%
Simplified71.3%
if -4.999999999999985e-310 < x.re < 1.15e-212Initial program 46.6%
Taylor expanded in y.im around 0 67.4%
Taylor expanded in x.re around inf 80.1%
if 1.15e-212 < x.re < 1e-165Initial program 24.9%
exp-diff24.9%
exp-to-pow24.9%
hypot-define24.9%
*-commutative24.9%
exp-prod24.9%
fma-define24.9%
hypot-define91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in x.re around 0 75.0%
Taylor expanded in y.re around 0 16.7%
+-commutative16.7%
unpow216.7%
unpow216.7%
hypot-undefine75.0%
Simplified75.0%
if 1e-165 < x.re Initial program 39.9%
exp-diff35.5%
exp-to-pow35.5%
hypot-define35.5%
*-commutative35.5%
exp-prod34.1%
fma-define34.1%
hypot-define59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in y.im around 0 66.8%
Taylor expanded in y.im around 0 55.1%
Final simplification66.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 (sin t_1)))
(if (<= x.re -5e-310)
(* t_2 (exp (- (* y.re (log (- x.re))) t_0)))
(if (or (<= x.re 1.06e-212) (not (<= x.re 5e-116)))
(* t_2 (exp (- (* y.re (log x.re)) t_0)))
(* (sin (fabs t_1)) (pow 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if ((x_46_re <= 1.06e-212) || !(x_46_re <= 5e-116)) {
tmp = t_2 * exp(((y_46_re * log(x_46_re)) - t_0));
} else {
tmp = sin(fabs(t_1)) * pow(x_46_im, y_46_re);
}
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) :: t_2
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = y_46re * atan2(x_46im, x_46re)
t_2 = sin(t_1)
if (x_46re <= (-5d-310)) then
tmp = t_2 * exp(((y_46re * log(-x_46re)) - t_0))
else if ((x_46re <= 1.06d-212) .or. (.not. (x_46re <= 5d-116))) then
tmp = t_2 * exp(((y_46re * log(x_46re)) - t_0))
else
tmp = sin(abs(t_1)) * (x_46im ** y_46re)
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_re <= -5e-310) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if ((x_46_re <= 1.06e-212) || !(x_46_re <= 5e-116)) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else {
tmp = Math.sin(Math.abs(t_1)) * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_re <= -5e-310: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif (x_46_re <= 1.06e-212) or not (x_46_re <= 5e-116): tmp = t_2 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) else: tmp = math.sin(math.fabs(t_1)) * math.pow(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(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) tmp = 0.0 if (x_46_re <= -5e-310) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif ((x_46_re <= 1.06e-212) || !(x_46_re <= 5e-116)) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); else tmp = Float64(sin(abs(t_1)) * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_re <= -5e-310) tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif ((x_46_re <= 1.06e-212) || ~((x_46_re <= 5e-116))) tmp = t_2 * exp(((y_46_re * log(x_46_re)) - t_0)); else tmp = sin(abs(t_1)) * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$re, -5e-310], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, 1.06e-212], N[Not[LessEqual[x$46$re, 5e-116]], $MachinePrecision]], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{elif}\;x.re \leq 1.06 \cdot 10^{-212} \lor \neg \left(x.re \leq 5 \cdot 10^{-116}\right):\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left|t\_1\right|\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 44.9%
Taylor expanded in y.im around 0 60.6%
Taylor expanded in x.re around -inf 71.3%
mul-1-neg71.3%
Simplified71.3%
if -4.999999999999985e-310 < x.re < 1.06000000000000004e-212 or 5.0000000000000003e-116 < x.re Initial program 37.0%
Taylor expanded in y.im around 0 51.9%
Taylor expanded in x.re around inf 58.1%
if 1.06000000000000004e-212 < x.re < 5.0000000000000003e-116Initial program 49.8%
exp-diff44.8%
exp-to-pow44.8%
hypot-define44.8%
*-commutative44.8%
exp-prod44.8%
fma-define44.8%
hypot-define89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in x.re around 0 70.0%
Taylor expanded in y.im around 0 50.5%
Taylor expanded in y.im around 0 50.8%
add-sqr-sqrt15.4%
sqrt-unprod30.8%
pow230.8%
Applied egg-rr30.8%
unpow230.8%
rem-sqrt-square55.9%
Simplified55.9%
Final simplification65.0%
(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 -1.42e-282)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(* t_1 (/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1.42e-282) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = t_1 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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_re <= -1.42e-282) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = t_1 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.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 <= -1.42e-282: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = t_1 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -1.42e-282) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); else tmp = Float64(t_1 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.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 <= -1.42e-282) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = t_1 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (t_0 + 1.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, -1.42e-282], 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[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1.42 \cdot 10^{-282}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t\_0 + 1}\\
\end{array}
\end{array}
if x.re < -1.42e-282Initial program 43.9%
Taylor expanded in y.im around 0 61.8%
Taylor expanded in x.re around -inf 72.9%
mul-1-neg72.9%
Simplified72.9%
if -1.42e-282 < x.re Initial program 40.5%
exp-diff37.3%
exp-to-pow37.3%
hypot-define37.3%
*-commutative37.3%
exp-prod36.3%
fma-define36.3%
hypot-define65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y.im around 0 66.9%
Taylor expanded in y.im around 0 55.3%
Final simplification64.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 -4e-310)
(* t_1 (exp (- (* y.re (log (- x.im))) 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 <= -4e-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_im)) - 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 <= (-4d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46im)) - 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 <= -4e-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_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 <= -4e-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_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 <= -4e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - 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 <= -4e-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_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, -4e-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$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 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -3.999999999999988e-310Initial program 44.5%
Taylor expanded in y.im around 0 55.6%
Taylor expanded in x.im around -inf 57.2%
mul-1-neg57.2%
Simplified57.2%
if -3.999999999999988e-310 < x.im Initial program 39.8%
Taylor expanded in y.im around 0 58.3%
Taylor expanded in x.re around 0 57.8%
*-commutative57.8%
Simplified57.8%
Final simplification57.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1900000000.0)
(* (sin (fabs t_0)) (pow x.im y.re))
(if (<= y.re 1.35e+29)
(/ t_0 (exp (* (atan2 x.im x.re) y.im)))
(* (sin (pow (cbrt t_0) 3.0)) (pow 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_re <= -1900000000.0) {
tmp = sin(fabs(t_0)) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 1.35e+29) {
tmp = t_0 / exp((atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = sin(pow(cbrt(t_0), 3.0)) * pow(x_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1900000000.0) {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 1.35e+29) {
tmp = t_0 / Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = Math.sin(Math.pow(Math.cbrt(t_0), 3.0)) * Math.pow(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_re <= -1900000000.0) tmp = Float64(sin(abs(t_0)) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 1.35e+29) tmp = Float64(t_0 / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(sin((cbrt(t_0) ^ 3.0)) * (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[LessEqual[y$46$re, -1900000000.0], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.35e+29], N[(t$95$0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, 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.re \leq -1900000000:\\
\;\;\;\;\sin \left(\left|t\_0\right|\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.35 \cdot 10^{+29}:\\
\;\;\;\;\frac{t\_0}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right) \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.9e9Initial program 47.9%
exp-diff43.7%
exp-to-pow43.7%
hypot-define43.7%
*-commutative43.7%
exp-prod43.7%
fma-define43.7%
hypot-define71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x.re around 0 46.9%
Taylor expanded in y.im around 0 48.2%
Taylor expanded in y.im around 0 53.9%
add-sqr-sqrt24.1%
sqrt-unprod26.9%
pow226.9%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square56.7%
Simplified56.7%
if -1.9e9 < y.re < 1.35e29Initial program 35.4%
exp-diff34.0%
exp-to-pow34.0%
hypot-define34.0%
*-commutative34.0%
exp-prod33.8%
fma-define33.7%
hypot-define70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in x.re around 0 30.5%
Taylor expanded in y.im around 0 25.7%
Taylor expanded in y.re around 0 54.3%
if 1.35e29 < y.re Initial program 53.1%
exp-diff38.8%
exp-to-pow38.8%
hypot-define38.8%
*-commutative38.8%
exp-prod36.7%
fma-define36.7%
hypot-define51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in x.re around 0 49.2%
Taylor expanded in y.im around 0 51.2%
Taylor expanded in y.im around 0 63.7%
add-cube-cbrt73.5%
pow371.5%
Applied egg-rr65.7%
Final simplification57.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1900000000.0)
(* (sin (fabs t_0)) (pow x.im y.re))
(if (<= y.re 7.8e+40)
(/ t_0 (exp (* (atan2 x.im x.re) y.im)))
(* (sin t_0) (pow 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_re <= -1900000000.0) {
tmp = sin(fabs(t_0)) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 7.8e+40) {
tmp = t_0 / exp((atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
}
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) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if (y_46re <= (-1900000000.0d0)) then
tmp = sin(abs(t_0)) * (x_46im ** y_46re)
else if (y_46re <= 7.8d+40) then
tmp = t_0 / exp((atan2(x_46im, x_46re) * y_46im))
else
tmp = sin(t_0) * (x_46im ** y_46re)
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1900000000.0) {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 7.8e+40) {
tmp = t_0 / Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -1900000000.0: tmp = math.sin(math.fabs(t_0)) * math.pow(x_46_im, y_46_re) elif y_46_re <= 7.8e+40: tmp = t_0 / math.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) else: tmp = math.sin(t_0) * math.pow(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_re <= -1900000000.0) tmp = Float64(sin(abs(t_0)) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 7.8e+40) tmp = Float64(t_0 / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(sin(t_0) * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -1900000000.0) tmp = sin(abs(t_0)) * (x_46_im ^ y_46_re); elseif (y_46_re <= 7.8e+40) tmp = t_0 / exp((atan2(x_46_im, x_46_re) * y_46_im)); else tmp = sin(t_0) * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1900000000.0], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.8e+40], N[(t$95$0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, 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.re \leq -1900000000:\\
\;\;\;\;\sin \left(\left|t\_0\right|\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{+40}:\\
\;\;\;\;\frac{t\_0}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\sin t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.9e9Initial program 47.9%
exp-diff43.7%
exp-to-pow43.7%
hypot-define43.7%
*-commutative43.7%
exp-prod43.7%
fma-define43.7%
hypot-define71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x.re around 0 46.9%
Taylor expanded in y.im around 0 48.2%
Taylor expanded in y.im around 0 53.9%
add-sqr-sqrt24.1%
sqrt-unprod26.9%
pow226.9%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square56.7%
Simplified56.7%
if -1.9e9 < y.re < 7.8000000000000002e40Initial program 34.7%
exp-diff33.2%
exp-to-pow33.2%
hypot-define33.2%
*-commutative33.2%
exp-prod33.0%
fma-define33.0%
hypot-define69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in x.re around 0 29.9%
Taylor expanded in y.im around 0 25.2%
Taylor expanded in y.re around 0 53.2%
if 7.8000000000000002e40 < y.re Initial program 56.5%
exp-diff41.3%
exp-to-pow41.3%
hypot-define41.3%
*-commutative41.3%
exp-prod39.1%
fma-define39.1%
hypot-define54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in x.re around 0 52.3%
Taylor expanded in y.im around 0 54.5%
Taylor expanded in y.im around 0 67.8%
Final simplification56.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -520000000.0) (not (<= y.re 7.8e+40)))
(* (sin t_0) (pow x.im y.re))
(/ t_0 (exp (* (atan2 x.im x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -520000000.0) || !(y_46_re <= 7.8e+40)) {
tmp = sin(t_0) * pow(x_46_im, y_46_re);
} else {
tmp = t_0 / exp((atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
if ((y_46re <= (-520000000.0d0)) .or. (.not. (y_46re <= 7.8d+40))) then
tmp = sin(t_0) * (x_46im ** y_46re)
else
tmp = t_0 / exp((atan2(x_46im, x_46re) * y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -520000000.0) || !(y_46_re <= 7.8e+40)) {
tmp = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 / 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 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if (y_46_re <= -520000000.0) or not (y_46_re <= 7.8e+40): tmp = math.sin(t_0) * math.pow(x_46_im, y_46_re) else: tmp = t_0 / math.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -520000000.0) || !(y_46_re <= 7.8e+40)) tmp = Float64(sin(t_0) * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 / exp(Float64(atan(x_46_im, x_46_re) * 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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if ((y_46_re <= -520000000.0) || ~((y_46_re <= 7.8e+40))) tmp = sin(t_0) * (x_46_im ^ y_46_re); else tmp = t_0 / 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -520000000.0], N[Not[LessEqual[y$46$re, 7.8e+40]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -520000000 \lor \neg \left(y.re \leq 7.8 \cdot 10^{+40}\right):\\
\;\;\;\;\sin t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.re < -5.2e8 or 7.8000000000000002e40 < y.re Initial program 51.3%
exp-diff42.7%
exp-to-pow42.7%
hypot-define42.7%
*-commutative42.7%
exp-prod41.9%
fma-define41.9%
hypot-define65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in x.re around 0 49.0%
Taylor expanded in y.im around 0 50.7%
Taylor expanded in y.im around 0 59.3%
if -5.2e8 < y.re < 7.8000000000000002e40Initial program 34.7%
exp-diff33.2%
exp-to-pow33.2%
hypot-define33.2%
*-commutative33.2%
exp-prod33.0%
fma-define33.0%
hypot-define69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in x.re around 0 29.9%
Taylor expanded in y.im around 0 25.2%
Taylor expanded in y.re around 0 53.2%
Final simplification56.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)))
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))) * pow(x_46_im, 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
code = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
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.pow(x_46_im, y_46_re);
}
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.pow(x_46_im, y_46_re)
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))) * (x_46_im ^ y_46_re)) 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))) * (x_46_im ^ y_46_re); 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[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 42.3%
exp-diff37.6%
exp-to-pow37.6%
hypot-define37.6%
*-commutative37.6%
exp-prod37.1%
fma-define37.1%
hypot-define67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in x.re around 0 38.6%
Taylor expanded in y.im around 0 36.8%
Taylor expanded in y.im around 0 31.1%
Final simplification31.1%
herbie shell --seed 2024039
(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)))))