
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re 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_im * y_46_re) - (x_46_re * 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_46im * y_46re) - (x_46re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - Float64(x_46_re * 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_im * y_46_re) - (x_46_re * 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$im * y$46$re), $MachinePrecision] - N[(x$46$re * 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.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re 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_im * y_46_re) - (x_46_re * 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_46im * y_46re) - (x_46re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - Float64(x_46_re * 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_im * y_46_re) - (x_46_re * 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$im * y$46$re), $MachinePrecision] - N[(x$46$re * 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.im \cdot y.re - x.re \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.im y.re) (* x.re y.im))
(+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (- (- x.re) (* (- y.re) (/ x.im y.im))) y.im)))
(if (<=
y.im
-1549999999999999942316721355256651167768960321267789649373183178612670464)
t_1
(if (<=
y.im
-8593944123082061/226156424291633194186662080095093570025917938800079226639565593765455331328)
t_0
(if (<=
y.im
3630826122770869/1037378892220248239628101965922790287753111558060609224998914332422663202853227036599926762236775948572049471652825197295598787768852943826971718708528490921765295450850377380921344)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<=
y.im
339999999999999980010654200175664637847404227877287010028207688682110504545216375346111184896)
t_0
t_1))))))double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (-x_46_re - (-y_46_re * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -1.55e+72) {
tmp = t_1;
} else if (y_46_im <= -3.8e-59) {
tmp = t_0;
} else if (y_46_im <= 3.5e-165) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 3.4e+92) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (-x_46re - (-y_46re * (x_46im / y_46im))) / y_46im
if (y_46im <= (-1.55d+72)) then
tmp = t_1
else if (y_46im <= (-3.8d-59)) then
tmp = t_0
else if (y_46im <= 3.5d-165) then
tmp = (x_46im - (x_46re / (y_46re / y_46im))) / y_46re
else if (y_46im <= 3.4d+92) then
tmp = t_0
else
tmp = t_1
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_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (-x_46_re - (-y_46_re * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -1.55e+72) {
tmp = t_1;
} else if (y_46_im <= -3.8e-59) {
tmp = t_0;
} else if (y_46_im <= 3.5e-165) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 3.4e+92) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (-x_46_re - (-y_46_re * (x_46_im / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -1.55e+72: tmp = t_1 elif y_46_im <= -3.8e-59: tmp = t_0 elif y_46_im <= 3.5e-165: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re elif y_46_im <= 3.4e+92: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(Float64(-x_46_re) - Float64(Float64(-y_46_re) * Float64(x_46_im / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -1.55e+72) tmp = t_1; elseif (y_46_im <= -3.8e-59) tmp = t_0; elseif (y_46_im <= 3.5e-165) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_im <= 3.4e+92) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (-x_46_re - (-y_46_re * (x_46_im / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -1.55e+72) tmp = t_1; elseif (y_46_im <= -3.8e-59) tmp = t_0; elseif (y_46_im <= 3.5e-165) tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; elseif (y_46_im <= 3.4e+92) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[((-x$46$re) - N[((-y$46$re) * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1549999999999999942316721355256651167768960321267789649373183178612670464], t$95$1, If[LessEqual[y$46$im, -8593944123082061/226156424291633194186662080095093570025917938800079226639565593765455331328], t$95$0, If[LessEqual[y$46$im, 3630826122770869/1037378892220248239628101965922790287753111558060609224998914332422663202853227036599926762236775948572049471652825197295598787768852943826971718708528490921765295450850377380921344], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 339999999999999980010654200175664637847404227877287010028207688682110504545216375346111184896], t$95$0, t$95$1]]]]]]
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{\left(-x.re\right) - \left(-y.re\right) \cdot \frac{x.im}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -1549999999999999942316721355256651167768960321267789649373183178612670464:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq \frac{-8593944123082061}{226156424291633194186662080095093570025917938800079226639565593765455331328}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq \frac{3630826122770869}{1037378892220248239628101965922790287753111558060609224998914332422663202853227036599926762236775948572049471652825197295598787768852943826971718708528490921765295450850377380921344}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 339999999999999980010654200175664637847404227877287010028207688682110504545216375346111184896:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y.im < -1.5499999999999999e72 or 3.3999999999999998e92 < y.im Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.4%
Applied rewrites52.4%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6453.6%
Applied rewrites53.6%
if -1.5499999999999999e72 < y.im < -3.7999999999999998e-59 or 3.5000000000000002e-165 < y.im < 3.3999999999999998e92Initial program 61.5%
if -3.7999999999999998e-59 < y.im < 3.5000000000000002e-165Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6454.5%
Applied rewrites54.5%
lift-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6454.5%
Applied rewrites54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (- x.re) (* (- y.re) (/ x.im y.im))) y.im)))
(if (<=
y.im
-2100000000000000136991060992552505181349115988754604270400850104669962240)
t_0
(if (<=
y.im
-498150793720287/3213876088517980551083924184682325205044405987565585670602752)
(/ (* -1 (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 7999999999999999517673330972825428688896)
(/ (- x.im (/ x.re (/ y.re y.im))) 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 * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+72) {
tmp = t_0;
} else if (y_46_im <= -1.55e-46) {
tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 8e+39) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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 * (x_46im / y_46im))) / y_46im
if (y_46im <= (-2.1d+72)) then
tmp = t_0
else if (y_46im <= (-1.55d-46)) then
tmp = ((-1.0d0) * (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 8d+39) then
tmp = (x_46im - (x_46re / (y_46re / y_46im))) / 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 * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+72) {
tmp = t_0;
} else if (y_46_im <= -1.55e-46) {
tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 8e+39) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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 * (x_46_im / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -2.1e+72: tmp = t_0 elif y_46_im <= -1.55e-46: tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 8e+39: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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(Float64(-x_46_re) - Float64(Float64(-y_46_re) * Float64(x_46_im / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -2.1e+72) tmp = t_0; elseif (y_46_im <= -1.55e-46) tmp = Float64(Float64(-1.0 * Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 8e+39) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / 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 * (x_46_im / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -2.1e+72) tmp = t_0; elseif (y_46_im <= -1.55e-46) tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 8e+39) tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2100000000000000136991060992552505181349115988754604270400850104669962240], t$95$0, If[LessEqual[y$46$im, -498150793720287/3213876088517980551083924184682325205044405987565585670602752], N[(N[(-1 * N[(x$46$re * 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, 7999999999999999517673330972825428688896], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \frac{\left(-x.re\right) - \left(-y.re\right) \cdot \frac{x.im}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -2100000000000000136991060992552505181349115988754604270400850104669962240:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq \frac{-498150793720287}{3213876088517980551083924184682325205044405987565585670602752}:\\
\;\;\;\;\frac{-1 \cdot \left(x.re \cdot y.im\right)}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 7999999999999999517673330972825428688896:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.im < -2.1000000000000001e72 or 7.9999999999999995e39 < y.im Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.4%
Applied rewrites52.4%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6453.6%
Applied rewrites53.6%
if -2.1000000000000001e72 < y.im < -1.55e-46Initial program 61.5%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-*.f6439.6%
Applied rewrites39.6%
if -1.55e-46 < y.im < 7.9999999999999995e39Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6454.5%
Applied rewrites54.5%
lift-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6454.5%
Applied rewrites54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (- x.re) (* (- y.re) (/ x.im y.im))) y.im)))
(if (<=
y.im
-2100000000000000136991060992552505181349115988754604270400850104669962240)
t_0
(if (<=
y.im
-498150793720287/3213876088517980551083924184682325205044405987565585670602752)
(/ (* -1 (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 7999999999999999517673330972825428688896)
(/ (- x.im (* (/ y.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_re - (-y_46_re * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+72) {
tmp = t_0;
} else if (y_46_im <= -1.55e-46) {
tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 8e+39) {
tmp = (x_46_im - ((y_46_im / y_46_re) * x_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 * (x_46im / y_46im))) / y_46im
if (y_46im <= (-2.1d+72)) then
tmp = t_0
else if (y_46im <= (-1.55d-46)) then
tmp = ((-1.0d0) * (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 8d+39) then
tmp = (x_46im - ((y_46im / y_46re) * x_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 * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+72) {
tmp = t_0;
} else if (y_46_im <= -1.55e-46) {
tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 8e+39) {
tmp = (x_46_im - ((y_46_im / y_46_re) * x_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 * (x_46_im / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -2.1e+72: tmp = t_0 elif y_46_im <= -1.55e-46: tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 8e+39: tmp = (x_46_im - ((y_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(Float64(Float64(-x_46_re) - Float64(Float64(-y_46_re) * Float64(x_46_im / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -2.1e+72) tmp = t_0; elseif (y_46_im <= -1.55e-46) tmp = Float64(Float64(-1.0 * Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 8e+39) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_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 * (x_46_im / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -2.1e+72) tmp = t_0; elseif (y_46_im <= -1.55e-46) tmp = (-1.0 * (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 8e+39) tmp = (x_46_im - ((y_46_im / y_46_re) * x_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[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2100000000000000136991060992552505181349115988754604270400850104669962240], t$95$0, If[LessEqual[y$46$im, -498150793720287/3213876088517980551083924184682325205044405987565585670602752], N[(N[(-1 * N[(x$46$re * 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, 7999999999999999517673330972825428688896], N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \frac{\left(-x.re\right) - \left(-y.re\right) \cdot \frac{x.im}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -2100000000000000136991060992552505181349115988754604270400850104669962240:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq \frac{-498150793720287}{3213876088517980551083924184682325205044405987565585670602752}:\\
\;\;\;\;\frac{-1 \cdot \left(x.re \cdot y.im\right)}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 7999999999999999517673330972825428688896:\\
\;\;\;\;\frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.im < -2.1000000000000001e72 or 7.9999999999999995e39 < y.im Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.4%
Applied rewrites52.4%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6453.6%
Applied rewrites53.6%
if -2.1000000000000001e72 < y.im < -1.55e-46Initial program 61.5%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-*.f6439.6%
Applied rewrites39.6%
if -1.55e-46 < y.im < 7.9999999999999995e39Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6454.5%
Applied rewrites54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (- x.re) (* (- y.re) (/ x.im y.im))) y.im)))
(if (<=
y.im
-195000000000000005714904619635812128629974360554371271422985808308600832)
t_0
(if (<= y.im 7999999999999999517673330972825428688896)
(/ (- x.im (* (/ y.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_re - (-y_46_re * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = t_0;
} else if (y_46_im <= 8e+39) {
tmp = (x_46_im - ((y_46_im / y_46_re) * x_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 * (x_46im / y_46im))) / y_46im
if (y_46im <= (-1.95d+71)) then
tmp = t_0
else if (y_46im <= 8d+39) then
tmp = (x_46im - ((y_46im / y_46re) * x_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 * (x_46_im / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = t_0;
} else if (y_46_im <= 8e+39) {
tmp = (x_46_im - ((y_46_im / y_46_re) * x_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 * (x_46_im / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -1.95e+71: tmp = t_0 elif y_46_im <= 8e+39: tmp = (x_46_im - ((y_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(Float64(Float64(-x_46_re) - Float64(Float64(-y_46_re) * Float64(x_46_im / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -1.95e+71) tmp = t_0; elseif (y_46_im <= 8e+39) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_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 * (x_46_im / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -1.95e+71) tmp = t_0; elseif (y_46_im <= 8e+39) tmp = (x_46_im - ((y_46_im / y_46_re) * x_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[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -195000000000000005714904619635812128629974360554371271422985808308600832], t$95$0, If[LessEqual[y$46$im, 7999999999999999517673330972825428688896], N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{\left(-x.re\right) - \left(-y.re\right) \cdot \frac{x.im}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -195000000000000005714904619635812128629974360554371271422985808308600832:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 7999999999999999517673330972825428688896:\\
\;\;\;\;\frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.im < -1.9500000000000001e71 or 7.9999999999999995e39 < y.im Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.4%
Applied rewrites52.4%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6453.6%
Applied rewrites53.6%
if -1.9500000000000001e71 < y.im < 7.9999999999999995e39Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6454.5%
Applied rewrites54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* (/ x.re y.re) y.im)) y.re)))
(if (<=
y.re
-6941760285187145/2722258935367507707706996859454145691648)
t_0
(if (<= y.re 1900000000000000011885089336066048)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
t_0))))double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
double tmp;
if (y_46_re <= -2.55e-24) {
tmp = t_0;
} else if (y_46_re <= 1.9e+33) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} 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_46im - ((x_46re / y_46re) * y_46im)) / y_46re
if (y_46re <= (-2.55d-24)) then
tmp = t_0
else if (y_46re <= 1.9d+33) then
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
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_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
double tmp;
if (y_46_re <= -2.55e-24) {
tmp = t_0;
} else if (y_46_re <= 1.9e+33) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re tmp = 0 if y_46_re <= -2.55e-24: tmp = t_0 elif y_46_re <= 1.9e+33: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im 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_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re) tmp = 0.0 if (y_46_re <= -2.55e-24) tmp = t_0; elseif (y_46_re <= 1.9e+33) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); 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_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re; tmp = 0.0; if (y_46_re <= -2.55e-24) tmp = t_0; elseif (y_46_re <= 1.9e+33) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; 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$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -6941760285187145/2722258935367507707706996859454145691648], t$95$0, If[LessEqual[y$46$re, 1900000000000000011885089336066048], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
\mathbf{if}\;y.re \leq \frac{-6941760285187145}{2722258935367507707706996859454145691648}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1900000000000000011885089336066048:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.re < -2.5500000000000001e-24 or 1.9e33 < y.re Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6454.0%
Applied rewrites54.0%
if -2.5500000000000001e-24 < y.re < 1.9e33Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
Taylor expanded in y.im around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.4%
Applied rewrites52.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6452.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6452.4%
Applied rewrites52.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<=
y.im
-195000000000000005714904619635812128629974360554371271422985808308600832)
t_0
(if (<= y.im 39999999999999998543585179860992)
(/ (- x.im (* (/ y.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_re / y_46_im;
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = t_0;
} else if (y_46_im <= 4e+31) {
tmp = (x_46_im - ((y_46_im / y_46_re) * x_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_46im
if (y_46im <= (-1.95d+71)) then
tmp = t_0
else if (y_46im <= 4d+31) then
tmp = (x_46im - ((y_46im / y_46re) * x_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_im;
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = t_0;
} else if (y_46_im <= 4e+31) {
tmp = (x_46_im - ((y_46_im / y_46_re) * x_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_im tmp = 0 if y_46_im <= -1.95e+71: tmp = t_0 elif y_46_im <= 4e+31: tmp = (x_46_im - ((y_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(Float64(-x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -1.95e+71) tmp = t_0; elseif (y_46_im <= 4e+31) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_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_im; tmp = 0.0; if (y_46_im <= -1.95e+71) tmp = t_0; elseif (y_46_im <= 4e+31) tmp = (x_46_im - ((y_46_im / y_46_re) * x_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[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -195000000000000005714904619635812128629974360554371271422985808308600832], t$95$0, If[LessEqual[y$46$im, 39999999999999998543585179860992], N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -195000000000000005714904619635812128629974360554371271422985808308600832:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 39999999999999998543585179860992:\\
\;\;\;\;\frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.im < -1.9500000000000001e71 or 3.9999999999999999e31 < y.im Initial program 61.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-/.f6442.7%
Applied rewrites42.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lower-/.f6442.7%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6442.7%
Applied rewrites42.7%
if -1.9500000000000001e71 < y.im < 3.9999999999999999e31Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6454.5%
Applied rewrites54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<=
y.im
-195000000000000005714904619635812128629974360554371271422985808308600832)
t_0
(if (<= y.im 39999999999999998543585179860992)
(/ (- x.im (* (/ x.re y.re) y.im)) 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_im;
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = t_0;
} else if (y_46_im <= 4e+31) {
tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / 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_46im
if (y_46im <= (-1.95d+71)) then
tmp = t_0
else if (y_46im <= 4d+31) then
tmp = (x_46im - ((x_46re / y_46re) * y_46im)) / 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_im;
double tmp;
if (y_46_im <= -1.95e+71) {
tmp = t_0;
} else if (y_46_im <= 4e+31) {
tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / 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_im tmp = 0 if y_46_im <= -1.95e+71: tmp = t_0 elif y_46_im <= 4e+31: tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / 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) / y_46_im) tmp = 0.0 if (y_46_im <= -1.95e+71) tmp = t_0; elseif (y_46_im <= 4e+31) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / 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_im; tmp = 0.0; if (y_46_im <= -1.95e+71) tmp = t_0; elseif (y_46_im <= 4e+31) tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / 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[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -195000000000000005714904619635812128629974360554371271422985808308600832], t$95$0, If[LessEqual[y$46$im, 39999999999999998543585179860992], N[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -195000000000000005714904619635812128629974360554371271422985808308600832:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 39999999999999998543585179860992:\\
\;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.im < -1.9500000000000001e71 or 3.9999999999999999e31 < y.im Initial program 61.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-/.f6442.7%
Applied rewrites42.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lower-/.f6442.7%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6442.7%
Applied rewrites42.7%
if -1.9500000000000001e71 < y.im < 3.9999999999999999e31Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6452.8%
Applied rewrites52.8%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
frac-2negN/A
lift-/.f6452.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6454.0%
Applied rewrites54.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<=
y.im
-1156995391866473/6427752177035961102167848369364650410088811975131171341205504)
t_0
(if (<= y.im 39999999999999998543585179860992)
(/ x.im 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_im;
double tmp;
if (y_46_im <= -1.8e-46) {
tmp = t_0;
} else if (y_46_im <= 4e+31) {
tmp = x_46_im / 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_46im
if (y_46im <= (-1.8d-46)) then
tmp = t_0
else if (y_46im <= 4d+31) then
tmp = x_46im / 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_im;
double tmp;
if (y_46_im <= -1.8e-46) {
tmp = t_0;
} else if (y_46_im <= 4e+31) {
tmp = x_46_im / 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_im tmp = 0 if y_46_im <= -1.8e-46: tmp = t_0 elif y_46_im <= 4e+31: tmp = x_46_im / 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) / y_46_im) tmp = 0.0 if (y_46_im <= -1.8e-46) tmp = t_0; elseif (y_46_im <= 4e+31) tmp = Float64(x_46_im / 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_im; tmp = 0.0; if (y_46_im <= -1.8e-46) tmp = t_0; elseif (y_46_im <= 4e+31) tmp = x_46_im / 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[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1156995391866473/6427752177035961102167848369364650410088811975131171341205504], t$95$0, If[LessEqual[y$46$im, 39999999999999998543585179860992], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq \frac{-1156995391866473}{6427752177035961102167848369364650410088811975131171341205504}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 39999999999999998543585179860992:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y.im < -1.8e-46 or 3.9999999999999999e31 < y.im Initial program 61.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-/.f6442.7%
Applied rewrites42.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lower-/.f6442.7%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6442.7%
Applied rewrites42.7%
if -1.8e-46 < y.im < 3.9999999999999999e31Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
y.im
800000000000000011524758069796219084664894897942650104109698519483991416553009053014906061005811648644043497466369868300288)
(/ x.im y.re)
(/ 0 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_im <= 8e+122) {
tmp = x_46_im / y_46_re;
} else {
tmp = 0.0 / 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_46im <= 8d+122) then
tmp = x_46im / y_46re
else
tmp = 0.0d0 / 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_im <= 8e+122) {
tmp = x_46_im / y_46_re;
} else {
tmp = 0.0 / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 8e+122: tmp = x_46_im / y_46_re else: tmp = 0.0 / 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_im <= 8e+122) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(0.0 / 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_im <= 8e+122) tmp = x_46_im / y_46_re; else tmp = 0.0 / 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$im, 800000000000000011524758069796219084664894897942650104109698519483991416553009053014906061005811648644043497466369868300288], N[(x$46$im / y$46$re), $MachinePrecision], N[(0 / y$46$re), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y.im \leq 800000000000000011524758069796219084664894897942650104109698519483991416553009053014906061005811648644043497466369868300288:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{y.re}\\
\end{array}
if y.im < 8.0000000000000001e122Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
if 8.0000000000000001e122 < y.im Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
Taylor expanded in undef-var around zero
Applied rewrites17.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\frac{x.im}{y.re}
Initial program 61.5%
Taylor expanded in y.re around inf
lower-/.f6443.0%
Applied rewrites43.0%
herbie shell --seed 2025285 -o generate:evaluate
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))