
(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 (* 0.5 (log (fma x.im x.im (* x.re x.re)))))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re)))
(t_3 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_4 (exp (- (* t_3 y.re) t_1)))
(t_5 (cos (fma t_0 y.im (- t_2)))))
(if (<= (* t_4 (cos (+ (* t_3 y.im) t_2))) 5e+31)
(* t_4 (/ 1.0 (/ t_5 (* t_5 (cos (fma t_0 y.im t_2))))))
(* (exp (- (* y.re (log (hypot x.re x.im))) t_1)) (cos t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 0.5 * log(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double t_3 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_4 = exp(((t_3 * y_46_re) - t_1));
double t_5 = cos(fma(t_0, y_46_im, -t_2));
double tmp;
if ((t_4 * cos(((t_3 * y_46_im) + t_2))) <= 5e+31) {
tmp = t_4 * (1.0 / (t_5 / (t_5 * cos(fma(t_0, y_46_im, t_2)))));
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_1)) * cos(t_2);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(0.5 * log(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_3 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_4 = exp(Float64(Float64(t_3 * y_46_re) - t_1)) t_5 = cos(fma(t_0, y_46_im, Float64(-t_2))) tmp = 0.0 if (Float64(t_4 * cos(Float64(Float64(t_3 * y_46_im) + t_2))) <= 5e+31) tmp = Float64(t_4 * Float64(1.0 / Float64(t_5 / Float64(t_5 * cos(fma(t_0, y_46_im, t_2)))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_1)) * cos(t_2)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(0.5 * N[Log[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Cos[N[(t$95$0 * y$46$im + (-t$95$2)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$4 * N[Cos[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 5e+31], N[(t$95$4 * N[(1.0 / N[(t$95$5 / N[(t$95$5 * N[Cos[N[(t$95$0 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \log \left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_3 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_4 := e^{t\_3 \cdot y.re - t\_1}\\
t_5 := \cos \left(\mathsf{fma}\left(t\_0, y.im, -t\_2\right)\right)\\
\mathbf{if}\;t\_4 \cdot \cos \left(t\_3 \cdot y.im + t\_2\right) \leq 5 \cdot 10^{+31}:\\
\;\;\;\;t\_4 \cdot \frac{1}{\frac{t\_5}{t\_5 \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, t\_2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t\_1} \cdot \cos t\_2\\
\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)))) < 5.00000000000000027e31Initial program 87.9%
Applied egg-rr87.9%
if 5.00000000000000027e31 < (*.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 13.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6448.2
Simplified48.2%
lower-hypot.f6475.0
Applied egg-rr75.0%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1)))))
(if (<= t_3 0.9830716708561194)
t_3
(* (exp (- (* y.re (log (hypot x.re x.im))) t_0)) (cos t_1)))))
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 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1));
double tmp;
if (t_3 <= 0.9830716708561194) {
tmp = t_3;
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * cos(t_1);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.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.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = Math.exp(((t_2 * y_46_re) - t_0)) * Math.cos(((t_2 * y_46_im) + t_1));
double tmp;
if (t_3 <= 0.9830716708561194) {
tmp = t_3;
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_0)) * Math.cos(t_1);
}
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.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_3 = math.exp(((t_2 * y_46_re) - t_0)) * math.cos(((t_2 * y_46_im) + t_1)) tmp = 0 if t_3 <= 0.9830716708561194: tmp = t_3 else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_0)) * math.cos(t_1) 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 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) tmp = 0.0 if (t_3 <= 0.9830716708561194) tmp = t_3; else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * cos(t_1)); 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 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_3 = exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1)); tmp = 0.0; if (t_3 <= 0.9830716708561194) tmp = t_3; else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * cos(t_1); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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[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[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.9830716708561194], t$95$3, N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $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 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - t\_0} \cdot \cos \left(t\_2 \cdot y.im + t\_1\right)\\
\mathbf{if}\;t\_3 \leq 0.9830716708561194:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t\_0} \cdot \cos t\_1\\
\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.98307167085611935Initial program 82.6%
if 0.98307167085611935 < (*.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 28.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6457.1
Simplified57.1%
lower-hypot.f6479.3
Applied egg-rr79.3%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -6.2e+118)
(exp (- (* y.re (log (- x.im))) t_0))
(*
(exp (- (* y.re (log (hypot x.re x.im))) t_0))
(cos (* 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 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -6.2e+118) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -6.2e+118) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_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 tmp = 0 if x_46_im <= -6.2e+118: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) else: tmp = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -6.2e+118) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -6.2e+118) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); else tmp = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -6.2e+118], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $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 -6.2 \cdot 10^{+118}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.im < -6.19999999999999973e118Initial program 17.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6457.2
Simplified57.2%
Taylor expanded in y.re around 0
Simplified70.0%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6485.0
Simplified85.0%
if -6.19999999999999973e118 < x.im Initial program 48.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6462.7
Simplified62.7%
lower-hypot.f6478.8
Applied egg-rr78.8%
Final simplification79.7%
(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.1e-295)
(exp (- (* y.re (log (- x.im))) t_0))
(if (<= x.im 4.6e-257)
(*
(pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)
(fma (pow (atan2 x.im x.re) 2.0) (* -0.5 (* y.re y.re)) 1.0))
(*
(cos (* y.re (atan2 x.im x.re)))
(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.1e-295) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 4.6e-257) {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * fma(pow(atan2(x_46_im, x_46_re), 2.0), (-0.5 * (y_46_re * y_46_re)), 1.0);
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * 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.1e-295) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); elseif (x_46_im <= 4.6e-257) tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * fma((atan(x_46_im, x_46_re) ^ 2.0), Float64(-0.5 * Float64(y_46_re * y_46_re)), 1.0)); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -1.1e-295], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 4.6e-257], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $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.1 \cdot 10^{-295}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 4.6 \cdot 10^{-257}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \mathsf{fma}\left({\tan^{-1}_* \frac{x.im}{x.re}}^{2}, -0.5 \cdot \left(y.re \cdot y.re\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -1.1000000000000001e-295Initial program 43.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6462.8
Simplified62.8%
Taylor expanded in y.re around 0
Simplified65.3%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6471.8
Simplified71.8%
if -1.1000000000000001e-295 < x.im < 4.6e-257Initial program 44.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6463.8
Simplified63.8%
lower-hypot.f6469.8
Applied egg-rr69.8%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.1
Simplified76.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6470.0
Simplified70.0%
if 4.6e-257 < x.im Initial program 43.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6460.5
Simplified60.5%
lower-hypot.f6482.5
Applied egg-rr82.5%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-log.f6477.3
Simplified77.3%
Final simplification74.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -5e-310)
(exp (- (* y.re (log (- x.re))) t_0))
(* (cos (* y.re (atan2 x.im x.re))) (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 <= -5e-310) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * 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 <= (-5d-310)) then
tmp = exp(((y_46re * log(-x_46re)) - t_0))
else
tmp = cos((y_46re * atan2(x_46im, x_46re))) * 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 <= -5e-310) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * 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 <= -5e-310: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * 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 <= -5e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0)); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * 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 <= -5e-310) tmp = exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * 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, -5e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 42.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6458.3
Simplified58.3%
Taylor expanded in y.re around 0
Simplified60.7%
Taylor expanded in x.re around -inf
neg-mul-1N/A
lower-neg.f6473.3
Simplified73.3%
if -4.999999999999985e-310 < x.re Initial program 44.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6465.9
Simplified65.9%
lower-hypot.f6480.8
Applied egg-rr80.8%
Taylor expanded in x.re around inf
mul-1-negN/A
log-recN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6476.8
Simplified76.8%
Final simplification74.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) (- y.im))))
(if (<= x.re -7.2e-174)
(exp (- (* y.re (log (- x.re))) (* (atan2 x.im x.re) y.im)))
(if (<= x.re 1.25e-155)
(*
(fma (pow (atan2 x.im x.re) 2.0) (* -0.5 (* y.re y.re)) 1.0)
(exp t_0))
(exp (fma 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 <= -7.2e-174) {
tmp = exp(((y_46_re * log(-x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (x_46_re <= 1.25e-155) {
tmp = fma(pow(atan2(x_46_im, x_46_re), 2.0), (-0.5 * (y_46_re * y_46_re)), 1.0) * exp(t_0);
} else {
tmp = exp(fma(y_46_re, 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) * Float64(-y_46_im)) tmp = 0.0 if (x_46_re <= -7.2e-174) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - Float64(atan(x_46_im, x_46_re) * y_46_im))); elseif (x_46_re <= 1.25e-155) tmp = Float64(fma((atan(x_46_im, x_46_re) ^ 2.0), Float64(-0.5 * Float64(y_46_re * y_46_re)), 1.0) * exp(t_0)); else tmp = exp(fma(y_46_re, log(x_46_re), t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[x$46$re, -7.2e-174], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$re, 1.25e-155], N[(N[(N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision], N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;x.re \leq -7.2 \cdot 10^{-174}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;x.re \leq 1.25 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left({\tan^{-1}_* \frac{x.im}{x.re}}^{2}, -0.5 \cdot \left(y.re \cdot y.re\right), 1\right) \cdot e^{t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(y.re, \log x.re, t\_0\right)}\\
\end{array}
\end{array}
if x.re < -7.19999999999999997e-174Initial program 44.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6458.5
Simplified58.5%
Taylor expanded in y.re around 0
Simplified63.5%
Taylor expanded in x.re around -inf
neg-mul-1N/A
lower-neg.f6478.7
Simplified78.7%
if -7.19999999999999997e-174 < x.re < 1.25e-155Initial program 33.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6456.3
Simplified56.3%
lower-hypot.f6473.9
Applied egg-rr73.9%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.1
Simplified76.1%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6467.9
Simplified67.9%
if 1.25e-155 < x.re Initial program 48.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6469.7
Simplified69.7%
Taylor expanded in y.re around 0
Simplified64.0%
Taylor expanded in x.re around inf
sub-negN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6472.0
Simplified72.0%
Final simplification73.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -5e-310) (exp (- (* y.re (log (- x.re))) (* (atan2 x.im x.re) y.im))) (exp (fma y.re (log x.re) (* (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_re <= -5e-310) {
tmp = exp(((y_46_re * log(-x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = exp(fma(y_46_re, log(x_46_re), (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_re <= -5e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = exp(fma(y_46_re, log(x_46_re), 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_] := If[LessEqual[x$46$re, -5e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(y$46$re * N[Log[x$46$re], $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.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(y.re, \log x.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 42.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6458.3
Simplified58.3%
Taylor expanded in y.re around 0
Simplified60.7%
Taylor expanded in x.re around -inf
neg-mul-1N/A
lower-neg.f6473.3
Simplified73.3%
if -4.999999999999985e-310 < x.re Initial program 44.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6465.9
Simplified65.9%
Taylor expanded in y.re around 0
Simplified56.9%
Taylor expanded in x.re around inf
sub-negN/A
mul-1-negN/A
log-recN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6468.4
Simplified68.4%
Final simplification71.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5.6e+31)
(* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re))
(if (<= y.re 6.2e-7)
(exp (* (atan2 x.im x.re) (- y.im)))
(exp (* y.re (log (sqrt (fma x.im x.im (* x.re x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -5.6e+31) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else if (y_46_re <= 6.2e-7) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp((y_46_re * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -5.6e+31) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); elseif (y_46_re <= 6.2e-7) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = exp(Float64(y_46_re * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -5.6e+31], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-7], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Exp[N[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{+31}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}\\
\end{array}
\end{array}
if y.re < -5.60000000000000034e31Initial program 41.2%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6480.5
Simplified80.5%
lower-hypot.f6482.4
Applied egg-rr82.4%
Taylor expanded in x.re around inf
mul-1-negN/A
log-recN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6445.2
Simplified45.2%
Taylor expanded in y.im around 0
lower-pow.f6468.9
Simplified68.9%
if -5.60000000000000034e31 < y.re < 6.1999999999999999e-7Initial program 40.8%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6449.8
Simplified49.8%
Taylor expanded in y.re around 0
Simplified50.2%
Taylor expanded in y.re around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6475.9
Simplified75.9%
lift-atan2.f64N/A
rem-log-expN/A
lift-neg.f64N/A
rem-log-expN/A
lift-*.f64N/A
lift-exp.f64N/A
*-rgt-identity75.9
Applied egg-rr75.9%
if 6.1999999999999999e-7 < y.re Initial program 49.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6470.3
Simplified70.3%
Taylor expanded in y.re around 0
Simplified69.1%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.1
Simplified65.1%
Final simplification71.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.re (log (sqrt (fma x.im x.im (* x.re x.re))))))))
(if (<= y.re -0.00019)
t_0
(if (<= y.re 6.2e-7) (exp (* (atan2 x.im x.re) (- y.im))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_re * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))));
double tmp;
if (y_46_re <= -0.00019) {
tmp = t_0;
} else if (y_46_re <= 6.2e-7) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_re * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))))) tmp = 0.0 if (y_46_re <= -0.00019) tmp = t_0; elseif (y_46_re <= 6.2e-7) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = t_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[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00019], t$95$0, If[LessEqual[y$46$re, 6.2e-7], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}\\
\mathbf{if}\;y.re \leq -0.00019:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.9000000000000001e-4 or 6.1999999999999999e-7 < y.re Initial program 47.7%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6473.5
Simplified73.5%
Taylor expanded in y.re around 0
Simplified68.0%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6464.3
Simplified64.3%
if -1.9000000000000001e-4 < y.re < 6.1999999999999999e-7Initial program 39.1%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6449.4
Simplified49.4%
Taylor expanded in y.re around 0
Simplified49.4%
Taylor expanded in y.re around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6476.8
Simplified76.8%
lift-atan2.f64N/A
rem-log-expN/A
lift-neg.f64N/A
rem-log-expN/A
lift-*.f64N/A
lift-exp.f64N/A
*-rgt-identity76.8
Applied egg-rr76.8%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (- (/ (* (* x.re x.re) -0.5) x.im) x.im) y.re)))
(if (<= y.re -5.4e+31)
t_0
(if (<= y.re 6.2e-7) (exp (* (atan2 x.im x.re) (- y.im))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im), y_46_re);
double tmp;
if (y_46_re <= -5.4e+31) {
tmp = t_0;
} else if (y_46_re <= 6.2e-7) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 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 = ((((x_46re * x_46re) * (-0.5d0)) / x_46im) - x_46im) ** y_46re
if (y_46re <= (-5.4d+31)) then
tmp = t_0
else if (y_46re <= 6.2d-7) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = 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.pow(((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im), y_46_re);
double tmp;
if (y_46_re <= -5.4e+31) {
tmp = t_0;
} else if (y_46_re <= 6.2e-7) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im), y_46_re) tmp = 0 if y_46_re <= -5.4e+31: tmp = t_0 elif y_46_re <= 6.2e-7: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(Float64(x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -5.4e+31) tmp = t_0; elseif (y_46_re <= 6.2e-7) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -5.4e+31) tmp = t_0; elseif (y_46_re <= 6.2e-7) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * -0.5), $MachinePrecision] / x$46$im), $MachinePrecision] - x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -5.4e+31], t$95$0, If[LessEqual[y$46$re, 6.2e-7], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{\left(x.re \cdot x.re\right) \cdot -0.5}{x.im} - x.im\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5.4 \cdot 10^{+31}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.39999999999999971e31 or 6.1999999999999999e-7 < y.re Initial program 46.3%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6474.4
Simplified74.4%
Taylor expanded in y.re around 0
Simplified68.1%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6421.8
Simplified21.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6454.8
Simplified54.8%
if -5.39999999999999971e31 < y.re < 6.1999999999999999e-7Initial program 40.8%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6449.8
Simplified49.8%
Taylor expanded in y.re around 0
Simplified50.2%
Taylor expanded in y.re around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6475.9
Simplified75.9%
lift-atan2.f64N/A
rem-log-expN/A
lift-neg.f64N/A
rem-log-expN/A
lift-*.f64N/A
lift-exp.f64N/A
*-rgt-identity75.9
Applied egg-rr75.9%
Final simplification65.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (- (/ (* (* x.re x.re) -0.5) x.im) x.im) y.re)))
(if (<= y.re -3.9e-47)
t_0
(if (<= y.re 2.45e-8) (- 1.0 (* (atan2 x.im x.re) y.im)) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im), y_46_re);
double tmp;
if (y_46_re <= -3.9e-47) {
tmp = t_0;
} else if (y_46_re <= 2.45e-8) {
tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im);
} else {
tmp = 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 = ((((x_46re * x_46re) * (-0.5d0)) / x_46im) - x_46im) ** y_46re
if (y_46re <= (-3.9d-47)) then
tmp = t_0
else if (y_46re <= 2.45d-8) then
tmp = 1.0d0 - (atan2(x_46im, x_46re) * y_46im)
else
tmp = 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.pow(((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im), y_46_re);
double tmp;
if (y_46_re <= -3.9e-47) {
tmp = t_0;
} else if (y_46_re <= 2.45e-8) {
tmp = 1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im), y_46_re) tmp = 0 if y_46_re <= -3.9e-47: tmp = t_0 elif y_46_re <= 2.45e-8: tmp = 1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(Float64(x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -3.9e-47) tmp = t_0; elseif (y_46_re <= 2.45e-8) tmp = Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((((x_46_re * x_46_re) * -0.5) / x_46_im) - x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -3.9e-47) tmp = t_0; elseif (y_46_re <= 2.45e-8) tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * -0.5), $MachinePrecision] / x$46$im), $MachinePrecision] - x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -3.9e-47], t$95$0, If[LessEqual[y$46$re, 2.45e-8], N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{\left(x.re \cdot x.re\right) \cdot -0.5}{x.im} - x.im\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -3.9 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{-8}:\\
\;\;\;\;1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.89999999999999978e-47 or 2.4500000000000001e-8 < y.re Initial program 45.1%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6471.6
Simplified71.6%
Taylor expanded in y.re around 0
Simplified66.4%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6422.4
Simplified22.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6452.7
Simplified52.7%
if -3.89999999999999978e-47 < y.re < 2.4500000000000001e-8Initial program 41.6%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6450.0
Simplified50.0%
Taylor expanded in y.re around 0
Simplified50.0%
Taylor expanded in y.re around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6478.5
Simplified78.5%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
lower-atan2.f6447.4
Simplified47.4%
Final simplification50.3%
(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 43.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6461.8
Simplified61.8%
Taylor expanded in y.re around 0
Simplified59.0%
Taylor expanded in y.re around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6449.3
Simplified49.3%
Taylor expanded in y.im around 0
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
lower-atan2.f6423.2
Simplified23.2%
Final simplification23.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
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
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;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 43.5%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f6461.8
Simplified61.8%
Taylor expanded in y.re around 0
Simplified59.0%
Taylor expanded in y.re around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6449.3
Simplified49.3%
Taylor expanded in y.im around 0
Simplified23.0%
herbie shell --seed 2024219
(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)))))