
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot \left(y - z\right)}{t - z}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot \left(y - z\right)}{t - z}
(FPCore (x y z t) :precision binary64 (* (copysign 1.0 x) (if (<= (fabs x) 3.6e-56) (/ (fma y (fabs x) (* (- (fabs x)) z)) (- t z)) (* (/ (fabs x) (- z t)) (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (fabs(x) <= 3.6e-56) {
tmp = fma(y, fabs(x), (-fabs(x) * z)) / (t - z);
} else {
tmp = (fabs(x) / (z - t)) * (z - y);
}
return copysign(1.0, x) * tmp;
}
function code(x, y, z, t) tmp = 0.0 if (abs(x) <= 3.6e-56) tmp = Float64(fma(y, abs(x), Float64(Float64(-abs(x)) * z)) / Float64(t - z)); else tmp = Float64(Float64(abs(x) / Float64(z - t)) * Float64(z - y)); end return Float64(copysign(1.0, x) * tmp) end
code[x_, y_, z_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[x], $MachinePrecision], 3.6e-56], N[(N[(y * N[Abs[x], $MachinePrecision] + N[((-N[Abs[x], $MachinePrecision]) * z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 3.6 \cdot 10^{-56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \left|x\right|, \left(-\left|x\right|\right) \cdot z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{z - t} \cdot \left(z - y\right)\\
\end{array}
if x < 3.5999999999999998e-56Initial program 84.7%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lower-fma.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6484.2%
Applied rewrites84.2%
if 3.5999999999999998e-56 < x Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
(FPCore (x y z t) :precision binary64 (* (copysign 1.0 x) (if (<= (fabs x) 3.6e-56) (/ (- (* y (fabs x)) (* z (fabs x))) (- t z)) (* (/ (fabs x) (- z t)) (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (fabs(x) <= 3.6e-56) {
tmp = ((y * fabs(x)) - (z * fabs(x))) / (t - z);
} else {
tmp = (fabs(x) / (z - t)) * (z - y);
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (Math.abs(x) <= 3.6e-56) {
tmp = ((y * Math.abs(x)) - (z * Math.abs(x))) / (t - z);
} else {
tmp = (Math.abs(x) / (z - t)) * (z - y);
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t): tmp = 0 if math.fabs(x) <= 3.6e-56: tmp = ((y * math.fabs(x)) - (z * math.fabs(x))) / (t - z) else: tmp = (math.fabs(x) / (z - t)) * (z - y) return math.copysign(1.0, x) * tmp
function code(x, y, z, t) tmp = 0.0 if (abs(x) <= 3.6e-56) tmp = Float64(Float64(Float64(y * abs(x)) - Float64(z * abs(x))) / Float64(t - z)); else tmp = Float64(Float64(abs(x) / Float64(z - t)) * Float64(z - y)); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (abs(x) <= 3.6e-56) tmp = ((y * abs(x)) - (z * abs(x))) / (t - z); else tmp = (abs(x) / (z - t)) * (z - y); end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[x], $MachinePrecision], 3.6e-56], N[(N[(N[(y * N[Abs[x], $MachinePrecision]), $MachinePrecision] - N[(z * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 3.6 \cdot 10^{-56}:\\
\;\;\;\;\frac{y \cdot \left|x\right| - z \cdot \left|x\right|}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{z - t} \cdot \left(z - y\right)\\
\end{array}
if x < 3.5999999999999998e-56Initial program 84.7%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
lower--.f64N/A
lower-*.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
lower-*.f6484.1%
Applied rewrites84.1%
if 3.5999999999999998e-56 < x Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
(FPCore (x y z t) :precision binary64 (* (copysign 1.0 x) (if (<= (fabs x) 3.6e-56) (/ (* (fabs x) (- y z)) (- t z)) (* (/ (fabs x) (- z t)) (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (fabs(x) <= 3.6e-56) {
tmp = (fabs(x) * (y - z)) / (t - z);
} else {
tmp = (fabs(x) / (z - t)) * (z - y);
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (Math.abs(x) <= 3.6e-56) {
tmp = (Math.abs(x) * (y - z)) / (t - z);
} else {
tmp = (Math.abs(x) / (z - t)) * (z - y);
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t): tmp = 0 if math.fabs(x) <= 3.6e-56: tmp = (math.fabs(x) * (y - z)) / (t - z) else: tmp = (math.fabs(x) / (z - t)) * (z - y) return math.copysign(1.0, x) * tmp
function code(x, y, z, t) tmp = 0.0 if (abs(x) <= 3.6e-56) tmp = Float64(Float64(abs(x) * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(abs(x) / Float64(z - t)) * Float64(z - y)); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (abs(x) <= 3.6e-56) tmp = (abs(x) * (y - z)) / (t - z); else tmp = (abs(x) / (z - t)) * (z - y); end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[x], $MachinePrecision], 3.6e-56], N[(N[(N[Abs[x], $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 3.6 \cdot 10^{-56}:\\
\;\;\;\;\frac{\left|x\right| \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{z - t} \cdot \left(z - y\right)\\
\end{array}
if x < 3.5999999999999998e-56Initial program 84.7%
if 3.5999999999999998e-56 < x Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
(FPCore (x y z t) :precision binary64 (* (/ (- z y) (- z t)) x))
double code(double x, double y, double z, double t) {
return ((z - y) / (z - t)) * x;
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((z - y) / (z - t)) * x
end function
public static double code(double x, double y, double z, double t) {
return ((z - y) / (z - t)) * x;
}
def code(x, y, z, t): return ((z - y) / (z - t)) * x
function code(x, y, z, t) return Float64(Float64(Float64(z - y) / Float64(z - t)) * x) end
function tmp = code(x, y, z, t) tmp = ((z - y) / (z - t)) * x; end
code[x_, y_, z_, t_] := N[(N[(N[(z - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{z - y}{z - t} \cdot x
Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -3.6e+145)
t_1
(if (<= z 1.1e+81) (* (/ x (- z t)) (- z y)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -3.6e+145) {
tmp = t_1;
} else if (z <= 1.1e+81) {
tmp = (x / (z - t)) * (z - y);
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z / (z - t)) * x
if (z <= (-3.6d+145)) then
tmp = t_1
else if (z <= 1.1d+81) then
tmp = (x / (z - t)) * (z - y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -3.6e+145) {
tmp = t_1;
} else if (z <= 1.1e+81) {
tmp = (x / (z - t)) * (z - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -3.6e+145: tmp = t_1 elif z <= 1.1e+81: tmp = (x / (z - t)) * (z - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(z - t)) * x) tmp = 0.0 if (z <= -3.6e+145) tmp = t_1; elseif (z <= 1.1e+81) tmp = Float64(Float64(x / Float64(z - t)) * Float64(z - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (z - t)) * x; tmp = 0.0; if (z <= -3.6e+145) tmp = t_1; elseif (z <= 1.1e+81) tmp = (x / (z - t)) * (z - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -3.6e+145], t$95$1, If[LessEqual[z, 1.1e+81], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+81}:\\
\;\;\;\;\frac{x}{z - t} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.5999999999999997e145 or 1.0999999999999999e81 < z Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites46.4%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flipN/A
lower-/.f64N/A
lift--.f6454.5%
Applied rewrites54.5%
if -3.5999999999999997e145 < z < 1.0999999999999999e81Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (- y z) t) x)))
(if (<= t -1.95e+56)
t_1
(if (<= t 4.9e+128) (* (- 1.0 (/ y (- z t))) x) t_1))))double code(double x, double y, double z, double t) {
double t_1 = ((y - z) / t) * x;
double tmp;
if (t <= -1.95e+56) {
tmp = t_1;
} else if (t <= 4.9e+128) {
tmp = (1.0 - (y / (z - t))) * x;
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((y - z) / t) * x
if (t <= (-1.95d+56)) then
tmp = t_1
else if (t <= 4.9d+128) then
tmp = (1.0d0 - (y / (z - t))) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((y - z) / t) * x;
double tmp;
if (t <= -1.95e+56) {
tmp = t_1;
} else if (t <= 4.9e+128) {
tmp = (1.0 - (y / (z - t))) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((y - z) / t) * x tmp = 0 if t <= -1.95e+56: tmp = t_1 elif t <= 4.9e+128: tmp = (1.0 - (y / (z - t))) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(y - z) / t) * x) tmp = 0.0 if (t <= -1.95e+56) tmp = t_1; elseif (t <= 4.9e+128) tmp = Float64(Float64(1.0 - Float64(y / Float64(z - t))) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((y - z) / t) * x; tmp = 0.0; if (t <= -1.95e+56) tmp = t_1; elseif (t <= 4.9e+128) tmp = (1.0 - (y / (z - t))) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.95e+56], t$95$1, If[LessEqual[t, 4.9e+128], N[(N[(1.0 - N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y - z}{t} \cdot x\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+128}:\\
\;\;\;\;\left(1 - \frac{y}{z - t}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.95e56 or 4.9000000000000002e128 < t Initial program 84.7%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
lower--.f64N/A
lower-*.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
lower-*.f6484.1%
Applied rewrites84.1%
Taylor expanded in z around 0
Applied rewrites47.4%
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6450.6%
Applied rewrites50.6%
if -1.95e56 < t < 4.9000000000000002e128Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
div-addN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-*l/N/A
lower-*.f64N/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites66.1%
lift-fma.f64N/A
lift-*.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
add-flipN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower--.f64N/A
lower-/.f6466.1%
Applied rewrites66.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z (- z t)) x))) (if (<= z -2.9e-10) t_1 (if (<= z 3e+18) (/ (* x y) (- t z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -2.9e-10) {
tmp = t_1;
} else if (z <= 3e+18) {
tmp = (x * y) / (t - z);
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z / (z - t)) * x
if (z <= (-2.9d-10)) then
tmp = t_1
else if (z <= 3d+18) then
tmp = (x * y) / (t - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -2.9e-10) {
tmp = t_1;
} else if (z <= 3e+18) {
tmp = (x * y) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -2.9e-10: tmp = t_1 elif z <= 3e+18: tmp = (x * y) / (t - z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(z - t)) * x) tmp = 0.0 if (z <= -2.9e-10) tmp = t_1; elseif (z <= 3e+18) tmp = Float64(Float64(x * y) / Float64(t - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (z - t)) * x; tmp = 0.0; if (z <= -2.9e-10) tmp = t_1; elseif (z <= 3e+18) tmp = (x * y) / (t - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -2.9e-10], t$95$1, If[LessEqual[z, 3e+18], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+18}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.8999999999999998e-10 or 3e18 < z Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites46.4%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flipN/A
lower-/.f64N/A
lift--.f6454.5%
Applied rewrites54.5%
if -2.8999999999999998e-10 < z < 3e18Initial program 84.7%
Taylor expanded in y around inf
lower-*.f6450.4%
Applied rewrites50.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -6.2e+112)
t_1
(if (<= z 1.35e+36) (* (/ (- y z) t) x) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -6.2e+112) {
tmp = t_1;
} else if (z <= 1.35e+36) {
tmp = ((y - z) / t) * x;
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z / (z - t)) * x
if (z <= (-6.2d+112)) then
tmp = t_1
else if (z <= 1.35d+36) then
tmp = ((y - z) / t) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -6.2e+112) {
tmp = t_1;
} else if (z <= 1.35e+36) {
tmp = ((y - z) / t) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -6.2e+112: tmp = t_1 elif z <= 1.35e+36: tmp = ((y - z) / t) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(z - t)) * x) tmp = 0.0 if (z <= -6.2e+112) tmp = t_1; elseif (z <= 1.35e+36) tmp = Float64(Float64(Float64(y - z) / t) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (z - t)) * x; tmp = 0.0; if (z <= -6.2e+112) tmp = t_1; elseif (z <= 1.35e+36) tmp = ((y - z) / t) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -6.2e+112], t$95$1, If[LessEqual[z, 1.35e+36], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+36}:\\
\;\;\;\;\frac{y - z}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -6.1999999999999997e112 or 1.35e36 < z Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites46.4%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flipN/A
lower-/.f64N/A
lift--.f6454.5%
Applied rewrites54.5%
if -6.1999999999999997e112 < z < 1.35e36Initial program 84.7%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
lower--.f64N/A
lower-*.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
lower-*.f6484.1%
Applied rewrites84.1%
Taylor expanded in z around 0
Applied rewrites47.4%
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-rgt-out--N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower--.f6450.6%
Applied rewrites50.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -3.1e-22)
t_1
(if (<= z 4.2e-84)
(* (/ x t) y)
(if (<= z 2.1e+19) (* (/ (- z y) z) x) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -3.1e-22) {
tmp = t_1;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} else if (z <= 2.1e+19) {
tmp = ((z - y) / z) * x;
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z / (z - t)) * x
if (z <= (-3.1d-22)) then
tmp = t_1
else if (z <= 4.2d-84) then
tmp = (x / t) * y
else if (z <= 2.1d+19) then
tmp = ((z - y) / z) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -3.1e-22) {
tmp = t_1;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} else if (z <= 2.1e+19) {
tmp = ((z - y) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -3.1e-22: tmp = t_1 elif z <= 4.2e-84: tmp = (x / t) * y elif z <= 2.1e+19: tmp = ((z - y) / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(z - t)) * x) tmp = 0.0 if (z <= -3.1e-22) tmp = t_1; elseif (z <= 4.2e-84) tmp = Float64(Float64(x / t) * y); elseif (z <= 2.1e+19) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (z - t)) * x; tmp = 0.0; if (z <= -3.1e-22) tmp = t_1; elseif (z <= 4.2e-84) tmp = (x / t) * y; elseif (z <= 2.1e+19) tmp = ((z - y) / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -3.1e-22], t$95$1, If[LessEqual[z, 4.2e-84], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.1e+19], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+19}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.1000000000000001e-22 or 2.1e19 < z Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites46.4%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flipN/A
lower-/.f64N/A
lift--.f6454.5%
Applied rewrites54.5%
if -3.1000000000000001e-22 < z < 4.2e-84Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6437.6%
Applied rewrites37.6%
if 4.2e-84 < z < 2.1e19Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6452.5%
Applied rewrites52.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (- z y) z) x)))
(if (<= z -9.2e+222)
t_1
(if (<= z -3.1e-22)
(* (/ x (- z t)) z)
(if (<= z 4.2e-84) (* (/ x t) y) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = ((z - y) / z) * x;
double tmp;
if (z <= -9.2e+222) {
tmp = t_1;
} else if (z <= -3.1e-22) {
tmp = (x / (z - t)) * z;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((z - y) / z) * x
if (z <= (-9.2d+222)) then
tmp = t_1
else if (z <= (-3.1d-22)) then
tmp = (x / (z - t)) * z
else if (z <= 4.2d-84) then
tmp = (x / t) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((z - y) / z) * x;
double tmp;
if (z <= -9.2e+222) {
tmp = t_1;
} else if (z <= -3.1e-22) {
tmp = (x / (z - t)) * z;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - y) / z) * x tmp = 0 if z <= -9.2e+222: tmp = t_1 elif z <= -3.1e-22: tmp = (x / (z - t)) * z elif z <= 4.2e-84: tmp = (x / t) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - y) / z) * x) tmp = 0.0 if (z <= -9.2e+222) tmp = t_1; elseif (z <= -3.1e-22) tmp = Float64(Float64(x / Float64(z - t)) * z); elseif (z <= 4.2e-84) tmp = Float64(Float64(x / t) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - y) / z) * x; tmp = 0.0; if (z <= -9.2e+222) tmp = t_1; elseif (z <= -3.1e-22) tmp = (x / (z - t)) * z; elseif (z <= 4.2e-84) tmp = (x / t) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -9.2e+222], t$95$1, If[LessEqual[z, -3.1e-22], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 4.2e-84], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{z - y}{z} \cdot x\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+222}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{z - t} \cdot z\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -9.2000000000000004e222 or 4.2e-84 < z Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6452.5%
Applied rewrites52.5%
if -9.2000000000000004e222 < z < -3.1000000000000001e-22Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites46.4%
if -3.1000000000000001e-22 < z < 4.2e-84Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (- z y) z) x))) (if (<= z -3.7e-22) t_1 (if (<= z 4.2e-84) (* (/ x t) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - y) / z) * x;
double tmp;
if (z <= -3.7e-22) {
tmp = t_1;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} 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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((z - y) / z) * x
if (z <= (-3.7d-22)) then
tmp = t_1
else if (z <= 4.2d-84) then
tmp = (x / t) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((z - y) / z) * x;
double tmp;
if (z <= -3.7e-22) {
tmp = t_1;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - y) / z) * x tmp = 0 if z <= -3.7e-22: tmp = t_1 elif z <= 4.2e-84: tmp = (x / t) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - y) / z) * x) tmp = 0.0 if (z <= -3.7e-22) tmp = t_1; elseif (z <= 4.2e-84) tmp = Float64(Float64(x / t) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - y) / z) * x; tmp = 0.0; if (z <= -3.7e-22) tmp = t_1; elseif (z <= 4.2e-84) tmp = (x / t) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -3.7e-22], t$95$1, If[LessEqual[z, 4.2e-84], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z - y}{z} \cdot x\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.7e-22 or 4.2e-84 < z Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6452.5%
Applied rewrites52.5%
if -3.7e-22 < z < 4.2e-84Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- z y)) z)))
(if (<= z -2.25e+153)
(* 1.0 x)
(if (<= z -3.7e-22)
t_1
(if (<= z 4.2e-84)
(* (/ x t) y)
(if (<= z 7e+193) t_1 (* 1.0 x)))))))double code(double x, double y, double z, double t) {
double t_1 = (x * (z - y)) / z;
double tmp;
if (z <= -2.25e+153) {
tmp = 1.0 * x;
} else if (z <= -3.7e-22) {
tmp = t_1;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} else if (z <= 7e+193) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * (z - y)) / z
if (z <= (-2.25d+153)) then
tmp = 1.0d0 * x
else if (z <= (-3.7d-22)) then
tmp = t_1
else if (z <= 4.2d-84) then
tmp = (x / t) * y
else if (z <= 7d+193) then
tmp = t_1
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (z - y)) / z;
double tmp;
if (z <= -2.25e+153) {
tmp = 1.0 * x;
} else if (z <= -3.7e-22) {
tmp = t_1;
} else if (z <= 4.2e-84) {
tmp = (x / t) * y;
} else if (z <= 7e+193) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (z - y)) / z tmp = 0 if z <= -2.25e+153: tmp = 1.0 * x elif z <= -3.7e-22: tmp = t_1 elif z <= 4.2e-84: tmp = (x / t) * y elif z <= 7e+193: tmp = t_1 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(z - y)) / z) tmp = 0.0 if (z <= -2.25e+153) tmp = Float64(1.0 * x); elseif (z <= -3.7e-22) tmp = t_1; elseif (z <= 4.2e-84) tmp = Float64(Float64(x / t) * y); elseif (z <= 7e+193) tmp = t_1; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (z - y)) / z; tmp = 0.0; if (z <= -2.25e+153) tmp = 1.0 * x; elseif (z <= -3.7e-22) tmp = t_1; elseif (z <= 4.2e-84) tmp = (x / t) * y; elseif (z <= 7e+193) tmp = t_1; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2.25e+153], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -3.7e-22], t$95$1, If[LessEqual[z, 4.2e-84], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 7e+193], t$95$1, N[(1.0 * x), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot \left(z - y\right)}{z}\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+153}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
if z < -2.25e153 or 7.0000000000000003e193 < z Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
if -2.25e153 < z < -3.7e-22 or 4.2e-84 < z < 7.0000000000000003e193Initial program 84.7%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6484.4%
Applied rewrites84.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6445.6%
Applied rewrites45.6%
if -3.7e-22 < z < 4.2e-84Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.25e+113) (* 1.0 x) (if (<= z 5.1e+36) (* (/ y t) x) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e+113) {
tmp = 1.0 * x;
} else if (z <= 5.1e+36) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * x;
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.25d+113)) then
tmp = 1.0d0 * x
else if (z <= 5.1d+36) then
tmp = (y / t) * x
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e+113) {
tmp = 1.0 * x;
} else if (z <= 5.1e+36) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.25e+113: tmp = 1.0 * x elif z <= 5.1e+36: tmp = (y / t) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e+113) tmp = Float64(1.0 * x); elseif (z <= 5.1e+36) tmp = Float64(Float64(y / t) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.25e+113) tmp = 1.0 * x; elseif (z <= 5.1e+36) tmp = (y / t) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e+113], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 5.1e+36], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+113}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+36}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
if z < -1.25e113 or 5.0999999999999997e36 < z Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
if -1.25e113 < z < 5.0999999999999997e36Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6439.7%
Applied rewrites39.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.25e+113) (* 1.0 x) (if (<= z 2.5e+38) (* (/ x t) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e+113) {
tmp = 1.0 * x;
} else if (z <= 2.5e+38) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * x;
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.25d+113)) then
tmp = 1.0d0 * x
else if (z <= 2.5d+38) then
tmp = (x / t) * y
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e+113) {
tmp = 1.0 * x;
} else if (z <= 2.5e+38) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.25e+113: tmp = 1.0 * x elif z <= 2.5e+38: tmp = (x / t) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e+113) tmp = Float64(1.0 * x); elseif (z <= 2.5e+38) tmp = Float64(Float64(x / t) * y); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.25e+113) tmp = 1.0 * x; elseif (z <= 2.5e+38) tmp = (x / t) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e+113], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 2.5e+38], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+113}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
if z < -1.25e113 or 2.4999999999999998e38 < z Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
if -1.25e113 < z < 2.4999999999999998e38Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6437.6%
Applied rewrites37.6%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * x;
}
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, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
1 \cdot x
Initial program 84.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6497.2%
Applied rewrites97.2%
Taylor expanded in z around inf
Applied rewrites35.1%
herbie shell --seed 2025212
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
(/ (* x (- y z)) (- t z)))