
(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)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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 16 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)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im))))
(t_4 (* y.re (atan2 x.im x.re)))
(t_5 (sin t_4))
(t_6 (log (hypot x.re x.im))))
(if (<= (* t_3 (sin (+ (* t_2 y.im) t_1))) (- INFINITY))
(*
t_3
(+
t_5
(* y.im (fma -0.5 (* y.im (* (pow t_0 2.0) t_5)) (* (cos t_4) t_0)))))
(*
(exp (fma t_6 y.re (* (- (atan2 x.im x.re)) y.im)))
(sin (fma t_6 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_im, x_46_re));
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_4 = y_46_re * atan2(x_46_im, x_46_re);
double t_5 = sin(t_4);
double t_6 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((t_3 * sin(((t_2 * y_46_im) + t_1))) <= -((double) INFINITY)) {
tmp = t_3 * (t_5 + (y_46_im * fma(-0.5, (y_46_im * (pow(t_0, 2.0) * t_5)), (cos(t_4) * t_0))));
} else {
tmp = exp(fma(t_6, y_46_re, (-atan2(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_6, 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_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_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(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_4 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_5 = sin(t_4) t_6 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (Float64(t_3 * sin(Float64(Float64(t_2 * y_46_im) + t_1))) <= Float64(-Inf)) tmp = Float64(t_3 * Float64(t_5 + Float64(y_46_im * fma(-0.5, Float64(y_46_im * Float64((t_0 ^ 2.0) * t_5)), Float64(cos(t_4) * t_0))))); else tmp = Float64(exp(fma(t_6, y_46_re, Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))) * sin(fma(t_6, 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$im ^ 2 + x$46$re ^ 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[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[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $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]}, Block[{t$95$6 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$3 * N[(t$95$5 + N[(y$46$im * N[(-0.5 * N[(y$46$im * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t$95$4], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$6 * y$46$re + N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$6 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_5 := \sin t\_4\\
t_6 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;t\_3 \cdot \sin \left(t\_2 \cdot y.im + t\_1\right) \leq -\infty:\\
\;\;\;\;t\_3 \cdot \left(t\_5 + y.im \cdot \mathsf{fma}\left(-0.5, y.im \cdot \left({t\_0}^{2} \cdot t\_5\right), \cos t\_4 \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_6, y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im\right)} \cdot \sin \left(\mathsf{fma}\left(t\_6, y.im, t\_1\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 45.0%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
Applied rewrites70.0%
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 40.7%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (- (atan2 x.im x.re)) y.im)))
(sin (fma t_0 y.im (* (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(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (-atan2(x_46_im, x_46_re) * y_46_im))) * sin(fma(t_0, y_46_im, (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(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))) * sin(fma(t_0, y_46_im, Float64(atan(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[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)
\end{array}
\end{array}
Initial program 41.0%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites80.9%
(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 (fma t_1 y.re (* (- (atan2 x.im x.re)) y.im))) (sin t_0))))
(if (<= y.re -7e-33)
t_2
(if (<= y.re 6000000.0)
(*
(exp (* (- y.im) (atan2 x.im x.re)))
(sin (fma t_1 y.im (* (atan2 x.im x.re) y.re))))
(if (<= y.re 1.1e+81)
t_2
(*
(pow (hypot x.im x.re) y.re)
(fma y.im (log (hypot x.im 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_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(fma(t_1, y_46_re, (-atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
double tmp;
if (y_46_re <= -7e-33) {
tmp = t_2;
} else if (y_46_re <= 6000000.0) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin(fma(t_1, y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)));
} else if (y_46_re <= 1.1e+81) {
tmp = t_2;
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma(y_46_im, log(hypot(x_46_im, 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_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(exp(fma(t_1, y_46_re, Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))) * sin(t_0)) tmp = 0.0 if (y_46_re <= -7e-33) tmp = t_2; elseif (y_46_re <= 6000000.0) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(fma(t_1, y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re)))); elseif (y_46_re <= 1.1e+81) tmp = t_2; else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(y_46_im, log(hypot(x_46_im, x_46_re)), 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[(N[Exp[N[(t$95$1 * y$46$re + N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7e-33], t$95$2, If[LessEqual[y$46$re, 6000000.0], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.1e+81], t$95$2, N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $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^{\mathsf{fma}\left(t\_1, y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im\right)} \cdot \sin t\_0\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 6000000:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(t\_1, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+81}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\\
\end{array}
\end{array}
if y.re < -6.9999999999999997e-33 or 6e6 < y.re < 1.09999999999999993e81Initial program 42.5%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites86.1%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6488.6
Applied rewrites88.6%
if -6.9999999999999997e-33 < y.re < 6e6Initial program 44.0%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites84.1%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-*.f64N/A
lower-atan2.f6484.0
Applied rewrites84.0%
if 1.09999999999999993e81 < y.re Initial program 31.4%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites64.7%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lower-hypot.f6459.0
Applied rewrites59.0%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
Applied rewrites61.0%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-atan2.f6464.9
Applied rewrites64.9%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -2600.0) (not (<= y.im 0.00135)))
(*
(exp (fma t_0 y.re (* (- (atan2 x.im x.re)) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(*
(pow (hypot x.im x.re) y.re)
(sin (fma 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(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -2600.0) || !(y_46_im <= 0.00135)) {
tmp = exp(fma(t_0, y_46_re, (-atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(fma(t_0, y_46_im, (atan2(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)) tmp = 0.0 if ((y_46_im <= -2600.0) || !(y_46_im <= 0.00135)) tmp = Float64(exp(fma(t_0, y_46_re, Float64(Float64(-atan(x_46_im, x_46_re)) * y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(fma(t_0, y_46_im, Float64(atan(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]}, If[Or[LessEqual[y$46$im, -2600.0], N[Not[LessEqual[y$46$im, 0.00135]], $MachinePrecision]], N[(N[Exp[N[(t$95$0 * y$46$re + N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + 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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -2600 \lor \neg \left(y.im \leq 0.00135\right):\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.im\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\end{array}
\end{array}
if y.im < -2600 or 0.0013500000000000001 < y.im Initial program 35.2%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites70.5%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6467.8
Applied rewrites67.8%
if -2600 < y.im < 0.0013500000000000001Initial program 46.2%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites90.0%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lower-hypot.f6488.5
Applied rewrites88.5%
Final simplification78.8%
(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 -220000.0) (not (<= y.im 4.2e+142)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(* (pow (hypot x.im x.re) y.re) (fma y.im (log (hypot x.im 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_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -220000.0) || !(y_46_im <= 4.2e+142)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma(y_46_im, log(hypot(x_46_im, 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_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -220000.0) || !(y_46_im <= 4.2e+142)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(y_46_im, log(hypot(x_46_im, x_46_re)), 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]}, If[Or[LessEqual[y$46$im, -220000.0], N[Not[LessEqual[y$46$im, 4.2e+142]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $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 -220000 \lor \neg \left(y.im \leq 4.2 \cdot 10^{+142}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\\
\end{array}
\end{array}
if y.im < -2.2e5 or 4.2e142 < y.im Initial program 39.2%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6453.6
Applied rewrites53.6%
if -2.2e5 < y.im < 4.2e142Initial program 42.1%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites86.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lower-hypot.f6480.3
Applied rewrites80.3%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
Applied rewrites80.0%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-atan2.f6481.7
Applied rewrites81.7%
Final simplification71.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.im -235000.0)
(* (sin t_0) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(if (<= y.im 2.55e+216)
(* (pow (hypot x.im x.re) y.re) (fma y.im (log (hypot x.im x.re)) t_0))
(* (exp (* (- y.im) (atan2 x.im x.re))) (sin (* y.im (log x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -235000.0) {
tmp = sin(t_0) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
} else if (y_46_im <= 2.55e+216) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0);
} else {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -235000.0) tmp = Float64(sin(t_0) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); elseif (y_46_im <= 2.55e+216) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)); else tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -235000.0], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.55e+216], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -235000:\\
\;\;\;\;\sin t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 2.55 \cdot 10^{+216}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if y.im < -235000Initial program 34.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6426.6
Applied rewrites26.6%
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lower-*.f6431.6
Applied rewrites31.6%
if -235000 < y.im < 2.55e216Initial program 43.0%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites86.9%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lower-hypot.f6480.1
Applied rewrites80.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
Applied rewrites79.8%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-atan2.f6480.8
Applied rewrites80.8%
if 2.55e216 < y.im Initial program 55.6%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6466.7
Applied rewrites66.7%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f6466.7
Applied rewrites66.7%
Final simplification66.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im 6.8e+140)
(* (pow (hypot x.im x.re) y.re) (fma y.im (log (hypot x.im x.re)) t_0))
(* (exp (- (* y.re (log x.im)) (* y.im (atan2 x.im x.re)))) (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 tmp;
if (x_46_im <= 6.8e+140) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0);
} else {
tmp = exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(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)) tmp = 0.0 if (x_46_im <= 6.8e+140) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(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]}, If[LessEqual[x$46$im, 6.8e+140], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(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] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq 6.8 \cdot 10^{+140}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t\_0\\
\end{array}
\end{array}
if x.im < 6.8e140Initial program 46.1%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites80.3%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lower-hypot.f6464.1
Applied rewrites64.1%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
Applied rewrites64.9%
Taylor expanded in y.re around 0
lower-fma.f64N/A
pow2N/A
pow2N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-atan2.f6464.3
Applied rewrites64.3%
if 6.8e140 < x.im Initial program 0.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6481.7
Applied rewrites81.7%
Taylor expanded in y.re around inf
lower-*.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
(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)))
(if (<= y.re -7e-11)
(* t_1 (pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re))
(if (<= y.re 6000000.0)
(*
1.0
(sin (fma (log (hypot x.re x.im)) y.im (* (atan2 x.im x.re) y.re))))
(if (<= y.re 2.55e+151)
(* t_1 (pow x.re y.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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -7e-11) {
tmp = t_1 * pow((x_46_re + (0.5 * ((x_46_im * x_46_im) / x_46_re))), y_46_re);
} else if (y_46_re <= 6000000.0) {
tmp = 1.0 * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)));
} else if (y_46_re <= 2.55e+151) {
tmp = t_1 * pow(x_46_re, y_46_re);
} else {
tmp = 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(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -7e-11) tmp = Float64(t_1 * (Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * x_46_im) / x_46_re))) ^ y_46_re)); elseif (y_46_re <= 6000000.0) tmp = Float64(1.0 * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re)))); elseif (y_46_re <= 2.55e+151) tmp = Float64(t_1 * (x_46_re ^ y_46_re)); else tmp = Float64(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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -7e-11], N[(t$95$1 * N[Power[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6000000.0], N[(1.0 * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.55e+151], N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 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 t\_0\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{-11}:\\
\;\;\;\;t\_1 \cdot {\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 6000000:\\
\;\;\;\;1 \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\mathbf{elif}\;y.re \leq 2.55 \cdot 10^{+151}:\\
\;\;\;\;t\_1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -7.00000000000000038e-11Initial program 39.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6479.5
Applied rewrites79.5%
Taylor expanded in x.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-*.f6479.9
Applied rewrites79.9%
if -7.00000000000000038e-11 < y.re < 6e6Initial program 44.3%
lower-*.f64N/A
lower-exp.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-hypot.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites84.1%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
lower-hypot.f6456.6
Applied rewrites56.6%
Taylor expanded in y.re around 0
Applied rewrites56.5%
if 6e6 < y.re < 2.54999999999999998e151Initial program 43.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6450.5
Applied rewrites50.5%
Taylor expanded in x.re around inf
Applied rewrites57.1%
if 2.54999999999999998e151 < y.re Initial program 28.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6443.8
Applied rewrites43.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-atan2.f6453.2
Applied rewrites53.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re 2.8e-85)
(* (sin t_0) (pow (hypot x.im x.re) y.re))
(* (pow x.re y.re) (sin (fma y.im (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_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= 2.8e-85) {
tmp = sin(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_re, y_46_re) * sin(fma(y_46_im, 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_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= 2.8e-85) tmp = Float64(sin(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((x_46_re ^ y_46_re) * sin(fma(y_46_im, log(x_46_re), 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]}, If[LessEqual[x$46$re, 2.8e-85], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq 2.8 \cdot 10^{-85}:\\
\;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right)\\
\end{array}
\end{array}
if x.re < 2.80000000000000017e-85Initial program 43.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6447.6
Applied rewrites47.6%
if 2.80000000000000017e-85 < x.re Initial program 36.2%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6476.7
Applied rewrites76.7%
Taylor expanded in y.im around 0
lower-pow.f6464.3
Applied rewrites64.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 4.4e-17) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (* (pow x.re y.re) (sin (* y.im (log x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 4.4e-17) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 4.4e-17) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 4.4e-17: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(x_46_re, y_46_re) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 4.4e-17) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= 4.4e-17) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = (x_46_re ^ y_46_re) * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 4.4e-17], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 4.4e-17Initial program 46.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6449.0
Applied rewrites49.0%
if 4.4e-17 < x.re Initial program 28.0%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
Taylor expanded in y.im around 0
lower-pow.f6464.0
Applied rewrites64.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f6462.8
Applied rewrites62.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -8.5e+98)
(* t_0 (pow x.re y.re))
(if (<= x.re 1.85e-42)
(* t_0 (pow x.im y.re))
(* (pow x.re y.re) (sin (* y.im (log x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -8.5e+98) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else if (x_46_re <= 1.85e-42) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-8.5d+98)) then
tmp = t_0 * (x_46re ** y_46re)
else if (x_46re <= 1.85d-42) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = (x_46re ** y_46re) * sin((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -8.5e+98) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else if (x_46_re <= 1.85e-42) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -8.5e+98: tmp = t_0 * math.pow(x_46_re, y_46_re) elif x_46_re <= 1.85e-42: tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -8.5e+98) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); elseif (x_46_re <= 1.85e-42) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -8.5e+98) tmp = t_0 * (x_46_re ^ y_46_re); elseif (x_46_re <= 1.85e-42) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = (x_46_re ^ y_46_re) * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -8.5e+98], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.85e-42], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -8.5 \cdot 10^{+98}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.85 \cdot 10^{-42}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -8.4999999999999996e98Initial program 20.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6446.7
Applied rewrites46.7%
Taylor expanded in x.re around inf
Applied rewrites29.0%
if -8.4999999999999996e98 < x.re < 1.8500000000000001e-42Initial program 54.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6448.9
Applied rewrites48.9%
Taylor expanded in x.re around 0
Applied rewrites41.9%
if 1.8500000000000001e-42 < x.re Initial program 31.0%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6476.7
Applied rewrites76.7%
Taylor expanded in y.im around 0
lower-pow.f6464.3
Applied rewrites64.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f6460.7
Applied rewrites60.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 4.4e-17) (* (* y.re (atan2 x.im x.re)) (pow (hypot x.im x.re) y.re)) (* (pow x.re y.re) (sin (* y.im (log x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 4.4e-17) {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 4.4e-17) {
tmp = (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 4.4e-17: tmp = (y_46_re * math.atan2(x_46_im, x_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(x_46_re, y_46_re) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 4.4e-17) tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= 4.4e-17) tmp = (y_46_re * atan2(x_46_im, x_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = (x_46_re ^ y_46_re) * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 4.4e-17], N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 4.4e-17Initial program 46.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6449.0
Applied rewrites49.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-atan2.f6447.1
Applied rewrites47.1%
if 4.4e-17 < x.re Initial program 28.0%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6474.8
Applied rewrites74.8%
Taylor expanded in y.im around 0
lower-pow.f6464.0
Applied rewrites64.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f6462.8
Applied rewrites62.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 1.85e-42) (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (* (pow x.re y.re) (sin (* y.im (log x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 1.85e-42) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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) :: tmp
if (x_46re <= 1.85d-42) then
tmp = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
else
tmp = (x_46re ** y_46re) * sin((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 1.85e-42) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 1.85e-42: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 1.85e-42) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= 1.85e-42) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = (x_46_re ^ y_46_re) * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 1.85e-42], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 1.85 \cdot 10^{-42}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 1.8500000000000001e-42Initial program 45.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6448.3
Applied rewrites48.3%
Taylor expanded in x.re around 0
Applied rewrites35.5%
if 1.8500000000000001e-42 < x.re Initial program 31.0%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6476.7
Applied rewrites76.7%
Taylor expanded in y.im around 0
lower-pow.f6464.3
Applied rewrites64.3%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f6460.7
Applied rewrites60.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 9.2e-287) (* (sin (* y.re (atan2 x.im x.re))) 1.0) (* (pow x.re y.re) (sin (* y.im (log x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 9.2e-287) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = pow(x_46_re, y_46_re) * sin((y_46_im * log(x_46_re)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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) :: tmp
if (x_46re <= 9.2d-287) then
tmp = sin((y_46re * atan2(x_46im, x_46re))) * 1.0d0
else
tmp = (x_46re ** y_46re) * sin((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 9.2e-287) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * Math.sin((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 9.2e-287: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * 1.0 else: tmp = math.pow(x_46_re, y_46_re) * math.sin((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 9.2e-287) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * 1.0); else tmp = Float64((x_46_re ^ y_46_re) * sin(Float64(y_46_im * log(x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= 9.2e-287) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * 1.0; else tmp = (x_46_re ^ y_46_re) * sin((y_46_im * log(x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 9.2e-287], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 9.2 \cdot 10^{-287}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 9.19999999999999944e-287Initial program 41.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6443.7
Applied rewrites43.7%
Taylor expanded in y.re around 0
Applied rewrites17.0%
if 9.19999999999999944e-287 < x.re Initial program 41.1%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6468.9
Applied rewrites68.9%
Taylor expanded in y.im around 0
lower-pow.f6456.2
Applied rewrites56.2%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f6449.7
Applied rewrites49.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) 1.0))
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))) * 1.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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))) * 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * 1.0;
}
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))) * 1.0
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))) * 1.0) 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))) * 1.0; 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] * 1.0), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1
\end{array}
Initial program 41.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6443.9
Applied rewrites43.9%
Taylor expanded in y.re around 0
Applied rewrites14.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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) {
return y_46_re * atan2(x_46_im, x_46_re);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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 = y_46re * 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 y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 41.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-hypot.f6443.9
Applied rewrites43.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-atan2.f6414.6
Applied rewrites14.6%
herbie shell --seed 2025044
(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)))))