
(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 17 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)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -9e+20)
(* (sin t_1) t_2)
(if (<= y.re 1.68e-18)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(if (<= y.re 5.5e+127)
(pow
(pow
(*
(/ (pow (hypot x.re x.im) y.re) (fma (atan2 x.im x.re) y.im 1.0))
(sin (fma t_0 y.im t_1)))
0.5)
2.0)
(*
(sin (/ 1.0 (pow (fma y.im (log (hypot x.im x.re)) t_1) -1.0)))
t_2))))))
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 t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -9e+20) {
tmp = sin(t_1) * t_2;
} else if (y_46_re <= 1.68e-18) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_re <= 5.5e+127) {
tmp = pow(pow(((pow(hypot(x_46_re, x_46_im), y_46_re) / fma(atan2(x_46_im, x_46_re), y_46_im, 1.0)) * sin(fma(t_0, y_46_im, t_1))), 0.5), 2.0);
} else {
tmp = sin((1.0 / pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1), -1.0))) * t_2;
}
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)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(sin(t_1) * t_2); elseif (y_46_re <= 1.68e-18) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); elseif (y_46_re <= 5.5e+127) tmp = (Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / fma(atan(x_46_im, x_46_re), y_46_im, 1.0)) * sin(fma(t_0, y_46_im, t_1))) ^ 0.5) ^ 2.0; else tmp = Float64(sin(Float64(1.0 / (fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1) ^ -1.0))) * t_2); 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]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Sin[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.68e-18], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.5e+127], N[Power[N[Power[N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], 2.0], $MachinePrecision], N[(N[Sin[N[(1.0 / N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\sin t\_1 \cdot t\_2\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_0\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+127}:\\
\;\;\;\;{\left({\left(\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right)\right)}^{0.5}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\frac{1}{{\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_1\right)\right)}^{-1}}\right) \cdot t\_2\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.6
Applied rewrites86.6%
if -9e20 < y.re < 1.6799999999999999e-18Initial program 44.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.0
Applied rewrites54.0%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6479.9
Applied rewrites79.9%
if 1.6799999999999999e-18 < y.re < 5.50000000000000041e127Initial program 20.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites59.9%
Taylor expanded in y.im around 0
+-commutativeN/A
lower-fma.f64N/A
lower-atan2.f6465.1
Applied rewrites65.1%
lift-/.f64N/A
inv-powN/A
sqr-powN/A
pow2N/A
lower-pow.f64N/A
Applied rewrites85.0%
if 5.50000000000000041e127 < y.re Initial program 40.0%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites85.0%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(t_2 (log (hypot x.re x.im))))
(if (<= y.re -1.36e-14)
(* (fma (* t_2 (cos t_0)) y.im (sin t_0)) t_1)
(if (<= y.re 3.1e+126)
(/
1.0
(/
(/ (pow (exp y.im) (atan2 x.im x.re)) (pow (hypot x.re x.im) y.re))
(sin (fma t_2 y.im t_0))))
(*
(sin (/ 1.0 (pow (fma y.im (log (hypot x.im x.re)) t_0) -1.0)))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -1.36e-14) {
tmp = fma((t_2 * cos(t_0)), y_46_im, sin(t_0)) * t_1;
} else if (y_46_re <= 3.1e+126) {
tmp = 1.0 / ((pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_re, x_46_im), y_46_re)) / sin(fma(t_2, y_46_im, t_0)));
} else {
tmp = sin((1.0 / pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0), -1.0))) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -1.36e-14) tmp = Float64(fma(Float64(t_2 * cos(t_0)), y_46_im, sin(t_0)) * t_1); elseif (y_46_re <= 3.1e+126) tmp = Float64(1.0 / Float64(Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_re, x_46_im) ^ y_46_re)) / sin(fma(t_2, y_46_im, t_0)))); else tmp = Float64(sin(Float64(1.0 / (fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0) ^ -1.0))) * t_1); 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$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.36e-14], N[(N[(N[(t$95$2 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * y$46$im + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3.1e+126], N[(1.0 / N[(N[(N[Power[N[Exp[y$46$im], $MachinePrecision], 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] / N[Sin[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(1.0 / N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -1.36 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(t\_2 \cdot \cos t\_0, y.im, \sin t\_0\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 3.1 \cdot 10^{+126}:\\
\;\;\;\;\frac{1}{\frac{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}{\sin \left(\mathsf{fma}\left(t\_2, y.im, t\_0\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\frac{1}{{\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}^{-1}}\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.36e-14Initial program 45.0%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
Applied rewrites85.2%
if -1.36e-14 < y.re < 3.1e126Initial program 40.6%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites77.8%
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lift-/.f64N/A
neg-sub0N/A
lower--.f64N/A
lift-/.f64N/A
Applied rewrites80.3%
if 3.1e126 < y.re Initial program 40.0%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites85.0%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -1.7e-10)
(* (sin t_0) t_1)
(if (<= y.re 3.1e+126)
(/
1.0
(/
(/ (pow (exp y.im) (atan2 x.im x.re)) (pow (hypot x.re x.im) y.re))
(sin (fma (log (hypot x.re x.im)) y.im t_0))))
(*
(sin (/ 1.0 (pow (fma y.im (log (hypot x.im x.re)) t_0) -1.0)))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.7e-10) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 3.1e+126) {
tmp = 1.0 / ((pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_re, x_46_im), y_46_re)) / sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)));
} else {
tmp = sin((1.0 / pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0), -1.0))) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.7e-10) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 3.1e+126) tmp = Float64(1.0 / Float64(Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_re, x_46_im) ^ y_46_re)) / sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)))); else tmp = Float64(sin(Float64(1.0 / (fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0) ^ -1.0))) * t_1); 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$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.7e-10], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3.1e+126], N[(1.0 / N[(N[(N[Power[N[Exp[y$46$im], $MachinePrecision], 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] / N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(1.0 / N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{-10}:\\
\;\;\;\;\sin t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 3.1 \cdot 10^{+126}:\\
\;\;\;\;\frac{1}{\frac{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\frac{1}{{\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}^{-1}}\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.70000000000000007e-10Initial program 44.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6483.2
Applied rewrites83.2%
if -1.70000000000000007e-10 < y.re < 3.1e126Initial program 41.0%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites77.9%
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lift-/.f64N/A
neg-sub0N/A
lower--.f64N/A
lift-/.f64N/A
Applied rewrites80.4%
if 3.1e126 < y.re Initial program 40.0%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
Applied rewrites85.0%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -9e+20)
(* (sin (* (atan2 x.im x.re) y.re)) t_1)
(if (<= y.re 1.75)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(* (fma (* 1.0 (atan2 x.im x.re)) y.re (sin (* t_0 y.im))) t_1)))))
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 t_1 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -9e+20) {
tmp = sin((atan2(x_46_im, x_46_re) * y_46_re)) * t_1;
} else if (y_46_re <= 1.75) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = fma((1.0 * atan2(x_46_im, x_46_re)), y_46_re, sin((t_0 * y_46_im))) * t_1;
}
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)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_1); elseif (y_46_re <= 1.75) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(fma(Float64(1.0 * atan(x_46_im, x_46_re)), y_46_re, sin(Float64(t_0 * y_46_im))) * t_1); 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]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.75], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.75:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_0\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, \sin \left(t\_0 \cdot y.im\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.6
Applied rewrites86.6%
if -9e20 < y.re < 1.75Initial program 44.1%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6453.3
Applied rewrites53.3%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
if 1.75 < y.re Initial program 34.5%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites72.4%
Taylor expanded in y.im around 0
Applied rewrites77.6%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -9e+20)
(*
(sin t_1)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 0.135)
(*
(sin (* (fma y.re (/ (atan2 x.im x.re) y.im) t_0) y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(if (<= y.re 1.2e+105)
(*
(sin (* t_0 y.im))
(exp (* (- y.re) (fma y.im (/ (atan2 x.im x.re) y.re) (- t_0)))))
(/
1.0
(/
1.0
(*
(sin (fma y.im (log (hypot x.im x.re)) t_1))
(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 t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -9e+20) {
tmp = sin(t_1) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 0.135) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else if (y_46_re <= 1.2e+105) {
tmp = sin((t_0 * y_46_im)) * exp((-y_46_re * fma(y_46_im, (atan2(x_46_im, x_46_re) / y_46_re), -t_0)));
} else {
tmp = 1.0 / (1.0 / (sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) * pow(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) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(sin(t_1) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 0.135) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_0) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); elseif (y_46_re <= 1.2e+105) tmp = Float64(sin(Float64(t_0 * y_46_im)) * exp(Float64(Float64(-y_46_re) * fma(y_46_im, Float64(atan(x_46_im, x_46_re) / y_46_re), Float64(-t_0))))); else tmp = Float64(1.0 / Float64(1.0 / Float64(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) * (hypot(x_46_im, 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.135], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e+105], N[(N[Sin[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$re) * N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision] + (-t$95$0)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$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)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\sin t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 0.135:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_0\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+105}:\\
\;\;\;\;\sin \left(t\_0 \cdot y.im\right) \cdot e^{\left(-y.re\right) \cdot \mathsf{fma}\left(y.im, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}, -t\_0\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.6
Applied rewrites86.6%
if -9e20 < y.re < 0.13500000000000001Initial program 44.1%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6453.3
Applied rewrites53.3%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6480.1
Applied rewrites80.1%
if 0.13500000000000001 < y.re < 1.19999999999999987e105Initial program 26.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6480.1
Applied rewrites80.1%
Taylor expanded in y.re around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6486.7
Applied rewrites86.7%
if 1.19999999999999987e105 < y.re Initial program 37.2%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites55.8%
Taylor expanded in y.im around 0
Applied rewrites81.4%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -9e+20)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 1.68e-18)
(*
(sin
(*
(fma y.re (/ (atan2 x.im x.re) y.im) (log (hypot x.re x.im)))
y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(/
1.0
(/
1.0
(*
(sin (fma y.im (log (hypot x.im x.re)) t_0))
(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 t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -9e+20) {
tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 1.68e-18) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_re, x_46_im))) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = 1.0 / (1.0 / (sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)) * pow(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) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(sin(t_0) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 1.68e-18) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_re, x_46_im))) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(1.0 / Float64(1.0 / Float64(sin(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)) * (hypot(x_46_im, 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.68e-18], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.6
Applied rewrites86.6%
if -9e20 < y.re < 1.6799999999999999e-18Initial program 44.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.0
Applied rewrites54.0%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6479.9
Applied rewrites79.9%
if 1.6799999999999999e-18 < y.re Initial program 33.3%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
associate-*r/N/A
clear-numN/A
Applied rewrites56.6%
Taylor expanded in y.im around 0
Applied rewrites75.0%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -9e+20)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 1.68e-18)
(*
(sin
(*
(fma y.re (/ (atan2 x.im x.re) y.im) (log (hypot x.re x.im)))
y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(* t_0 (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) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -9e+20) {
tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 1.68e-18) {
tmp = sin((fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_re, x_46_im))) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(sin(t_0) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 1.68e-18) tmp = Float64(sin(Float64(fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), log(hypot(x_46_re, x_46_im))) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.68e-18], N[(N[Sin[N[(N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6486.6
Applied rewrites86.6%
if -9e20 < y.re < 1.6799999999999999e-18Initial program 44.7%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6454.0
Applied rewrites54.0%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6479.9
Applied rewrites79.9%
if 1.6799999999999999e-18 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around 0
Applied rewrites66.7%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -4.6e-174)
(*
(sin t_0)
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* y.im (atan2 x.im x.re)))))
(if (<= y.re 4.9e-70)
(*
(* (log (hypot x.re x.im)) y.im)
(pow (exp y.im) (- (atan2 x.im x.re))))
(* t_0 (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) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -4.6e-174) {
tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.9e-70) {
tmp = (log(hypot(x_46_re, x_46_im)) * y_46_im) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), 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 t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -4.6e-174) {
tmp = Math.sin(t_0) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_re <= 4.9e-70) {
tmp = (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, 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.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_re <= -4.6e-174: tmp = math.sin(t_0) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_re <= 4.9e-70: tmp = (math.log(math.hypot(x_46_re, x_46_im)) * y_46_im) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) else: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -4.6e-174) tmp = Float64(sin(t_0) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4.9e-70) tmp = Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * (hypot(x_46_re, 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 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_re <= -4.6e-174) tmp = sin(t_0) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_re <= 4.9e-70) tmp = (log(hypot(x_46_re, x_46_im)) * y_46_im) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); else tmp = t_0 * (hypot(x_46_re, 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -4.6e-174], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.9e-70], N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -4.6 \cdot 10^{-174}:\\
\;\;\;\;\sin t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4.9 \cdot 10^{-70}:\\
\;\;\;\;\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.5999999999999998e-174Initial program 43.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.2
Applied rewrites69.2%
if -4.5999999999999998e-174 < y.re < 4.9e-70Initial program 46.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6416.1
Applied rewrites16.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6463.3
Applied rewrites63.3%
Taylor expanded in y.im around 0
Applied rewrites68.7%
if 4.9e-70 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.6
Applied rewrites59.6%
Taylor expanded in y.re around 0
Applied rewrites66.8%
Final simplification68.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -9e+20)
(* t_0 (sin t_1))
(if (<= y.re 8.2e-53)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(exp (* (- (atan2 x.im x.re)) y.im)))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -9e+20) {
tmp = t_0 * sin(t_1);
} else if (y_46_re <= 8.2e-53) {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -9e+20) {
tmp = t_0 * Math.sin(t_1);
} else if (y_46_re <= 8.2e-53) {
tmp = Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im)) * Math.exp((-Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_re <= -9e+20: tmp = t_0 * math.sin(t_1) elif y_46_re <= 8.2e-53: tmp = math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) * math.exp((-math.atan2(x_46_im, x_46_re) * y_46_im)) else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -9e+20) tmp = Float64(t_0 * sin(t_1)); elseif (y_46_re <= 8.2e-53) tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp(Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))); else tmp = Float64(t_1 * 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_re, x_46_im) ^ y_46_re; t_1 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_re <= -9e+20) tmp = t_0 * sin(t_1); elseif (y_46_re <= 8.2e-53) tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * exp((-atan2(x_46_im, x_46_re) * y_46_im)); else tmp = t_1 * 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.2e-53], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;t\_0 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{-53}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot e^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -9e20Initial program 42.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.9
Applied rewrites82.9%
if -9e20 < y.re < 8.2000000000000001e-53Initial program 45.1%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6441.8
Applied rewrites41.8%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6460.2
Applied rewrites60.2%
if 8.2000000000000001e-53 < y.re Initial program 33.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.4
Applied rewrites60.4%
Taylor expanded in y.re around 0
Applied rewrites67.8%
Final simplification66.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -4e+15)
(* t_0 (sin t_1))
(if (<= y.re 4.9e-70)
(*
(* (log (hypot x.re x.im)) y.im)
(pow (exp y.im) (- (atan2 x.im x.re))))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -4e+15) {
tmp = t_0 * sin(t_1);
} else if (y_46_re <= 4.9e-70) {
tmp = (log(hypot(x_46_re, x_46_im)) * y_46_im) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -4e+15) {
tmp = t_0 * Math.sin(t_1);
} else if (y_46_re <= 4.9e-70) {
tmp = (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_re <= -4e+15: tmp = t_0 * math.sin(t_1) elif y_46_re <= 4.9e-70: tmp = (math.log(math.hypot(x_46_re, x_46_im)) * y_46_im) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -4e+15) tmp = Float64(t_0 * sin(t_1)); elseif (y_46_re <= 4.9e-70) tmp = Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); else tmp = Float64(t_1 * 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_re, x_46_im) ^ y_46_re; t_1 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_re <= -4e+15) tmp = t_0 * sin(t_1); elseif (y_46_re <= 4.9e-70) tmp = (log(hypot(x_46_re, x_46_im)) * y_46_im) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); else tmp = t_1 * 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -4e+15], N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.9e-70], N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -4 \cdot 10^{+15}:\\
\;\;\;\;t\_0 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 4.9 \cdot 10^{-70}:\\
\;\;\;\;\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -4e15Initial program 43.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6481.3
Applied rewrites81.3%
if -4e15 < y.re < 4.9e-70Initial program 45.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6423.3
Applied rewrites23.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6459.3
Applied rewrites59.3%
Taylor expanded in y.im around 0
Applied rewrites59.4%
if 4.9e-70 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.6
Applied rewrites59.6%
Taylor expanded in y.re around 0
Applied rewrites66.8%
Final simplification65.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -1.05e-156)
(* t_0 (sin t_1))
(if (<= y.re 2.1e-187)
(*
(sin (* (log (hypot x.re x.im)) y.im))
(fma (- y.im) (atan2 x.im x.re) 1.0))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = t_0 * sin(t_1);
} else if (y_46_re <= 2.1e-187) {
tmp = sin((log(hypot(x_46_re, x_46_im)) * y_46_im)) * fma(-y_46_im, atan2(x_46_im, x_46_re), 1.0);
} else {
tmp = t_1 * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -1.05e-156) tmp = Float64(t_0 * sin(t_1)); elseif (y_46_re <= 2.1e-187) tmp = Float64(sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im)) * fma(Float64(-y_46_im), atan(x_46_im, x_46_re), 1.0)); else tmp = Float64(t_1 * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-156], N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-187], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-156}:\\
\;\;\;\;t\_0 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-187}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot \mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.05000000000000006e-156Initial program 44.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.5
Applied rewrites59.5%
if -1.05000000000000006e-156 < y.re < 2.09999999999999992e-187Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.7
Applied rewrites11.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.3
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites56.0%
if 2.09999999999999992e-187 < y.re Initial program 34.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.6
Applied rewrites48.6%
Taylor expanded in y.re around 0
Applied rewrites53.7%
Final simplification56.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -1.05e-156)
(* t_0 (sin t_1))
(if (<= y.re 2.1e-187)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = t_0 * sin(t_1);
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = t_0 * Math.sin(t_1);
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_re <= -1.05e-156: tmp = t_0 * math.sin(t_1) elif y_46_re <= 2.1e-187: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -1.05e-156) tmp = Float64(t_0 * sin(t_1)); elseif (y_46_re <= 2.1e-187) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = Float64(t_1 * 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_re, x_46_im) ^ y_46_re; t_1 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_re <= -1.05e-156) tmp = t_0 * sin(t_1); elseif (y_46_re <= 2.1e-187) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_1 * 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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-156], N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-187], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-156}:\\
\;\;\;\;t\_0 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-187}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.05000000000000006e-156Initial program 44.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.5
Applied rewrites59.5%
if -1.05000000000000006e-156 < y.re < 2.09999999999999992e-187Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.7
Applied rewrites11.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.3
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites55.4%
if 2.09999999999999992e-187 < y.re Initial program 34.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.6
Applied rewrites48.6%
Taylor expanded in y.re around 0
Applied rewrites53.7%
Final simplification56.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (sin t_0)))
(if (<= y.re -210000.0)
(* (pow x.re y.re) t_1)
(if (<= y.re -1.05e-156)
t_0
(if (<= y.re 2.1e-187)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
(if (<= y.re 1.68e-18) (* 1.0 t_1) (* (pow x.im y.re) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -210000.0) {
tmp = pow(x_46_re, y_46_re) * t_1;
} else if (y_46_re <= -1.05e-156) {
tmp = t_0;
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 1.68e-18) {
tmp = 1.0 * t_1;
} else {
tmp = pow(x_46_im, y_46_re) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double tmp;
if (y_46_re <= -210000.0) {
tmp = Math.pow(x_46_re, y_46_re) * t_1;
} else if (y_46_re <= -1.05e-156) {
tmp = t_0;
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 1.68e-18) {
tmp = 1.0 * t_1;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.sin(t_0) tmp = 0 if y_46_re <= -210000.0: tmp = math.pow(x_46_re, y_46_re) * t_1 elif y_46_re <= -1.05e-156: tmp = t_0 elif y_46_re <= 2.1e-187: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) elif y_46_re <= 1.68e-18: tmp = 1.0 * t_1 else: tmp = math.pow(x_46_im, y_46_re) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -210000.0) tmp = Float64((x_46_re ^ y_46_re) * t_1); elseif (y_46_re <= -1.05e-156) tmp = t_0; elseif (y_46_re <= 2.1e-187) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); elseif (y_46_re <= 1.68e-18) tmp = Float64(1.0 * t_1); else tmp = Float64((x_46_im ^ y_46_re) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); tmp = 0.0; if (y_46_re <= -210000.0) tmp = (x_46_re ^ y_46_re) * t_1; elseif (y_46_re <= -1.05e-156) tmp = t_0; elseif (y_46_re <= 2.1e-187) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); elseif (y_46_re <= 1.68e-18) tmp = 1.0 * t_1; else tmp = (x_46_im ^ y_46_re) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -210000.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, -1.05e-156], t$95$0, If[LessEqual[y$46$re, 2.1e-187], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.68e-18], N[(1.0 * t$95$1), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.re \leq -210000:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_1\\
\mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-156}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-187}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -2.1e5Initial program 42.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6479.9
Applied rewrites79.9%
Taylor expanded in x.im around 0
Applied rewrites70.7%
if -2.1e5 < y.re < -1.05000000000000006e-156Initial program 47.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6437.1
Applied rewrites37.1%
Taylor expanded in y.re around 0
Applied rewrites32.3%
if -1.05000000000000006e-156 < y.re < 2.09999999999999992e-187Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.7
Applied rewrites11.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.3
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites55.4%
if 2.09999999999999992e-187 < y.re < 1.6799999999999999e-18Initial program 36.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6433.3
Applied rewrites33.3%
Taylor expanded in y.re around 0
Applied rewrites33.3%
if 1.6799999999999999e-18 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.3
Applied rewrites58.3%
Taylor expanded in x.re around 0
Applied rewrites52.1%
Final simplification50.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (sin t_0))
(t_2 (* (pow x.im y.re) t_1)))
(if (<= y.re -12.0)
t_2
(if (<= y.re -1.05e-156)
t_0
(if (<= y.re 2.1e-187)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
(if (<= y.re 1.68e-18) (* 1.0 t_1) t_2))))))
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_re;
double t_1 = sin(t_0);
double t_2 = pow(x_46_im, y_46_re) * t_1;
double tmp;
if (y_46_re <= -12.0) {
tmp = t_2;
} else if (y_46_re <= -1.05e-156) {
tmp = t_0;
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 1.68e-18) {
tmp = 1.0 * t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.sin(t_0);
double t_2 = Math.pow(x_46_im, y_46_re) * t_1;
double tmp;
if (y_46_re <= -12.0) {
tmp = t_2;
} else if (y_46_re <= -1.05e-156) {
tmp = t_0;
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else if (y_46_re <= 1.68e-18) {
tmp = 1.0 * t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.sin(t_0) t_2 = math.pow(x_46_im, y_46_re) * t_1 tmp = 0 if y_46_re <= -12.0: tmp = t_2 elif y_46_re <= -1.05e-156: tmp = t_0 elif y_46_re <= 2.1e-187: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) elif y_46_re <= 1.68e-18: tmp = 1.0 * t_1 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = sin(t_0) t_2 = Float64((x_46_im ^ y_46_re) * t_1) tmp = 0.0 if (y_46_re <= -12.0) tmp = t_2; elseif (y_46_re <= -1.05e-156) tmp = t_0; elseif (y_46_re <= 2.1e-187) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); elseif (y_46_re <= 1.68e-18) tmp = Float64(1.0 * t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = sin(t_0); t_2 = (x_46_im ^ y_46_re) * t_1; tmp = 0.0; if (y_46_re <= -12.0) tmp = t_2; elseif (y_46_re <= -1.05e-156) tmp = t_0; elseif (y_46_re <= 2.1e-187) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); elseif (y_46_re <= 1.68e-18) tmp = 1.0 * t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -12.0], t$95$2, If[LessEqual[y$46$re, -1.05e-156], t$95$0, If[LessEqual[y$46$re, 2.1e-187], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.68e-18], N[(1.0 * t$95$1), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \sin t\_0\\
t_2 := {x.im}^{y.re} \cdot t\_1\\
\mathbf{if}\;y.re \leq -12:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-156}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-187}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -12 or 1.6799999999999999e-18 < y.re Initial program 37.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.1
Applied rewrites69.1%
Taylor expanded in x.re around 0
Applied rewrites58.1%
if -12 < y.re < -1.05000000000000006e-156Initial program 47.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6434.4
Applied rewrites34.4%
Taylor expanded in y.re around 0
Applied rewrites33.6%
if -1.05000000000000006e-156 < y.re < 2.09999999999999992e-187Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.7
Applied rewrites11.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.3
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites55.4%
if 2.09999999999999992e-187 < y.re < 1.6799999999999999e-18Initial program 36.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6433.3
Applied rewrites33.3%
Taylor expanded in y.re around 0
Applied rewrites33.3%
Final simplification49.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (* (atan2 x.im x.re) y.re) (pow (hypot x.re x.im) y.re))))
(if (<= y.re -1.05e-156)
t_0
(if (<= y.re 2.1e-187)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (atan2(x_46_im, x_46_re) * y_46_re) * pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = t_0;
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (Math.atan2(x_46_im, x_46_re) * y_46_re) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = t_0;
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (math.atan2(x_46_im, x_46_re) * y_46_re) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.05e-156: tmp = t_0 elif y_46_re <= 2.1e-187: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.05e-156) tmp = t_0; elseif (y_46_re <= 2.1e-187) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (atan2(x_46_im, x_46_re) * y_46_re) * (hypot(x_46_re, x_46_im) ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.05e-156) tmp = t_0; elseif (y_46_re <= 2.1e-187) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-156], t$95$0, If[LessEqual[y$46$re, 2.1e-187], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-156}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-187}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.05000000000000006e-156 or 2.09999999999999992e-187 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6454.2
Applied rewrites54.2%
Taylor expanded in y.re around 0
Applied rewrites54.2%
if -1.05000000000000006e-156 < y.re < 2.09999999999999992e-187Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.7
Applied rewrites11.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.3
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites55.4%
Final simplification54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -1.05e-156)
(* 1.0 (sin t_0))
(if (<= y.re 2.1e-187)
(* 1.0 (sin (* (log (hypot x.re x.im)) y.im)))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = 1.0 * sin(t_0);
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -1.05e-156) {
tmp = 1.0 * Math.sin(t_0);
} else if (y_46_re <= 2.1e-187) {
tmp = 1.0 * Math.sin((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if y_46_re <= -1.05e-156: tmp = 1.0 * math.sin(t_0) elif y_46_re <= 2.1e-187: tmp = 1.0 * math.sin((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -1.05e-156) tmp = Float64(1.0 * sin(t_0)); elseif (y_46_re <= 2.1e-187) tmp = Float64(1.0 * sin(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (y_46_re <= -1.05e-156) tmp = 1.0 * sin(t_0); elseif (y_46_re <= 2.1e-187) tmp = 1.0 * sin((log(hypot(x_46_re, x_46_im)) * y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-156], N[(1.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-187], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-156}:\\
\;\;\;\;1 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-187}:\\
\;\;\;\;1 \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.05000000000000006e-156Initial program 44.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6459.5
Applied rewrites59.5%
Taylor expanded in y.re around 0
Applied rewrites18.8%
if -1.05000000000000006e-156 < y.re < 2.09999999999999992e-187Initial program 47.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6411.7
Applied rewrites11.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6466.3
Applied rewrites66.3%
Taylor expanded in y.im around 0
Applied rewrites55.4%
if 2.09999999999999992e-187 < y.re Initial program 34.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.6
Applied rewrites48.6%
Taylor expanded in y.re around 0
Applied rewrites16.7%
Final simplification25.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (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) {
return 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
code = 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) {
return 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): return 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) return 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) tmp = atan2(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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re
\end{array}
Initial program 41.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6445.1
Applied rewrites45.1%
Taylor expanded in y.re around 0
Applied rewrites16.3%
Final simplification16.3%
herbie shell --seed 2024250
(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)))))