
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(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 (* (atan2 x.im x.re) y.im))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) t_0)))
(t_3 (* y.im (log (hypot x.im x.re)))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) (* y.re (atan2 x.im x.re))))) INFINITY)
(* t_2 (- (cos t_3) (* y.re (* (atan2 x.im x.re) (sin t_3)))))
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - t_0));
double t_3 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))))) <= ((double) INFINITY)) {
tmp = t_2 * (cos(t_3) - (y_46_re * (atan2(x_46_im, x_46_re) * sin(t_3))));
} else {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = Math.exp(((t_1 * y_46_re) - t_0));
double t_3 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * Math.cos(((t_1 * y_46_im) + (y_46_re * Math.atan2(x_46_im, x_46_re))))) <= Double.POSITIVE_INFINITY) {
tmp = t_2 * (Math.cos(t_3) - (y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.sin(t_3))));
} else {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_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.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_2 = math.exp(((t_1 * y_46_re) - t_0)) t_3 = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if (t_2 * math.cos(((t_1 * y_46_im) + (y_46_re * math.atan2(x_46_im, x_46_re))))) <= math.inf: tmp = t_2 * (math.cos(t_3) - (y_46_re * (math.atan2(x_46_im, x_46_re) * math.sin(t_3)))) else: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_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 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - t_0)) t_3 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + Float64(y_46_re * atan(x_46_im, x_46_re))))) <= Inf) tmp = Float64(t_2 * Float64(cos(t_3) - Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * sin(t_3))))); else tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_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 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_2 = exp(((t_1 * y_46_re) - t_0)); t_3 = y_46_im * log(hypot(x_46_im, x_46_re)); tmp = 0.0; if ((t_2 * cos(((t_1 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))))) <= Inf) tmp = t_2 * (cos(t_3) - (y_46_re * (atan2(x_46_im, x_46_re) * sin(t_3)))); else tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_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[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$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * N[(N[Cos[t$95$3], $MachinePrecision] - N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$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 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - t\_0}\\
t_3 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \leq \infty:\\
\;\;\;\;t\_2 \cdot \left(\cos t\_3 - y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sin t\_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\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)))) < +inf.0Initial program 77.5%
Taylor expanded in y.re around 0 79.9%
+-commutative79.9%
unpow279.9%
unpow279.9%
hypot-undefine80.7%
mul-1-neg80.7%
unsub-neg80.7%
Simplified80.7%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (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 0.0%
Taylor expanded in y.im around 0 42.9%
Taylor expanded in y.re around 0 45.9%
add-log-exp45.9%
hypot-define77.8%
pow-to-exp77.8%
Applied egg-rr77.8%
Final simplification79.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) t_0))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) (* y.re (atan2 x.im x.re))))) INFINITY)
(* t_2 (cos (* y.im (log (hypot x.im x.re)))))
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - t_0));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))))) <= ((double) INFINITY)) {
tmp = t_2 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = Math.exp(((t_1 * y_46_re) - t_0));
double tmp;
if ((t_2 * Math.cos(((t_1 * y_46_im) + (y_46_re * Math.atan2(x_46_im, x_46_re))))) <= Double.POSITIVE_INFINITY) {
tmp = t_2 * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_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.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_2 = math.exp(((t_1 * y_46_re) - t_0)) tmp = 0 if (t_2 * math.cos(((t_1 * y_46_im) + (y_46_re * math.atan2(x_46_im, x_46_re))))) <= math.inf: tmp = t_2 * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_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 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - t_0)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + Float64(y_46_re * atan(x_46_im, x_46_re))))) <= Inf) tmp = Float64(t_2 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_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 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_2 = exp(((t_1 * y_46_re) - t_0)); tmp = 0.0; if ((t_2 * cos(((t_1 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))))) <= Inf) tmp = t_2 * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_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[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$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$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 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - t\_0}\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \leq \infty:\\
\;\;\;\;t\_2 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\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)))) < +inf.0Initial program 77.5%
Taylor expanded in y.re around 0 76.7%
unpow276.7%
unpow276.7%
hypot-undefine77.5%
Simplified77.5%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (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 0.0%
Taylor expanded in y.im around 0 42.9%
Taylor expanded in y.re around 0 45.9%
add-log-exp45.9%
hypot-define77.8%
pow-to-exp77.8%
Applied egg-rr77.8%
Final simplification77.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 37.5%
cancel-sign-sub-inv37.5%
fma-define37.5%
hypot-define37.5%
distribute-lft-neg-in37.5%
distribute-rgt-neg-out37.5%
fma-define37.5%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= y.re -7.5e+54)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(cos (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -9.8e-80) (not (<= y.re 1.5e-285)))
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(log1p (expm1 (cos (* y.im (log (hypot x.re x.im)))))))))))
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 (y_46_re <= -7.5e+54) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= -9.8e-80) || !(y_46_re <= 1.5e-285)) {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * log1p(expm1(cos((y_46_im * log(hypot(x_46_re, x_46_im))))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -7.5e+54) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= -9.8e-80) || !(y_46_re <= 1.5e-285)) {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.log1p(Math.expm1(Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im))))));
}
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 y_46_re <= -7.5e+54: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif (y_46_re <= -9.8e-80) or not (y_46_re <= 1.5e-285): tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) - t_0)) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.log1p(math.expm1(math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))))) 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 (y_46_re <= -7.5e+54) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif ((y_46_re <= -9.8e-80) || !(y_46_re <= 1.5e-285)) tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * log1p(expm1(cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im))))))); 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[y$46$re, -7.5e+54], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, -9.8e-80], N[Not[LessEqual[y$46$re, 1.5e-285]], $MachinePrecision]], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Log[1 + N[(Exp[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{+54}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq -9.8 \cdot 10^{-80} \lor \neg \left(y.re \leq 1.5 \cdot 10^{-285}\right):\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -7.50000000000000042e54Initial program 44.4%
Taylor expanded in y.im around 0 89.0%
if -7.50000000000000042e54 < y.re < -9.79999999999999981e-80 or 1.50000000000000002e-285 < y.re Initial program 32.2%
Taylor expanded in y.im around 0 53.2%
Taylor expanded in y.re around 0 57.2%
add-log-exp55.9%
hypot-define72.3%
pow-to-exp72.3%
Applied egg-rr72.3%
if -9.79999999999999981e-80 < y.re < 1.50000000000000002e-285Initial program 45.2%
exp-diff45.2%
exp-to-pow45.2%
hypot-define45.2%
*-commutative45.2%
exp-prod45.1%
fma-define45.1%
hypot-define87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y.re around 0 87.7%
rec-exp87.7%
distribute-lft-neg-in87.7%
Simplified87.7%
add-cbrt-cube68.3%
pow366.6%
fma-undefine66.6%
*-commutative66.6%
*-commutative66.6%
fma-define66.6%
Applied egg-rr66.6%
Taylor expanded in y.im around inf 37.1%
+-commutative37.1%
unpow237.1%
unpow237.1%
hypot-undefine68.3%
cube-prod66.6%
hypot-undefine35.5%
unpow235.5%
unpow235.5%
+-commutative35.5%
unpow235.5%
unpow235.5%
hypot-undefine66.6%
Simplified66.6%
rem-cbrt-cube87.7%
*-commutative87.7%
add-cube-cbrt87.7%
associate-*r*87.6%
pow287.6%
Applied egg-rr87.6%
log1p-expm1-u87.6%
associate-*l*87.7%
unpow287.7%
add-cube-cbrt87.7%
*-commutative87.7%
hypot-undefine45.2%
+-commutative45.2%
hypot-undefine87.7%
Applied egg-rr87.7%
Final simplification78.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -0.038)
(exp (- (* y.re (log (- x.im))) t_0))
(if (<= x.im -2.5e-163)
(+ 1.0 (log (pow (exp y.im) (atan2 x.im x.re))))
(if (<= x.im 4.7e-132)
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0))
(*
(cos (* y.im (log (hypot x.re x.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 <= -0.038) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= -2.5e-163) {
tmp = 1.0 + log(pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (x_46_im <= 4.7e-132) {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -0.038) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= -2.5e-163) {
tmp = 1.0 + Math.log(Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else if (x_46_im <= 4.7e-132) {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * 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 <= -0.038: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= -2.5e-163: tmp = 1.0 + math.log(math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) elif x_46_im <= 4.7e-132: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) - t_0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * 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 <= -0.038) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); elseif (x_46_im <= -2.5e-163) tmp = Float64(1.0 + log((exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (x_46_im <= 4.7e-132) tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * 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 <= -0.038) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= -2.5e-163) tmp = 1.0 + log((exp(y_46_im) ^ atan2(x_46_im, x_46_re))); elseif (x_46_im <= 4.7e-132) tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im)))) * 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, -0.038], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, -2.5e-163], N[(1.0 + N[Log[N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.7e-132], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -0.038:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq -2.5 \cdot 10^{-163}:\\
\;\;\;\;1 + \log \left({\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;x.im \leq 4.7 \cdot 10^{-132}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -0.0379999999999999991Initial program 27.1%
Taylor expanded in y.im around 0 56.3%
Taylor expanded in y.re around 0 63.4%
Taylor expanded in x.im around -inf 84.2%
mul-1-neg84.2%
Simplified84.2%
if -0.0379999999999999991 < x.im < -2.49999999999999989e-163Initial program 56.7%
Taylor expanded in y.im around 0 57.1%
Taylor expanded in y.re around 0 43.8%
unpow243.8%
unpow243.8%
swap-sqr47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in y.re around 0 50.6%
distribute-rgt-neg-in50.6%
exp-prod53.7%
Simplified53.7%
Taylor expanded in y.im around 0 37.7%
neg-mul-137.7%
distribute-rgt-neg-in37.7%
Simplified37.7%
add-sqr-sqrt37.7%
sqrt-unprod37.7%
sqr-neg37.7%
sqrt-unprod3.4%
add-sqr-sqrt38.8%
rem-log-exp60.7%
pow-exp67.2%
Applied egg-rr67.2%
if -2.49999999999999989e-163 < x.im < 4.7000000000000002e-132Initial program 46.6%
Taylor expanded in y.im around 0 70.8%
Taylor expanded in y.re around 0 68.1%
add-log-exp68.1%
hypot-define80.4%
pow-to-exp80.4%
Applied egg-rr80.4%
if 4.7000000000000002e-132 < x.im Initial program 31.3%
cancel-sign-sub-inv31.3%
fma-define31.3%
hypot-define31.3%
distribute-lft-neg-in31.3%
distribute-rgt-neg-out31.3%
fma-define31.3%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
hypot-define31.3%
*-commutative31.3%
fma-define31.3%
add-exp-log15.7%
*-commutative15.7%
hypot-define46.5%
fma-define46.5%
Applied egg-rr46.5%
Taylor expanded in x.re around 0 44.2%
+-commutative44.2%
neg-mul-144.2%
unsub-neg44.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in y.re around 0 32.5%
+-commutative32.5%
unpow232.5%
unpow232.5%
hypot-undefine76.4%
Simplified76.4%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= y.re -1.04e+55)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(cos (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -1.45e-80) (not (<= y.re 3.3e-288)))
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -1.04e+55) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= -1.45e-80) || !(y_46_re <= 3.3e-288)) {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (y_46_re <= -1.04e+55) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if ((y_46_re <= -1.45e-80) || !(y_46_re <= 3.3e-288)) {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if y_46_re <= -1.04e+55: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif (y_46_re <= -1.45e-80) or not (y_46_re <= 3.3e-288): tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) - t_0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (y_46_re <= -1.04e+55) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif ((y_46_re <= -1.45e-80) || !(y_46_re <= 3.3e-288)) tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (y_46_re <= -1.04e+55) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif ((y_46_re <= -1.45e-80) || ~((y_46_re <= 3.3e-288))) tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -1.04e+55], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, -1.45e-80], N[Not[LessEqual[y$46$re, 3.3e-288]], $MachinePrecision]], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $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}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -1.04 \cdot 10^{+55}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq -1.45 \cdot 10^{-80} \lor \neg \left(y.re \leq 3.3 \cdot 10^{-288}\right):\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.04000000000000003e55Initial program 44.4%
Taylor expanded in y.im around 0 89.0%
if -1.04000000000000003e55 < y.re < -1.44999999999999999e-80 or 3.29999999999999988e-288 < y.re Initial program 32.2%
Taylor expanded in y.im around 0 53.2%
Taylor expanded in y.re around 0 57.2%
add-log-exp55.9%
hypot-define72.3%
pow-to-exp72.3%
Applied egg-rr72.3%
if -1.44999999999999999e-80 < y.re < 3.29999999999999988e-288Initial program 45.2%
exp-diff45.2%
exp-to-pow45.2%
hypot-define45.2%
*-commutative45.2%
exp-prod45.1%
fma-define45.1%
hypot-define87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y.re around 0 87.7%
rec-exp87.7%
distribute-lft-neg-in87.7%
Simplified87.7%
Taylor expanded in y.im around inf 45.2%
unpow245.2%
unpow245.2%
hypot-undefine87.7%
Simplified87.7%
Final simplification78.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ 1.0 (log (pow (exp y.im) (atan2 x.im x.re)))))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -1.32e+25)
t_1
(if (<= y.re -1.6e-159)
(* t_2 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re -1.45e-199)
t_0
(if (<= y.re 5.4e-271)
(* (cos (* y.im (log (hypot x.im x.re)))) t_2)
(if (<= y.re 1.12e-181) t_0 (if (<= y.re 2e-22) t_2 t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 + log(pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.32e+25) {
tmp = t_1;
} else if (y_46_re <= -1.6e-159) {
tmp = t_2 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= -1.45e-199) {
tmp = t_0;
} else if (y_46_re <= 5.4e-271) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2;
} else if (y_46_re <= 1.12e-181) {
tmp = t_0;
} else if (y_46_re <= 2e-22) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 + Math.log(Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
double t_1 = 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 t_2 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.32e+25) {
tmp = t_1;
} else if (y_46_re <= -1.6e-159) {
tmp = t_2 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= -1.45e-199) {
tmp = t_0;
} else if (y_46_re <= 5.4e-271) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_2;
} else if (y_46_re <= 1.12e-181) {
tmp = t_0;
} else if (y_46_re <= 2e-22) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 + math.log(math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) t_1 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_2 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_re <= -1.32e+25: tmp = t_1 elif y_46_re <= -1.6e-159: tmp = t_2 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= -1.45e-199: tmp = t_0 elif y_46_re <= 5.4e-271: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_2 elif y_46_re <= 1.12e-181: tmp = t_0 elif y_46_re <= 2e-22: tmp = t_2 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 + log((exp(y_46_im) ^ atan(x_46_im, x_46_re)))) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -1.32e+25) tmp = t_1; elseif (y_46_re <= -1.6e-159) tmp = Float64(t_2 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= -1.45e-199) tmp = t_0; elseif (y_46_re <= 5.4e-271) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2); elseif (y_46_re <= 1.12e-181) tmp = t_0; elseif (y_46_re <= 2e-22) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 + log((exp(y_46_im) ^ atan2(x_46_im, x_46_re))); t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); t_2 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (y_46_re <= -1.32e+25) tmp = t_1; elseif (y_46_re <= -1.6e-159) tmp = t_2 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= -1.45e-199) tmp = t_0; elseif (y_46_re <= 5.4e-271) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2; elseif (y_46_re <= 1.12e-181) tmp = t_0; elseif (y_46_re <= 2e-22) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 + N[Log[N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.32e+25], t$95$1, If[LessEqual[y$46$re, -1.6e-159], N[(t$95$2 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.45e-199], t$95$0, If[LessEqual[y$46$re, 5.4e-271], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.12e-181], t$95$0, If[LessEqual[y$46$re, 2e-22], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \log \left({\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -1.32 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.6 \cdot 10^{-159}:\\
\;\;\;\;t\_2 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq -1.45 \cdot 10^{-199}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.4 \cdot 10^{-271}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_2\\
\mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-181}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-22}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.32e25 or 2.0000000000000001e-22 < y.re Initial program 37.2%
Taylor expanded in y.im around 0 71.8%
Taylor expanded in y.re around 0 74.4%
if -1.32e25 < y.re < -1.6e-159Initial program 28.9%
exp-diff28.9%
exp-to-pow28.9%
hypot-define28.9%
*-commutative28.9%
exp-prod28.9%
fma-define28.9%
hypot-define77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in y.re around 0 73.7%
rec-exp73.7%
distribute-lft-neg-in73.7%
Simplified73.7%
Taylor expanded in y.im around 0 80.9%
*-commutative80.9%
Simplified80.9%
if -1.6e-159 < y.re < -1.45e-199 or 5.3999999999999997e-271 < y.re < 1.11999999999999997e-181Initial program 53.6%
Taylor expanded in y.im around 0 54.1%
Taylor expanded in y.re around 0 54.1%
unpow254.1%
unpow254.1%
swap-sqr54.1%
unpow254.1%
Simplified54.1%
Taylor expanded in y.re around 0 72.4%
distribute-rgt-neg-in72.4%
exp-prod72.4%
Simplified72.4%
Taylor expanded in y.im around 0 62.3%
neg-mul-162.3%
distribute-rgt-neg-in62.3%
Simplified62.3%
add-sqr-sqrt33.3%
sqrt-unprod61.8%
sqr-neg61.8%
sqrt-unprod33.3%
add-sqr-sqrt61.5%
rem-log-exp85.4%
pow-exp85.4%
Applied egg-rr85.4%
if -1.45e-199 < y.re < 5.3999999999999997e-271Initial program 45.0%
exp-diff45.0%
exp-to-pow45.0%
hypot-define45.0%
*-commutative45.0%
exp-prod45.0%
fma-define45.0%
hypot-define83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in y.re around 0 83.4%
rec-exp83.4%
distribute-lft-neg-in83.4%
Simplified83.4%
Taylor expanded in y.im around inf 45.0%
unpow245.0%
unpow245.0%
hypot-undefine83.4%
Simplified83.4%
if 1.11999999999999997e-181 < y.re < 2.0000000000000001e-22Initial program 27.2%
Taylor expanded in y.im around 0 40.0%
Taylor expanded in y.re around 0 40.0%
unpow240.0%
unpow240.0%
swap-sqr40.0%
unpow240.0%
Simplified40.0%
Taylor expanded in y.re around 0 81.9%
distribute-lft-neg-in81.9%
Simplified81.9%
Final simplification79.1%
(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.22e-8)
(exp (- (* y.re (log (- x.im))) t_0))
(if (<= x.im -2.5e-163)
(+ 1.0 (log (pow (exp y.im) (atan2 x.im x.re))))
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.22e-8) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= -2.5e-163) {
tmp = 1.0 + log(pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -1.22e-8) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= -2.5e-163) {
tmp = 1.0 + Math.log(Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_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_im <= -1.22e-8: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= -2.5e-163: tmp = 1.0 + math.log(math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_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_im <= -1.22e-8) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); elseif (x_46_im <= -2.5e-163) tmp = Float64(1.0 + log((exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_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_im <= -1.22e-8) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= -2.5e-163) tmp = 1.0 + log((exp(y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_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$im, -1.22e-8], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, -2.5e-163], N[(1.0 + N[Log[N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$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.im \leq -1.22 \cdot 10^{-8}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq -2.5 \cdot 10^{-163}:\\
\;\;\;\;1 + \log \left({\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\end{array}
\end{array}
if x.im < -1.22e-8Initial program 27.1%
Taylor expanded in y.im around 0 56.3%
Taylor expanded in y.re around 0 63.4%
Taylor expanded in x.im around -inf 84.2%
mul-1-neg84.2%
Simplified84.2%
if -1.22e-8 < x.im < -2.49999999999999989e-163Initial program 56.7%
Taylor expanded in y.im around 0 57.1%
Taylor expanded in y.re around 0 43.8%
unpow243.8%
unpow243.8%
swap-sqr47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in y.re around 0 50.6%
distribute-rgt-neg-in50.6%
exp-prod53.7%
Simplified53.7%
Taylor expanded in y.im around 0 37.7%
neg-mul-137.7%
distribute-rgt-neg-in37.7%
Simplified37.7%
add-sqr-sqrt37.7%
sqrt-unprod37.7%
sqr-neg37.7%
sqrt-unprod3.4%
add-sqr-sqrt38.8%
rem-log-exp60.7%
pow-exp67.2%
Applied egg-rr67.2%
if -2.49999999999999989e-163 < x.im Initial program 38.5%
Taylor expanded in y.im around 0 61.1%
Taylor expanded in y.re around 0 60.5%
add-log-exp59.3%
hypot-define75.7%
pow-to-exp75.7%
Applied egg-rr75.7%
Final simplification77.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(cos (* y.re (atan2 x.im x.re))))))
(if (<= y.re -1.32e+25)
t_0
(if (<= y.re -3.2e-159)
t_1
(if (<= y.re -1.45e-199)
(+ 1.0 (log (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 1.2e-17) t_1 t_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 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.32e+25) {
tmp = t_0;
} else if (y_46_re <= -3.2e-159) {
tmp = t_1;
} else if (y_46_re <= -1.45e-199) {
tmp = 1.0 + log(pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-17) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - (atan2(x_46im, x_46re) * y_46im)))
t_1 = exp((atan2(x_46im, x_46re) * -y_46im)) * cos((y_46re * atan2(x_46im, x_46re)))
if (y_46re <= (-1.32d+25)) then
tmp = t_0
else if (y_46re <= (-3.2d-159)) then
tmp = t_1
else if (y_46re <= (-1.45d-199)) then
tmp = 1.0d0 + log((exp(y_46im) ** atan2(x_46im, x_46re)))
else if (y_46re <= 1.2d-17) then
tmp = t_1
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.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 t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.32e+25) {
tmp = t_0;
} else if (y_46_re <= -3.2e-159) {
tmp = t_1;
} else if (y_46_re <= -1.45e-199) {
tmp = 1.0 + Math.log(Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-17) {
tmp = t_1;
} else {
tmp = t_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))) t_1 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -1.32e+25: tmp = t_0 elif y_46_re <= -3.2e-159: tmp = t_1 elif y_46_re <= -1.45e-199: tmp = 1.0 + math.log(math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.2e-17: tmp = t_1 else: tmp = t_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(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.32e+25) tmp = t_0; elseif (y_46_re <= -3.2e-159) tmp = t_1; elseif (y_46_re <= -1.45e-199) tmp = Float64(1.0 + log((exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.2e-17) tmp = t_1; 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 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); t_1 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -1.32e+25) tmp = t_0; elseif (y_46_re <= -3.2e-159) tmp = t_1; elseif (y_46_re <= -1.45e-199) tmp = 1.0 + log((exp(y_46_im) ^ atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.2e-17) tmp = t_1; 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[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[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.32e+25], t$95$0, If[LessEqual[y$46$re, -3.2e-159], t$95$1, If[LessEqual[y$46$re, -1.45e-199], N[(1.0 + N[Log[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, 1.2e-17], t$95$1, t$95$0]]]]]]
\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 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.32 \cdot 10^{+25}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -3.2 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.45 \cdot 10^{-199}:\\
\;\;\;\;1 + \log \left({\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.32e25 or 1.19999999999999993e-17 < y.re Initial program 37.5%
Taylor expanded in y.im around 0 72.4%
Taylor expanded in y.re around 0 75.1%
if -1.32e25 < y.re < -3.2e-159 or -1.45e-199 < y.re < 1.19999999999999993e-17Initial program 35.6%
exp-diff35.6%
exp-to-pow35.6%
hypot-define35.6%
*-commutative35.6%
exp-prod35.6%
fma-define35.6%
hypot-define78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in y.re around 0 77.6%
rec-exp77.6%
distribute-lft-neg-in77.6%
Simplified77.6%
Taylor expanded in y.im around 0 78.2%
*-commutative78.2%
Simplified78.2%
if -3.2e-159 < y.re < -1.45e-199Initial program 58.3%
Taylor expanded in y.im around 0 50.7%
Taylor expanded in y.re around 0 50.7%
unpow250.7%
unpow250.7%
swap-sqr50.7%
unpow250.7%
Simplified50.7%
Taylor expanded in y.re around 0 77.2%
distribute-rgt-neg-in77.2%
exp-prod77.3%
Simplified77.3%
Taylor expanded in y.im around 0 77.3%
neg-mul-177.3%
distribute-rgt-neg-in77.3%
Simplified77.3%
add-sqr-sqrt43.9%
sqrt-unprod76.9%
sqr-neg76.9%
sqrt-unprod43.8%
add-sqr-sqrt74.7%
rem-log-exp90.7%
pow-exp90.7%
Applied egg-rr90.7%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re))
(t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -9e-11)
t_0
(if (<= y.re -1.75e-104)
(pow (exp y.im) (- (atan2 x.im x.re)))
(if (<= y.re -6e-238)
(+ 1.0 (log (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 3.05e-266)
t_1
(if (<= y.re 3.6e-204)
(+ 1.0 (log1p (expm1 (* (atan2 x.im x.re) y.im))))
(if (<= y.re 1.6e-41) t_1 t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -9e-11) {
tmp = t_0;
} else if (y_46_re <= -1.75e-104) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else if (y_46_re <= -6e-238) {
tmp = 1.0 + log(pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 3.05e-266) {
tmp = t_1;
} else if (y_46_re <= 3.6e-204) {
tmp = 1.0 + log1p(expm1((atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 1.6e-41) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -9e-11) {
tmp = t_0;
} else if (y_46_re <= -1.75e-104) {
tmp = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else if (y_46_re <= -6e-238) {
tmp = 1.0 + Math.log(Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 3.05e-266) {
tmp = t_1;
} else if (y_46_re <= 3.6e-204) {
tmp = 1.0 + Math.log1p(Math.expm1((Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 1.6e-41) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_re <= -9e-11: tmp = t_0 elif y_46_re <= -1.75e-104: tmp = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) elif y_46_re <= -6e-238: tmp = 1.0 + math.log(math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) elif y_46_re <= 3.05e-266: tmp = t_1 elif y_46_re <= 3.6e-204: tmp = 1.0 + math.log1p(math.expm1((math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_re <= 1.6e-41: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -9e-11) tmp = t_0; elseif (y_46_re <= -1.75e-104) tmp = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)); elseif (y_46_re <= -6e-238) tmp = Float64(1.0 + log((exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 3.05e-266) tmp = t_1; elseif (y_46_re <= 3.6e-204) tmp = Float64(1.0 + log1p(expm1(Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 1.6e-41) tmp = t_1; 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e-11], t$95$0, If[LessEqual[y$46$re, -1.75e-104], N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision], If[LessEqual[y$46$re, -6e-238], N[(1.0 + N[Log[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, 3.05e-266], t$95$1, If[LessEqual[y$46$re, 3.6e-204], N[(1.0 + N[Log[1 + N[(Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-41], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-104}:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq -6 \cdot 10^{-238}:\\
\;\;\;\;1 + \log \left({\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;y.re \leq 3.05 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{-204}:\\
\;\;\;\;1 + \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -8.9999999999999999e-11 or 1.60000000000000006e-41 < y.re Initial program 35.7%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod27.0%
fma-define27.0%
hypot-define58.7%
*-commutative58.7%
Simplified58.7%
add-cube-cbrt59.5%
pow358.7%
fma-undefine58.7%
*-commutative58.7%
*-commutative58.7%
fma-define58.7%
Applied egg-rr58.7%
Taylor expanded in y.im around inf 28.6%
+-commutative28.6%
unpow228.6%
unpow228.6%
hypot-undefine64.3%
Simplified64.3%
Taylor expanded in y.im around 0 27.8%
*-commutative27.8%
unpow227.8%
unpow227.8%
swap-sqr29.4%
+-commutative29.4%
unpow229.4%
unpow229.4%
hypot-undefine29.4%
*-commutative29.4%
+-commutative29.4%
unpow229.4%
unpow229.4%
hypot-undefine57.9%
Simplified57.9%
Taylor expanded in y.im around 0 62.0%
Taylor expanded in y.im around 0 68.6%
+-commutative68.6%
unpow268.6%
unpow268.6%
hypot-undefine71.6%
Simplified71.6%
if -8.9999999999999999e-11 < y.re < -1.75000000000000014e-104Initial program 34.8%
Taylor expanded in y.im around 0 61.8%
Taylor expanded in y.re around 0 61.8%
unpow261.8%
unpow261.8%
swap-sqr61.8%
unpow261.8%
Simplified61.8%
Taylor expanded in y.re around 0 81.1%
distribute-rgt-neg-in81.1%
exp-prod81.2%
Simplified81.2%
if -1.75000000000000014e-104 < y.re < -5.9999999999999999e-238Initial program 48.3%
Taylor expanded in y.im around 0 49.4%
Taylor expanded in y.re around 0 49.4%
unpow249.4%
unpow249.4%
swap-sqr49.4%
unpow249.4%
Simplified49.4%
Taylor expanded in y.re around 0 80.3%
distribute-rgt-neg-in80.3%
exp-prod80.3%
Simplified80.3%
Taylor expanded in y.im around 0 73.7%
neg-mul-173.7%
distribute-rgt-neg-in73.7%
Simplified73.7%
add-sqr-sqrt42.6%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod35.8%
add-sqr-sqrt72.8%
rem-log-exp85.9%
pow-exp85.9%
Applied egg-rr85.9%
if -5.9999999999999999e-238 < y.re < 3.05e-266 or 3.59999999999999965e-204 < y.re < 1.60000000000000006e-41Initial program 35.9%
Taylor expanded in y.im around 0 46.3%
Taylor expanded in y.re around 0 46.3%
unpow246.3%
unpow246.3%
swap-sqr46.3%
unpow246.3%
Simplified46.3%
Taylor expanded in y.re around 0 79.9%
distribute-lft-neg-in79.9%
Simplified79.9%
if 3.05e-266 < y.re < 3.59999999999999965e-204Initial program 45.5%
Taylor expanded in y.im around 0 46.0%
Taylor expanded in y.re around 0 46.0%
unpow246.0%
unpow246.0%
swap-sqr46.0%
unpow246.0%
Simplified46.0%
Taylor expanded in y.re around 0 63.6%
distribute-rgt-neg-in63.6%
exp-prod63.6%
Simplified63.6%
Taylor expanded in y.im around 0 63.8%
neg-mul-163.8%
distribute-rgt-neg-in63.8%
Simplified63.8%
add-sqr-sqrt36.5%
sqrt-unprod63.8%
sqr-neg63.8%
sqrt-unprod27.6%
add-sqr-sqrt65.0%
log1p-expm1-u100.0%
Applied egg-rr100.0%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.im -3.1e+16)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.im 9.2e+22)
(pow (hypot x.re x.im) y.re)
(if (or (<= y.im 2e+81) (not (<= y.im 1.18e+112)))
t_0
(+ 1.0 (log1p (expm1 (* (atan2 x.im x.re) y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -3.1e+16) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 9.2e+22) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 2e+81) || !(y_46_im <= 1.18e+112)) {
tmp = t_0;
} else {
tmp = 1.0 + log1p(expm1((atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_im <= -3.1e+16) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 9.2e+22) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else if ((y_46_im <= 2e+81) || !(y_46_im <= 1.18e+112)) {
tmp = t_0;
} else {
tmp = 1.0 + Math.log1p(Math.expm1((Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_im <= -3.1e+16: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_im <= 9.2e+22: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) elif (y_46_im <= 2e+81) or not (y_46_im <= 1.18e+112): tmp = t_0 else: tmp = 1.0 + math.log1p(math.expm1((math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -3.1e+16) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_im <= 9.2e+22) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; elseif ((y_46_im <= 2e+81) || !(y_46_im <= 1.18e+112)) tmp = t_0; else tmp = Float64(1.0 + log1p(expm1(Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -3.1e+16], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.2e+22], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], If[Or[LessEqual[y$46$im, 2e+81], N[Not[LessEqual[y$46$im, 1.18e+112]], $MachinePrecision]], t$95$0, N[(1.0 + N[Log[1 + N[(Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.im \leq -3.1 \cdot 10^{+16}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{+22}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+81} \lor \neg \left(y.im \leq 1.18 \cdot 10^{+112}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;1 + \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\\
\end{array}
\end{array}
if y.im < -3.1e16Initial program 39.0%
exp-diff32.2%
exp-to-pow32.2%
hypot-define32.2%
*-commutative32.2%
exp-prod28.8%
fma-define28.8%
hypot-define57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in y.re around 0 64.8%
rec-exp64.8%
distribute-lft-neg-in64.8%
Simplified64.8%
Taylor expanded in y.im around 0 58.0%
*-commutative58.0%
Simplified58.0%
if -3.1e16 < y.im < 9.2000000000000008e22Initial program 41.1%
exp-diff41.1%
exp-to-pow41.1%
hypot-define41.1%
*-commutative41.1%
exp-prod41.1%
fma-define41.1%
hypot-define86.9%
*-commutative86.9%
Simplified86.9%
add-cube-cbrt85.5%
pow386.2%
fma-undefine86.2%
*-commutative86.2%
*-commutative86.2%
fma-define86.2%
Applied egg-rr86.2%
Taylor expanded in y.im around inf 41.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-undefine91.1%
Simplified91.1%
Taylor expanded in y.im around 0 42.0%
*-commutative42.0%
unpow242.0%
unpow242.0%
swap-sqr43.5%
+-commutative43.5%
unpow243.5%
unpow243.5%
hypot-undefine43.5%
*-commutative43.5%
+-commutative43.5%
unpow243.5%
unpow243.5%
hypot-undefine90.2%
Simplified90.2%
Taylor expanded in y.im around 0 90.6%
Taylor expanded in y.im around 0 65.2%
+-commutative65.2%
unpow265.2%
unpow265.2%
hypot-undefine91.3%
Simplified91.3%
if 9.2000000000000008e22 < y.im < 1.99999999999999984e81 or 1.18e112 < y.im Initial program 26.6%
Taylor expanded in y.im around 0 52.1%
Taylor expanded in y.re around 0 46.0%
unpow246.0%
unpow246.0%
swap-sqr50.0%
unpow250.0%
Simplified50.0%
Taylor expanded in y.re around 0 57.0%
distribute-lft-neg-in57.0%
Simplified57.0%
if 1.99999999999999984e81 < y.im < 1.18e112Initial program 28.6%
Taylor expanded in y.im around 0 42.9%
Taylor expanded in y.re around 0 42.9%
unpow242.9%
unpow242.9%
swap-sqr42.9%
unpow242.9%
Simplified42.9%
Taylor expanded in y.re around 0 14.5%
distribute-rgt-neg-in14.5%
exp-prod14.5%
Simplified14.5%
Taylor expanded in y.im around 0 0.9%
neg-mul-10.9%
distribute-rgt-neg-in0.9%
Simplified0.9%
add-sqr-sqrt0.9%
sqrt-unprod1.4%
sqr-neg1.4%
sqrt-unprod0.5%
add-sqr-sqrt3.4%
log1p-expm1-u85.7%
Applied egg-rr85.7%
Final simplification76.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.45e-13) (not (<= y.re 7.2e-83))) (pow (hypot x.re x.im) y.re) (pow (exp y.im) (- (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e-13) || !(y_46_re <= 7.2e-83)) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = pow(exp(y_46_im), -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 tmp;
if ((y_46_re <= -1.45e-13) || !(y_46_re <= 7.2e-83)) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.45e-13) or not (y_46_re <= 7.2e-83): tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: tmp = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.45e-13) || !(y_46_re <= 7.2e-83)) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; else tmp = exp(y_46_im) ^ Float64(-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) tmp = 0.0; if ((y_46_re <= -1.45e-13) || ~((y_46_re <= 7.2e-83))) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; else tmp = exp(y_46_im) ^ -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_] := If[Or[LessEqual[y$46$re, -1.45e-13], N[Not[LessEqual[y$46$re, 7.2e-83]], $MachinePrecision]], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-13} \lor \neg \left(y.re \leq 7.2 \cdot 10^{-83}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -1.4499999999999999e-13 or 7.20000000000000025e-83 < y.re Initial program 34.1%
exp-diff27.4%
exp-to-pow27.4%
hypot-define27.4%
*-commutative27.4%
exp-prod25.9%
fma-define25.9%
hypot-define60.8%
*-commutative60.8%
Simplified60.8%
add-cube-cbrt60.8%
pow360.8%
fma-undefine60.8%
*-commutative60.8%
*-commutative60.8%
fma-define60.8%
Applied egg-rr60.8%
Taylor expanded in y.im around inf 27.4%
+-commutative27.4%
unpow227.4%
unpow227.4%
hypot-undefine65.9%
Simplified65.9%
Taylor expanded in y.im around 0 26.7%
*-commutative26.7%
unpow226.7%
unpow226.7%
swap-sqr28.2%
+-commutative28.2%
unpow228.2%
unpow228.2%
hypot-undefine28.2%
*-commutative28.2%
+-commutative28.2%
unpow228.2%
unpow228.2%
hypot-undefine59.3%
Simplified59.3%
Taylor expanded in y.im around 0 63.0%
Taylor expanded in y.im around 0 65.1%
+-commutative65.1%
unpow265.1%
unpow265.1%
hypot-undefine71.5%
Simplified71.5%
if -1.4499999999999999e-13 < y.re < 7.20000000000000025e-83Initial program 41.3%
Taylor expanded in y.im around 0 52.2%
Taylor expanded in y.re around 0 52.2%
unpow252.2%
unpow252.2%
swap-sqr52.2%
unpow252.2%
Simplified52.2%
Taylor expanded in y.re around 0 79.0%
distribute-rgt-neg-in79.0%
exp-prod79.0%
Simplified79.0%
Final simplification75.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -11.5) (not (<= y.re 1.6e-41))) (pow (hypot x.re x.im) y.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 <= -11.5) || !(y_46_re <= 1.6e-41)) {
tmp = pow(hypot(x_46_re, x_46_im), y_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 <= -11.5) || !(y_46_re <= 1.6e-41)) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_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 <= -11.5) or not (y_46_re <= 1.6e-41): tmp = math.pow(math.hypot(x_46_re, x_46_im), y_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 <= -11.5) || !(y_46_re <= 1.6e-41)) tmp = hypot(x_46_re, x_46_im) ^ y_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 <= -11.5) || ~((y_46_re <= 1.6e-41))) tmp = hypot(x_46_re, x_46_im) ^ y_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, -11.5], N[Not[LessEqual[y$46$re, 1.6e-41]], $MachinePrecision]], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $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 -11.5 \lor \neg \left(y.re \leq 1.6 \cdot 10^{-41}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -11.5 or 1.60000000000000006e-41 < y.re Initial program 36.0%
exp-diff28.8%
exp-to-pow28.8%
hypot-define28.8%
*-commutative28.8%
exp-prod27.2%
fma-define27.2%
hypot-define58.4%
*-commutative58.4%
Simplified58.4%
add-cube-cbrt59.2%
pow358.4%
fma-undefine58.4%
*-commutative58.4%
*-commutative58.4%
fma-define58.4%
Applied egg-rr58.4%
Taylor expanded in y.im around inf 28.8%
+-commutative28.8%
unpow228.8%
unpow228.8%
hypot-undefine64.0%
Simplified64.0%
Taylor expanded in y.im around 0 28.0%
*-commutative28.0%
unpow228.0%
unpow228.0%
swap-sqr29.6%
+-commutative29.6%
unpow229.6%
unpow229.6%
hypot-undefine29.6%
*-commutative29.6%
+-commutative29.6%
unpow229.6%
unpow229.6%
hypot-undefine57.6%
Simplified57.6%
Taylor expanded in y.im around 0 61.7%
Taylor expanded in y.im around 0 68.3%
+-commutative68.3%
unpow268.3%
unpow268.3%
hypot-undefine71.4%
Simplified71.4%
if -11.5 < y.re < 1.60000000000000006e-41Initial program 39.0%
Taylor expanded in y.im around 0 50.1%
Taylor expanded in y.re around 0 50.1%
unpow250.1%
unpow250.1%
swap-sqr50.1%
unpow250.1%
Simplified50.1%
Taylor expanded in y.re around 0 78.2%
distribute-lft-neg-in78.2%
Simplified78.2%
Final simplification74.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.re x.im) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_re, x_46_im), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_re, x_46_im), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_re, x_46_im) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}
\end{array}
Initial program 37.5%
exp-diff34.0%
exp-to-pow34.0%
hypot-define34.0%
*-commutative34.0%
exp-prod33.2%
fma-define33.2%
hypot-define69.4%
*-commutative69.4%
Simplified69.4%
add-cube-cbrt69.2%
pow369.2%
fma-undefine69.2%
*-commutative69.2%
*-commutative69.2%
fma-define69.2%
Applied egg-rr69.2%
Taylor expanded in y.im around inf 34.4%
+-commutative34.4%
unpow234.4%
unpow234.4%
hypot-undefine71.9%
Simplified71.9%
Taylor expanded in y.im around 0 36.5%
*-commutative36.5%
unpow236.5%
unpow236.5%
swap-sqr37.3%
+-commutative37.3%
unpow237.3%
unpow237.3%
hypot-undefine37.3%
*-commutative37.3%
+-commutative37.3%
unpow237.3%
unpow237.3%
hypot-undefine66.1%
Simplified66.1%
Taylor expanded in y.im around 0 60.9%
Taylor expanded in y.im around 0 52.8%
+-commutative52.8%
unpow252.8%
unpow252.8%
hypot-undefine62.1%
Simplified62.1%
(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 37.5%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in y.re around 0 46.1%
unpow246.1%
unpow246.1%
swap-sqr50.0%
unpow250.0%
Simplified50.0%
Taylor expanded in y.re around 0 52.6%
distribute-rgt-neg-in52.6%
exp-prod53.2%
Simplified53.2%
Taylor expanded in y.im around 0 30.7%
neg-mul-130.7%
distribute-rgt-neg-in30.7%
Simplified30.7%
add-sqr-sqrt17.7%
sqrt-unprod30.8%
sqr-neg30.8%
sqrt-unprod14.3%
add-sqr-sqrt30.8%
rem-log-exp44.4%
pow-exp45.8%
*-un-lft-identity45.8%
log-prod45.8%
metadata-eval45.8%
pow-exp44.4%
rem-log-exp30.8%
Applied egg-rr30.8%
+-lft-identity30.8%
Simplified30.8%
Final simplification30.8%
herbie shell --seed 2024107
(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)))))