
(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]
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
Herbie found 9 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]
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/
(+ (* x.re y.re) (* x.im y.im))
(+ (* y.re y.re) (* y.im y.im)))))
(if (<=
y.im
-195000000000000005714904619635812128629974360554371271422985808308600832)
(/ (+ x.im (* (/ y.re y.im) x.re)) y.im)
(if (<= y.im -85000000000)
(/ (+ x.re (/ (* x.im y.im) y.re)) y.re)
(if (<=
y.im
-8593944123082061/226156424291633194186662080095093570025917938800079226639565593765455331328)
t_0
(if (<=
y.im
664824119159705/63316582777114760719488645381029680648993625369910231018000142359781689627272157995600998671678219517337003885060131670873949448782528309751691815706084650986651333670066978816)
(/ (+ x.re (* (/ y.im y.re) x.im)) y.re)
(if (<=
y.im
339999999999999980010654200175664637847404227877287010028207688682110504545216375346111184896)
t_0
(/ (+ x.im (* y.re (/ x.re y.im))) y.im))))))))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) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im;
} else if (y_46_im <= -85000000000.0) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= -3.8e-59) {
tmp = t_0;
} else if (y_46_im <= 1.05e-161) {
tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re;
} else if (y_46_im <= 3.4e+92) {
tmp = t_0;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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) :: t_0
real(8) :: tmp
t_0 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-1.95d+71)) then
tmp = (x_46im + ((y_46re / y_46im) * x_46re)) / y_46im
else if (y_46im <= (-85000000000.0d0)) then
tmp = (x_46re + ((x_46im * y_46im) / y_46re)) / y_46re
else if (y_46im <= (-3.8d-59)) then
tmp = t_0
else if (y_46im <= 1.05d-161) then
tmp = (x_46re + ((y_46im / y_46re) * x_46im)) / y_46re
else if (y_46im <= 3.4d+92) then
tmp = t_0
else
tmp = (x_46im + (y_46re * (x_46re / y_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 t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im;
} else if (y_46_im <= -85000000000.0) {
tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= -3.8e-59) {
tmp = t_0;
} else if (y_46_im <= 1.05e-161) {
tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re;
} else if (y_46_im <= 3.4e+92) {
tmp = t_0;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.95e+71: tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im elif y_46_im <= -85000000000.0: tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re elif y_46_im <= -3.8e-59: tmp = t_0 elif y_46_im <= 1.05e-161: tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re elif y_46_im <= 3.4e+92: tmp = t_0 else: tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) tmp = 0.0 if (y_46_im <= -1.95e+71) tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re / y_46_im) * x_46_re)) / y_46_im); elseif (y_46_im <= -85000000000.0) 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.8e-59) tmp = t_0; elseif (y_46_im <= 1.05e-161) tmp = Float64(Float64(x_46_re + Float64(Float64(y_46_im / y_46_re) * x_46_im)) / y_46_re); elseif (y_46_im <= 3.4e+92) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_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) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.95e+71) tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im; elseif (y_46_im <= -85000000000.0) tmp = (x_46_re + ((x_46_im * y_46_im) / y_46_re)) / y_46_re; elseif (y_46_im <= -3.8e-59) tmp = t_0; elseif (y_46_im <= 1.05e-161) tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re; elseif (y_46_im <= 3.4e+92) tmp = t_0; else tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(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]}, If[LessEqual[y$46$im, -195000000000000005714904619635812128629974360554371271422985808308600832], N[(N[(x$46$im + N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -85000000000], 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, -8593944123082061/226156424291633194186662080095093570025917938800079226639565593765455331328], t$95$0, If[LessEqual[y$46$im, 664824119159705/63316582777114760719488645381029680648993625369910231018000142359781689627272157995600998671678219517337003885060131670873949448782528309751691815706084650986651333670066978816], N[(N[(x$46$re + N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 339999999999999980010654200175664637847404227877287010028207688682110504545216375346111184896], t$95$0, N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -195000000000000005714904619635812128629974360554371271422985808308600832:\\
\;\;\;\;\frac{x.im + \frac{y.re}{y.im} \cdot x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -85000000000:\\
\;\;\;\;\frac{x.re + \frac{x.im \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq \frac{-8593944123082061}{226156424291633194186662080095093570025917938800079226639565593765455331328}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq \frac{664824119159705}{63316582777114760719488645381029680648993625369910231018000142359781689627272157995600998671678219517337003885060131670873949448782528309751691815706084650986651333670066978816}:\\
\;\;\;\;\frac{x.re + \frac{y.im}{y.re} \cdot x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 339999999999999980010654200175664637847404227877287010028207688682110504545216375346111184896:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\end{array}
if y.im < -1.9500000000000001e71Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.3%
Applied rewrites54.3%
if -1.9500000000000001e71 < y.im < -8.5e10Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.6%
Applied rewrites52.6%
if -8.5e10 < y.im < -3.7999999999999998e-59 or 1.05e-161 < y.im < 3.3999999999999998e92Initial program 61.4%
if -3.7999999999999998e-59 < y.im < 1.05e-161Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.6%
Applied rewrites52.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.5%
Applied rewrites54.5%
if 3.3999999999999998e92 < y.im Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6453.5%
Applied rewrites53.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.im
-195000000000000005714904619635812128629974360554371271422985808308600832)
(/ (+ x.im (* (/ y.re y.im) x.re)) y.im)
(if (<= y.im 39999999999999998543585179860992)
(/ (+ x.re (* (/ y.im y.re) x.im)) y.re)
(/ (+ x.im (* y.re (/ x.re y.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.95e+71) {
tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im;
} else if (y_46_im <= 4e+31) {
tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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.95d+71)) then
tmp = (x_46im + ((y_46re / y_46im) * x_46re)) / y_46im
else if (y_46im <= 4d+31) then
tmp = (x_46re + ((y_46im / y_46re) * x_46im)) / y_46re
else
tmp = (x_46im + (y_46re * (x_46re / y_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.95e+71) {
tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im;
} else if (y_46_im <= 4e+31) {
tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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.95e+71: tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im elif y_46_im <= 4e+31: tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re else: tmp = (x_46_im + (y_46_re * (x_46_re / y_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.95e+71) tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re / y_46_im) * x_46_re)) / y_46_im); elseif (y_46_im <= 4e+31) tmp = Float64(Float64(x_46_re + Float64(Float64(y_46_im / y_46_re) * x_46_im)) / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_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.95e+71) tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im; elseif (y_46_im <= 4e+31) tmp = (x_46_re + ((y_46_im / y_46_re) * x_46_im)) / y_46_re; else tmp = (x_46_im + (y_46_re * (x_46_re / y_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, -195000000000000005714904619635812128629974360554371271422985808308600832], N[(N[(x$46$im + N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 39999999999999998543585179860992], N[(N[(x$46$re + N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y.im \leq -195000000000000005714904619635812128629974360554371271422985808308600832:\\
\;\;\;\;\frac{x.im + \frac{y.re}{y.im} \cdot x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 39999999999999998543585179860992:\\
\;\;\;\;\frac{x.re + \frac{y.im}{y.re} \cdot x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\end{array}
if y.im < -1.9500000000000001e71Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.3%
Applied rewrites54.3%
if -1.9500000000000001e71 < y.im < 3.9999999999999999e31Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.6%
Applied rewrites52.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.5%
Applied rewrites54.5%
if 3.9999999999999999e31 < y.im Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6453.5%
Applied rewrites53.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.re
-650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784)
(/ x.re y.re)
(if (<=
y.re
-6941760285187145/2722258935367507707706996859454145691648)
(/ (+ (* y.im x.im) (* y.re x.re)) (* y.re y.re))
(if (<= y.re 289999999999999988258055890934410369826816)
(/ (+ x.im (/ (* x.re y.re) y.im)) y.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.5e+185) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -2.55e-24) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re);
} else if (y_46_re <= 2.9e+41) {
tmp = (x_46_im + ((x_46_re * y_46_re) / y_46_im)) / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-6.5d+185)) then
tmp = x_46re / y_46re
else if (y_46re <= (-2.55d-24)) then
tmp = ((y_46im * x_46im) + (y_46re * x_46re)) / (y_46re * y_46re)
else if (y_46re <= 2.9d+41) then
tmp = (x_46im + ((x_46re * y_46re) / y_46im)) / y_46im
else
tmp = x_46re / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -6.5e+185) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -2.55e-24) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re);
} else if (y_46_re <= 2.9e+41) {
tmp = (x_46_im + ((x_46_re * y_46_re) / y_46_im)) / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -6.5e+185: tmp = x_46_re / y_46_re elif y_46_re <= -2.55e-24: tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re) elif y_46_re <= 2.9e+41: tmp = (x_46_im + ((x_46_re * y_46_re) / y_46_im)) / y_46_im else: tmp = 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.5e+185) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -2.55e-24) tmp = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(y_46_re * x_46_re)) / Float64(y_46_re * y_46_re)); elseif (y_46_re <= 2.9e+41) tmp = Float64(Float64(x_46_im + Float64(Float64(x_46_re * y_46_re) / y_46_im)) / y_46_im); else tmp = Float64(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) tmp = 0.0; if (y_46_re <= -6.5e+185) tmp = x_46_re / y_46_re; elseif (y_46_re <= -2.55e-24) tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re); elseif (y_46_re <= 2.9e+41) tmp = (x_46_im + ((x_46_re * y_46_re) / y_46_im)) / y_46_im; else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -6941760285187145/2722258935367507707706996859454145691648], N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 289999999999999988258055890934410369826816], N[(N[(x$46$im + N[(N[(x$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y.re \leq -650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq \frac{-6941760285187145}{2722258935367507707706996859454145691648}:\\
\;\;\;\;\frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re}\\
\mathbf{elif}\;y.re \leq 289999999999999988258055890934410369826816:\\
\;\;\;\;\frac{x.im + \frac{x.re \cdot y.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
if y.re < -6.5000000000000002e185 or 2.8999999999999999e41 < y.re Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
if -6.5000000000000002e185 < y.re < -2.5500000000000001e-24Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.6%
Applied rewrites52.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lift-*.f64N/A
lift-+.f64N/A
associate-/l/N/A
lift-*.f64N/A
lower-/.f6435.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f6435.7%
Applied rewrites35.7%
if -2.5500000000000001e-24 < y.re < 2.8999999999999999e41Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.re
-650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784)
(/ x.re y.re)
(if (<=
y.re
-6941760285187145/2722258935367507707706996859454145691648)
(/ (+ (* y.im x.im) (* y.re x.re)) (* y.re y.re))
(if (<= y.re 289999999999999988258055890934410369826816)
(/ (+ x.im (* (/ y.re y.im) x.re)) y.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.5e+185) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -2.55e-24) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re);
} else if (y_46_re <= 2.9e+41) {
tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-6.5d+185)) then
tmp = x_46re / y_46re
else if (y_46re <= (-2.55d-24)) then
tmp = ((y_46im * x_46im) + (y_46re * x_46re)) / (y_46re * y_46re)
else if (y_46re <= 2.9d+41) then
tmp = (x_46im + ((y_46re / y_46im) * x_46re)) / y_46im
else
tmp = x_46re / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -6.5e+185) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -2.55e-24) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re);
} else if (y_46_re <= 2.9e+41) {
tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -6.5e+185: tmp = x_46_re / y_46_re elif y_46_re <= -2.55e-24: tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re) elif y_46_re <= 2.9e+41: tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im else: tmp = 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.5e+185) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -2.55e-24) tmp = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(y_46_re * x_46_re)) / Float64(y_46_re * y_46_re)); elseif (y_46_re <= 2.9e+41) tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re / y_46_im) * x_46_re)) / y_46_im); else tmp = Float64(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) tmp = 0.0; if (y_46_re <= -6.5e+185) tmp = x_46_re / y_46_re; elseif (y_46_re <= -2.55e-24) tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re); elseif (y_46_re <= 2.9e+41) tmp = (x_46_im + ((y_46_re / y_46_im) * x_46_re)) / y_46_im; else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -6941760285187145/2722258935367507707706996859454145691648], N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 289999999999999988258055890934410369826816], N[(N[(x$46$im + N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y.re \leq -650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq \frac{-6941760285187145}{2722258935367507707706996859454145691648}:\\
\;\;\;\;\frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re}\\
\mathbf{elif}\;y.re \leq 289999999999999988258055890934410369826816:\\
\;\;\;\;\frac{x.im + \frac{y.re}{y.im} \cdot x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
if y.re < -6.5000000000000002e185 or 2.8999999999999999e41 < y.re Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
if -6.5000000000000002e185 < y.re < -2.5500000000000001e-24Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.6%
Applied rewrites52.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lift-*.f64N/A
lift-+.f64N/A
associate-/l/N/A
lift-*.f64N/A
lower-/.f6435.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f6435.7%
Applied rewrites35.7%
if -2.5500000000000001e-24 < y.re < 2.8999999999999999e41Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.3%
Applied rewrites54.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.re
-650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784)
(/ x.re y.re)
(if (<=
y.re
-6941760285187145/2722258935367507707706996859454145691648)
(/ (+ (* y.im x.im) (* y.re x.re)) (* y.re y.re))
(if (<= y.re 289999999999999988258055890934410369826816)
(/ (+ x.im (* y.re (/ x.re y.im))) y.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.5e+185) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -2.55e-24) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re);
} else if (y_46_re <= 2.9e+41) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-6.5d+185)) then
tmp = x_46re / y_46re
else if (y_46re <= (-2.55d-24)) then
tmp = ((y_46im * x_46im) + (y_46re * x_46re)) / (y_46re * y_46re)
else if (y_46re <= 2.9d+41) then
tmp = (x_46im + (y_46re * (x_46re / y_46im))) / y_46im
else
tmp = x_46re / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -6.5e+185) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -2.55e-24) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re);
} else if (y_46_re <= 2.9e+41) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -6.5e+185: tmp = x_46_re / y_46_re elif y_46_re <= -2.55e-24: tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re) elif y_46_re <= 2.9e+41: tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im else: tmp = 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.5e+185) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -2.55e-24) tmp = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(y_46_re * x_46_re)) / Float64(y_46_re * y_46_re)); elseif (y_46_re <= 2.9e+41) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); else tmp = Float64(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) tmp = 0.0; if (y_46_re <= -6.5e+185) tmp = x_46_re / y_46_re; elseif (y_46_re <= -2.55e-24) tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_re * y_46_re); elseif (y_46_re <= 2.9e+41) tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -6941760285187145/2722258935367507707706996859454145691648], N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 289999999999999988258055890934410369826816], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y.re \leq -650000000000000016942778108262245679152070791619598201179330640653864922620265123488504739108948206990105433825829362209021281589289406368151958646346392448584274767173853546041818742784:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq \frac{-6941760285187145}{2722258935367507707706996859454145691648}:\\
\;\;\;\;\frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re}\\
\mathbf{elif}\;y.re \leq 289999999999999988258055890934410369826816:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
if y.re < -6.5000000000000002e185 or 2.8999999999999999e41 < y.re Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
if -6.5000000000000002e185 < y.re < -2.5500000000000001e-24Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.6%
Applied rewrites52.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
lift-*.f64N/A
lift-+.f64N/A
associate-/l/N/A
lift-*.f64N/A
lower-/.f6435.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f6435.7%
Applied rewrites35.7%
if -2.5500000000000001e-24 < y.re < 2.8999999999999999e41Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6453.5%
Applied rewrites53.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.im
-116000000000000005191169734821008188981370141870044122179692768472954571804161081344)
(/ x.im y.im)
(if (<=
y.im
1099049231272839/11692013098647223345629478661730264157247460343808)
(/ x.re y.re)
(if (<=
y.im
229999999999999998397569380430793254499668963870155256385109504983250463018868254725191499776)
(/ (* x.im y.im) (+ (* y.re y.re) (* y.im y.im)))
(/ 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.16e+83) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 9.4e-35) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 2.3e+92) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} 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.16d+83)) then
tmp = x_46im / y_46im
else if (y_46im <= 9.4d-35) then
tmp = x_46re / y_46re
else if (y_46im <= 2.3d+92) then
tmp = (x_46im * y_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
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.16e+83) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 9.4e-35) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 2.3e+92) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} 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.16e+83: tmp = x_46_im / y_46_im elif y_46_im <= 9.4e-35: tmp = x_46_re / y_46_re elif y_46_im <= 2.3e+92: tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) 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.16e+83) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 9.4e-35) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= 2.3e+92) tmp = Float64(Float64(x_46_im * y_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); 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.16e+83) tmp = x_46_im / y_46_im; elseif (y_46_im <= 9.4e-35) tmp = x_46_re / y_46_re; elseif (y_46_im <= 2.3e+92) tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); 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, -116000000000000005191169734821008188981370141870044122179692768472954571804161081344], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1099049231272839/11692013098647223345629478661730264157247460343808], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 229999999999999998397569380430793254499668963870155256385109504983250463018868254725191499776], N[(N[(x$46$im * y$46$im), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y.im \leq -116000000000000005191169734821008188981370141870044122179692768472954571804161081344:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq \frac{1099049231272839}{11692013098647223345629478661730264157247460343808}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 229999999999999998397569380430793254499668963870155256385109504983250463018868254725191499776:\\
\;\;\;\;\frac{x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
if y.im < -1.1600000000000001e83 or 2.3e92 < y.im Initial program 61.4%
Taylor expanded in y.re around 0
lower-/.f6442.4%
Applied rewrites42.4%
if -1.1600000000000001e83 < y.im < 9.4e-35Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
if 9.4e-35 < y.im < 2.3e92Initial program 61.4%
Taylor expanded in x.re around 0
lower-*.f6440.0%
Applied rewrites40.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.im
-116000000000000005191169734821008188981370141870044122179692768472954571804161081344)
(/ x.im y.im)
(if (<=
y.im
1099049231272839/11692013098647223345629478661730264157247460343808)
(/ x.re y.re)
(if (<=
y.im
450000000000000007001737258260079360920690628614477645016396761193875201524140066469243425461771351454292826390528)
(/ (+ (* y.im x.im) (* y.re x.re)) (* y.im y.im))
(/ 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.16e+83) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 9.4e-35) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 4.5e+113) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_im * y_46_im);
} 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.16d+83)) then
tmp = x_46im / y_46im
else if (y_46im <= 9.4d-35) then
tmp = x_46re / y_46re
else if (y_46im <= 4.5d+113) then
tmp = ((y_46im * x_46im) + (y_46re * x_46re)) / (y_46im * y_46im)
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.16e+83) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 9.4e-35) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 4.5e+113) {
tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_im * y_46_im);
} 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.16e+83: tmp = x_46_im / y_46_im elif y_46_im <= 9.4e-35: tmp = x_46_re / y_46_re elif y_46_im <= 4.5e+113: tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_im * y_46_im) 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.16e+83) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 9.4e-35) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= 4.5e+113) tmp = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(y_46_re * x_46_re)) / Float64(y_46_im * y_46_im)); 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.16e+83) tmp = x_46_im / y_46_im; elseif (y_46_im <= 9.4e-35) tmp = x_46_re / y_46_re; elseif (y_46_im <= 4.5e+113) tmp = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / (y_46_im * y_46_im); 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, -116000000000000005191169734821008188981370141870044122179692768472954571804161081344], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1099049231272839/11692013098647223345629478661730264157247460343808], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 450000000000000007001737258260079360920690628614477645016396761193875201524140066469243425461771351454292826390528], N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;y.im \leq -116000000000000005191169734821008188981370141870044122179692768472954571804161081344:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq \frac{1099049231272839}{11692013098647223345629478661730264157247460343808}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 450000000000000007001737258260079360920690628614477645016396761193875201524140066469243425461771351454292826390528:\\
\;\;\;\;\frac{y.im \cdot x.im + y.re \cdot x.re}{y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
if y.im < -1.1600000000000001e83 or 4.5000000000000001e113 < y.im Initial program 61.4%
Taylor expanded in y.re around 0
lower-/.f6442.4%
Applied rewrites42.4%
if -1.1600000000000001e83 < y.im < 9.4e-35Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
if 9.4e-35 < y.im < 4.5000000000000001e113Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f6452.0%
Applied rewrites52.0%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l/N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.8%
Applied rewrites35.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.im
-116000000000000005191169734821008188981370141870044122179692768472954571804161081344)
(/ x.im y.im)
(if (<=
y.im
1099049231272839/11692013098647223345629478661730264157247460343808)
(/ 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.16e+83) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 9.4e-35) {
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.16d+83)) then
tmp = x_46im / y_46im
else if (y_46im <= 9.4d-35) 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.16e+83) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 9.4e-35) {
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.16e+83: tmp = x_46_im / y_46_im elif y_46_im <= 9.4e-35: 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.16e+83) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 9.4e-35) 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.16e+83) tmp = x_46_im / y_46_im; elseif (y_46_im <= 9.4e-35) 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, -116000000000000005191169734821008188981370141870044122179692768472954571804161081344], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1099049231272839/11692013098647223345629478661730264157247460343808], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y.im \leq -116000000000000005191169734821008188981370141870044122179692768472954571804161081344:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq \frac{1099049231272839}{11692013098647223345629478661730264157247460343808}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
if y.im < -1.1600000000000001e83 or 9.4e-35 < y.im Initial program 61.4%
Taylor expanded in y.re around 0
lower-/.f6442.4%
Applied rewrites42.4%
if -1.1600000000000001e83 < y.im < 9.4e-35Initial program 61.4%
Taylor expanded in y.re around inf
lower-/.f6442.4%
Applied rewrites42.4%
(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]
\frac{x.im}{y.im}
Initial program 61.4%
Taylor expanded in y.re around 0
lower-/.f6442.4%
Applied rewrites42.4%
herbie shell --seed 2025285 -o generate:evaluate
(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))))