
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
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 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
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 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (- x.re) (/ 1.0 (- (fma (/ y.im y.re) y.im y.re))) (/ x.im (fma (/ y.re y.im) y.re y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma(-x_46_re, (1.0 / -fma((y_46_im / y_46_re), y_46_im, y_46_re)), (x_46_im / fma((y_46_re / y_46_im), y_46_re, y_46_im)));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(-x_46_re), Float64(1.0 / Float64(-fma(Float64(y_46_im / y_46_re), y_46_im, y_46_re))), Float64(x_46_im / fma(Float64(y_46_re / y_46_im), y_46_re, y_46_im))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[((-x$46$re) * N[(1.0 / (-N[(N[(y$46$im / y$46$re), $MachinePrecision] * y$46$im + y$46$re), $MachinePrecision])), $MachinePrecision] + N[(x$46$im / N[(N[(y$46$re / y$46$im), $MachinePrecision] * y$46$re + y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-x.re, \frac{1}{-\mathsf{fma}\left(\frac{y.im}{y.re}, y.im, y.re\right)}, \frac{x.im}{\mathsf{fma}\left(\frac{y.re}{y.im}, y.re, y.im\right)}\right)
\end{array}
Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
lift-+.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6488.3
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6491.8
lift-+.f64N/A
+-commutativeN/A
Applied rewrites95.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -6.2e+187)
(/ (fma y.im (/ x.im y.re) x.re) y.re)
(if (<= y.re 1.9e+147)
(+
(/ x.re (+ y.re (/ (* y.im y.im) y.re)))
(/ x.im (+ y.im (/ (* y.re y.re) y.im))))
(/ (fma (/ y.im y.re) x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -6.2e+187) {
tmp = fma(y_46_im, (x_46_im / y_46_re), x_46_re) / y_46_re;
} else if (y_46_re <= 1.9e+147) {
tmp = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / (y_46_im + ((y_46_re * y_46_re) / y_46_im)));
} else {
tmp = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -6.2e+187) tmp = Float64(fma(y_46_im, Float64(x_46_im / y_46_re), x_46_re) / y_46_re); elseif (y_46_re <= 1.9e+147) tmp = Float64(Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_46_im) / y_46_re))) + Float64(x_46_im / Float64(y_46_im + Float64(Float64(y_46_re * y_46_re) / y_46_im)))); else tmp = Float64(fma(Float64(y_46_im / y_46_re), 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_] := If[LessEqual[y$46$re, -6.2e+187], N[(N[(y$46$im * N[(x$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.9e+147], N[(N[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / N[(y$46$im + N[(N[(y$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{+187}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.im, \frac{x.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+147}:\\
\;\;\;\;\frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}} + \frac{x.im}{y.im + \frac{y.re \cdot y.re}{y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\end{array}
\end{array}
if y.re < -6.20000000000000024e187Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6454.4
Applied rewrites54.4%
if -6.20000000000000024e187 < y.re < 1.89999999999999985e147Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
if 1.89999999999999985e147 < y.re Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6455.2
Applied rewrites55.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(fma (/ x.re (* x.im y.im)) y.re 1.0)
(/ x.im (fma (/ y.re y.im) y.re y.im)))))
(if (<= y.im -2e-15)
t_0
(if (<= y.im 8.6e-159)
(/ (+ x.re (/ (* x.im y.im) y.re)) y.re)
(if (<= y.im 3.4e+49)
(/
1.0
(/ (fma y.im y.im (* y.re y.re)) (fma y.im x.im (* y.re 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 = fma((x_46_re / (x_46_im * y_46_im)), y_46_re, 1.0) * (x_46_im / fma((y_46_re / y_46_im), y_46_re, y_46_im));
double tmp;
if (y_46_im <= -2e-15) {
tmp = t_0;
} else if (y_46_im <= 8.6e-159) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 3.4e+49) {
tmp = 1.0 / (fma(y_46_im, y_46_im, (y_46_re * y_46_re)) / fma(y_46_im, x_46_im, (y_46_re * 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(fma(Float64(x_46_re / Float64(x_46_im * y_46_im)), y_46_re, 1.0) * Float64(x_46_im / fma(Float64(y_46_re / y_46_im), y_46_re, y_46_im))) tmp = 0.0 if (y_46_im <= -2e-15) tmp = t_0; elseif (y_46_im <= 8.6e-159) tmp = Float64(Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 3.4e+49) tmp = Float64(1.0 / Float64(fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) / fma(y_46_im, x_46_im, Float64(y_46_re * 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[(N[(x$46$re / N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] * y$46$re + 1.0), $MachinePrecision] * N[(x$46$im / N[(N[(y$46$re / y$46$im), $MachinePrecision] * y$46$re + y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2e-15], t$95$0, If[LessEqual[y$46$im, 8.6e-159], N[(N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.4e+49], N[(1.0 / N[(N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * x$46$im + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{x.re}{x.im \cdot y.im}, y.re, 1\right) \cdot \frac{x.im}{\mathsf{fma}\left(\frac{y.re}{y.im}, y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.4 \cdot 10^{+49}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -2.0000000000000002e-15 or 3.4000000000000001e49 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Applied rewrites65.7%
if -2.0000000000000002e-15 < y.im < 8.6e-159Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
if 8.6e-159 < y.im < 3.4000000000000001e49Initial program 62.3%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6462.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.0
Applied rewrites62.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -9e-43)
(+ (/ x.re (+ y.re (/ (* y.im y.im) y.re))) (/ x.im y.im))
(if (<= y.im 8.6e-159)
(/ (+ x.re (/ (* x.im y.im) y.re)) y.re)
(if (<= y.im 5e+77)
(/ 1.0 (/ (fma y.im y.im (* y.re y.re)) (fma y.im x.im (* y.re x.re))))
(fma
(- x.re)
(/ 1.0 (- (fma (/ y.im y.re) y.im y.re)))
(/ x.im y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -9e-43) {
tmp = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im);
} else if (y_46_im <= 8.6e-159) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5e+77) {
tmp = 1.0 / (fma(y_46_im, y_46_im, (y_46_re * y_46_re)) / fma(y_46_im, x_46_im, (y_46_re * x_46_re)));
} else {
tmp = fma(-x_46_re, (1.0 / -fma((y_46_im / y_46_re), y_46_im, y_46_re)), (x_46_im / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -9e-43) tmp = Float64(Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_46_im) / y_46_re))) + Float64(x_46_im / y_46_im)); elseif (y_46_im <= 8.6e-159) tmp = Float64(Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 5e+77) tmp = Float64(1.0 / Float64(fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) / fma(y_46_im, x_46_im, Float64(y_46_re * x_46_re)))); else tmp = fma(Float64(-x_46_re), Float64(1.0 / Float64(-fma(Float64(y_46_im / y_46_re), y_46_im, y_46_re))), Float64(x_46_im / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -9e-43], N[(N[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.6e-159], N[(N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5e+77], N[(1.0 / N[(N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * x$46$im + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x$46$re) * N[(1.0 / (-N[(N[(y$46$im / y$46$re), $MachinePrecision] * y$46$im + y$46$re), $MachinePrecision])), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9 \cdot 10^{-43}:\\
\;\;\;\;\frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}} + \frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+77}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x.re, \frac{1}{-\mathsf{fma}\left(\frac{y.im}{y.re}, y.im, y.re\right)}, \frac{x.im}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -9.0000000000000005e-43Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in y.re around 0
Applied rewrites58.2%
if -9.0000000000000005e-43 < y.im < 8.6e-159Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
if 8.6e-159 < y.im < 5.00000000000000004e77Initial program 62.3%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6462.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.0
Applied rewrites62.0%
if 5.00000000000000004e77 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
lift-+.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6488.3
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6491.8
lift-+.f64N/A
+-commutativeN/A
Applied rewrites95.1%
Taylor expanded in y.re around 0
Applied rewrites61.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -9e-43)
(+ (/ x.re (+ y.re (/ (* y.im y.im) y.re))) (/ x.im y.im))
(if (<= y.im 8.6e-159)
(/ (+ x.re (/ (* x.im y.im) y.re)) y.re)
(if (<= y.im 5e+77)
(* (fma y.im x.im (* y.re x.re)) (/ 1.0 (fma y.im y.im (* y.re y.re))))
(fma
(- x.re)
(/ 1.0 (- (fma (/ y.im y.re) y.im y.re)))
(/ x.im y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -9e-43) {
tmp = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im);
} else if (y_46_im <= 8.6e-159) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5e+77) {
tmp = fma(y_46_im, x_46_im, (y_46_re * x_46_re)) * (1.0 / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else {
tmp = fma(-x_46_re, (1.0 / -fma((y_46_im / y_46_re), y_46_im, y_46_re)), (x_46_im / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -9e-43) tmp = Float64(Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_46_im) / y_46_re))) + Float64(x_46_im / y_46_im)); elseif (y_46_im <= 8.6e-159) tmp = Float64(Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 5e+77) tmp = Float64(fma(y_46_im, x_46_im, Float64(y_46_re * x_46_re)) * Float64(1.0 / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); else tmp = fma(Float64(-x_46_re), Float64(1.0 / Float64(-fma(Float64(y_46_im / y_46_re), y_46_im, y_46_re))), Float64(x_46_im / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -9e-43], N[(N[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.6e-159], N[(N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5e+77], N[(N[(y$46$im * x$46$im + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x$46$re) * N[(1.0 / (-N[(N[(y$46$im / y$46$re), $MachinePrecision] * y$46$im + y$46$re), $MachinePrecision])), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9 \cdot 10^{-43}:\\
\;\;\;\;\frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}} + \frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right) \cdot \frac{1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x.re, \frac{1}{-\mathsf{fma}\left(\frac{y.im}{y.re}, y.im, y.re\right)}, \frac{x.im}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -9.0000000000000005e-43Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in y.re around 0
Applied rewrites58.2%
if -9.0000000000000005e-43 < y.im < 8.6e-159Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
if 8.6e-159 < y.im < 5.00000000000000004e77Initial program 62.3%
lift-/.f64N/A
mult-flipN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.1
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.1
Applied rewrites62.1%
if 5.00000000000000004e77 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
lift-+.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6488.3
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6491.8
lift-+.f64N/A
+-commutativeN/A
Applied rewrites95.1%
Taylor expanded in y.re around 0
Applied rewrites61.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -9e-43)
(+ (/ x.re (+ y.re (/ (* y.im y.im) y.re))) (/ x.im y.im))
(if (<= y.im 8.6e-159)
(/ (+ x.re (/ (* x.im y.im) y.re)) y.re)
(if (<= y.im 5e+77)
(/ (fma y.im x.im (* y.re x.re)) (fma y.im y.im (* y.re y.re)))
(fma
(- x.re)
(/ 1.0 (- (fma (/ y.im y.re) y.im y.re)))
(/ x.im y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -9e-43) {
tmp = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im);
} else if (y_46_im <= 8.6e-159) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5e+77) {
tmp = fma(y_46_im, x_46_im, (y_46_re * x_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else {
tmp = fma(-x_46_re, (1.0 / -fma((y_46_im / y_46_re), y_46_im, y_46_re)), (x_46_im / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -9e-43) tmp = Float64(Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_46_im) / y_46_re))) + Float64(x_46_im / y_46_im)); elseif (y_46_im <= 8.6e-159) tmp = Float64(Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 5e+77) tmp = Float64(fma(y_46_im, x_46_im, Float64(y_46_re * x_46_re)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); else tmp = fma(Float64(-x_46_re), Float64(1.0 / Float64(-fma(Float64(y_46_im / y_46_re), y_46_im, y_46_re))), Float64(x_46_im / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -9e-43], N[(N[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.6e-159], N[(N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5e+77], N[(N[(y$46$im * x$46$im + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x$46$re) * N[(1.0 / (-N[(N[(y$46$im / y$46$re), $MachinePrecision] * y$46$im + y$46$re), $MachinePrecision])), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9 \cdot 10^{-43}:\\
\;\;\;\;\frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}} + \frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+77}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x.re, \frac{1}{-\mathsf{fma}\left(\frac{y.im}{y.re}, y.im, y.re\right)}, \frac{x.im}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -9.0000000000000005e-43Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in y.re around 0
Applied rewrites58.2%
if -9.0000000000000005e-43 < y.im < 8.6e-159Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
if 8.6e-159 < y.im < 5.00000000000000004e77Initial program 62.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.3
Applied rewrites62.3%
if 5.00000000000000004e77 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
lift-+.f64N/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6488.3
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6491.8
lift-+.f64N/A
+-commutativeN/A
Applied rewrites95.1%
Taylor expanded in y.re around 0
Applied rewrites61.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re (+ y.re (/ (* y.im y.im) y.re))) (/ x.im y.im))))
(if (<= y.im -9e-43)
t_0
(if (<= y.im 8.6e-159)
(/ (+ x.re (/ (* x.im y.im) y.re)) y.re)
(if (<= y.im 5e+77)
(/ (fma y.im x.im (* y.re x.re)) (fma y.im y.im (* y.re y.re)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -9e-43) {
tmp = t_0;
} else if (y_46_im <= 8.6e-159) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5e+77) {
tmp = fma(y_46_im, x_46_im, (y_46_re * x_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_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(Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_46_im) / y_46_re))) + Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_im <= -9e-43) tmp = t_0; elseif (y_46_im <= 8.6e-159) tmp = Float64(Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 5e+77) tmp = Float64(fma(y_46_im, x_46_im, Float64(y_46_re * x_46_re)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_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[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9e-43], t$95$0, If[LessEqual[y$46$im, 8.6e-159], N[(N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5e+77], N[(N[(y$46$im * x$46$im + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}} + \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+77}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -9.0000000000000005e-43 or 5.00000000000000004e77 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in y.re around 0
Applied rewrites58.2%
if -9.0000000000000005e-43 < y.im < 8.6e-159Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
if 8.6e-159 < y.im < 5.00000000000000004e77Initial program 62.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.3
Applied rewrites62.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re (+ y.re (/ (* y.im y.im) y.re))) (/ x.im y.im))))
(if (<= y.im -9e-43)
t_0
(if (<= y.im 4.2e+44) (/ (+ x.re (/ (* x.im y.im) y.re)) y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -9e-43) {
tmp = t_0;
} else if (y_46_im <= 4.2e+44) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_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 = (x_46re / (y_46re + ((y_46im * y_46im) / y_46re))) + (x_46im / y_46im)
if (y_46im <= (-9d-43)) then
tmp = t_0
else if (y_46im <= 4.2d+44) then
tmp = (x_46re + ((x_46im * y_46im) / y_46re)) / y_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 = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -9e-43) {
tmp = t_0;
} else if (y_46_im <= 4.2e+44) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im) tmp = 0 if y_46_im <= -9e-43: tmp = t_0 elif y_46_im <= 4.2e+44: tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_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(Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_46_im) / y_46_re))) + Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_im <= -9e-43) tmp = t_0; elseif (y_46_im <= 4.2e+44) tmp = Float64(Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re)) / y_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 = (x_46_re / (y_46_re + ((y_46_im * y_46_im) / y_46_re))) + (x_46_im / y_46_im); tmp = 0.0; if (y_46_im <= -9e-43) tmp = t_0; elseif (y_46_im <= 4.2e+44) tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_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[(N[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9e-43], t$95$0, If[LessEqual[y$46$im, 4.2e+44], N[(N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}} + \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -9.0000000000000005e-43 or 4.19999999999999974e44 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in y.re around 0
Applied rewrites58.2%
if -9.0000000000000005e-43 < y.im < 4.19999999999999974e44Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.6e+42)
(/ (+ x.im (/ (* x.re y.re) y.im)) y.im)
(if (<= y.im 1.7e+82)
(/ (fma (/ y.im y.re) x.im x.re) y.re)
(/ x.im (fma (/ y.re y.im) y.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.6e+42) {
tmp = (x_46_im + ((x_46_re * y_46_re) / y_46_im)) / y_46_im;
} else if (y_46_im <= 1.7e+82) {
tmp = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
} else {
tmp = x_46_im / fma((y_46_re / y_46_im), y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -5.6e+42) tmp = Float64(Float64(x_46_im + Float64(Float64(x_46_re * y_46_re) / y_46_im)) / y_46_im); elseif (y_46_im <= 1.7e+82) tmp = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re); else tmp = Float64(x_46_im / fma(Float64(y_46_re / y_46_im), y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5.6e+42], N[(N[(x$46$im + N[(N[(x$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.7e+82], N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], N[(x$46$im / N[(N[(y$46$re / y$46$im), $MachinePrecision] * y$46$re + y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{x.im + \frac{x.re \cdot y.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{fma}\left(\frac{y.re}{y.im}, y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -5.5999999999999999e42Initial program 62.3%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6451.7
Applied rewrites51.7%
if -5.5999999999999999e42 < y.im < 1.69999999999999997e82Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6455.2
Applied rewrites55.2%
if 1.69999999999999997e82 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in x.re around 0
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-pow.f6453.6
Applied rewrites53.6%
Applied rewrites56.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.im (fma (/ y.re y.im) y.re y.im))))
(if (<= y.im -1.05e+26)
t_0
(if (<= y.im 1.7e+82) (/ (fma (/ y.im y.re) x.im x.re) y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im / fma((y_46_re / y_46_im), y_46_re, y_46_im);
double tmp;
if (y_46_im <= -1.05e+26) {
tmp = t_0;
} else if (y_46_im <= 1.7e+82) {
tmp = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_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(x_46_im / fma(Float64(y_46_re / y_46_im), y_46_re, y_46_im)) tmp = 0.0 if (y_46_im <= -1.05e+26) tmp = t_0; elseif (y_46_im <= 1.7e+82) tmp = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_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[(x$46$im / N[(N[(y$46$re / y$46$im), $MachinePrecision] * y$46$re + y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.05e+26], t$95$0, If[LessEqual[y$46$im, 1.7e+82], N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\mathsf{fma}\left(\frac{y.re}{y.im}, y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -1.05 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.05e26 or 1.69999999999999997e82 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in x.re around 0
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-pow.f6453.6
Applied rewrites53.6%
Applied rewrites56.2%
if -1.05e26 < y.im < 1.69999999999999997e82Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6455.2
Applied rewrites55.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.im (fma (/ y.re y.im) y.re y.im))))
(if (<= y.im -1.05e+26)
t_0
(if (<= y.im 1.7e+82) (/ (fma y.im (/ x.im y.re) x.re) y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im / fma((y_46_re / y_46_im), y_46_re, y_46_im);
double tmp;
if (y_46_im <= -1.05e+26) {
tmp = t_0;
} else if (y_46_im <= 1.7e+82) {
tmp = fma(y_46_im, (x_46_im / y_46_re), x_46_re) / y_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(x_46_im / fma(Float64(y_46_re / y_46_im), y_46_re, y_46_im)) tmp = 0.0 if (y_46_im <= -1.05e+26) tmp = t_0; elseif (y_46_im <= 1.7e+82) tmp = Float64(fma(y_46_im, Float64(x_46_im / y_46_re), x_46_re) / y_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[(x$46$im / N[(N[(y$46$re / y$46$im), $MachinePrecision] * y$46$re + y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.05e+26], t$95$0, If[LessEqual[y$46$im, 1.7e+82], N[(N[(y$46$im * N[(x$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\mathsf{fma}\left(\frac{y.re}{y.im}, y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -1.05 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.im, \frac{x.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.05e26 or 1.69999999999999997e82 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in x.re around 0
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-pow.f6453.6
Applied rewrites53.6%
Applied rewrites56.2%
if -1.05e26 < y.im < 1.69999999999999997e82Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6453.3
Applied rewrites53.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6454.4
Applied rewrites54.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (/ x.im (fma (/ y.re y.im) y.re y.im)))) (if (<= y.im -9e+24) t_0 (if (<= y.im 1.75e-141) (/ x.re y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im / fma((y_46_re / y_46_im), y_46_re, y_46_im);
double tmp;
if (y_46_im <= -9e+24) {
tmp = t_0;
} else if (y_46_im <= 1.75e-141) {
tmp = x_46_re / y_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(x_46_im / fma(Float64(y_46_re / y_46_im), y_46_re, y_46_im)) tmp = 0.0 if (y_46_im <= -9e+24) tmp = t_0; elseif (y_46_im <= 1.75e-141) tmp = Float64(x_46_re / y_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[(x$46$im / N[(N[(y$46$re / y$46$im), $MachinePrecision] * y$46$re + y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9e+24], t$95$0, If[LessEqual[y$46$im, 1.75e-141], N[(x$46$re / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\mathsf{fma}\left(\frac{y.re}{y.im}, y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.75 \cdot 10^{-141}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -9.00000000000000039e24 or 1.7500000000000001e-141 < y.im Initial program 62.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.4
Applied rewrites62.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lower-+.f64N/A
Applied rewrites88.3%
Taylor expanded in x.re around 0
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-pow.f6453.6
Applied rewrites53.6%
Applied rewrites56.2%
if -9.00000000000000039e24 < y.im < 1.7500000000000001e-141Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f6443.7
Applied rewrites43.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -1.45e+41) (/ x.im y.im) (if (<= y.im 1.7e+82) (/ x.re y.re) (/ x.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.45e+41) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.7e+82) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
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 (y_46im <= (-1.45d+41)) then
tmp = x_46im / y_46im
else if (y_46im <= 1.7d+82) then
tmp = x_46re / y_46re
else
tmp = x_46im / y_46im
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 (y_46_im <= -1.45e+41) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.7e+82) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -1.45e+41: tmp = x_46_im / y_46_im elif y_46_im <= 1.7e+82: tmp = x_46_re / y_46_re else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -1.45e+41) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1.7e+82) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -1.45e+41) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1.7e+82) tmp = x_46_re / y_46_re; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.45e+41], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.7e+82], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.45 \cdot 10^{+41}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.44999999999999994e41 or 1.69999999999999997e82 < y.im Initial program 62.3%
Taylor expanded in y.re around 0
lower-/.f6442.0
Applied rewrites42.0%
if -1.44999999999999994e41 < y.im < 1.69999999999999997e82Initial program 62.3%
Taylor expanded in y.re around inf
lower-/.f6443.7
Applied rewrites43.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
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 = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 62.3%
Taylor expanded in y.re around 0
lower-/.f6442.0
Applied rewrites42.0%
herbie shell --seed 2025156
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))