
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -9e-15)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 7e-5)
(* (exp (* y.im (- (atan2 x.im x.re)))) (cos (* y.im (log (fabs x.re)))))
(* (sin (* 0.5 PI)) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -9e-15) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 7e-5) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * cos((y_46_im * log(fabs(x_46_re))));
} else {
tmp = sin((0.5 * ((double) M_PI))) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -9e-15) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 7e-5) tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * log(abs(x_46_re))))); else tmp = Float64(sin(Float64(0.5 * pi)) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -9e-15], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7e-5], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Abs[x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9 \cdot 10^{-15}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{-5}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log \left(\left|x.re\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(0.5 \cdot \pi\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -8.9999999999999995e-15Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
if -8.9999999999999995e-15 < y.re < 6.9999999999999994e-5Initial program 39.9%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-atan2.f6426.8
Applied rewrites26.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6426.7
Applied rewrites26.7%
Taylor expanded in x.im around 0
lower-*.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lift-log.f64N/A
lift-fabs.f6452.1
Applied rewrites52.1%
if 6.9999999999999994e-5 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (sin (* 0.5 PI)) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
(if (<= y.re -1.6e-12)
t_0
(if (<= y.re 7e-5)
(*
(exp (* y.im (- (atan2 x.im x.re))))
(cos (* y.im (log (fabs 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 = sin((0.5 * ((double) M_PI))) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -1.6e-12) {
tmp = t_0;
} else if (y_46_re <= 7e-5) {
tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * cos((y_46_im * log(fabs(x_46_re))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(0.5 * pi)) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.6e-12) tmp = t_0; elseif (y_46_re <= 7e-5) tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * cos(Float64(y_46_im * log(abs(x_46_re))))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $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$re, -1.6e-12], t$95$0, If[LessEqual[y$46$re, 7e-5], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Abs[x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{-5}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log \left(\left|x.re\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.6e-12 or 6.9999999999999994e-5 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
if -1.6e-12 < y.re < 6.9999999999999994e-5Initial program 39.9%
Taylor expanded in y.re around 0
distribute-lft-neg-inN/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-atan2.f6426.8
Applied rewrites26.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6426.7
Applied rewrites26.7%
Taylor expanded in x.im around 0
lower-*.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lift-log.f64N/A
lift-fabs.f6452.1
Applied rewrites52.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 PI))))
(if (<= x.re -1.45e+129)
(* t_0 (pow (fabs x.re) y.re))
(if (<= x.re 2.8e-174)
(* t_0 (pow (sqrt (* x.im x.im)) y.re))
(if (<= x.re 9.5e+36)
(* (cos (* y.im (log x.re))) (exp (- (* y.im (atan2 x.im x.re)))))
(* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((0.5 * ((double) M_PI)));
double tmp;
if (x_46_re <= -1.45e+129) {
tmp = t_0 * pow(fabs(x_46_re), y_46_re);
} else if (x_46_re <= 2.8e-174) {
tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
} else if (x_46_re <= 9.5e+36) {
tmp = cos((y_46_im * log(x_46_re))) * exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((0.5 * Math.PI));
double tmp;
if (x_46_re <= -1.45e+129) {
tmp = t_0 * Math.pow(Math.abs(x_46_re), y_46_re);
} else if (x_46_re <= 2.8e-174) {
tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
} else if (x_46_re <= 9.5e+36) {
tmp = Math.cos((y_46_im * Math.log(x_46_re))) * Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((0.5 * math.pi)) tmp = 0 if x_46_re <= -1.45e+129: tmp = t_0 * math.pow(math.fabs(x_46_re), y_46_re) elif x_46_re <= 2.8e-174: tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re) elif x_46_re <= 9.5e+36: tmp = math.cos((y_46_im * math.log(x_46_re))) * math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(0.5 * pi)) tmp = 0.0 if (x_46_re <= -1.45e+129) tmp = Float64(t_0 * (abs(x_46_re) ^ y_46_re)); elseif (x_46_re <= 2.8e-174) tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re)); elseif (x_46_re <= 9.5e+36) tmp = Float64(cos(Float64(y_46_im * log(x_46_re))) * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))); else tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((0.5 * pi)); tmp = 0.0; if (x_46_re <= -1.45e+129) tmp = t_0 * (abs(x_46_re) ^ y_46_re); elseif (x_46_re <= 2.8e-174) tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re); elseif (x_46_re <= 9.5e+36) tmp = cos((y_46_im * log(x_46_re))) * exp(-(y_46_im * atan2(x_46_im, x_46_re))); else tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -1.45e+129], N[(t$95$0 * N[Power[N[Abs[x$46$re], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.8e-174], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 9.5e+36], N[(N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right)\\
\mathbf{if}\;x.re \leq -1.45 \cdot 10^{+129}:\\
\;\;\;\;t\_0 \cdot {\left(\left|x.re\right|\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 2.8 \cdot 10^{-174}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 9.5 \cdot 10^{+36}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.re\right) \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -1.45000000000000001e129Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.im around 0
lower-pow.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lift-fabs.f6453.6
Applied rewrites53.6%
if -1.45000000000000001e129 < x.re < 2.79999999999999999e-174Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
pow2N/A
lift-*.f6445.3
Applied rewrites45.3%
if 2.79999999999999999e-174 < x.re < 9.49999999999999974e36Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites34.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lift-atan2.f64N/A
lift-*.f6423.1
Applied rewrites23.1%
if 9.49999999999999974e36 < x.re Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites34.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lower-pow.f6438.8
Applied rewrites38.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (sin (* 0.5 PI)) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
(if (<= y.re -1.4e-100)
t_0
(if (<= y.re 1.6e-6) (+ 1.0 (* y.re (log (fabs 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 = sin((0.5 * ((double) M_PI))) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -1.4e-100) {
tmp = t_0;
} else if (y_46_re <= 1.6e-6) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(0.5 * pi)) * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.4e-100) tmp = t_0; elseif (y_46_re <= 1.6e-6) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $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$re, -1.4e-100], t$95$0, If[LessEqual[y$46$re, 1.6e-6], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.4 \cdot 10^{-100}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-6}:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.re\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.39999999999999998e-100 or 1.5999999999999999e-6 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
if -1.39999999999999998e-100 < y.re < 1.5999999999999999e-6Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 PI))) (t_1 (* t_0 (pow (fabs x.re) y.re))))
(if (<= x.re -1.45e+129)
t_1
(if (<= x.re 6.6e-145) (* t_0 (pow (sqrt (* x.im x.im)) y.re)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((0.5 * ((double) M_PI)));
double t_1 = t_0 * pow(fabs(x_46_re), y_46_re);
double tmp;
if (x_46_re <= -1.45e+129) {
tmp = t_1;
} else if (x_46_re <= 6.6e-145) {
tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((0.5 * Math.PI));
double t_1 = t_0 * Math.pow(Math.abs(x_46_re), y_46_re);
double tmp;
if (x_46_re <= -1.45e+129) {
tmp = t_1;
} else if (x_46_re <= 6.6e-145) {
tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((0.5 * math.pi)) t_1 = t_0 * math.pow(math.fabs(x_46_re), y_46_re) tmp = 0 if x_46_re <= -1.45e+129: tmp = t_1 elif x_46_re <= 6.6e-145: tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(0.5 * pi)) t_1 = Float64(t_0 * (abs(x_46_re) ^ y_46_re)) tmp = 0.0 if (x_46_re <= -1.45e+129) tmp = t_1; elseif (x_46_re <= 6.6e-145) tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((0.5 * pi)); t_1 = t_0 * (abs(x_46_re) ^ y_46_re); tmp = 0.0; if (x_46_re <= -1.45e+129) tmp = t_1; elseif (x_46_re <= 6.6e-145) tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re); else tmp = 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[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Abs[x$46$re], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.45e+129], t$95$1, If[LessEqual[x$46$re, 6.6e-145], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right)\\
t_1 := t\_0 \cdot {\left(\left|x.re\right|\right)}^{y.re}\\
\mathbf{if}\;x.re \leq -1.45 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.re \leq 6.6 \cdot 10^{-145}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.re < -1.45000000000000001e129 or 6.59999999999999962e-145 < x.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.im around 0
lower-pow.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lift-fabs.f6453.6
Applied rewrites53.6%
if -1.45000000000000001e129 < x.re < 6.59999999999999962e-145Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
pow2N/A
lift-*.f6445.3
Applied rewrites45.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 PI))))
(if (<= x.im -2.2e+23)
(* t_0 (pow (* -1.0 x.im) y.re))
(* t_0 (pow (fabs x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((0.5 * ((double) M_PI)));
double tmp;
if (x_46_im <= -2.2e+23) {
tmp = t_0 * pow((-1.0 * x_46_im), y_46_re);
} else {
tmp = t_0 * pow(fabs(x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((0.5 * Math.PI));
double tmp;
if (x_46_im <= -2.2e+23) {
tmp = t_0 * Math.pow((-1.0 * x_46_im), y_46_re);
} else {
tmp = t_0 * Math.pow(Math.abs(x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((0.5 * math.pi)) tmp = 0 if x_46_im <= -2.2e+23: tmp = t_0 * math.pow((-1.0 * x_46_im), y_46_re) else: tmp = t_0 * math.pow(math.fabs(x_46_re), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(0.5 * pi)) tmp = 0.0 if (x_46_im <= -2.2e+23) tmp = Float64(t_0 * (Float64(-1.0 * x_46_im) ^ y_46_re)); else tmp = Float64(t_0 * (abs(x_46_re) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((0.5 * pi)); tmp = 0.0; if (x_46_im <= -2.2e+23) tmp = t_0 * ((-1.0 * x_46_im) ^ y_46_re); else tmp = t_0 * (abs(x_46_re) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -2.2e+23], N[(t$95$0 * N[Power[N[(-1.0 * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Abs[x$46$re], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right)\\
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{+23}:\\
\;\;\;\;t\_0 \cdot {\left(-1 \cdot x.im\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\left|x.re\right|\right)}^{y.re}\\
\end{array}
\end{array}
if x.im < -2.20000000000000008e23Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.im around -inf
lower-*.f6439.8
Applied rewrites39.8%
if -2.20000000000000008e23 < x.im Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.im around 0
lower-pow.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lift-fabs.f6453.6
Applied rewrites53.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* 0.5 PI)) (pow (fabs x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((0.5 * ((double) M_PI))) * pow(fabs(x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((0.5 * Math.PI)) * Math.pow(Math.abs(x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((0.5 * math.pi)) * math.pow(math.fabs(x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(0.5 * pi)) * (abs(x_46_re) ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((0.5 * pi)) * (abs(x_46_re) ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[Power[N[Abs[x$46$re], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(0.5 \cdot \pi\right) \cdot {\left(\left|x.re\right|\right)}^{y.re}
\end{array}
Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.im around 0
lower-pow.f64N/A
pow2N/A
rem-sqrt-square-revN/A
lift-fabs.f6453.6
Applied rewrites53.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 1e+15) (+ 1.0 (log (pow (fabs x.re) y.re))) (+ 1.0 (log (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 1e+15) {
tmp = 1.0 + log(pow(fabs(x_46_re), y_46_re));
} else {
tmp = 1.0 + log(pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 1e+15) tmp = Float64(1.0 + log((abs(x_46_re) ^ y_46_re))); else tmp = Float64(1.0 + log((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 1e+15], N[(1.0 + N[Log[N[Power[N[Abs[x$46$re], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[Log[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]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 10^{+15}:\\
\;\;\;\;1 + \log \left({\left(\left|x.re\right|\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < 1e15Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
lift-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
lower-log.f64N/A
lower-pow.f6438.2
Applied rewrites38.2%
if 1e15 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
lift-log.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
log-pow-revN/A
lower-log.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f6431.9
Applied rewrites31.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (log (pow (fabs x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + log(pow(fabs(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
code = 1.0d0 + log((abs(x_46re) ** y_46re))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + Math.log(Math.pow(Math.abs(x_46_re), y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + math.log(math.pow(math.fabs(x_46_re), y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + log((abs(x_46_re) ^ y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + log((abs(x_46_re) ^ y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[Log[N[Power[N[Abs[x$46$re], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left({\left(\left|x.re\right|\right)}^{y.re}\right)
\end{array}
Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
lift-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
lower-log.f64N/A
lower-pow.f6438.2
Applied rewrites38.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.8e-21)
(+ 1.0 (* y.re (log (sqrt (* x.re x.re)))))
(if (<= y.re 1.7e-9)
(+ 1.0 (* y.re (log (fabs x.re))))
(+ 1.0 (* y.re (log (sqrt (fma x.im x.im (* x.re x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.8e-21) {
tmp = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re))));
} else if (y_46_re <= 1.7e-9) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_re)));
} else {
tmp = 1.0 + (y_46_re * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -2.8e-21) tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_re * x_46_re))))); elseif (y_46_re <= 1.7e-9) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_re)))); else tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.8e-21], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.7e-9], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{x.re \cdot x.re}\right)\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-9}:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.re\right|\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\\
\end{array}
\end{array}
if y.re < -2.80000000000000004e-21Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lift-*.f6422.6
Applied rewrites22.6%
if -2.80000000000000004e-21 < y.re < 1.6999999999999999e-9Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
if 1.6999999999999999e-9 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ 1.0 (* y.re (log (sqrt (* x.re x.re)))))))
(if (<= y.re -2.8e-21)
t_0
(if (<= y.re 6200000.0) (+ 1.0 (* y.re (log (fabs 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 = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re))));
double tmp;
if (y_46_re <= -2.8e-21) {
tmp = t_0;
} else if (y_46_re <= 6200000.0) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_re)));
} else {
tmp = t_0;
}
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 = 1.0d0 + (y_46re * log(sqrt((x_46re * x_46re))))
if (y_46re <= (-2.8d-21)) then
tmp = t_0
else if (y_46re <= 6200000.0d0) then
tmp = 1.0d0 + (y_46re * log(abs(x_46re)))
else
tmp = 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 = 1.0 + (y_46_re * Math.log(Math.sqrt((x_46_re * x_46_re))));
double tmp;
if (y_46_re <= -2.8e-21) {
tmp = t_0;
} else if (y_46_re <= 6200000.0) {
tmp = 1.0 + (y_46_re * Math.log(Math.abs(x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 + (y_46_re * math.log(math.sqrt((x_46_re * x_46_re)))) tmp = 0 if y_46_re <= -2.8e-21: tmp = t_0 elif y_46_re <= 6200000.0: tmp = 1.0 + (y_46_re * math.log(math.fabs(x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_re * x_46_re))))) tmp = 0.0 if (y_46_re <= -2.8e-21) tmp = t_0; elseif (y_46_re <= 6200000.0) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re)))); tmp = 0.0; if (y_46_re <= -2.8e-21) tmp = t_0; elseif (y_46_re <= 6200000.0) tmp = 1.0 + (y_46_re * log(abs(x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.8e-21], t$95$0, If[LessEqual[y$46$re, 6200000.0], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + y.re \cdot \log \left(\sqrt{x.re \cdot x.re}\right)\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6200000:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.re\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.80000000000000004e-21 or 6.2e6 < y.re Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lift-*.f6422.6
Applied rewrites22.6%
if -2.80000000000000004e-21 < y.re < 6.2e6Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log (fabs x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * log(fabs(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 = 1.0d0 + (y_46re * log(abs(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 1.0 + (y_46_re * Math.log(Math.abs(x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(math.fabs(x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(abs(x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(abs(x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\left|x.re\right|\right)
\end{array}
Initial program 39.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
herbie shell --seed 2025142
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))