
(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 21 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 (cos (* (log (hypot x.im x.re)) y.im)))
(t_1 (log (- x.im)))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3 (exp (- (* t_1 y.re) t_2))))
(if (<= x.im -1e+20)
(* t_3 t_0)
(if (<= x.im -1.26e-181)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_2))
(cos (* (atan2 x.im x.re) y.re)))
(if (<= x.im -2.3e-294)
(* t_3 (cos (* t_1 y.im)))
(if (<= x.im 11500000000.0)
(*
(sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))
(pow (hypot x.im x.re) y.re))
(* (exp (- (fma (- (log x.im)) y.re t_2))) t_0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
t_1 := \log \left(-x.im\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{t\_1 \cdot y.re - t\_2}\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{+20}:\\
\;\;\;\;t\_3 \cdot t\_0\\
\mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_2} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\
\;\;\;\;t\_3 \cdot \cos \left(t\_1 \cdot y.im\right)\\
\mathbf{elif}\;x.im \leq 11500000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, t\_2\right)} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -1e20Initial program 29.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.8
Applied rewrites69.8%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6489.5
Applied rewrites89.5%
if -1e20 < x.im < -1.26000000000000002e-181Initial program 51.1%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.9
Applied rewrites78.9%
if -1.26000000000000002e-181 < x.im < -2.30000000000000016e-294Initial program 19.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6439.6
Applied rewrites39.6%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6465.8
Applied rewrites65.8%
Taylor expanded in x.im around -inf
Applied rewrites75.9%
if -2.30000000000000016e-294 < x.im < 1.15e10Initial program 39.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.1
Applied rewrites67.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.8
Applied rewrites61.8%
Applied rewrites73.9%
if 1.15e10 < x.im Initial program 26.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.7
Applied rewrites52.7%
Taylor expanded in x.im around inf
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-outN/A
lower-neg.f64N/A
*-commutativeN/A
lower-fma.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (/ (PI) 2.0))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_3 (cos (* t_0 y.im))))
(if (<= y.im -2.15e+170)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_3)
(if (<= y.im -3.8e+18)
(* t_2 (sin (fma y.im t_0 (fma (atan2 x.im x.re) y.re t_1))))
(if (<= y.im 2.3e-22)
(* (pow (hypot x.im x.re) y.re) t_3)
(*
t_2
(sin (+ (- (fma y.im t_0 (* (atan2 x.im x.re) y.re))) t_1))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \cos \left(t\_0 \cdot y.im\right)\\
\mathbf{if}\;y.im \leq -2.15 \cdot 10^{+170}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_3\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{+18}:\\
\;\;\;\;t\_2 \cdot \sin \left(\mathsf{fma}\left(y.im, t\_0, \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_1\right)\right)\right)\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{-22}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + t\_1\right)\\
\end{array}
\end{array}
if y.im < -2.1499999999999999e170Initial program 36.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6450.6
Applied rewrites50.6%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6460.0
Applied rewrites60.0%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6476.7
Applied rewrites76.7%
if -2.1499999999999999e170 < y.im < -3.8e18Initial program 29.7%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites70.7%
if -3.8e18 < y.im < 2.2999999999999998e-22Initial program 33.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.0
Applied rewrites33.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6490.6
Applied rewrites90.6%
if 2.2999999999999998e-22 < y.im Initial program 37.8%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites68.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (- x.im)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* (exp (- (* t_0 y.re) t_1)) (cos (* t_0 y.im)))))
(if (<= x.im -0.098)
t_2
(if (<= x.im -1.26e-181)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_1))
(cos (* (atan2 x.im x.re) y.re)))
(if (<= x.im -2.3e-294)
t_2
(if (<= x.im 11500000000.0)
(*
(sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))
(pow (hypot x.im x.re) y.re))
(*
(exp (- (fma (- (log x.im)) y.re t_1)))
(cos (* (log (hypot x.im x.re)) y.im)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(-x.im\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := e^{t\_0 \cdot y.re - t\_1} \cdot \cos \left(t\_0 \cdot y.im\right)\\
\mathbf{if}\;x.im \leq -0.098:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_1} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x.im \leq 11500000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, t\_1\right)} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if x.im < -0.098000000000000004 or -1.26000000000000002e-181 < x.im < -2.30000000000000016e-294Initial program 28.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.6
Applied rewrites61.6%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6481.6
Applied rewrites81.6%
Taylor expanded in x.im around -inf
Applied rewrites84.2%
if -0.098000000000000004 < x.im < -1.26000000000000002e-181Initial program 50.0%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6480.2
Applied rewrites80.2%
if -2.30000000000000016e-294 < x.im < 1.15e10Initial program 39.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.1
Applied rewrites67.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.8
Applied rewrites61.8%
Applied rewrites73.9%
if 1.15e10 < x.im Initial program 26.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.7
Applied rewrites52.7%
Taylor expanded in x.im around inf
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-outN/A
lower-neg.f64N/A
*-commutativeN/A
lower-fma.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (log (hypot x.im x.re)) y.im))))
(if (<= y.im -2.55e+151)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
(if (or (<= y.im -9.2e+22) (not (<= y.im 2.3e-22)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* (atan2 x.im x.re) y.re)))
(* (pow (hypot x.im x.re) 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 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_im <= -2.55e+151) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else if ((y_46_im <= -9.2e+22) || !(y_46_im <= 2.3e-22)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = pow(hypot(x_46_im, x_46_re), 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.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_im <= -2.55e+151) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
} else if ((y_46_im <= -9.2e+22) || !(y_46_im <= 2.3e-22)) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if y_46_im <= -2.55e+151: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_0 elif (y_46_im <= -9.2e+22) or not (y_46_im <= 2.3e-22): tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if (y_46_im <= -2.55e+151) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_0); elseif ((y_46_im <= -9.2e+22) || !(y_46_im <= 2.3e-22)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ 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 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if (y_46_im <= -2.55e+151) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0; elseif ((y_46_im <= -9.2e+22) || ~((y_46_im <= 2.3e-22))) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = (hypot(x_46_im, x_46_re) ^ 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[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2.55e+151], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[Or[LessEqual[y$46$im, -9.2e+22], N[Not[LessEqual[y$46$im, 2.3e-22]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.im \leq -2.55 \cdot 10^{+151}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{elif}\;y.im \leq -9.2 \cdot 10^{+22} \lor \neg \left(y.im \leq 2.3 \cdot 10^{-22}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.im < -2.54999999999999998e151Initial program 38.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6450.6
Applied rewrites50.6%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6459.5
Applied rewrites59.5%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6474.2
Applied rewrites74.2%
if -2.54999999999999998e151 < y.im < -9.2000000000000008e22 or 2.2999999999999998e-22 < y.im Initial program 35.6%
Taylor expanded in y.im around 0
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6461.9
Applied rewrites61.9%
if -9.2000000000000008e22 < y.im < 2.2999999999999998e-22Initial program 32.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6432.2
Applied rewrites32.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6490.0
Applied rewrites90.0%
Final simplification76.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (cos (* (log (hypot x.im x.re)) y.im))))
(if (<= y.re -7.5e-17)
(* (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))) t_0)
(if (<= y.re 2.9e+19)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
(* t_0 t_1)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{-17}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+19}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -7.49999999999999984e-17Initial program 32.9%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.7
Applied rewrites81.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.8
Applied rewrites77.8%
Applied rewrites79.1%
if -7.49999999999999984e-17 < y.re < 2.9e19Initial program 40.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.3
Applied rewrites45.3%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6443.6
Applied rewrites43.6%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6475.0
Applied rewrites75.0%
if 2.9e19 < y.re Initial program 25.4%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6420.7
Applied rewrites20.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.9
Applied rewrites66.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -1.2e+146)
(* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* (log (- x.im)) y.im)))
(if (<= y.im 6.8e-103)
(* t_0 (cos (* (log (hypot x.im x.re)) y.im)))
(* (cos (* (atan2 x.im x.re) 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.2e+146) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(-x_46_im) * y_46_im));
} else if (y_46_im <= 6.8e-103) {
tmp = t_0 * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = cos((atan2(x_46_im, x_46_re) * 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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.2e+146) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(-x_46_im) * y_46_im));
} else if (y_46_im <= 6.8e-103) {
tmp = t_0 * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * 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_im, x_46_re), y_46_re) tmp = 0 if y_46_im <= -1.2e+146: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(-x_46_im) * y_46_im)) elif y_46_im <= 6.8e-103: tmp = t_0 * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -1.2e+146) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(Float64(-x_46_im)) * y_46_im))); elseif (y_46_im <= 6.8e-103) tmp = Float64(t_0 * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * 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 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_im <= -1.2e+146) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(-x_46_im) * y_46_im)); elseif (y_46_im <= 6.8e-103) tmp = t_0 * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = cos((atan2(x_46_im, x_46_re) * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -1.2e+146], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.8e-103], N[(t$95$0 * N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+146}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\
\mathbf{elif}\;y.im \leq 6.8 \cdot 10^{-103}:\\
\;\;\;\;t\_0 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\end{array}
\end{array}
if y.im < -1.2000000000000001e146Initial program 40.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.6
Applied rewrites54.6%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6460.0
Applied rewrites60.0%
Taylor expanded in x.im around -inf
Applied rewrites60.0%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6457.3
Applied rewrites57.3%
if -1.2000000000000001e146 < y.im < 6.80000000000000006e-103Initial program 30.5%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6426.8
Applied rewrites26.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.0
Applied rewrites81.0%
if 6.80000000000000006e-103 < y.im Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6455.7
Applied rewrites55.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6449.3
Applied rewrites49.3%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -6e+155)
(* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* (log (- x.im)) y.im)))
(*
(sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))
(pow (hypot x.im x.re) y.re))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6 \cdot 10^{+155}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6.0000000000000003e155Initial program 40.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6453.7
Applied rewrites53.7%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6462.5
Applied rewrites62.5%
Taylor expanded in x.im around -inf
Applied rewrites62.5%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6459.4
Applied rewrites59.4%
if -6.0000000000000003e155 < y.im Initial program 33.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.8
Applied rewrites63.8%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
Applied rewrites65.0%
Final simplification64.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(*
(cos (* (atan2 x.im x.re) y.re))
(pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re))))
(if (<= y.re -9.5e-6)
t_1
(if (<= y.re 5e-24)
(fma t_0 y.re 1.0)
(if (<= y.re 6.2e+157) t_1 (* (pow x.im y.re) (cos (* t_0 y.im))))))))
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_im, x_46_re));
double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -9.5e-6) {
tmp = t_1;
} else if (y_46_re <= 5e-24) {
tmp = fma(t_0, y_46_re, 1.0);
} else if (y_46_re <= 6.2e+157) {
tmp = t_1;
} else {
tmp = pow(x_46_im, y_46_re) * cos((t_0 * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -9.5e-6) tmp = t_1; elseif (y_46_re <= 5e-24) tmp = fma(t_0, y_46_re, 1.0); elseif (y_46_re <= 6.2e+157) tmp = t_1; else tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(t_0 * 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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.5e-6], t$95$1, If[LessEqual[y$46$re, 5e-24], N[(t$95$0 * y$46$re + 1.0), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+157], t$95$1, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-24}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, y.re, 1\right)\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(t\_0 \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < -9.5000000000000005e-6 or 4.9999999999999998e-24 < y.re < 6.1999999999999994e157Initial program 31.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.3
Applied rewrites77.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6468.7
Applied rewrites68.7%
Taylor expanded in x.re around 0
Applied rewrites68.1%
if -9.5000000000000005e-6 < y.re < 4.9999999999999998e-24Initial program 39.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6444.7
Applied rewrites44.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.1
Applied rewrites46.1%
Taylor expanded in y.re around 0
Applied rewrites46.0%
Taylor expanded in y.re around 0
Applied rewrites46.1%
if 6.1999999999999994e157 < y.re Initial program 27.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.4
Applied rewrites24.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.7
Applied rewrites67.7%
Taylor expanded in x.re around 0
Applied rewrites62.6%
Final simplification58.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -6e+145) (* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* (log (- x.im)) y.im))) (* (cos (* (atan2 x.im x.re) y.re)) (pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6e+145) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(-x_46_im) * y_46_im));
} else {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6e+145) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.cos((Math.log(-x_46_im) * y_46_im));
} else {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -6e+145: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.cos((math.log(-x_46_im) * y_46_im)) else: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -6e+145) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * cos(Float64(log(Float64(-x_46_im)) * y_46_im))); else tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, 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) tmp = 0.0; if (y_46_im <= -6e+145) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * cos((log(-x_46_im) * y_46_im)); else tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -6e+145], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6 \cdot 10^{+145}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6.0000000000000005e145Initial program 40.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.6
Applied rewrites54.6%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6460.0
Applied rewrites60.0%
Taylor expanded in x.im around -inf
Applied rewrites60.0%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6457.3
Applied rewrites57.3%
if -6.0000000000000005e145 < y.im Initial program 33.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.9
Applied rewrites63.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.3
Applied rewrites62.3%
Final simplification61.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -4.5e-111)
(* (cos (* (atan2 x.im x.re) y.re)) (pow (- x.re) y.re))
(if (<= x.re -2e-310)
(* (pow x.im y.re) (cos (* (log (hypot x.im x.re)) y.im)))
(* (pow (hypot x.im x.re) y.re) (cos (* (log x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -4.5e-111) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(-x_46_re, y_46_re);
} else if (x_46_re <= -2e-310) {
tmp = pow(x_46_im, y_46_re) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((log(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 (x_46_re <= -4.5e-111) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= -2e-310) {
tmp = Math.pow(x_46_im, y_46_re) * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((Math.log(x_46_re) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -4.5e-111: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(-x_46_re, y_46_re) elif x_46_re <= -2e-310: tmp = math.pow(x_46_im, y_46_re) * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((math.log(x_46_re) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -4.5e-111) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= -2e-310) tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(log(x_46_re) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -4.5e-111) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (-x_46_re ^ y_46_re); elseif (x_46_re <= -2e-310) tmp = (x_46_im ^ y_46_re) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((log(x_46_re) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -4.5e-111], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -2e-310], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[Log[x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -4.5 \cdot 10^{-111}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log x.re \cdot y.im\right)\\
\end{array}
\end{array}
if x.re < -4.49999999999999994e-111Initial program 32.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.3
Applied rewrites63.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.5
Applied rewrites46.5%
Taylor expanded in x.re around -inf
Applied rewrites46.6%
if -4.49999999999999994e-111 < x.re < -1.999999999999994e-310Initial program 37.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6421.5
Applied rewrites21.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.5
Applied rewrites63.5%
Taylor expanded in x.re around 0
Applied rewrites56.2%
if -1.999999999999994e-310 < x.re Initial program 34.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6428.4
Applied rewrites28.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.7
Applied rewrites62.7%
Taylor expanded in x.im around 0
Applied rewrites62.7%
Final simplification56.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= x.re -3.6e-299)
(* t_0 (cos (* (log (- x.re)) y.im)))
(* (cos (* (atan2 x.im x.re) 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_re <= -3.6e-299) {
tmp = t_0 * cos((log(-x_46_re) * y_46_im));
} else {
tmp = cos((atan2(x_46_im, x_46_re) * 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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_re <= -3.6e-299) {
tmp = t_0 * Math.cos((Math.log(-x_46_re) * y_46_im));
} else {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * 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_im, x_46_re), y_46_re) tmp = 0 if x_46_re <= -3.6e-299: tmp = t_0 * math.cos((math.log(-x_46_re) * y_46_im)) else: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (x_46_re <= -3.6e-299) tmp = Float64(t_0 * cos(Float64(log(Float64(-x_46_re)) * y_46_im))); else tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * 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 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (x_46_re <= -3.6e-299) tmp = t_0 * cos((log(-x_46_re) * y_46_im)); else tmp = cos((atan2(x_46_im, x_46_re) * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$re, -3.6e-299], N[(t$95$0 * N[Cos[N[(N[Log[(-x$46$re)], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;x.re \leq -3.6 \cdot 10^{-299}:\\
\;\;\;\;t\_0 \cdot \cos \left(\log \left(-x.re\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
\end{array}
\end{array}
if x.re < -3.6e-299Initial program 33.3%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6418.0
Applied rewrites18.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6456.4
Applied rewrites56.4%
Taylor expanded in x.re around -inf
Applied rewrites53.8%
if -3.6e-299 < x.re Initial program 35.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.1
Applied rewrites57.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.8
Applied rewrites65.8%
Final simplification60.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= x.im -1e-310)
(* t_0 (cos (* (log (- x.im)) y.im)))
(* t_0 (cos (* (log x.im) y.im))))))
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_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_0 * cos((log(-x_46_im) * y_46_im));
} else {
tmp = t_0 * cos((log(x_46_im) * 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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (x_46_im <= -1e-310) {
tmp = t_0 * Math.cos((Math.log(-x_46_im) * y_46_im));
} else {
tmp = t_0 * Math.cos((Math.log(x_46_im) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if x_46_im <= -1e-310: tmp = t_0 * math.cos((math.log(-x_46_im) * y_46_im)) else: tmp = t_0 * math.cos((math.log(x_46_im) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (x_46_im <= -1e-310) tmp = Float64(t_0 * cos(Float64(log(Float64(-x_46_im)) * y_46_im))); else tmp = Float64(t_0 * cos(Float64(log(x_46_im) * 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 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (x_46_im <= -1e-310) tmp = t_0 * cos((log(-x_46_im) * y_46_im)); else tmp = t_0 * cos((log(x_46_im) * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -1e-310], N[(t$95$0 * N[Cos[N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(\log x.im \cdot y.im\right)\\
\end{array}
\end{array}
if x.im < -9.999999999999969e-311Initial program 33.8%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6422.2
Applied rewrites22.2%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6458.7
Applied rewrites58.7%
Taylor expanded in x.im around -inf
Applied rewrites58.9%
if -9.999999999999969e-311 < x.im Initial program 35.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6425.8
Applied rewrites25.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
Taylor expanded in x.re around 0
Applied rewrites61.5%
Final simplification60.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 1.3e+158) (* (cos (* (atan2 x.im x.re) y.re)) (pow (hypot x.im x.re) y.re)) (* (pow x.im y.re) (cos (* (log (hypot x.im x.re)) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 1.3e+158) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_im, y_46_re) * cos((log(hypot(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 <= 1.3e+158) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re) * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 1.3e+158: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(x_46_im, y_46_re) * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 1.3e+158) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= 1.3e+158) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = (x_46_im ^ y_46_re) * cos((log(hypot(x_46_im, x_46_re)) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 1.3e+158], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 1.3 \cdot 10^{+158}:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.re < 1.3e158Initial program 35.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.2
Applied rewrites61.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.6
Applied rewrites57.6%
if 1.3e158 < y.re Initial program 27.0%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.4
Applied rewrites24.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.7
Applied rewrites67.7%
Taylor expanded in x.re around 0
Applied rewrites62.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -9.5e-6)
(* t_0 (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re))
(if (<= y.re 6.5e-151)
(fma (log (hypot x.im x.re)) y.re 1.0)
(* t_0 (pow (fma (/ (* x.im x.im) x.re) 0.5 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -9.5e-6) {
tmp = t_0 * pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re);
} else if (y_46_re <= 6.5e-151) {
tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
} else {
tmp = t_0 * pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -9.5e-6) tmp = Float64(t_0 * (fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re)); elseif (y_46_re <= 6.5e-151) tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); else tmp = Float64(t_0 * (fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9.5e-6], N[(t$95$0 * N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.5e-151], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision], N[(t$95$0 * N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -9.5000000000000005e-6Initial program 33.3%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.7
Applied rewrites82.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.5
Applied rewrites77.5%
Taylor expanded in x.re around 0
Applied rewrites76.2%
if -9.5000000000000005e-6 < y.re < 6.4999999999999994e-151Initial program 39.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.3
Applied rewrites43.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6450.0
Applied rewrites50.0%
Taylor expanded in y.re around 0
Applied rewrites49.8%
Taylor expanded in y.re around 0
Applied rewrites50.0%
if 6.4999999999999994e-151 < y.re Initial program 30.1%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6464.5
Applied rewrites64.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6444.2
Applied rewrites44.2%
Taylor expanded in x.im around 0
Applied rewrites41.8%
Final simplification54.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= x.re -3e-105)
(* t_0 (pow (- x.re) y.re))
(if (<= x.re 7.2e-299)
(* 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= -3e-105) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else if (x_46_re <= 7.2e-299) {
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 = cos((atan2(x_46im, x_46re) * y_46re))
if (x_46re <= (-3d-105)) then
tmp = t_0 * (-x_46re ** y_46re)
else if (x_46re <= 7.2d-299) 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.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_re <= -3e-105) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 7.2e-299) {
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.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_re <= -3e-105: tmp = t_0 * math.pow(-x_46_re, y_46_re) elif x_46_re <= 7.2e-299: 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 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_re <= -3e-105) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= 7.2e-299) tmp = Float64(t_0 * (Float64(-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 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_re <= -3e-105) tmp = t_0 * (-x_46_re ^ y_46_re); elseif (x_46_re <= 7.2e-299) 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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -3e-105], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 7.2e-299], 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 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.re \leq -3 \cdot 10^{-105}:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 7.2 \cdot 10^{-299}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -3.0000000000000001e-105Initial program 31.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.7
Applied rewrites63.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.1
Applied rewrites45.1%
Taylor expanded in x.re around -inf
Applied rewrites46.5%
if -3.0000000000000001e-105 < x.re < 7.2e-299Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.2
Applied rewrites75.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.6
Applied rewrites46.6%
Taylor expanded in x.im around -inf
Applied rewrites44.3%
if 7.2e-299 < x.re Initial program 34.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6457.3
Applied rewrites57.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.5
Applied rewrites65.5%
Taylor expanded in x.im around 0
Applied rewrites61.5%
Final simplification53.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4.8e+14) (not (<= y.re 7.8e-6))) (* (cos (* (atan2 x.im x.re) y.re)) (pow x.re y.re)) (fma (log (hypot x.im x.re)) y.re 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.8e+14) || !(y_46_re <= 7.8e-6)) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(x_46_re, y_46_re);
} else {
tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -4.8e+14) || !(y_46_re <= 7.8e-6)) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (x_46_re ^ y_46_re)); else tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.8e+14], N[Not[LessEqual[y$46$re, 7.8e-6]], $MachinePrecision]], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{+14} \lor \neg \left(y.re \leq 7.8 \cdot 10^{-6}\right):\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\end{array}
\end{array}
if y.re < -4.8e14 or 7.7999999999999999e-6 < y.re Initial program 29.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6475.7
Applied rewrites75.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.3
Applied rewrites63.3%
Taylor expanded in x.im around 0
Applied rewrites55.2%
if -4.8e14 < y.re < 7.7999999999999999e-6Initial program 40.0%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.4
Applied rewrites46.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.8
Applied rewrites46.8%
Taylor expanded in y.re around 0
Applied rewrites43.6%
Taylor expanded in y.re around 0
Applied rewrites43.9%
Final simplification50.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -58.0) (not (<= y.re 1.32e+23))) (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re)) (fma (log (hypot x.im x.re)) y.re 1.0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -58.0) || !(y_46_re <= 1.32e+23)) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(x_46_im, y_46_re);
} else {
tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -58.0) || !(y_46_re <= 1.32e+23)) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (x_46_im ^ y_46_re)); else tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -58.0], N[Not[LessEqual[y$46$re, 1.32e+23]], $MachinePrecision]], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -58 \lor \neg \left(y.re \leq 1.32 \cdot 10^{+23}\right):\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
\end{array}
\end{array}
if y.re < -58 or 1.3199999999999999e23 < y.re Initial program 29.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6477.1
Applied rewrites77.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6465.3
Applied rewrites65.3%
Taylor expanded in x.re around 0
Applied rewrites46.5%
if -58 < y.re < 1.3199999999999999e23Initial program 39.7%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.3
Applied rewrites46.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.4
Applied rewrites45.4%
Taylor expanded in y.re around 0
Applied rewrites42.0%
Taylor expanded in y.re around 0
Applied rewrites42.6%
Final simplification44.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= x.im -4.9e-40)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im 0.000105) (* t_0 (pow x.re y.re)) (* t_0 (pow x.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -4.9e-40) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.000105) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= (-4.9d-40)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= 0.000105d0) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -4.9e-40) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.000105) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= -4.9e-40: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 0.000105: tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= -4.9e-40) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 0.000105) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_0 * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= -4.9e-40) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 0.000105) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4.9e-40], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 0.000105], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq -4.9 \cdot 10^{-40}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 0.000105:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -4.8999999999999997e-40Initial program 34.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.3
Applied rewrites69.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.6
Applied rewrites54.6%
Taylor expanded in x.im around -inf
Applied rewrites53.3%
if -4.8999999999999997e-40 < x.im < 1.05e-4Initial program 37.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.9
Applied rewrites62.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6458.2
Applied rewrites58.2%
Taylor expanded in x.im around 0
Applied rewrites52.0%
if 1.05e-4 < x.im Initial program 26.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6451.7
Applied rewrites51.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.4
Applied rewrites52.4%
Taylor expanded in x.re around 0
Applied rewrites52.4%
Final simplification52.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (fma (* -0.5 (* y.re y.re)) (pow (atan2 x.im x.re) 2.0) 1.0) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma((-0.5 * (y_46_re * y_46_re)), pow(atan2(x_46_im, x_46_re), 2.0), 1.0) * 1.0;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(fma(Float64(-0.5 * Float64(y_46_re * y_46_re)), (atan(x_46_im, x_46_re) ^ 2.0), 1.0) * 1.0) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] * 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.5 \cdot \left(y.re \cdot y.re\right), {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot 1
\end{array}
Initial program 34.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.5
Applied rewrites62.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6455.9
Applied rewrites55.9%
Taylor expanded in y.re around 0
Applied rewrites21.2%
Taylor expanded in y.re around 0
Applied rewrites28.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (log (hypot x.im x.re)) y.re 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)
\end{array}
Initial program 34.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.5
Applied rewrites62.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6455.9
Applied rewrites55.9%
Taylor expanded in y.re around 0
Applied rewrites21.2%
Taylor expanded in y.re around 0
Applied rewrites21.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 34.4%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6462.5
Applied rewrites62.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6455.9
Applied rewrites55.9%
Taylor expanded in y.re around 0
Applied rewrites21.2%
Taylor expanded in y.re around 0
Applied rewrites21.3%
herbie shell --seed 2024329
(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)))))