
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (pow (cbrt (fma t_0 y.im (* y.re (atan2 x.im x.re)))) 3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(pow(cbrt(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))), 3.0));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin((cbrt(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) ^ 3.0))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right)
\end{array}
\end{array}
Initial program 40.3%
cancel-sign-sub-inv40.3%
fma-define40.3%
hypot-define40.3%
distribute-lft-neg-in40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
fma-undefine81.4%
hypot-define40.3%
*-commutative40.3%
add-cube-cbrt39.4%
pow339.4%
fma-define39.4%
hypot-define82.1%
Applied egg-rr82.1%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re -11500000000000.0)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(* y.im (log (hypot x.im x.re))))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -11500000000000.0) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * (y_46_im * log(hypot(x_46_im, x_46_re)));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -11500000000000.0) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -11500000000000.0], 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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -11500000000000:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -1.15e13Initial program 41.7%
cancel-sign-sub-inv41.7%
fma-define41.7%
hypot-define41.7%
distribute-lft-neg-in41.7%
distribute-rgt-neg-out41.7%
fma-define41.7%
hypot-define88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in y.im around inf 40.3%
unpow240.3%
unpow240.3%
hypot-undefine86.1%
Simplified86.1%
Taylor expanded in y.im around 0 51.4%
unpow251.4%
unpow251.4%
hypot-undefine93.1%
Simplified93.1%
if -1.15e13 < y.re Initial program 39.7%
exp-diff37.0%
exp-to-pow37.0%
hypot-define37.0%
*-commutative37.0%
exp-prod36.4%
fma-define36.4%
hypot-define73.5%
*-commutative73.5%
Simplified73.5%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 40.3%
cancel-sign-sub-inv40.3%
fma-define40.3%
hypot-define40.3%
distribute-lft-neg-in40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im)))) (sin (* y.im (log (hypot x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)
\end{array}
Initial program 40.3%
cancel-sign-sub-inv40.3%
fma-define40.3%
hypot-define40.3%
distribute-lft-neg-in40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.im around inf 37.5%
unpow237.5%
unpow237.5%
hypot-undefine74.6%
Simplified74.6%
Final simplification74.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) (- y.im))))
(if (<= x.re -2e-311)
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (- t_0 (* y.re (log (/ -1.0 x.re))))))
(*
(exp (fma (log (hypot x.re x.im)) y.re t_0))
(sin (* y.im (log x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (x_46_re <= -2e-311) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((t_0 - (y_46_re * log((-1.0 / x_46_re)))));
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_0)) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (x_46_re <= -2e-311) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(t_0 - Float64(y_46_re * log(Float64(-1.0 / x_46_re)))))); else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_0)) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[x$46$re, -2e-311], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(t$95$0 - N[(y$46$re * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $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 -2 \cdot 10^{-311}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{t\_0 - y.re \cdot \log \left(\frac{-1}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, t\_0\right)} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -1.9999999999999e-311Initial program 40.1%
cancel-sign-sub-inv40.1%
fma-define40.1%
hypot-define40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in y.im around inf 36.8%
unpow236.8%
unpow236.8%
hypot-undefine71.5%
Simplified71.5%
Taylor expanded in x.re around -inf 61.0%
mul-1-neg61.0%
unsub-neg61.0%
neg-mul-161.0%
*-commutative61.0%
distribute-rgt-neg-in61.0%
Simplified61.0%
if -1.9999999999999e-311 < x.re Initial program 40.5%
cancel-sign-sub-inv40.5%
fma-define40.5%
hypot-define40.5%
distribute-lft-neg-in40.5%
distribute-rgt-neg-out40.5%
fma-define40.5%
hypot-define81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in y.im around inf 38.2%
unpow238.2%
unpow238.2%
hypot-undefine77.4%
Simplified77.4%
Taylor expanded in x.im around 0 72.7%
Final simplification67.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im)))) (* y.im (log (hypot x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * (y_46_im * log(hypot(x_46_im, x_46_re)));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)
\end{array}
Initial program 40.3%
cancel-sign-sub-inv40.3%
fma-define40.3%
hypot-define40.3%
distribute-lft-neg-in40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.im around inf 37.5%
unpow237.5%
unpow237.5%
hypot-undefine74.6%
Simplified74.6%
Taylor expanded in y.im around 0 47.7%
unpow247.7%
unpow247.7%
hypot-undefine73.1%
Simplified73.1%
Final simplification73.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))))
(if (<= x.im -1.35e-63)
(* y.im (* (exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re t_0))) (- t_0)))
(*
(pow (hypot x.re x.im) y.re)
(sin
(*
y.im
(+ (log (hypot x.im x.re)) (* y.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 t_0 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.35e-63) {
tmp = y_46_im * (exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0);
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (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.log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.35e-63) {
tmp = y_46_im * (Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0);
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) + (y_46_re * (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.log((-1.0 / x_46_im)) tmp = 0 if x_46_im <= -1.35e-63: tmp = y_46_im * (math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) + (y_46_re * (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 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.35e-63) tmp = Float64(y_46_im * Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(y_46_re * t_0))) * Float64(-t_0))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)); tmp = 0.0; if (x_46_im <= -1.35e-63) tmp = y_46_im * (exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0); else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.35e-63], N[(y$46$im * N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(y$46$re * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-t$95$0)), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1.35 \cdot 10^{-63}:\\
\;\;\;\;y.im \cdot \left(e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot t\_0} \cdot \left(-t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\end{array}
\end{array}
if x.im < -1.3500000000000001e-63Initial program 28.0%
cancel-sign-sub-inv28.0%
fma-define28.0%
hypot-define28.0%
distribute-lft-neg-in28.0%
distribute-rgt-neg-out28.0%
fma-define28.0%
hypot-define76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in y.im around inf 30.5%
unpow230.5%
unpow230.5%
hypot-undefine74.8%
Simplified74.8%
Taylor expanded in y.im around 0 47.4%
unpow247.4%
unpow247.4%
hypot-undefine76.8%
Simplified76.8%
Taylor expanded in x.im around -inf 68.8%
mul-1-neg68.8%
distribute-rgt-neg-in68.8%
*-commutative68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
mul-1-neg68.8%
*-commutative68.8%
distribute-rgt-neg-in68.8%
Simplified68.8%
if -1.3500000000000001e-63 < x.im Initial program 46.1%
exp-diff43.2%
exp-to-pow43.2%
hypot-define43.2%
*-commutative43.2%
exp-prod41.9%
fma-define41.9%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in y.im around 0 67.5%
Taylor expanded in y.im around inf 31.4%
unpow231.4%
unpow231.4%
hypot-undefine59.5%
associate-/l*59.5%
Simplified59.5%
Final simplification62.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))))
(if (<= x.im -3.5e-60)
(* y.im (* (exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re t_0))) (- t_0)))
(*
(pow (hypot x.re x.im) y.re)
(sin
(*
y.im
(+ (log (hypot x.re x.im)) (* y.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 t_0 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -3.5e-60) {
tmp = y_46_im * (exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0);
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_im * (log(hypot(x_46_re, x_46_im)) + (y_46_re * (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.log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -3.5e-60) {
tmp = y_46_im * (Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0);
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((y_46_im * (Math.log(Math.hypot(x_46_re, x_46_im)) + (y_46_re * (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.log((-1.0 / x_46_im)) tmp = 0 if x_46_im <= -3.5e-60: tmp = y_46_im * (math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((y_46_im * (math.log(math.hypot(x_46_re, x_46_im)) + (y_46_re * (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 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -3.5e-60) tmp = Float64(y_46_im * Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(y_46_re * t_0))) * Float64(-t_0))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_im * Float64(log(hypot(x_46_re, x_46_im)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)); tmp = 0.0; if (x_46_im <= -3.5e-60) tmp = y_46_im * (exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * -t_0); else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_im * (log(hypot(x_46_re, x_46_im)) + (y_46_re * (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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -3.5e-60], N[(y$46$im * N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(y$46$re * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-t$95$0)), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -3.5 \cdot 10^{-60}:\\
\;\;\;\;y.im \cdot \left(e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot t\_0} \cdot \left(-t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\end{array}
\end{array}
if x.im < -3.49999999999999976e-60Initial program 28.0%
cancel-sign-sub-inv28.0%
fma-define28.0%
hypot-define28.0%
distribute-lft-neg-in28.0%
distribute-rgt-neg-out28.0%
fma-define28.0%
hypot-define76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in y.im around inf 30.5%
unpow230.5%
unpow230.5%
hypot-undefine74.8%
Simplified74.8%
Taylor expanded in y.im around 0 47.4%
unpow247.4%
unpow247.4%
hypot-undefine76.8%
Simplified76.8%
Taylor expanded in x.im around -inf 68.8%
mul-1-neg68.8%
distribute-rgt-neg-in68.8%
*-commutative68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
mul-1-neg68.8%
*-commutative68.8%
distribute-rgt-neg-in68.8%
Simplified68.8%
if -3.49999999999999976e-60 < x.im Initial program 46.1%
exp-diff43.2%
exp-to-pow43.2%
hypot-define43.2%
*-commutative43.2%
exp-prod41.9%
fma-define41.9%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in y.im around 0 67.5%
expm1-log1p-u49.0%
*-commutative49.0%
Applied egg-rr49.0%
Taylor expanded in y.im around inf 31.4%
+-commutative31.4%
unpow231.4%
unpow231.4%
hypot-undefine59.5%
associate-/l*59.5%
Simplified59.5%
Final simplification62.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow (hypot x.re x.im) y.re) (sin (* y.re (+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / 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) * Math.sin((y_46_re * (Math.atan2(x_46_im, x_46_re) + (y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) / 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) * math.sin((y_46_re * (math.atan2(x_46_im, x_46_re) + (y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) / y_46_re)))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(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) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re))))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)
\end{array}
Initial program 40.3%
exp-diff36.4%
exp-to-pow36.4%
hypot-define36.4%
*-commutative36.4%
exp-prod35.5%
fma-define35.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 65.0%
Taylor expanded in y.re around inf 31.2%
+-commutative31.2%
associate-/l*30.8%
unpow230.8%
unpow230.8%
hypot-undefine63.3%
Simplified63.3%
Final simplification63.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.im (log (hypot x.im x.re)))) (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 sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * 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.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * 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 Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (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 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * (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[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}
\end{array}
Initial program 40.3%
exp-diff36.4%
exp-to-pow36.4%
hypot-define36.4%
*-commutative36.4%
exp-prod35.5%
fma-define35.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 65.0%
Taylor expanded in y.im around inf 28.6%
unpow237.5%
unpow237.5%
hypot-undefine74.6%
Simplified58.1%
Final simplification58.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.im (* (log (hypot x.re x.im)) (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 y_46_im * (log(hypot(x_46_re, x_46_im)) * 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 y_46_im * (Math.log(Math.hypot(x_46_re, x_46_im)) * 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 y_46_im * (math.log(math.hypot(x_46_re, x_46_im)) * 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 Float64(y_46_im * Float64(log(hypot(x_46_re, x_46_im)) * (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 = y_46_im * (log(hypot(x_46_re, x_46_im)) * (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[(y$46$im * N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)
\end{array}
Initial program 40.3%
cancel-sign-sub-inv40.3%
fma-define40.3%
hypot-define40.3%
distribute-lft-neg-in40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.im around inf 37.5%
unpow237.5%
unpow237.5%
hypot-undefine74.6%
Simplified74.6%
Taylor expanded in y.im around 0 47.7%
unpow247.7%
unpow247.7%
hypot-undefine73.1%
Simplified73.1%
Taylor expanded in y.im around 0 35.7%
+-commutative35.7%
unpow235.7%
unpow235.7%
hypot-undefine52.5%
+-commutative52.5%
unpow252.5%
unpow252.5%
hypot-undefine56.3%
Simplified56.3%
Final simplification56.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))) (if (<= x.re 38000.0) (* t_0 (pow x.im y.re)) (* t_0 (pow 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 38000.0) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= 38000.0d0) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 38000.0) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= 38000.0: tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= 38000.0) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= 38000.0) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 38000.0], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq 38000:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < 38000Initial program 42.8%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.4%
fma-define37.4%
hypot-define73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.im around 0 61.9%
Taylor expanded in y.im around 0 49.4%
Taylor expanded in x.re around 0 38.3%
*-commutative38.3%
Simplified38.3%
if 38000 < x.re Initial program 33.4%
exp-diff33.4%
exp-to-pow33.4%
hypot-define33.4%
*-commutative33.4%
exp-prod30.5%
fma-define30.5%
hypot-define68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y.im around 0 73.3%
Taylor expanded in y.im around 0 55.0%
Taylor expanded in x.im around 0 55.0%
*-commutative55.0%
Simplified55.0%
Final simplification42.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (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 (y_46_re * atan2(x_46_im, x_46_re)) * 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 (y_46_re * Math.atan2(x_46_im, x_46_re)) * 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 (y_46_re * math.atan2(x_46_im, x_46_re)) * 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 Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (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 = (y_46_re * atan2(x_46_im, x_46_re)) * (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[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}
\end{array}
Initial program 40.3%
exp-diff36.4%
exp-to-pow36.4%
hypot-define36.4%
*-commutative36.4%
exp-prod35.5%
fma-define35.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 65.0%
Taylor expanded in y.im around 0 50.9%
Taylor expanded in y.re around 0 49.7%
*-commutative49.7%
Simplified49.7%
Final simplification49.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 40.3%
exp-diff36.4%
exp-to-pow36.4%
hypot-define36.4%
*-commutative36.4%
exp-prod35.5%
fma-define35.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 65.0%
Taylor expanded in y.im around 0 50.9%
Taylor expanded in x.re around 0 35.4%
*-commutative35.4%
Simplified35.4%
Final simplification35.4%
herbie shell --seed 2024066
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))