
(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)))
(cos (+ (* 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))) * cos(((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))) * cos(((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.cos(((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.cos(((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))) * cos(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))) * cos(((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[Cos[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 \cos \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 13 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)))
(cos (+ (* 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))) * cos(((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))) * cos(((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.cos(((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.cos(((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))) * cos(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))) * cos(((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[Cos[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 \cos \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
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -320.0)
t_0
(if (<= y.re 13200000000000.0)
(*
(cos (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 5e+247)
t_0
(*
t_0
(+ 1.0 (* -0.5 (pow (* y.im (log (hypot x.im x.re))) 2.0)))))))))
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 tmp;
if (y_46_re <= -320.0) {
tmp = t_0;
} else if (y_46_re <= 13200000000000.0) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5e+247) {
tmp = t_0;
} else {
tmp = t_0 * (1.0 + (-0.5 * pow((y_46_im * log(hypot(x_46_im, x_46_re))), 2.0)));
}
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))) tmp = 0.0 if (y_46_re <= -320.0) tmp = t_0; elseif (y_46_re <= 13200000000000.0) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 5e+247) tmp = t_0; else tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (Float64(y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(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, -320.0], t$95$0, If[LessEqual[y$46$re, 13200000000000.0], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5e+247], t$95$0, N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $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}\\
\mathbf{if}\;y.re \leq -320:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 13200000000000:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+247}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if y.re < -320 or 1.32e13 < y.re < 5.00000000000000023e247Initial program 45.3%
Taylor expanded in y.im around 0 73.6%
Taylor expanded in y.re around 0 83.8%
if -320 < y.re < 1.32e13Initial program 34.8%
exp-diff34.8%
exp-to-pow34.8%
hypot-define34.8%
*-commutative34.8%
exp-prod34.9%
fma-define34.9%
hypot-define78.1%
*-commutative78.1%
Simplified78.1%
if 5.00000000000000023e247 < y.re Initial program 26.7%
Taylor expanded in y.re around 0 20.0%
unpow220.0%
unpow220.0%
hypot-undefine40.0%
Simplified40.0%
Taylor expanded in y.im around 0 60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
swap-sqr60.0%
unpow260.0%
unpow260.0%
hypot-undefine60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
hypot-undefine73.3%
*-commutative73.3%
Simplified73.3%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* (cos (+ (* t_2 y.im) t_0)) t_3) -0.5)
(* (fabs (cos (* y.im (log (hypot x.im x.re))))) t_3)
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_1 y.im t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((cos(((t_2 * y_46_im) + t_0)) * t_3) <= -0.5) {
tmp = fabs(cos((y_46_im * log(hypot(x_46_im, x_46_re))))) * t_3;
} else {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_1, y_46_im, t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(cos(Float64(Float64(t_2 * y_46_im) + t_0)) * t_3) <= -0.5) tmp = Float64(abs(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) * t_3); else tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_1, y_46_im, t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], -0.5], N[(N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + 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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;\cos \left(t\_2 \cdot y.im + t\_0\right) \cdot t\_3 \leq -0.5:\\
\;\;\;\;\left|\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right| \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_0\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))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.5Initial program 30.8%
fma-define30.8%
hypot-define30.8%
*-commutative30.8%
add-sqr-sqrt0.0%
sqrt-unprod66.0%
pow266.0%
fma-undefine66.0%
*-commutative66.0%
*-commutative66.0%
fma-define66.0%
Applied egg-rr66.0%
unpow266.0%
rem-sqrt-square66.0%
hypot-undefine66.0%
unpow266.0%
unpow266.0%
+-commutative66.0%
*-commutative66.0%
fma-define66.0%
fma-define66.0%
unpow266.0%
unpow266.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.re around 0 66.0%
unpow266.0%
unpow266.0%
hypot-undefine66.0%
Simplified66.0%
if -0.5 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.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.1%
fma-neg40.1%
hypot-define40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Final simplification79.8%
(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.im (log (hypot x.im x.re)))))
(if (<= y.re -1.5)
t_0
(if (<= y.re 2250000000000.0)
(*
(fabs (cos (fma y.re (atan2 x.im x.re) t_1)))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 2.5e+259) t_0 (* t_0 (+ 1.0 (* -0.5 (pow t_1 2.0)))))))))
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_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1.5) {
tmp = t_0;
} else if (y_46_re <= 2250000000000.0) {
tmp = fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), t_1))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2.5e+259) {
tmp = t_0;
} else {
tmp = t_0 * (1.0 + (-0.5 * pow(t_1, 2.0)));
}
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_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.5) tmp = t_0; elseif (y_46_re <= 2250000000000.0) tmp = Float64(abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), t_1))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 2.5e+259) tmp = t_0; else tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (t_1 ^ 2.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(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$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.5], t$95$0, If[LessEqual[y$46$re, 2250000000000.0], N[(N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.5e+259], t$95$0, N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[t$95$1, 2.0], $MachinePrecision]), $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.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2250000000000:\\
\;\;\;\;\left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_1\right)\right)\right| \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+259}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(1 + -0.5 \cdot {t\_1}^{2}\right)\\
\end{array}
\end{array}
if y.re < -1.5 or 2.25e12 < y.re < 2.50000000000000016e259Initial program 45.8%
Taylor expanded in y.im around 0 73.8%
Taylor expanded in y.re around 0 84.0%
if -1.5 < y.re < 2.25e12Initial program 34.3%
exp-diff34.3%
exp-to-pow34.3%
hypot-define34.3%
*-commutative34.3%
exp-prod34.3%
fma-define34.3%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.re around 0 76.8%
rec-exp76.8%
distribute-lft-neg-in76.8%
Simplified76.8%
add-sqr-sqrt63.9%
sqrt-unprod77.6%
pow277.6%
Applied egg-rr77.6%
unpow277.6%
rem-sqrt-square77.6%
fma-define77.6%
+-commutative77.6%
fma-define77.6%
*-commutative77.6%
hypot-undefine37.5%
unpow237.5%
unpow237.5%
+-commutative37.5%
unpow237.5%
unpow237.5%
hypot-define77.6%
Simplified77.6%
if 2.50000000000000016e259 < y.re Initial program 26.7%
Taylor expanded in y.re around 0 20.0%
unpow220.0%
unpow220.0%
hypot-undefine40.0%
Simplified40.0%
Taylor expanded in y.im around 0 60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
swap-sqr60.0%
unpow260.0%
unpow260.0%
hypot-undefine60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
hypot-undefine73.3%
*-commutative73.3%
Simplified73.3%
Final simplification80.3%
(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)))))
(if (<= y.re -1.65)
t_0
(if (<= y.re 4700000000000.0)
(*
(cos (* y.re (atan2 x.im x.re)))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.6e+260)
t_0
(*
t_0
(+ 1.0 (* -0.5 (pow (* y.im (log (hypot x.im x.re))) 2.0)))))))))
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 tmp;
if (y_46_re <= -1.65) {
tmp = t_0;
} else if (y_46_re <= 4700000000000.0) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.6e+260) {
tmp = t_0;
} else {
tmp = t_0 * (1.0 + (-0.5 * pow((y_46_im * log(hypot(x_46_im, x_46_re))), 2.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.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -1.65) {
tmp = t_0;
} else if (y_46_re <= 4700000000000.0) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.6e+260) {
tmp = t_0;
} else {
tmp = t_0 * (1.0 + (-0.5 * Math.pow((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))), 2.0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if y_46_re <= -1.65: tmp = t_0 elif y_46_re <= 4700000000000.0: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) elif y_46_re <= 1.6e+260: tmp = t_0 else: tmp = t_0 * (1.0 + (-0.5 * math.pow((y_46_im * math.log(math.hypot(x_46_im, x_46_re))), 2.0))) 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))) tmp = 0.0 if (y_46_re <= -1.65) tmp = t_0; elseif (y_46_re <= 4700000000000.0) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.6e+260) tmp = t_0; else tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (Float64(y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) 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))); tmp = 0.0; if (y_46_re <= -1.65) tmp = t_0; elseif (y_46_re <= 4700000000000.0) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); elseif (y_46_re <= 1.6e+260) tmp = t_0; else tmp = t_0 * (1.0 + (-0.5 * ((y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0))); end tmp_2 = 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]}, If[LessEqual[y$46$re, -1.65], t$95$0, If[LessEqual[y$46$re, 4700000000000.0], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e+260], t$95$0, N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $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}\\
\mathbf{if}\;y.re \leq -1.65:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4700000000000:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+260}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if y.re < -1.6499999999999999 or 4.7e12 < y.re < 1.6e260Initial program 45.8%
Taylor expanded in y.im around 0 73.8%
Taylor expanded in y.re around 0 84.0%
if -1.6499999999999999 < y.re < 4.7e12Initial program 34.3%
exp-diff34.3%
exp-to-pow34.3%
hypot-define34.3%
*-commutative34.3%
exp-prod34.3%
fma-define34.3%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.re around 0 76.8%
rec-exp76.8%
distribute-lft-neg-in76.8%
Simplified76.8%
Taylor expanded in y.im around 0 76.9%
if 1.6e260 < y.re Initial program 26.7%
Taylor expanded in y.re around 0 20.0%
unpow220.0%
unpow220.0%
hypot-undefine40.0%
Simplified40.0%
Taylor expanded in y.im around 0 60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
swap-sqr60.0%
unpow260.0%
unpow260.0%
hypot-undefine60.0%
*-commutative60.0%
unpow260.0%
unpow260.0%
hypot-undefine73.3%
*-commutative73.3%
Simplified73.3%
Final simplification80.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.5) (not (<= y.re 2250000000000.0)))
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(* (cos (* y.re (atan2 x.im x.re))) (exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.5) || !(y_46_re <= 2250000000000.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)));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.5d0)) .or. (.not. (y_46re <= 2250000000000.0d0))) then
tmp = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - (atan2(x_46im, x_46re) * y_46im)))
else
tmp = cos((y_46re * atan2(x_46im, x_46re))) * exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.5) || !(y_46_re <= 2250000000000.0)) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.5) or not (y_46_re <= 2250000000000.0): tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.5) || !(y_46_re <= 2250000000000.0)) tmp = 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))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.5) || ~((y_46_re <= 2250000000000.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))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.5], N[Not[LessEqual[y$46$re, 2250000000000.0]], $MachinePrecision]], 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[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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}
\mathbf{if}\;y.re \leq -1.5 \lor \neg \left(y.re \leq 2250000000000\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}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.5 or 2.25e12 < y.re Initial program 43.6%
Taylor expanded in y.im around 0 71.5%
Taylor expanded in y.re around 0 79.0%
if -1.5 < y.re < 2.25e12Initial program 34.3%
exp-diff34.3%
exp-to-pow34.3%
hypot-define34.3%
*-commutative34.3%
exp-prod34.3%
fma-define34.3%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.re around 0 76.8%
rec-exp76.8%
distribute-lft-neg-in76.8%
Simplified76.8%
Taylor expanded in y.im around 0 76.9%
Final simplification78.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -410000.0) (not (<= y.re 3.8e+62))) (* (pow (hypot x.im x.re) y.re) (cos (* y.re (atan2 x.im x.re)))) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -410000.0) || !(y_46_re <= 3.8e+62)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -410000.0) || !(y_46_re <= 3.8e+62)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -410000.0) or not (y_46_re <= 3.8e+62): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -410000.0) || !(y_46_re <= 3.8e+62)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -410000.0) || ~((y_46_re <= 3.8e+62))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -410000.0], N[Not[LessEqual[y$46$re, 3.8e+62]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -410000 \lor \neg \left(y.re \leq 3.8 \cdot 10^{+62}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.1e5 or 3.79999999999999984e62 < y.re Initial program 42.5%
exp-diff33.3%
exp-to-pow33.3%
hypot-define33.3%
*-commutative33.3%
exp-prod29.2%
fma-define29.2%
hypot-define52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in y.im around 0 66.0%
unpow266.0%
unpow266.0%
hypot-undefine66.0%
Simplified66.0%
Taylor expanded in y.im around 0 67.6%
*-commutative67.6%
unpow267.6%
unpow267.6%
hypot-undefine67.6%
*-commutative67.6%
Simplified67.6%
if -4.1e5 < y.re < 3.79999999999999984e62Initial program 36.2%
Taylor expanded in y.im around 0 47.6%
Taylor expanded in y.re around 0 47.6%
Taylor expanded in y.re around 0 74.8%
mul-1-neg74.8%
*-commutative74.8%
distribute-rgt-neg-in74.8%
Simplified74.8%
Final simplification71.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= x.re -0.0033)
t_1
(if (<= x.re -6.8e-65)
(exp (- (* y.re (log x.im)) t_0))
(if (<= x.re 3.3e-307) 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 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (x_46_re <= -0.0033) {
tmp = t_1;
} else if (x_46_re <= -6.8e-65) {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
} else if (x_46_re <= 3.3e-307) {
tmp = t_1;
} else {
tmp = 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 = exp((atan2(x_46im, x_46re) * -y_46im))
if (x_46re <= (-0.0033d0)) then
tmp = t_1
else if (x_46re <= (-6.8d-65)) then
tmp = exp(((y_46re * log(x_46im)) - t_0))
else if (x_46re <= 3.3d-307) then
tmp = t_1
else
tmp = 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.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (x_46_re <= -0.0033) {
tmp = t_1;
} else if (x_46_re <= -6.8e-65) {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else if (x_46_re <= 3.3e-307) {
tmp = t_1;
} else {
tmp = 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.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if x_46_re <= -0.0033: tmp = t_1 elif x_46_re <= -6.8e-65: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) elif x_46_re <= 3.3e-307: tmp = t_1 else: tmp = 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 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (x_46_re <= -0.0033) tmp = t_1; elseif (x_46_re <= -6.8e-65) tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); elseif (x_46_re <= 3.3e-307) tmp = t_1; else tmp = 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 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (x_46_re <= -0.0033) tmp = t_1; elseif (x_46_re <= -6.8e-65) tmp = exp(((y_46_re * log(x_46_im)) - t_0)); elseif (x_46_re <= 3.3e-307) tmp = t_1; else tmp = 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -0.0033], t$95$1, If[LessEqual[x$46$re, -6.8e-65], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$re, 3.3e-307], t$95$1, N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;x.re \leq -0.0033:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.re \leq -6.8 \cdot 10^{-65}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0}\\
\mathbf{elif}\;x.re \leq 3.3 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -0.0033 or -6.79999999999999973e-65 < x.re < 3.3e-307Initial program 35.3%
Taylor expanded in y.im around 0 59.5%
Taylor expanded in y.re around 0 66.3%
Taylor expanded in y.re around 0 58.1%
mul-1-neg58.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
Simplified58.1%
if -0.0033 < x.re < -6.79999999999999973e-65Initial program 53.8%
Taylor expanded in y.im around 0 76.9%
Taylor expanded in y.re around 0 92.3%
Taylor expanded in x.re around 0 61.5%
if 3.3e-307 < x.re Initial program 40.6%
Taylor expanded in y.im around 0 57.6%
Taylor expanded in y.re around 0 57.6%
Taylor expanded in x.re around inf 66.3%
Final simplification62.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -1.7e-267)
(exp (- (* y.re (log (- x.im))) t_0))
(if (<= x.im 9.4e-254)
(exp (- (* y.re (log x.re)) t_0))
(if (<= x.im 3.95e-234)
(exp (* (atan2 x.im x.re) (- y.im)))
(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 tmp;
if (x_46_im <= -1.7e-267) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 9.4e-254) {
tmp = exp(((y_46_re * log(x_46_re)) - t_0));
} else if (x_46_im <= 3.95e-234) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46im <= (-1.7d-267)) then
tmp = exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 9.4d-254) then
tmp = exp(((y_46re * log(x_46re)) - t_0))
else if (x_46im <= 3.95d-234) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = 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 tmp;
if (x_46_im <= -1.7e-267) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 9.4e-254) {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else if (x_46_im <= 3.95e-234) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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 tmp = 0 if x_46_im <= -1.7e-267: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 9.4e-254: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) elif x_46_im <= 3.95e-234: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 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) tmp = 0.0 if (x_46_im <= -1.7e-267) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); elseif (x_46_im <= 9.4e-254) tmp = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)); elseif (x_46_im <= 3.95e-234) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = 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; tmp = 0.0; if (x_46_im <= -1.7e-267) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 9.4e-254) tmp = exp(((y_46_re * log(x_46_re)) - t_0)); elseif (x_46_im <= 3.95e-234) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 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]}, If[LessEqual[x$46$im, -1.7e-267], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 9.4e-254], N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 3.95e-234], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -1.7 \cdot 10^{-267}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 9.4 \cdot 10^{-254}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{elif}\;x.im \leq 3.95 \cdot 10^{-234}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -1.7000000000000001e-267Initial program 32.2%
Taylor expanded in y.im around 0 51.3%
Taylor expanded in y.re around 0 54.8%
Taylor expanded in x.im around -inf 69.7%
mul-1-neg69.7%
Simplified69.7%
if -1.7000000000000001e-267 < x.im < 9.40000000000000054e-254Initial program 46.9%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 62.6%
Taylor expanded in x.re around inf 55.4%
if 9.40000000000000054e-254 < x.im < 3.95e-234Initial program 50.0%
Taylor expanded in y.im around 0 100.0%
Taylor expanded in y.re around 0 100.0%
Taylor expanded in y.re around 0 75.8%
mul-1-neg75.8%
*-commutative75.8%
distribute-rgt-neg-in75.8%
Simplified75.8%
if 3.95e-234 < x.im Initial program 43.9%
Taylor expanded in y.im around 0 65.0%
Taylor expanded in y.re around 0 68.7%
Taylor expanded in x.re around 0 74.2%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -4e-310)
(exp (- (* y.re (log (- x.re))) t_0))
(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 tmp;
if (x_46_re <= -4e-310) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = 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) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46re <= (-4d-310)) then
tmp = exp(((y_46re * log(-x_46re)) - t_0))
else
tmp = 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 tmp;
if (x_46_re <= -4e-310) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = 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 tmp = 0 if x_46_re <= -4e-310: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = 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) tmp = 0.0 if (x_46_re <= -4e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0)); else tmp = 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; tmp = 0.0; if (x_46_re <= -4e-310) tmp = exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = 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]}, If[LessEqual[x$46$re, -4e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -4 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -3.999999999999988e-310Initial program 37.7%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.re around 0 69.9%
Taylor expanded in x.re around -inf 74.6%
mul-1-neg74.6%
Simplified74.6%
if -3.999999999999988e-310 < x.re Initial program 40.3%
Taylor expanded in y.im around 0 57.2%
Taylor expanded in y.re around 0 57.2%
Taylor expanded in x.re around inf 65.8%
Final simplification69.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im 1.3e-306) (exp (* (atan2 x.im x.re) (- y.im))) (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) {
double tmp;
if (x_46_im <= 1.3e-306) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= 1.3d-306) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = exp(((y_46re * log(x_46im)) - (atan2(x_46im, x_46re) * y_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= 1.3e-306) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= 1.3e-306: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - (math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= 1.3e-306) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - 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) tmp = 0.0; if (x_46_im <= 1.3e-306) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, 1.3e-306], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.3 \cdot 10^{-306}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < 1.3e-306Initial program 32.7%
Taylor expanded in y.im around 0 51.0%
Taylor expanded in y.re around 0 54.2%
Taylor expanded in y.re around 0 46.4%
mul-1-neg46.4%
*-commutative46.4%
distribute-rgt-neg-in46.4%
Simplified46.4%
if 1.3e-306 < x.im Initial program 45.4%
Taylor expanded in y.im around 0 67.3%
Taylor expanded in y.re around 0 71.2%
Taylor expanded in x.re around 0 68.9%
Final simplification57.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (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) {
return exp((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 = exp((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.exp((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.exp((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 exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 39.1%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in y.re around 0 62.8%
Taylor expanded in y.re around 0 49.2%
mul-1-neg49.2%
*-commutative49.2%
distribute-rgt-neg-in49.2%
Simplified49.2%
Final simplification49.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (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) {
return exp((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 = exp((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.exp((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.exp((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 exp(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 = exp((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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 39.1%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in y.re around 0 62.8%
Taylor expanded in y.re around 0 49.2%
mul-1-neg49.2%
*-commutative49.2%
distribute-rgt-neg-in49.2%
Simplified49.2%
add-sqr-sqrt24.3%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod13.0%
add-sqr-sqrt29.2%
add-log-exp30.1%
log-pow30.4%
*-un-lft-identity30.4%
log-prod30.4%
metadata-eval30.4%
pow-exp29.2%
rem-log-exp29.2%
Applied egg-rr29.2%
+-lft-identity29.2%
Simplified29.2%
Final simplification29.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (- 1.0 (* (atan2 x.im x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (atan2(x_46_im, x_46_re) * y_46_im);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0 - (atan2(x_46im, x_46re) * y_46im)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im
\end{array}
Initial program 39.1%
exp-diff32.9%
exp-to-pow32.9%
hypot-define32.9%
*-commutative32.9%
exp-prod30.9%
fma-define30.9%
hypot-define63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in y.re around 0 48.0%
rec-exp48.0%
distribute-lft-neg-in48.0%
Simplified48.0%
Taylor expanded in y.re around 0 23.6%
+-commutative23.6%
unpow223.6%
unpow223.6%
hypot-undefine48.0%
Simplified48.0%
Taylor expanded in y.im around 0 24.7%
mul-1-neg24.7%
unsub-neg24.7%
Simplified24.7%
Final simplification24.7%
herbie shell --seed 2024077
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))