
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) a)) (t_2 (* (- (+ y t) 2.0) b)))
(if (<= (+ (- (- x (* (- y 1.0) z)) t_1) t_2) INFINITY)
(+ (- (- (- x (* z y)) (- z)) t_1) t_2)
(* y (- b z)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * a;
double t_2 = ((y + t) - 2.0) * b;
double tmp;
if ((((x - ((y - 1.0) * z)) - t_1) + t_2) <= ((double) INFINITY)) {
tmp = (((x - (z * y)) - -z) - t_1) + t_2;
} else {
tmp = y * (b - z);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * a;
double t_2 = ((y + t) - 2.0) * b;
double tmp;
if ((((x - ((y - 1.0) * z)) - t_1) + t_2) <= Double.POSITIVE_INFINITY) {
tmp = (((x - (z * y)) - -z) - t_1) + t_2;
} else {
tmp = y * (b - z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * a t_2 = ((y + t) - 2.0) * b tmp = 0 if (((x - ((y - 1.0) * z)) - t_1) + t_2) <= math.inf: tmp = (((x - (z * y)) - -z) - t_1) + t_2 else: tmp = y * (b - z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * a) t_2 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - t_1) + t_2) <= Inf) tmp = Float64(Float64(Float64(Float64(x - Float64(z * y)) - Float64(-z)) - t_1) + t_2); else tmp = Float64(y * Float64(b - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * a; t_2 = ((y + t) - 2.0) * b; tmp = 0.0; if ((((x - ((y - 1.0) * z)) - t_1) + t_2) <= Inf) tmp = (((x - (z * y)) - -z) - t_1) + t_2; else tmp = y * (b - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], Infinity], N[(N[(N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] - (-z)), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot a\\
t_2 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;\left(\left(x - \left(y - 1\right) \cdot z\right) - t\_1\right) + t\_2 \leq \infty:\\
\;\;\;\;\left(\left(\left(x - z \cdot y\right) - \left(-z\right)\right) - t\_1\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 95.2%
lift--.f64N/A
sub-flipN/A
add-flipN/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.2%
Applied rewrites95.2%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 95.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.6%
Applied rewrites32.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+
(- (- x (* (- y 1.0) z)) (* (- t 1.0) a))
(* (- (+ y t) 2.0) b))))
(if (<= t_1 INFINITY) t_1 (* y (- b z)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = y * (b - z);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = y * (b - z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = y * (b - z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(y * Float64(b - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = y * (b - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 95.2%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 95.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.6%
Applied rewrites32.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- x (* a (- t 1.0))) (* (- (+ y t) 2.0) b))))
(if (<= b -5.8e+147)
t_1
(if (<= b 1.1e+62)
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* b y))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
double tmp;
if (b <= -5.8e+147) {
tmp = t_1;
} else if (b <= 1.1e+62) {
tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x - (a * (t - 1.0d0))) + (((y + t) - 2.0d0) * b)
if (b <= (-5.8d+147)) then
tmp = t_1
else if (b <= 1.1d+62) then
tmp = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (b * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
double tmp;
if (b <= -5.8e+147) {
tmp = t_1;
} else if (b <= 1.1e+62) {
tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b) tmp = 0 if b <= -5.8e+147: tmp = t_1 elif b <= 1.1e+62: tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -5.8e+147) tmp = t_1; elseif (b <= 1.1e+62) tmp = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(b * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b); tmp = 0.0; if (b <= -5.8e+147) tmp = t_1; elseif (b <= 1.1e+62) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.8e+147], t$95$1, If[LessEqual[b, 1.1e+62], N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x - a \cdot \left(t - 1\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -5.8 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+62}:\\
\;\;\;\;\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -5.7999999999999997e147 or 1.1000000000000001e62 < b Initial program 95.2%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.3%
Applied rewrites73.3%
if -5.7999999999999997e147 < b < 1.1000000000000001e62Initial program 95.2%
Taylor expanded in y around inf
lower-*.f6478.7%
Applied rewrites78.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.03e+186)
(- (+ x z) (* y z))
(if (<= z 3.9e+118)
(+ (- x (* a (- t 1.0))) (* (- (+ y t) 2.0) b))
(- (+ x (+ z (* b (- (+ t y) 2.0)))) (* y z)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.03e+186) {
tmp = (x + z) - (y * z);
} else if (z <= 3.9e+118) {
tmp = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
} else {
tmp = (x + (z + (b * ((t + y) - 2.0)))) - (y * z);
}
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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.03d+186)) then
tmp = (x + z) - (y * z)
else if (z <= 3.9d+118) then
tmp = (x - (a * (t - 1.0d0))) + (((y + t) - 2.0d0) * b)
else
tmp = (x + (z + (b * ((t + y) - 2.0d0)))) - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.03e+186) {
tmp = (x + z) - (y * z);
} else if (z <= 3.9e+118) {
tmp = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
} else {
tmp = (x + (z + (b * ((t + y) - 2.0)))) - (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.03e+186: tmp = (x + z) - (y * z) elif z <= 3.9e+118: tmp = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b) else: tmp = (x + (z + (b * ((t + y) - 2.0)))) - (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.03e+186) tmp = Float64(Float64(x + z) - Float64(y * z)); elseif (z <= 3.9e+118) tmp = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = Float64(Float64(x + Float64(z + Float64(b * Float64(Float64(t + y) - 2.0)))) - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.03e+186) tmp = (x + z) - (y * z); elseif (z <= 3.9e+118) tmp = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b); else tmp = (x + (z + (b * ((t + y) - 2.0)))) - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.03e+186], N[(N[(x + z), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+118], N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.03 \cdot 10^{+186}:\\
\;\;\;\;\left(x + z\right) - y \cdot z\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+118}:\\
\;\;\;\;\left(x - a \cdot \left(t - 1\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + \left(z + b \cdot \left(\left(t + y\right) - 2\right)\right)\right) - y \cdot z\\
\end{array}
if z < -2.0300000000000001e186Initial program 95.2%
lift--.f64N/A
sub-flipN/A
add-flipN/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.2%
Applied rewrites95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f6473.4%
Applied rewrites73.4%
Taylor expanded in b around 0
lower-+.f6441.5%
Applied rewrites41.5%
if -2.0300000000000001e186 < z < 3.9e118Initial program 95.2%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.3%
Applied rewrites73.3%
if 3.9e118 < z Initial program 95.2%
lift--.f64N/A
sub-flipN/A
add-flipN/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.2%
Applied rewrites95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f6473.4%
Applied rewrites73.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* a (- 1.0 t)) (* (- (+ y t) 2.0) b))))
(if (<= a -1.15e+98)
t_1
(if (<= a 7.5e+71)
(- (+ x (* b (- (+ t y) 2.0))) (* z (- y 1.0)))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * (1.0 - t)) + (((y + t) - 2.0) * b);
double tmp;
if (a <= -1.15e+98) {
tmp = t_1;
} else if (a <= 7.5e+71) {
tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.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, y, z, t, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a * (1.0d0 - t)) + (((y + t) - 2.0d0) * b)
if (a <= (-1.15d+98)) then
tmp = t_1
else if (a <= 7.5d+71) then
tmp = (x + (b * ((t + y) - 2.0d0))) - (z * (y - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * (1.0 - t)) + (((y + t) - 2.0) * b);
double tmp;
if (a <= -1.15e+98) {
tmp = t_1;
} else if (a <= 7.5e+71) {
tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * (1.0 - t)) + (((y + t) - 2.0) * b) tmp = 0 if a <= -1.15e+98: tmp = t_1 elif a <= 7.5e+71: tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * Float64(1.0 - t)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (a <= -1.15e+98) tmp = t_1; elseif (a <= 7.5e+71) tmp = Float64(Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))) - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a * (1.0 - t)) + (((y + t) - 2.0) * b); tmp = 0.0; if (a <= -1.15e+98) tmp = t_1; elseif (a <= 7.5e+71) tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.15e+98], t$95$1, If[LessEqual[a, 7.5e+71], N[(N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;a \leq -1.15 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+71}:\\
\;\;\;\;\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.1500000000000001e98 or 7.5000000000000001e71 < a Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
if -1.1500000000000001e98 < a < 7.5000000000000001e71Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.85e+61)
(- (+ x (* b (- y 2.0))) (* z (- y 1.0)))
(if (<= x 1.85e+34)
(+ (* a (- 1.0 t)) (* (- (+ y t) 2.0) b))
(+ (- (- x (* y z)) (* a t)) (* b y)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.85e+61) {
tmp = (x + (b * (y - 2.0))) - (z * (y - 1.0));
} else if (x <= 1.85e+34) {
tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b);
} else {
tmp = ((x - (y * z)) - (a * t)) + (b * y);
}
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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.85d+61)) then
tmp = (x + (b * (y - 2.0d0))) - (z * (y - 1.0d0))
else if (x <= 1.85d+34) then
tmp = (a * (1.0d0 - t)) + (((y + t) - 2.0d0) * b)
else
tmp = ((x - (y * z)) - (a * t)) + (b * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.85e+61) {
tmp = (x + (b * (y - 2.0))) - (z * (y - 1.0));
} else if (x <= 1.85e+34) {
tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b);
} else {
tmp = ((x - (y * z)) - (a * t)) + (b * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.85e+61: tmp = (x + (b * (y - 2.0))) - (z * (y - 1.0)) elif x <= 1.85e+34: tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b) else: tmp = ((x - (y * z)) - (a * t)) + (b * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.85e+61) tmp = Float64(Float64(x + Float64(b * Float64(y - 2.0))) - Float64(z * Float64(y - 1.0))); elseif (x <= 1.85e+34) tmp = Float64(Float64(a * Float64(1.0 - t)) + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = Float64(Float64(Float64(x - Float64(y * z)) - Float64(a * t)) + Float64(b * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.85e+61) tmp = (x + (b * (y - 2.0))) - (z * (y - 1.0)); elseif (x <= 1.85e+34) tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b); else tmp = ((x - (y * z)) - (a * t)) + (b * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.85e+61], N[(N[(x + N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e+34], N[(N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+61}:\\
\;\;\;\;\left(x + b \cdot \left(y - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+34}:\\
\;\;\;\;a \cdot \left(1 - t\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x - y \cdot z\right) - a \cdot t\right) + b \cdot y\\
\end{array}
if x < -1.85e61Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6460.4%
Applied rewrites60.4%
if -1.85e61 < x < 1.85e34Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
if 1.85e34 < x Initial program 95.2%
Taylor expanded in y around inf
lower-*.f6478.7%
Applied rewrites78.7%
Taylor expanded in t around inf
lower-*.f6469.5%
Applied rewrites69.5%
Taylor expanded in y around inf
lower-*.f6459.5%
Applied rewrites59.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ x (* b (- y 2.0))) (* z (- y 1.0)))))
(if (<= x -1.85e+61)
t_1
(if (<= x 7.2e+84)
(+ (* a (- 1.0 t)) (* (- (+ y t) 2.0) b))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (b * (y - 2.0))) - (z * (y - 1.0));
double tmp;
if (x <= -1.85e+61) {
tmp = t_1;
} else if (x <= 7.2e+84) {
tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b);
} 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (b * (y - 2.0d0))) - (z * (y - 1.0d0))
if (x <= (-1.85d+61)) then
tmp = t_1
else if (x <= 7.2d+84) then
tmp = (a * (1.0d0 - t)) + (((y + t) - 2.0d0) * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (b * (y - 2.0))) - (z * (y - 1.0));
double tmp;
if (x <= -1.85e+61) {
tmp = t_1;
} else if (x <= 7.2e+84) {
tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (b * (y - 2.0))) - (z * (y - 1.0)) tmp = 0 if x <= -1.85e+61: tmp = t_1 elif x <= 7.2e+84: tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(b * Float64(y - 2.0))) - Float64(z * Float64(y - 1.0))) tmp = 0.0 if (x <= -1.85e+61) tmp = t_1; elseif (x <= 7.2e+84) tmp = Float64(Float64(a * Float64(1.0 - t)) + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (b * (y - 2.0))) - (z * (y - 1.0)); tmp = 0.0; if (x <= -1.85e+61) tmp = t_1; elseif (x <= 7.2e+84) tmp = (a * (1.0 - t)) + (((y + t) - 2.0) * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e+61], t$95$1, If[LessEqual[x, 7.2e+84], N[(N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + b \cdot \left(y - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+84}:\\
\;\;\;\;a \cdot \left(1 - t\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -1.85e61 or 7.1999999999999999e84 < x Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6460.4%
Applied rewrites60.4%
if -1.85e61 < x < 7.1999999999999999e84Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -7.8e+129)
(+ a (* (- (+ y t) 2.0) b))
(if (<= b 1.6e-45)
(+ (- x (* a (- t 1.0))) (* b y))
(+ x (* b (- (+ t y) 2.0))))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -7.8e+129) {
tmp = a + (((y + t) - 2.0) * b);
} else if (b <= 1.6e-45) {
tmp = (x - (a * (t - 1.0))) + (b * y);
} else {
tmp = x + (b * ((t + y) - 2.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, y, z, t, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-7.8d+129)) then
tmp = a + (((y + t) - 2.0d0) * b)
else if (b <= 1.6d-45) then
tmp = (x - (a * (t - 1.0d0))) + (b * y)
else
tmp = x + (b * ((t + y) - 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -7.8e+129) {
tmp = a + (((y + t) - 2.0) * b);
} else if (b <= 1.6e-45) {
tmp = (x - (a * (t - 1.0))) + (b * y);
} else {
tmp = x + (b * ((t + y) - 2.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -7.8e+129: tmp = a + (((y + t) - 2.0) * b) elif b <= 1.6e-45: tmp = (x - (a * (t - 1.0))) + (b * y) else: tmp = x + (b * ((t + y) - 2.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -7.8e+129) tmp = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)); elseif (b <= 1.6e-45) tmp = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(b * y)); else tmp = Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -7.8e+129) tmp = a + (((y + t) - 2.0) * b); elseif (b <= 1.6e-45) tmp = (x - (a * (t - 1.0))) + (b * y); else tmp = x + (b * ((t + y) - 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -7.8e+129], N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e-45], N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -7.8 \cdot 10^{+129}:\\
\;\;\;\;a + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-45}:\\
\;\;\;\;\left(x - a \cdot \left(t - 1\right)\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\
\end{array}
if b < -7.7999999999999994e129Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in t around 0
Applied rewrites46.3%
if -7.7999999999999994e129 < b < 1.6e-45Initial program 95.2%
lift--.f64N/A
sub-flipN/A
add-flipN/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.2%
Applied rewrites95.2%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.3%
Applied rewrites73.3%
Taylor expanded in y around inf
lower-*.f6456.8%
Applied rewrites56.8%
if 1.6e-45 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6450.8%
Applied rewrites50.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ x z) (* y z))) (t_2 (+ (* a (- 1.0 t)) (* b t))))
(if (<= b -9e-27)
(+ a (* (- (+ y t) 2.0) b))
(if (<= b -2.6e-136)
t_1
(if (<= b 2.5e-304)
t_2
(if (<= b 3e-143)
t_1
(if (<= b 9.0) t_2 (+ x (* b (- (+ t y) 2.0))))))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + z) - (y * z);
double t_2 = (a * (1.0 - t)) + (b * t);
double tmp;
if (b <= -9e-27) {
tmp = a + (((y + t) - 2.0) * b);
} else if (b <= -2.6e-136) {
tmp = t_1;
} else if (b <= 2.5e-304) {
tmp = t_2;
} else if (b <= 3e-143) {
tmp = t_1;
} else if (b <= 9.0) {
tmp = t_2;
} else {
tmp = x + (b * ((t + y) - 2.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, y, z, t, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + z) - (y * z)
t_2 = (a * (1.0d0 - t)) + (b * t)
if (b <= (-9d-27)) then
tmp = a + (((y + t) - 2.0d0) * b)
else if (b <= (-2.6d-136)) then
tmp = t_1
else if (b <= 2.5d-304) then
tmp = t_2
else if (b <= 3d-143) then
tmp = t_1
else if (b <= 9.0d0) then
tmp = t_2
else
tmp = x + (b * ((t + y) - 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + z) - (y * z);
double t_2 = (a * (1.0 - t)) + (b * t);
double tmp;
if (b <= -9e-27) {
tmp = a + (((y + t) - 2.0) * b);
} else if (b <= -2.6e-136) {
tmp = t_1;
} else if (b <= 2.5e-304) {
tmp = t_2;
} else if (b <= 3e-143) {
tmp = t_1;
} else if (b <= 9.0) {
tmp = t_2;
} else {
tmp = x + (b * ((t + y) - 2.0));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + z) - (y * z) t_2 = (a * (1.0 - t)) + (b * t) tmp = 0 if b <= -9e-27: tmp = a + (((y + t) - 2.0) * b) elif b <= -2.6e-136: tmp = t_1 elif b <= 2.5e-304: tmp = t_2 elif b <= 3e-143: tmp = t_1 elif b <= 9.0: tmp = t_2 else: tmp = x + (b * ((t + y) - 2.0)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + z) - Float64(y * z)) t_2 = Float64(Float64(a * Float64(1.0 - t)) + Float64(b * t)) tmp = 0.0 if (b <= -9e-27) tmp = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)); elseif (b <= -2.6e-136) tmp = t_1; elseif (b <= 2.5e-304) tmp = t_2; elseif (b <= 3e-143) tmp = t_1; elseif (b <= 9.0) tmp = t_2; else tmp = Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + z) - (y * z); t_2 = (a * (1.0 - t)) + (b * t); tmp = 0.0; if (b <= -9e-27) tmp = a + (((y + t) - 2.0) * b); elseif (b <= -2.6e-136) tmp = t_1; elseif (b <= 2.5e-304) tmp = t_2; elseif (b <= 3e-143) tmp = t_1; elseif (b <= 9.0) tmp = t_2; else tmp = x + (b * ((t + y) - 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + z), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9e-27], N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.6e-136], t$95$1, If[LessEqual[b, 2.5e-304], t$95$2, If[LessEqual[b, 3e-143], t$95$1, If[LessEqual[b, 9.0], t$95$2, N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \left(x + z\right) - y \cdot z\\
t_2 := a \cdot \left(1 - t\right) + b \cdot t\\
\mathbf{if}\;b \leq -9 \cdot 10^{-27}:\\
\;\;\;\;a + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{elif}\;b \leq -2.6 \cdot 10^{-136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-304}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 9:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\
\end{array}
if b < -9.0000000000000003e-27Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in t around 0
Applied rewrites46.3%
if -9.0000000000000003e-27 < b < -2.6e-136 or 2.4999999999999998e-304 < b < 2.9999999999999999e-143Initial program 95.2%
lift--.f64N/A
sub-flipN/A
add-flipN/A
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.2%
Applied rewrites95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f6473.4%
Applied rewrites73.4%
Taylor expanded in b around 0
lower-+.f6441.5%
Applied rewrites41.5%
if -2.6e-136 < b < 2.4999999999999998e-304 or 2.9999999999999999e-143 < b < 9Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in t around inf
lower-*.f6439.8%
Applied rewrites39.8%
if 9 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6450.8%
Applied rewrites50.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))))
(if (<= y -2.9e+41)
t_1
(if (<= y 5.5e-25)
(- x (- (* (- 2.0 t) b) z))
(if (<= y 7.6e+51) (* t (- b a)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -2.9e+41) {
tmp = t_1;
} else if (y <= 5.5e-25) {
tmp = x - (((2.0 - t) * b) - z);
} else if (y <= 7.6e+51) {
tmp = t * (b - a);
} 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y * (b - z)
if (y <= (-2.9d+41)) then
tmp = t_1
else if (y <= 5.5d-25) then
tmp = x - (((2.0d0 - t) * b) - z)
else if (y <= 7.6d+51) then
tmp = t * (b - a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -2.9e+41) {
tmp = t_1;
} else if (y <= 5.5e-25) {
tmp = x - (((2.0 - t) * b) - z);
} else if (y <= 7.6e+51) {
tmp = t * (b - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -2.9e+41: tmp = t_1 elif y <= 5.5e-25: tmp = x - (((2.0 - t) * b) - z) elif y <= 7.6e+51: tmp = t * (b - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -2.9e+41) tmp = t_1; elseif (y <= 5.5e-25) tmp = Float64(x - Float64(Float64(Float64(2.0 - t) * b) - z)); elseif (y <= 7.6e+51) tmp = Float64(t * Float64(b - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -2.9e+41) tmp = t_1; elseif (y <= 5.5e-25) tmp = x - (((2.0 - t) * b) - z); elseif (y <= 7.6e+51) tmp = t * (b - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+41], t$95$1, If[LessEqual[y, 5.5e-25], N[(x - N[(N[(N[(2.0 - t), $MachinePrecision] * b), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+51], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-25}:\\
\;\;\;\;x - \left(\left(2 - t\right) \cdot b - z\right)\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+51}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.8999999999999999e41 or 7.5999999999999994e51 < y Initial program 95.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.6%
Applied rewrites32.6%
if -2.8999999999999999e41 < y < 5.5e-25Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
lift--.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6446.7%
Applied rewrites46.7%
if 5.5e-25 < y < 7.5999999999999994e51Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -35000000000.0)
t_1
(if (<= t 3e+25) (+ a (* (- y 2.0) b)) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -35000000000.0) {
tmp = t_1;
} else if (t <= 3e+25) {
tmp = a + ((y - 2.0) * b);
} 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-35000000000.0d0)) then
tmp = t_1
else if (t <= 3d+25) then
tmp = a + ((y - 2.0d0) * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -35000000000.0) {
tmp = t_1;
} else if (t <= 3e+25) {
tmp = a + ((y - 2.0) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -35000000000.0: tmp = t_1 elif t <= 3e+25: tmp = a + ((y - 2.0) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -35000000000.0) tmp = t_1; elseif (t <= 3e+25) tmp = Float64(a + Float64(Float64(y - 2.0) * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -35000000000.0) tmp = t_1; elseif (t <= 3e+25) tmp = a + ((y - 2.0) * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -35000000000.0], t$95$1, If[LessEqual[t, 3e+25], N[(a + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -35000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;a + \left(y - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.5e10 or 3.0000000000000001e25 < t Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
if -3.5e10 < t < 3.0000000000000001e25Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in t around 0
Applied rewrites46.3%
Taylor expanded in t around 0
lower--.f6433.2%
Applied rewrites33.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -35000000000.0)
t_1
(if (<= t 2.9e-218)
(+ x (* b (- y 2.0)))
(if (<= t 3e+25) (* y (- b z)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -35000000000.0) {
tmp = t_1;
} else if (t <= 2.9e-218) {
tmp = x + (b * (y - 2.0));
} else if (t <= 3e+25) {
tmp = y * (b - 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-35000000000.0d0)) then
tmp = t_1
else if (t <= 2.9d-218) then
tmp = x + (b * (y - 2.0d0))
else if (t <= 3d+25) then
tmp = y * (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -35000000000.0) {
tmp = t_1;
} else if (t <= 2.9e-218) {
tmp = x + (b * (y - 2.0));
} else if (t <= 3e+25) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -35000000000.0: tmp = t_1 elif t <= 2.9e-218: tmp = x + (b * (y - 2.0)) elif t <= 3e+25: tmp = y * (b - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -35000000000.0) tmp = t_1; elseif (t <= 2.9e-218) tmp = Float64(x + Float64(b * Float64(y - 2.0))); elseif (t <= 3e+25) tmp = Float64(y * Float64(b - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -35000000000.0) tmp = t_1; elseif (t <= 2.9e-218) tmp = x + (b * (y - 2.0)); elseif (t <= 3e+25) tmp = y * (b - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -35000000000.0], t$95$1, If[LessEqual[t, 2.9e-218], N[(x + N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+25], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -35000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-218}:\\
\;\;\;\;x + b \cdot \left(y - 2\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.5e10 or 3.0000000000000001e25 < t Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
if -3.5e10 < t < 2.9000000000000002e-218Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6450.8%
Applied rewrites50.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6437.5%
Applied rewrites37.5%
if 2.9000000000000002e-218 < t < 3.0000000000000001e25Initial program 95.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.6%
Applied rewrites32.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -35000000000.0)
t_1
(if (<= t 8.5e-216)
(+ a (* b y))
(if (<= t 3e+25) (* y (- b z)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -35000000000.0) {
tmp = t_1;
} else if (t <= 8.5e-216) {
tmp = a + (b * y);
} else if (t <= 3e+25) {
tmp = y * (b - 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-35000000000.0d0)) then
tmp = t_1
else if (t <= 8.5d-216) then
tmp = a + (b * y)
else if (t <= 3d+25) then
tmp = y * (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -35000000000.0) {
tmp = t_1;
} else if (t <= 8.5e-216) {
tmp = a + (b * y);
} else if (t <= 3e+25) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -35000000000.0: tmp = t_1 elif t <= 8.5e-216: tmp = a + (b * y) elif t <= 3e+25: tmp = y * (b - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -35000000000.0) tmp = t_1; elseif (t <= 8.5e-216) tmp = Float64(a + Float64(b * y)); elseif (t <= 3e+25) tmp = Float64(y * Float64(b - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -35000000000.0) tmp = t_1; elseif (t <= 8.5e-216) tmp = a + (b * y); elseif (t <= 3e+25) tmp = y * (b - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -35000000000.0], t$95$1, If[LessEqual[t, 8.5e-216], N[(a + N[(b * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+25], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -35000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-216}:\\
\;\;\;\;a + b \cdot y\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.5e10 or 3.0000000000000001e25 < t Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
if -3.5e10 < t < 8.5e-216Initial program 95.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6459.7%
Applied rewrites59.7%
Taylor expanded in t around 0
Applied rewrites46.3%
Taylor expanded in y around inf
lower-*.f6427.2%
Applied rewrites27.2%
if 8.5e-216 < t < 3.0000000000000001e25Initial program 95.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.6%
Applied rewrites32.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -1.72e-77) t_1 (if (<= y 7.6e+51) (* t (- b a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -1.72e-77) {
tmp = t_1;
} else if (y <= 7.6e+51) {
tmp = t * (b - a);
} 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y * (b - z)
if (y <= (-1.72d-77)) then
tmp = t_1
else if (y <= 7.6d+51) then
tmp = t * (b - a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -1.72e-77) {
tmp = t_1;
} else if (y <= 7.6e+51) {
tmp = t * (b - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -1.72e-77: tmp = t_1 elif y <= 7.6e+51: tmp = t * (b - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -1.72e-77) tmp = t_1; elseif (y <= 7.6e+51) tmp = Float64(t * Float64(b - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -1.72e-77) tmp = t_1; elseif (y <= 7.6e+51) tmp = t * (b - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.72e-77], t$95$1, If[LessEqual[y, 7.6e+51], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1.72 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+51}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.72e-77 or 7.5999999999999994e51 < y Initial program 95.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.6%
Applied rewrites32.6%
if -1.72e-77 < y < 7.5999999999999994e51Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -6.2e+23) t_1 (if (<= t 9.5e+24) (+ z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -6.2e+23) {
tmp = t_1;
} else if (t <= 9.5e+24) {
tmp = 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-6.2d+23)) then
tmp = t_1
else if (t <= 9.5d+24) then
tmp = 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 a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -6.2e+23) {
tmp = t_1;
} else if (t <= 9.5e+24) {
tmp = z + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -6.2e+23: tmp = t_1 elif t <= 9.5e+24: tmp = z + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -6.2e+23) tmp = t_1; elseif (t <= 9.5e+24) tmp = Float64(z + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -6.2e+23) tmp = t_1; elseif (t <= 9.5e+24) tmp = z + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+23], t$95$1, If[LessEqual[t, 9.5e+24], N[(z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+24}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -6.1999999999999994e23 or 9.5000000000000001e24 < t Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
if -6.1999999999999994e23 < t < 9.5000000000000001e24Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6425.4%
Applied rewrites25.4%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity25.4%
Applied rewrites25.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -8.5e+24) (* t b) (if (<= t 3e+25) (+ z x) (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.5e+24) {
tmp = t * b;
} else if (t <= 3e+25) {
tmp = z + x;
} else {
tmp = t * b;
}
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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-8.5d+24)) then
tmp = t * b
else if (t <= 3d+25) then
tmp = z + x
else
tmp = t * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.5e+24) {
tmp = t * b;
} else if (t <= 3e+25) {
tmp = z + x;
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8.5e+24: tmp = t * b elif t <= 3e+25: tmp = z + x else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8.5e+24) tmp = Float64(t * b); elseif (t <= 3e+25) tmp = Float64(z + x); else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -8.5e+24) tmp = t * b; elseif (t <= 3e+25) tmp = z + x; else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.5e+24], N[(t * b), $MachinePrecision], If[LessEqual[t, 3e+25], N[(z + x), $MachinePrecision], N[(t * b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+24}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
if t < -8.4999999999999996e24 or 3.0000000000000001e25 < t Initial program 95.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1%
Applied rewrites33.1%
Taylor expanded in a around 0
Applied rewrites17.3%
if -8.4999999999999996e24 < t < 3.0000000000000001e25Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6425.4%
Applied rewrites25.4%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity25.4%
Applied rewrites25.4%
(FPCore (x y z t a b) :precision binary64 (+ z x))
double code(double x, double y, double z, double t, double a, double b) {
return z + 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
code = z + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + x;
}
def code(x, y, z, t, a, b): return z + x
function code(x, y, z, t, a, b) return Float64(z + x) end
function tmp = code(x, y, z, t, a, b) tmp = z + x; end
code[x_, y_, z_, t_, a_, b_] := N[(z + x), $MachinePrecision]
z + x
Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6425.4%
Applied rewrites25.4%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity25.4%
Applied rewrites25.4%
(FPCore (x y z t a b) :precision binary64 z)
double code(double x, double y, double z, double t, double a, double b) {
return 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, a, b)
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), intent (in) :: a
real(8), intent (in) :: b
code = z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z;
}
def code(x, y, z, t, a, b): return z
function code(x, y, z, t, a, b) return z end
function tmp = code(x, y, z, t, a, b) tmp = z; end
code[x_, y_, z_, t_, a_, b_] := z
z
Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.4%
Applied rewrites73.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.7%
Applied rewrites46.7%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6425.4%
Applied rewrites25.4%
Taylor expanded in x around 0
Applied rewrites12.1%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
:precision binary64
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))