
(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 (* y.im (atan2 x.im x.re)))
(t_1
(+ (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.im x.re)))) 1.0))
(t_2 (log (hypot x.re x.im)))
(t_3 (exp (- (* t_2 y.re) t_0)))
(t_4 (* y.re (atan2 x.im x.re)))
(t_5 (sin t_4)))
(if (<= y.im -1.7e+151)
(* t_3 (- (* (sin t_1) (cos 1.0)) (* (cos t_1) (sin 1.0))))
(if (<= y.im -67000000000.0)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(+
t_5
(fma
-0.5
(* (* y.im y.im) (* t_5 (pow t_2 2.0)))
(* t_2 (* y.im (cos t_4))))))
(* t_3 (sin (/ 1.0 (/ 1.0 (fma t_2 y.im t_4)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_im, x_46_re)))) + 1.0;
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = exp(((t_2 * y_46_re) - t_0));
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double t_5 = sin(t_4);
double tmp;
if (y_46_im <= -1.7e+151) {
tmp = t_3 * ((sin(t_1) * cos(1.0)) - (cos(t_1) * sin(1.0)));
} else if (y_46_im <= -67000000000.0) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * (t_5 + fma(-0.5, ((y_46_im * y_46_im) * (t_5 * pow(t_2, 2.0))), (t_2 * (y_46_im * cos(t_4)))));
} else {
tmp = t_3 * sin((1.0 / (1.0 / fma(t_2, y_46_im, t_4))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) + 1.0) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = exp(Float64(Float64(t_2 * y_46_re) - t_0)) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_5 = sin(t_4) tmp = 0.0 if (y_46_im <= -1.7e+151) tmp = Float64(t_3 * Float64(Float64(sin(t_1) * cos(1.0)) - Float64(cos(t_1) * sin(1.0)))); elseif (y_46_im <= -67000000000.0) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * Float64(t_5 + fma(-0.5, Float64(Float64(y_46_im * y_46_im) * Float64(t_5 * (t_2 ^ 2.0))), Float64(t_2 * Float64(y_46_im * cos(t_4)))))); else tmp = Float64(t_3 * sin(Float64(1.0 / Float64(1.0 / fma(t_2, y_46_im, t_4))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sin[t$95$4], $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+151], N[(t$95$3 * N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[Cos[1.0], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t$95$1], $MachinePrecision] * N[Sin[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -67000000000.0], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(t$95$5 + N[(-0.5 * N[(N[(y$46$im * y$46$im), $MachinePrecision] * N[(t$95$5 * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(y$46$im * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[(1.0 / N[(1.0 / N[(t$95$2 * y$46$im + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) + 1\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{t_2 \cdot y.re - t_0}\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_5 := \sin t_4\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+151}:\\
\;\;\;\;t_3 \cdot \left(\sin t_1 \cdot \cos 1 - \cos t_1 \cdot \sin 1\right)\\
\mathbf{elif}\;y.im \leq -67000000000:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \left(t_5 + \mathsf{fma}\left(-0.5, \left(y.im \cdot y.im\right) \cdot \left(t_5 \cdot {t_2}^{2}\right), t_2 \cdot \left(y.im \cdot \cos t_4\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin \left(\frac{1}{\frac{1}{\mathsf{fma}\left(t_2, y.im, t_4\right)}}\right)\\
\end{array}
\end{array}
if y.im < -1.7e151Initial program 29.1%
Simplified74.9%
expm1-log1p-u_binary6412.9%
Applied rewrite-once12.9%
expm1-udef12.9%
sin-diff12.9%
Applied egg-rr84.5%
if -1.7e151 < y.im < -6.7e10Initial program 29.3%
Taylor expanded in y.im around 0 54.1%
fma-def54.1%
Simplified72.0%
if -6.7e10 < y.im Initial program 42.6%
Simplified83.1%
fma-udef83.1%
hypot-udef42.6%
*-commutative42.6%
remove-double-div43.2%
fma-def43.2%
hypot-udef83.1%
Applied egg-rr83.1%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* y.re t_2) t_1)))
(t_4 (* y.re (atan2 x.im x.re))))
(if (<= (* t_3 (sin (+ t_4 (* y.im t_2)))) (- INFINITY))
(* t_3 (sin t_4))
(* (exp (- (* t_0 y.re) t_1)) (sin (/ 1.0 (/ 1.0 (fma t_0 y.im t_4))))))))
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 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((y_46_re * t_2) - t_1));
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((t_3 * sin((t_4 + (y_46_im * t_2)))) <= -((double) INFINITY)) {
tmp = t_3 * sin(t_4);
} else {
tmp = exp(((t_0 * y_46_re) - t_1)) * sin((1.0 / (1.0 / fma(t_0, y_46_im, t_4))));
}
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(y_46_im * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(y_46_re * t_2) - t_1)) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_3 * sin(Float64(t_4 + Float64(y_46_im * t_2)))) <= Float64(-Inf)) tmp = Float64(t_3 * sin(t_4)); else tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - t_1)) * sin(Float64(1.0 / Float64(1.0 / fma(t_0, y_46_im, t_4))))); 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Sin[N[(t$95$4 + N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$3 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(1.0 / N[(1.0 / N[(t$95$0 * y$46$im + t$95$4), $MachinePrecision]), $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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{y.re \cdot t_2 - t_1}\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;t_3 \cdot \sin \left(t_4 + y.im \cdot t_2\right) \leq -\infty:\\
\;\;\;\;t_3 \cdot \sin t_4\\
\mathbf{else}:\\
\;\;\;\;e^{t_0 \cdot y.re - t_1} \cdot \sin \left(\frac{1}{\frac{1}{\mathsf{fma}\left(t_0, y.im, t_4\right)}}\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -inf.0Initial program 47.8%
Taylor expanded in y.im around 0 65.2%
if -inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 38.7%
Simplified81.6%
fma-udef81.6%
hypot-udef38.7%
*-commutative38.7%
remove-double-div39.2%
fma-def39.2%
hypot-udef81.6%
Applied egg-rr81.6%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* y.im (atan2 x.im x.re))))))
(if (<= x.im -1.95e-249)
(* t_2 (+ (sin t_0) (* y.im (* t_1 (cos t_0)))))
(* t_2 (sin (fma t_1 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (x_46_im <= -1.95e-249) {
tmp = t_2 * (sin(t_0) + (y_46_im * (t_1 * cos(t_0))));
} else {
tmp = t_2 * sin(fma(t_1, y_46_im, t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (x_46_im <= -1.95e-249) tmp = Float64(t_2 * Float64(sin(t_0) + Float64(y_46_im * Float64(t_1 * cos(t_0))))); else tmp = Float64(t_2 * sin(fma(t_1, y_46_im, t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.95e-249], N[(t$95$2 * N[(N[Sin[t$95$0], $MachinePrecision] + N[(y$46$im * N[(t$95$1 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t_1 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;x.im \leq -1.95 \cdot 10^{-249}:\\
\;\;\;\;t_2 \cdot \left(\sin t_0 + y.im \cdot \left(t_1 \cdot \cos t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
\end{array}
\end{array}
if x.im < -1.95e-249Initial program 33.3%
Simplified75.9%
expm1-log1p-u_binary6451.4%
Applied rewrite-once51.4%
Taylor expanded in y.im around 0 47.4%
unpow247.4%
unpow247.4%
+-commutative47.4%
hypot-def79.5%
Simplified79.5%
if -1.95e-249 < x.im Initial program 44.7%
Simplified80.8%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 39.5%
Simplified78.6%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* t_1 y.re) (* y.im (atan2 x.im x.re))))))
(if (<= y.im -1.1e-18)
(* t_2 (sin (* y.im t_1)))
(if (<= y.im 6.2e-10)
(* (sin (fma t_1 y.im t_0)) (pow (hypot x.re x.im) y.re))
(cast
(!
:precision
binary32
(cast (! :precision binary64 (* t_2 (sin t_0))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((t_1 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.1e-18) {
tmp = t_2 * sin((y_46_im * t_1));
} else if (y_46_im <= 6.2e-10) {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
double tmp_3 = t_2 * sin(t_0);
double tmp_2 = (float) tmp_3;
tmp = (double) tmp_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -1.1e-18) tmp = Float64(t_2 * sin(Float64(y_46_im * t_1))); elseif (y_46_im <= 6.2e-10) tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp_3 = Float64(t_2 * sin(t_0)) tmp_2 = Float32(tmp_3) tmp = Float64(tmp_2); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{t_1 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -1.1 \cdot 10^{-18}:\\
\;\;\;\;t_2 \cdot \sin \left(y.im \cdot t_1\right)\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{-10}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\langle \left( \langle \left( t_2 \cdot \sin t_0 \right)_{\text{binary64}} \rangle_{\text{binary32}} \right)_{\text{binary32}} \rangle_{\text{binary64}}\\
\end{array}
\end{array}
if y.im < -1.0999999999999999e-18Initial program 29.4%
Simplified65.2%
Taylor expanded in y.im around inf 29.4%
unpow229.4%
unpow229.4%
+-commutative29.4%
hypot-def68.4%
Simplified68.4%
if -1.0999999999999999e-18 < y.im < 6.2000000000000003e-10Initial program 44.6%
exp-diff44.6%
exp-to-pow44.6%
hypot-def44.6%
*-commutative44.6%
exp-prod44.6%
fma-def44.6%
hypot-def89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y.im around 0 70.5%
unpow270.5%
unpow270.5%
+-commutative70.5%
hypot-def89.3%
Simplified89.3%
if 6.2000000000000003e-10 < y.im Initial program 39.5%
Taylor expanded in y.im around 0 65.2%
rewrite-binary64/binary32-simplify65.2%
Applied rewrite-once65.2%
*-commutative65.2%
*-commutative65.2%
hypot-def72.2%
*-commutative72.2%
*-commutative72.2%
Simplified72.2%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -3e-17) (not (<= y.im 9.5e-58)))
(* (exp (- (* t_0 y.re) (* y.im (atan2 x.im x.re)))) (sin (* y.im t_0)))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -3e-17) || !(y_46_im <= 9.5e-58)) {
tmp = exp(((t_0 * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_im * t_0));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -3e-17) || !(y_46_im <= 9.5e-58)) tmp = Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * t_0))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -3e-17], N[Not[LessEqual[y$46$im, 9.5e-58]], $MachinePrecision]], N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -3 \cdot 10^{-17} \lor \neg \left(y.im \leq 9.5 \cdot 10^{-58}\right):\\
\;\;\;\;e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -3.00000000000000006e-17 or 9.4999999999999994e-58 < y.im Initial program 35.4%
Simplified69.3%
Taylor expanded in y.im around inf 34.7%
unpow234.7%
unpow234.7%
+-commutative34.7%
hypot-def70.0%
Simplified70.0%
if -3.00000000000000006e-17 < y.im < 9.4999999999999994e-58Initial program 44.4%
exp-diff44.4%
exp-to-pow44.4%
hypot-def44.4%
*-commutative44.4%
exp-prod44.4%
fma-def44.4%
hypot-def89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in y.im around 0 71.5%
unpow271.5%
unpow271.5%
+-commutative71.5%
hypot-def89.6%
Simplified89.6%
Final simplification78.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin (fma (log (hypot x.re x.im)) y.im t_0))))
(if (<= y.re -3.5e-8)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(sin t_0))
(if (<= y.re 2.75e-8)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
double tmp;
if (y_46_re <= -3.5e-8) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(t_0);
} else if (y_46_re <= 2.75e-8) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * 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(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) tmp = 0.0 if (y_46_re <= -3.5e-8) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(t_0)); elseif (y_46_re <= 2.75e-8) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[y$46$re, -3.5e-8], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.75e-8], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{-8}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t_0\\
\mathbf{elif}\;y.re \leq 2.75 \cdot 10^{-8}:\\
\;\;\;\;t_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.50000000000000024e-8Initial program 40.0%
Taylor expanded in y.im around 0 86.7%
if -3.50000000000000024e-8 < y.re < 2.7500000000000001e-8Initial program 41.9%
exp-diff41.9%
exp-to-pow41.9%
hypot-def41.9%
*-commutative41.9%
exp-prod41.8%
fma-def41.8%
hypot-def78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.re around 0 78.1%
rec-exp78.1%
distribute-rgt-neg-out78.1%
Simplified78.1%
if 2.7500000000000001e-8 < y.re Initial program 35.1%
exp-diff27.0%
exp-to-pow27.0%
hypot-def27.0%
*-commutative27.0%
exp-prod25.7%
fma-def25.7%
hypot-def52.7%
*-commutative52.7%
Simplified52.7%
Taylor expanded in y.im around 0 63.6%
unpow263.6%
unpow263.6%
+-commutative63.6%
hypot-def63.6%
Simplified63.6%
Final simplification75.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -950.0) (not (<= y.im 6.2e-10)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(sin t_0))
(*
(sin (fma (log (hypot x.re x.im)) 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -950.0) || !(y_46_im <= 6.2e-10)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(t_0);
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, 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(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -950.0) || !(y_46_im <= 6.2e-10)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(t_0)); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -950.0], N[Not[LessEqual[y$46$im, 6.2e-10]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(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] * 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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -950 \lor \neg \left(y.im \leq 6.2 \cdot 10^{-10}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -950 or 6.2000000000000003e-10 < y.im Initial program 35.3%
Taylor expanded in y.im around 0 60.0%
if -950 < y.im < 6.2000000000000003e-10Initial program 43.9%
exp-diff43.9%
exp-to-pow43.9%
hypot-def43.9%
*-commutative43.9%
exp-prod43.9%
fma-def43.9%
hypot-def89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y.im around 0 70.2%
unpow270.2%
unpow270.2%
+-commutative70.2%
hypot-def89.4%
Simplified89.4%
Final simplification74.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (log (- x.im)))
(t_3 (* y.im (atan2 x.im x.re))))
(if (<= x.im -3.8e-307)
(* (exp (- (* y.re t_2) t_3)) (sin (+ t_0 (* y.im t_2))))
(if (<= x.im 3.8e+165)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_3))
t_1)
(* t_1 (exp (- (* y.re (log x.im)) t_3)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = log(-x_46_im);
double t_3 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -3.8e-307) {
tmp = exp(((y_46_re * t_2) - t_3)) * sin((t_0 + (y_46_im * t_2)));
} else if (x_46_im <= 3.8e+165) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3)) * t_1;
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_3));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = sin(t_0)
t_2 = log(-x_46im)
t_3 = y_46im * atan2(x_46im, x_46re)
if (x_46im <= (-3.8d-307)) then
tmp = exp(((y_46re * t_2) - t_3)) * sin((t_0 + (y_46im * t_2)))
else if (x_46im <= 3.8d+165) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_3)) * t_1
else
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_3))
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = Math.log(-x_46_im);
double t_3 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -3.8e-307) {
tmp = Math.exp(((y_46_re * t_2) - t_3)) * Math.sin((t_0 + (y_46_im * t_2)));
} else if (x_46_im <= 3.8e+165) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3)) * t_1;
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_3));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) t_2 = math.log(-x_46_im) t_3 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -3.8e-307: tmp = math.exp(((y_46_re * t_2) - t_3)) * math.sin((t_0 + (y_46_im * t_2))) elif x_46_im <= 3.8e+165: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3)) * t_1 else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_3)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = log(Float64(-x_46_im)) t_3 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -3.8e-307) tmp = Float64(exp(Float64(Float64(y_46_re * t_2) - t_3)) * sin(Float64(t_0 + Float64(y_46_im * t_2)))); elseif (x_46_im <= 3.8e+165) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_3)) * t_1); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_3))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); t_2 = log(-x_46_im); t_3 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -3.8e-307) tmp = exp(((y_46_re * t_2) - t_3)) * sin((t_0 + (y_46_im * t_2))); elseif (x_46_im <= 3.8e+165) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_3)) * t_1; else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_3)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.8e-307], N[(N[Exp[N[(N[(y$46$re * t$95$2), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.8e+165], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t_0\\
t_2 := \log \left(-x.im\right)\\
t_3 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -3.8 \cdot 10^{-307}:\\
\;\;\;\;e^{y.re \cdot t_2 - t_3} \cdot \sin \left(t_0 + y.im \cdot t_2\right)\\
\mathbf{elif}\;x.im \leq 3.8 \cdot 10^{+165}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_3} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_3}\\
\end{array}
\end{array}
if x.im < -3.79999999999999985e-307Initial program 33.1%
Taylor expanded in x.im around -inf 28.3%
mul-1-neg57.4%
Simplified28.3%
Taylor expanded in x.im around -inf 67.9%
mul-1-neg57.4%
Simplified67.9%
if -3.79999999999999985e-307 < x.im < 3.7999999999999999e165Initial program 57.3%
Taylor expanded in y.im around 0 66.7%
if 3.7999999999999999e165 < x.im Initial program 0.0%
Taylor expanded in y.im around 0 49.1%
Taylor expanded in x.re around 0 70.7%
Final simplification67.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (- x.im)))
(t_2 (* y.im (atan2 x.im x.re))))
(if (<= x.im -4e-310)
(* (exp (- (* y.re t_1) t_2)) (sin (+ t_0 (* y.im t_1))))
(*
(sin t_0)
(exp (- (* y.re (log (+ x.im (* 0.5 (/ (* x.re x.re) x.im))))) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(-x_46_im);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4e-310) {
tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1)));
} else {
tmp = sin(t_0) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_2));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = log(-x_46im)
t_2 = y_46im * atan2(x_46im, x_46re)
if (x_46im <= (-4d-310)) then
tmp = exp(((y_46re * t_1) - t_2)) * sin((t_0 + (y_46im * t_1)))
else
tmp = sin(t_0) * exp(((y_46re * log((x_46im + (0.5d0 * ((x_46re * x_46re) / x_46im))))) - t_2))
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.log(-x_46_im);
double t_2 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4e-310) {
tmp = Math.exp(((y_46_re * t_1) - t_2)) * Math.sin((t_0 + (y_46_im * t_1)));
} else {
tmp = Math.sin(t_0) * Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_2));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.log(-x_46_im) t_2 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -4e-310: tmp = math.exp(((y_46_re * t_1) - t_2)) * math.sin((t_0 + (y_46_im * t_1))) else: tmp = math.sin(t_0) * math.exp(((y_46_re * math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_2)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(Float64(-x_46_im)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -4e-310) tmp = Float64(exp(Float64(Float64(y_46_re * t_1) - t_2)) * sin(Float64(t_0 + Float64(y_46_im * t_1)))); else tmp = Float64(sin(t_0) * exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))))) - t_2))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = log(-x_46_im); t_2 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -4e-310) tmp = exp(((y_46_re * t_1) - t_2)) * sin((t_0 + (y_46_im * t_1))); else tmp = sin(t_0) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -4e-310], N[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(-x.im\right)\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -4 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot t_1 - t_2} \cdot \sin \left(t_0 + y.im \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right) - t_2}\\
\end{array}
\end{array}
if x.im < -3.999999999999988e-310Initial program 33.6%
Taylor expanded in x.im around -inf 28.1%
mul-1-neg56.9%
Simplified28.1%
Taylor expanded in x.im around -inf 67.4%
mul-1-neg56.9%
Simplified67.4%
if -3.999999999999988e-310 < x.im Initial program 45.2%
Taylor expanded in y.im around 0 62.8%
Taylor expanded in x.re around 0 63.5%
unpow263.5%
Simplified63.5%
Final simplification65.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* y.im (atan2 x.im x.re))))
(if (<= x.im -4.1e-81)
(*
(sin (* y.im (log (hypot x.re x.im))))
(exp (- (* y.re (log (- x.im))) t_1)))
(if (<= x.im 2e-126)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
t_0)
(*
(sin t_0)
(exp
(- (* y.re (log (+ x.im (* 0.5 (/ (* x.re x.re) x.im))))) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4.1e-81) {
tmp = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp(((y_46_re * log(-x_46_im)) - t_1));
} else if (x_46_im <= 2e-126) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * t_0;
} else {
tmp = sin(t_0) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -4.1e-81) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_1));
} else if (x_46_im <= 2e-126) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * t_0;
} else {
tmp = Math.sin(t_0) * Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_1));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -4.1e-81: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) * math.exp(((y_46_re * math.log(-x_46_im)) - t_1)) elif x_46_im <= 2e-126: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * t_0 else: tmp = math.sin(t_0) * math.exp(((y_46_re * math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_1)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -4.1e-81) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_1))); elseif (x_46_im <= 2e-126) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * t_0); else tmp = Float64(sin(t_0) * exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))))) - t_1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -4.1e-81) tmp = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) * exp(((y_46_re * log(-x_46_im)) - t_1)); elseif (x_46_im <= 2e-126) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * t_0; else tmp = sin(t_0) * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -4.1e-81], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2e-126], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -4.1 \cdot 10^{-81}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot e^{y.re \cdot \log \left(-x.im\right) - t_1}\\
\mathbf{elif}\;x.im \leq 2 \cdot 10^{-126}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right) - t_1}\\
\end{array}
\end{array}
if x.im < -4.09999999999999984e-81Initial program 32.9%
Taylor expanded in x.im around -inf 31.6%
mul-1-neg62.7%
Simplified31.6%
Taylor expanded in y.re around 0 27.7%
unpow227.7%
unpow227.7%
+-commutative27.7%
hypot-def68.8%
Simplified68.8%
if -4.09999999999999984e-81 < x.im < 1.9999999999999999e-126Initial program 37.9%
Taylor expanded in y.im around 0 54.9%
Taylor expanded in y.re around 0 54.9%
if 1.9999999999999999e-126 < x.im Initial program 46.3%
Taylor expanded in y.im around 0 64.3%
Taylor expanded in x.re around 0 68.4%
unpow268.4%
Simplified68.4%
Final simplification64.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1)))
(if (<= x.im -3e-85)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 5.6e-133)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_1)
(*
t_2
(exp
(- (* y.re (log (+ x.im (* 0.5 (/ (* x.re x.re) x.im))))) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double tmp;
if (x_46_im <= -3e-85) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 5.6e-133) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
} else {
tmp = t_2 * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
t_1 = y_46re * atan2(x_46im, x_46re)
t_2 = sin(t_1)
if (x_46im <= (-3d-85)) then
tmp = t_2 * exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 5.6d-133) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * t_1
else
tmp = t_2 * exp(((y_46re * log((x_46im + (0.5d0 * ((x_46re * x_46re) / x_46im))))) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_im <= -3e-85) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 5.6e-133) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
} else {
tmp = t_2 * Math.exp(((y_46_re * Math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_im <= -3e-85: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 5.6e-133: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1 else: tmp = t_2 * math.exp(((y_46_re * math.log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) tmp = 0.0 if (x_46_im <= -3e-85) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 5.6e-133) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_1); else tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(x_46_im + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / x_46_im))))) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_im <= -3e-85) tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 5.6e-133) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1; else tmp = t_2 * exp(((y_46_re * log((x_46_im + (0.5 * ((x_46_re * x_46_re) / x_46_im))))) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$im, -3e-85], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5.6e-133], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$im + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
\mathbf{if}\;x.im \leq -3 \cdot 10^{-85}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 5.6 \cdot 10^{-133}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\right) - t_0}\\
\end{array}
\end{array}
if x.im < -3.00000000000000022e-85Initial program 32.0%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in x.im around -inf 61.2%
mul-1-neg61.2%
Simplified61.2%
if -3.00000000000000022e-85 < x.im < 5.5999999999999997e-133Initial program 38.8%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in y.re around 0 56.2%
if 5.5999999999999997e-133 < x.im Initial program 46.3%
Taylor expanded in y.im around 0 64.3%
Taylor expanded in x.re around 0 68.4%
unpow268.4%
Simplified68.4%
Final simplification62.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1)))
(if (<= x.im -3.2e-85)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 0.45)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_1)
(* t_2 (exp (- (* y.re (log x.im)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double tmp;
if (x_46_im <= -3.2e-85) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 0.45) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
} else {
tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
t_1 = y_46re * atan2(x_46im, x_46re)
t_2 = sin(t_1)
if (x_46im <= (-3.2d-85)) then
tmp = t_2 * exp(((y_46re * log(-x_46im)) - t_0))
else if (x_46im <= 0.45d0) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * t_1
else
tmp = t_2 * exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_im <= -3.2e-85) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 0.45) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
} else {
tmp = t_2 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_im <= -3.2e-85: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 0.45: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1 else: tmp = t_2 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) tmp = 0.0 if (x_46_im <= -3.2e-85) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 0.45) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_1); else tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_im <= -3.2e-85) tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 0.45) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1; else tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$im, -3.2e-85], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 0.45], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t_1\\
\mathbf{if}\;x.im \leq -3.2 \cdot 10^{-85}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 0.45:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -3.20000000000000027e-85Initial program 32.0%
Taylor expanded in y.im around 0 52.0%
Taylor expanded in x.im around -inf 61.2%
mul-1-neg61.2%
Simplified61.2%
if -3.20000000000000027e-85 < x.im < 0.450000000000000011Initial program 45.8%
Taylor expanded in y.im around 0 60.0%
Taylor expanded in y.re around 0 58.3%
if 0.450000000000000011 < x.im Initial program 37.5%
Taylor expanded in y.im around 0 61.3%
Taylor expanded in x.re around 0 70.4%
Final simplification62.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -9.6e-308)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(* t_1 (exp (- (* y.re (log x.im)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -9.6e-308) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-9.6d-308)) then
tmp = t_1 * exp(((y_46re * log(-x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -9.6e-308) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -9.6e-308: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -9.6e-308) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -9.6e-308) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -9.6e-308], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -9.6 \cdot 10^{-308}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -9.60000000000000032e-308Initial program 33.1%
Taylor expanded in y.im around 0 52.4%
Taylor expanded in x.im around -inf 57.4%
mul-1-neg57.4%
Simplified57.4%
if -9.60000000000000032e-308 < x.im Initial program 45.6%
Taylor expanded in y.im around 0 63.1%
Taylor expanded in x.re around 0 55.7%
Final simplification56.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -1e-310)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(* t_1 (exp (- (* y.re (log x.re)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1e-310) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-1d-310)) then
tmp = t_1 * exp(((y_46re * log(-x_46re)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -1e-310) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -1e-310: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -1e-310) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -1e-310) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1e-310], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -9.999999999999969e-311Initial program 42.6%
Taylor expanded in y.im around 0 61.1%
Taylor expanded in x.re around -inf 65.7%
mul-1-neg65.7%
Simplified65.7%
if -9.999999999999969e-311 < x.re Initial program 37.0%
Taylor expanded in y.im around 0 55.3%
Taylor expanded in x.re around inf 54.8%
Final simplification59.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -7.4e-306)
(* t_1 (exp (- (* y.re (log x.im)) t_0)))
(* t_1 (exp (- (* y.re (log x.re)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -7.4e-306) {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
t_1 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-7.4d-306)) then
tmp = t_1 * exp(((y_46re * log(x_46im)) - t_0))
else
tmp = t_1 * exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -7.4e-306) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -7.4e-306: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -7.4e-306) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -7.4e-306) tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_0)); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -7.4e-306], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -7.4 \cdot 10^{-306}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -7.400000000000001e-306Initial program 42.9%
Taylor expanded in y.im around 0 61.6%
Taylor expanded in x.re around 0 32.4%
if -7.400000000000001e-306 < x.re Initial program 36.8%
Taylor expanded in y.im around 0 54.9%
Taylor expanded in x.re around inf 54.4%
Final simplification44.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (exp (- (* y.re (log x.im)) (* y.im (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re))));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = sin((y_46re * atan2(x_46im, x_46re))) * exp(((y_46re * log(x_46im)) - (y_46im * atan2(x_46im, x_46re))))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.exp(((y_46_re * Math.log(x_46_im)) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.exp(((y_46_re * math.log(x_46_im)) - (y_46_im * math.atan2(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(y_46_im * atan(x_46_im, x_46_re))))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
\end{array}
Initial program 39.5%
Taylor expanded in y.im around 0 57.9%
Taylor expanded in x.re around 0 28.7%
Final simplification28.7%
herbie shell --seed 2023297
(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)))))