
(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]
\begin{array}{l}
\\
\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
\end{array}
Herbie found 21 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]
\begin{array}{l}
\\
\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
\end{array}
(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 (* (- b a) t))))
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 = (b - a) * t;
}
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 = (b - a) * t;
}
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 = (b - a) * t 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(Float64(b - a) * t); 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 = (b - a) * t; 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[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\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}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\end{array}
\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 100.0%
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 0.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.9
Applied rewrites56.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (fma (- (+ t y) 2.0) b x) (* (- t 1.0) a))))
(if (<= b -1e+43)
t_1
(if (<= b 1.2e+18) (- x (fma (- t 1.0) a (* (- y 1.0) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x) - ((t - 1.0) * a);
double tmp;
if (b <= -1e+43) {
tmp = t_1;
} else if (b <= 1.2e+18) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(Float64(t - 1.0) * a)) tmp = 0.0 if (b <= -1e+43) tmp = t_1; elseif (b <= 1.2e+18) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e+43], t$95$1, If[LessEqual[b, 1.2e+18], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a\\
\mathbf{if}\;b \leq -1 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+18}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.00000000000000001e43 or 1.2e18 < b Initial program 90.6%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6483.6
Applied rewrites83.6%
if -1.00000000000000001e43 < b < 1.2e18Initial program 99.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6490.1
Applied rewrites90.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.08e+170)
(* (- (+ t y) 2.0) b)
(if (<= b 6e+16)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(+ (* (- 1.0 y) z) (* (- (+ y t) 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.08e+170) {
tmp = ((t + y) - 2.0) * b;
} else if (b <= 6e+16) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = ((1.0 - y) * z) + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.08e+170) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); elseif (b <= 6e+16) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(Float64(Float64(1.0 - y) * z) + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.08e+170], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 6e+16], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.08 \cdot 10^{+170}:\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+16}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - y\right) \cdot z + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -1.07999999999999996e170Initial program 89.3%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6487.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6487.3
Applied rewrites87.3%
if -1.07999999999999996e170 < b < 6e16Initial program 98.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6484.3
Applied rewrites84.3%
if 6e16 < b Initial program 90.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.5
Applied rewrites76.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.08e+170)
t_1
(if (<= b 1.9e+18) (- x (fma (- t 1.0) a (* (- y 1.0) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.08e+170) {
tmp = t_1;
} else if (b <= 1.9e+18) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.08e+170) tmp = t_1; elseif (b <= 1.9e+18) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.08e+170], t$95$1, If[LessEqual[b, 1.9e+18], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.08 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+18}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.07999999999999996e170 or 1.9e18 < b Initial program 90.2%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6475.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6475.1
Applied rewrites75.1%
if -1.07999999999999996e170 < b < 1.9e18Initial program 98.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6484.2
Applied rewrites84.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -6.8e+43)
t_1
(if (<= b -5.1e-67)
(+ (* (- 1.0 y) z) (* t b))
(if (<= b 1.9e+18) (- x (fma (- t 1.0) a (- z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -6.8e+43) {
tmp = t_1;
} else if (b <= -5.1e-67) {
tmp = ((1.0 - y) * z) + (t * b);
} else if (b <= 1.9e+18) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -6.8e+43) tmp = t_1; elseif (b <= -5.1e-67) tmp = Float64(Float64(Float64(1.0 - y) * z) + Float64(t * b)); elseif (b <= 1.9e+18) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.8e+43], t$95$1, If[LessEqual[b, -5.1e-67], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + N[(t * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.9e+18], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -6.8 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -5.1 \cdot 10^{-67}:\\
\;\;\;\;\left(1 - y\right) \cdot z + t \cdot b\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+18}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.80000000000000024e43 or 1.9e18 < b Initial program 90.6%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.7
Applied rewrites71.7%
if -6.80000000000000024e43 < b < -5.09999999999999982e-67Initial program 99.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.7
Applied rewrites52.7%
Taylor expanded in t around inf
Applied rewrites41.8%
if -5.09999999999999982e-67 < b < 1.9e18Initial program 99.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6492.6
Applied rewrites92.6%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6470.5
Applied rewrites70.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.2e+37)
t_1
(if (<= b 1.9e+18) (- x (fma (- t 1.0) a (- z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.2e+37) {
tmp = t_1;
} else if (b <= 1.9e+18) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.2e+37) tmp = t_1; elseif (b <= 1.9e+18) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.2e+37], t$95$1, If[LessEqual[b, 1.9e+18], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+18}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.2e37 or 1.9e18 < b Initial program 90.7%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.4
Applied rewrites71.4%
if -1.2e37 < b < 1.9e18Initial program 99.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6490.3
Applied rewrites90.3%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6468.9
Applied rewrites68.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- (+ t y) 2.0) b))) (if (<= b -1e+43) t_1 (if (<= b 1.2e+18) (- x (* z (- y 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1e+43) {
tmp = t_1;
} else if (b <= 1.2e+18) {
tmp = x - (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 = ((t + y) - 2.0d0) * b
if (b <= (-1d+43)) then
tmp = t_1
else if (b <= 1.2d+18) then
tmp = x - (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 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1e+43) {
tmp = t_1;
} else if (b <= 1.2e+18) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t + y) - 2.0) * b tmp = 0 if b <= -1e+43: tmp = t_1 elif b <= 1.2e+18: tmp = x - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1e+43) tmp = t_1; elseif (b <= 1.2e+18) tmp = Float64(x - 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 = ((t + y) - 2.0) * b; tmp = 0.0; if (b <= -1e+43) tmp = t_1; elseif (b <= 1.2e+18) tmp = x - (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[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1e+43], t$95$1, If[LessEqual[b, 1.2e+18], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+18}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.00000000000000001e43 or 1.2e18 < b Initial program 90.6%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.6
Applied rewrites71.6%
if -1.00000000000000001e43 < b < 1.2e18Initial program 99.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6490.1
Applied rewrites90.1%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y 2.0) b)))
(if (<= b -6e+191)
t_1
(if (<= b -1.15e+131)
(* (- b a) t)
(if (<= b 4e+103) (- x (* z (- y 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 2.0) * b;
double tmp;
if (b <= -6e+191) {
tmp = t_1;
} else if (b <= -1.15e+131) {
tmp = (b - a) * t;
} else if (b <= 4e+103) {
tmp = x - (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 = (y - 2.0d0) * b
if (b <= (-6d+191)) then
tmp = t_1
else if (b <= (-1.15d+131)) then
tmp = (b - a) * t
else if (b <= 4d+103) then
tmp = x - (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 = (y - 2.0) * b;
double tmp;
if (b <= -6e+191) {
tmp = t_1;
} else if (b <= -1.15e+131) {
tmp = (b - a) * t;
} else if (b <= 4e+103) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y - 2.0) * b tmp = 0 if b <= -6e+191: tmp = t_1 elif b <= -1.15e+131: tmp = (b - a) * t elif b <= 4e+103: tmp = x - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 2.0) * b) tmp = 0.0 if (b <= -6e+191) tmp = t_1; elseif (b <= -1.15e+131) tmp = Float64(Float64(b - a) * t); elseif (b <= 4e+103) tmp = Float64(x - 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 = (y - 2.0) * b; tmp = 0.0; if (b <= -6e+191) tmp = t_1; elseif (b <= -1.15e+131) tmp = (b - a) * t; elseif (b <= 4e+103) tmp = x - (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[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6e+191], t$95$1, If[LessEqual[b, -1.15e+131], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 4e+103], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 2\right) \cdot b\\
\mathbf{if}\;b \leq -6 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.15 \cdot 10^{+131}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+103}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.9999999999999995e191 or 4e103 < b Initial program 89.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6487.5
Applied rewrites87.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6460.0
Applied rewrites60.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6453.7
Applied rewrites53.7%
if -5.9999999999999995e191 < b < -1.14999999999999996e131Initial program 88.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6440.0
Applied rewrites40.0%
if -1.14999999999999996e131 < b < 4e103Initial program 98.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6483.9
Applied rewrites83.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6452.2
Applied rewrites52.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -7.5e+43)
t_1
(if (<= t -2.25e-138)
(* (- 1.0 y) z)
(if (<= t 2.75e-294)
(+ a x)
(if (<= t 7.2e-101)
(* (- y 2.0) b)
(if (<= t 1.55e+23) (- x (- z)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -7.5e+43) {
tmp = t_1;
} else if (t <= -2.25e-138) {
tmp = (1.0 - y) * z;
} else if (t <= 2.75e-294) {
tmp = a + x;
} else if (t <= 7.2e-101) {
tmp = (y - 2.0) * b;
} else if (t <= 1.55e+23) {
tmp = x - -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 = (b - a) * t
if (t <= (-7.5d+43)) then
tmp = t_1
else if (t <= (-2.25d-138)) then
tmp = (1.0d0 - y) * z
else if (t <= 2.75d-294) then
tmp = a + x
else if (t <= 7.2d-101) then
tmp = (y - 2.0d0) * b
else if (t <= 1.55d+23) then
tmp = x - -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 = (b - a) * t;
double tmp;
if (t <= -7.5e+43) {
tmp = t_1;
} else if (t <= -2.25e-138) {
tmp = (1.0 - y) * z;
} else if (t <= 2.75e-294) {
tmp = a + x;
} else if (t <= 7.2e-101) {
tmp = (y - 2.0) * b;
} else if (t <= 1.55e+23) {
tmp = x - -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -7.5e+43: tmp = t_1 elif t <= -2.25e-138: tmp = (1.0 - y) * z elif t <= 2.75e-294: tmp = a + x elif t <= 7.2e-101: tmp = (y - 2.0) * b elif t <= 1.55e+23: tmp = x - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -7.5e+43) tmp = t_1; elseif (t <= -2.25e-138) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 2.75e-294) tmp = Float64(a + x); elseif (t <= 7.2e-101) tmp = Float64(Float64(y - 2.0) * b); elseif (t <= 1.55e+23) tmp = Float64(x - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -7.5e+43) tmp = t_1; elseif (t <= -2.25e-138) tmp = (1.0 - y) * z; elseif (t <= 2.75e-294) tmp = a + x; elseif (t <= 7.2e-101) tmp = (y - 2.0) * b; elseif (t <= 1.55e+23) tmp = x - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -7.5e+43], t$95$1, If[LessEqual[t, -2.25e-138], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 2.75e-294], N[(a + x), $MachinePrecision], If[LessEqual[t, 7.2e-101], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 1.55e+23], N[(x - (-z)), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{-138}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-294}:\\
\;\;\;\;a + x\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-101}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+23}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.49999999999999967e43 or 1.54999999999999985e23 < t Initial program 92.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.4
Applied rewrites67.4%
if -7.49999999999999967e43 < t < -2.25000000000000004e-138Initial program 97.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6430.7
Applied rewrites30.7%
if -2.25000000000000004e-138 < t < 2.75e-294Initial program 97.6%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.3
Applied rewrites69.3%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6469.3
Applied rewrites69.3%
Taylor expanded in b around 0
lower-+.f6437.3
Applied rewrites37.3%
if 2.75e-294 < t < 7.19999999999999999e-101Initial program 98.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6468.6
Applied rewrites68.6%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6468.6
Applied rewrites68.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6432.7
Applied rewrites32.7%
if 7.19999999999999999e-101 < t < 1.54999999999999985e23Initial program 97.8%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.3
Applied rewrites72.3%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6453.8
Applied rewrites53.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6434.5
Applied rewrites34.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -15500.0) t_1 (if (<= y 1.05e+31) (+ (fma -2.0 b x) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -15500.0) {
tmp = t_1;
} else if (y <= 1.05e+31) {
tmp = fma(-2.0, b, x) + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -15500.0) tmp = t_1; elseif (y <= 1.05e+31) tmp = Float64(fma(-2.0, b, x) + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -15500.0], t$95$1, If[LessEqual[y, 1.05e+31], N[(N[(-2.0 * b + x), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -15500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, x\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -15500 or 1.04999999999999989e31 < y Initial program 92.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.0
Applied rewrites66.0%
if -15500 < y < 1.04999999999999989e31Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6479.8
Applied rewrites79.8%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6443.8
Applied rewrites43.8%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6442.8
Applied rewrites42.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -1.65e+102)
t_1
(if (<= y -2.25e-120)
(* (- b a) t)
(if (<= y 3600000000.0) (- x (- z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -1.65e+102) {
tmp = t_1;
} else if (y <= -2.25e-120) {
tmp = (b - a) * t;
} else if (y <= 3600000000.0) {
tmp = x - -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 = (b - z) * y
if (y <= (-1.65d+102)) then
tmp = t_1
else if (y <= (-2.25d-120)) then
tmp = (b - a) * t
else if (y <= 3600000000.0d0) then
tmp = x - -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 = (b - z) * y;
double tmp;
if (y <= -1.65e+102) {
tmp = t_1;
} else if (y <= -2.25e-120) {
tmp = (b - a) * t;
} else if (y <= 3600000000.0) {
tmp = x - -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -1.65e+102: tmp = t_1 elif y <= -2.25e-120: tmp = (b - a) * t elif y <= 3600000000.0: tmp = x - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -1.65e+102) tmp = t_1; elseif (y <= -2.25e-120) tmp = Float64(Float64(b - a) * t); elseif (y <= 3600000000.0) tmp = Float64(x - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -1.65e+102) tmp = t_1; elseif (y <= -2.25e-120) tmp = (b - a) * t; elseif (y <= 3600000000.0) tmp = x - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.65e+102], t$95$1, If[LessEqual[y, -2.25e-120], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 3600000000.0], N[(x - (-z)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-120}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 3600000000:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.64999999999999999e102 or 3.6e9 < y Initial program 91.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.1
Applied rewrites69.1%
if -1.64999999999999999e102 < y < -2.25e-120Initial program 97.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6439.6
Applied rewrites39.6%
if -2.25e-120 < y < 3.6e9Initial program 98.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.2
Applied rewrites69.2%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6438.0
Applied rewrites38.0%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6437.4
Applied rewrites37.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y 2.0) b)))
(if (<= b -6e+191)
t_1
(if (<= b -1.4e+170)
(* b t)
(if (<= b -1.72e-44)
(* (- 1.0 t) a)
(if (<= b 1.2e+18) (- x (- z)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 2.0) * b;
double tmp;
if (b <= -6e+191) {
tmp = t_1;
} else if (b <= -1.4e+170) {
tmp = b * t;
} else if (b <= -1.72e-44) {
tmp = (1.0 - t) * a;
} else if (b <= 1.2e+18) {
tmp = x - -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 = (y - 2.0d0) * b
if (b <= (-6d+191)) then
tmp = t_1
else if (b <= (-1.4d+170)) then
tmp = b * t
else if (b <= (-1.72d-44)) then
tmp = (1.0d0 - t) * a
else if (b <= 1.2d+18) then
tmp = x - -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 = (y - 2.0) * b;
double tmp;
if (b <= -6e+191) {
tmp = t_1;
} else if (b <= -1.4e+170) {
tmp = b * t;
} else if (b <= -1.72e-44) {
tmp = (1.0 - t) * a;
} else if (b <= 1.2e+18) {
tmp = x - -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y - 2.0) * b tmp = 0 if b <= -6e+191: tmp = t_1 elif b <= -1.4e+170: tmp = b * t elif b <= -1.72e-44: tmp = (1.0 - t) * a elif b <= 1.2e+18: tmp = x - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 2.0) * b) tmp = 0.0 if (b <= -6e+191) tmp = t_1; elseif (b <= -1.4e+170) tmp = Float64(b * t); elseif (b <= -1.72e-44) tmp = Float64(Float64(1.0 - t) * a); elseif (b <= 1.2e+18) tmp = Float64(x - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y - 2.0) * b; tmp = 0.0; if (b <= -6e+191) tmp = t_1; elseif (b <= -1.4e+170) tmp = b * t; elseif (b <= -1.72e-44) tmp = (1.0 - t) * a; elseif (b <= 1.2e+18) tmp = x - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6e+191], t$95$1, If[LessEqual[b, -1.4e+170], N[(b * t), $MachinePrecision], If[LessEqual[b, -1.72e-44], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 1.2e+18], N[(x - (-z)), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 2\right) \cdot b\\
\mathbf{if}\;b \leq -6 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.4 \cdot 10^{+170}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq -1.72 \cdot 10^{-44}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+18}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.9999999999999995e191 or 1.2e18 < b Initial program 90.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6484.9
Applied rewrites84.9%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6456.4
Applied rewrites56.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6447.5
Applied rewrites47.5%
if -5.9999999999999995e191 < b < -1.40000000000000008e170Initial program 87.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in a around 0
Applied rewrites31.2%
if -1.40000000000000008e170 < b < -1.72e-44Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.3
Applied rewrites27.3%
if -1.72e-44 < b < 1.2e18Initial program 99.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6458.0
Applied rewrites58.0%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6435.5
Applied rewrites35.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)))
(if (<= z -1.45e+41)
t_1
(if (<= z -1.25e-213) (* (- y 2.0) b) (if (<= z 1.35e+26) (+ a x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -1.45e+41) {
tmp = t_1;
} else if (z <= -1.25e-213) {
tmp = (y - 2.0) * b;
} else if (z <= 1.35e+26) {
tmp = a + 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 = (1.0d0 - y) * z
if (z <= (-1.45d+41)) then
tmp = t_1
else if (z <= (-1.25d-213)) then
tmp = (y - 2.0d0) * b
else if (z <= 1.35d+26) then
tmp = a + 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 = (1.0 - y) * z;
double tmp;
if (z <= -1.45e+41) {
tmp = t_1;
} else if (z <= -1.25e-213) {
tmp = (y - 2.0) * b;
} else if (z <= 1.35e+26) {
tmp = a + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z tmp = 0 if z <= -1.45e+41: tmp = t_1 elif z <= -1.25e-213: tmp = (y - 2.0) * b elif z <= 1.35e+26: tmp = a + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if (z <= -1.45e+41) tmp = t_1; elseif (z <= -1.25e-213) tmp = Float64(Float64(y - 2.0) * b); elseif (z <= 1.35e+26) tmp = Float64(a + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; tmp = 0.0; if (z <= -1.45e+41) tmp = t_1; elseif (z <= -1.25e-213) tmp = (y - 2.0) * b; elseif (z <= 1.35e+26) tmp = a + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.45e+41], t$95$1, If[LessEqual[z, -1.25e-213], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 1.35e+26], N[(a + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-213}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+26}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.44999999999999994e41 or 1.35e26 < z Initial program 92.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6453.6
Applied rewrites53.6%
if -1.44999999999999994e41 < z < -1.24999999999999994e-213Initial program 97.5%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6489.5
Applied rewrites89.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6428.9
Applied rewrites28.9%
if -1.24999999999999994e-213 < z < 1.35e26Initial program 97.7%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6493.1
Applied rewrites93.1%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6462.2
Applied rewrites62.2%
Taylor expanded in b around 0
lower-+.f6434.1
Applied rewrites34.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y 2.0) b)))
(if (<= b -1e+43)
t_1
(if (<= b -5e-68) (* (- z) y) (if (<= b 1.2e+18) (- x (- z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 2.0) * b;
double tmp;
if (b <= -1e+43) {
tmp = t_1;
} else if (b <= -5e-68) {
tmp = -z * y;
} else if (b <= 1.2e+18) {
tmp = x - -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 = (y - 2.0d0) * b
if (b <= (-1d+43)) then
tmp = t_1
else if (b <= (-5d-68)) then
tmp = -z * y
else if (b <= 1.2d+18) then
tmp = x - -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 = (y - 2.0) * b;
double tmp;
if (b <= -1e+43) {
tmp = t_1;
} else if (b <= -5e-68) {
tmp = -z * y;
} else if (b <= 1.2e+18) {
tmp = x - -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y - 2.0) * b tmp = 0 if b <= -1e+43: tmp = t_1 elif b <= -5e-68: tmp = -z * y elif b <= 1.2e+18: tmp = x - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 2.0) * b) tmp = 0.0 if (b <= -1e+43) tmp = t_1; elseif (b <= -5e-68) tmp = Float64(Float64(-z) * y); elseif (b <= 1.2e+18) tmp = Float64(x - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y - 2.0) * b; tmp = 0.0; if (b <= -1e+43) tmp = t_1; elseif (b <= -5e-68) tmp = -z * y; elseif (b <= 1.2e+18) tmp = x - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1e+43], t$95$1, If[LessEqual[b, -5e-68], N[((-z) * y), $MachinePrecision], If[LessEqual[b, 1.2e+18], N[(x - (-z)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -5 \cdot 10^{-68}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+18}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.00000000000000001e43 or 1.2e18 < b Initial program 90.6%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6483.6
Applied rewrites83.6%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6455.5
Applied rewrites55.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.9
Applied rewrites44.9%
if -1.00000000000000001e43 < b < -4.99999999999999971e-68Initial program 99.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.9
Applied rewrites27.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6420.8
Applied rewrites20.8%
if -4.99999999999999971e-68 < b < 1.2e18Initial program 99.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6492.7
Applied rewrites92.7%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6458.3
Applied rewrites58.3%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6435.7
Applied rewrites35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.6e+183) (* (- z) y) (if (<= y -15500.0) (* b y) (if (<= y 1.25e+31) (- x (- z)) (* b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.6e+183) {
tmp = -z * y;
} else if (y <= -15500.0) {
tmp = b * y;
} else if (y <= 1.25e+31) {
tmp = x - -z;
} else {
tmp = 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 (y <= (-2.6d+183)) then
tmp = -z * y
else if (y <= (-15500.0d0)) then
tmp = b * y
else if (y <= 1.25d+31) then
tmp = x - -z
else
tmp = 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 (y <= -2.6e+183) {
tmp = -z * y;
} else if (y <= -15500.0) {
tmp = b * y;
} else if (y <= 1.25e+31) {
tmp = x - -z;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.6e+183: tmp = -z * y elif y <= -15500.0: tmp = b * y elif y <= 1.25e+31: tmp = x - -z else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.6e+183) tmp = Float64(Float64(-z) * y); elseif (y <= -15500.0) tmp = Float64(b * y); elseif (y <= 1.25e+31) tmp = Float64(x - Float64(-z)); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.6e+183) tmp = -z * y; elseif (y <= -15500.0) tmp = b * y; elseif (y <= 1.25e+31) tmp = x - -z; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.6e+183], N[((-z) * y), $MachinePrecision], If[LessEqual[y, -15500.0], N[(b * y), $MachinePrecision], If[LessEqual[y, 1.25e+31], N[(x - (-z)), $MachinePrecision], N[(b * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+183}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{elif}\;y \leq -15500:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+31}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -2.5999999999999999e183Initial program 89.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.4
Applied rewrites81.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6446.5
Applied rewrites46.5%
if -2.5999999999999999e183 < y < -15500 or 1.25000000000000007e31 < y Initial program 93.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6461.6
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites32.1%
if -15500 < y < 1.25000000000000007e31Initial program 98.1%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.1
Applied rewrites69.1%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6437.9
Applied rewrites37.9%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6436.4
Applied rewrites36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -15500.0) (* b y) (if (<= y 1.25e+31) (- x (- z)) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -15500.0) {
tmp = b * y;
} else if (y <= 1.25e+31) {
tmp = x - -z;
} else {
tmp = 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 (y <= (-15500.0d0)) then
tmp = b * y
else if (y <= 1.25d+31) then
tmp = x - -z
else
tmp = 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 (y <= -15500.0) {
tmp = b * y;
} else if (y <= 1.25e+31) {
tmp = x - -z;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -15500.0: tmp = b * y elif y <= 1.25e+31: tmp = x - -z else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -15500.0) tmp = Float64(b * y); elseif (y <= 1.25e+31) tmp = Float64(x - Float64(-z)); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -15500.0) tmp = b * y; elseif (y <= 1.25e+31) tmp = x - -z; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -15500.0], N[(b * y), $MachinePrecision], If[LessEqual[y, 1.25e+31], N[(x - (-z)), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -15500:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+31}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -15500 or 1.25000000000000007e31 < y Initial program 92.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.0
Applied rewrites66.0%
Taylor expanded in z around 0
Applied rewrites35.1%
if -15500 < y < 1.25000000000000007e31Initial program 98.1%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6469.1
Applied rewrites69.1%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6437.9
Applied rewrites37.9%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6436.4
Applied rewrites36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -9.2e+235) (* b y) (if (<= b -4.2e+104) (* b t) (if (<= b 9.5e+70) (+ a x) (* b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.2e+235) {
tmp = b * y;
} else if (b <= -4.2e+104) {
tmp = b * t;
} else if (b <= 9.5e+70) {
tmp = a + x;
} else {
tmp = 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 (b <= (-9.2d+235)) then
tmp = b * y
else if (b <= (-4.2d+104)) then
tmp = b * t
else if (b <= 9.5d+70) then
tmp = a + x
else
tmp = 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 (b <= -9.2e+235) {
tmp = b * y;
} else if (b <= -4.2e+104) {
tmp = b * t;
} else if (b <= 9.5e+70) {
tmp = a + x;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.2e+235: tmp = b * y elif b <= -4.2e+104: tmp = b * t elif b <= 9.5e+70: tmp = a + x else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.2e+235) tmp = Float64(b * y); elseif (b <= -4.2e+104) tmp = Float64(b * t); elseif (b <= 9.5e+70) tmp = Float64(a + x); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -9.2e+235) tmp = b * y; elseif (b <= -4.2e+104) tmp = b * t; elseif (b <= 9.5e+70) tmp = a + x; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.2e+235], N[(b * y), $MachinePrecision], If[LessEqual[b, -4.2e+104], N[(b * t), $MachinePrecision], If[LessEqual[b, 9.5e+70], N[(a + x), $MachinePrecision], N[(b * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{+235}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{+104}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+70}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if b < -9.2e235 or 9.5000000000000002e70 < b Initial program 89.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6441.8
Applied rewrites41.8%
Taylor expanded in z around 0
Applied rewrites36.6%
if -9.2e235 < b < -4.1999999999999997e104Initial program 90.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6439.8
Applied rewrites39.8%
Taylor expanded in a around 0
Applied rewrites33.2%
if -4.1999999999999997e104 < b < 9.5000000000000002e70Initial program 98.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6440.4
Applied rewrites40.4%
Taylor expanded in b around 0
lower-+.f6432.9
Applied rewrites32.9%
(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 -5e+304) (* b t) (if (<= t_1 5e+303) (+ a x) (* b t)))))
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 <= -5e+304) {
tmp = b * t;
} else if (t_1 <= 5e+303) {
tmp = a + x;
} else {
tmp = b * t;
}
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 - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
if (t_1 <= (-5d+304)) then
tmp = b * t
else if (t_1 <= 5d+303) then
tmp = a + x
else
tmp = b * t
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 - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -5e+304) {
tmp = b * t;
} else if (t_1 <= 5e+303) {
tmp = a + x;
} else {
tmp = b * t;
}
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 <= -5e+304: tmp = b * t elif t_1 <= 5e+303: tmp = a + x else: tmp = b * t 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 <= -5e+304) tmp = Float64(b * t); elseif (t_1 <= 5e+303) tmp = Float64(a + x); else tmp = Float64(b * t); 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 <= -5e+304) tmp = b * t; elseif (t_1 <= 5e+303) tmp = a + x; else tmp = b * t; 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, -5e+304], N[(b * t), $MachinePrecision], If[LessEqual[t$95$1, 5e+303], N[(a + x), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\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 -5 \cdot 10^{+304}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\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)) < -4.9999999999999997e304 or 4.9999999999999997e303 < (+.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 88.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.0
Applied rewrites54.0%
Taylor expanded in a around 0
Applied rewrites30.5%
if -4.9999999999999997e304 < (+.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)) < 4.9999999999999997e303Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.7
Applied rewrites74.7%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6455.1
Applied rewrites55.1%
Taylor expanded in b around 0
lower-+.f6437.2
Applied rewrites37.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8e+108) z (if (<= z 4.3e+74) (+ a x) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+108) {
tmp = z;
} else if (z <= 4.3e+74) {
tmp = a + x;
} else {
tmp = 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 <= (-8d+108)) then
tmp = z
else if (z <= 4.3d+74) then
tmp = a + x
else
tmp = 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 <= -8e+108) {
tmp = z;
} else if (z <= 4.3e+74) {
tmp = a + x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8e+108: tmp = z elif z <= 4.3e+74: tmp = a + x else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8e+108) tmp = z; elseif (z <= 4.3e+74) tmp = Float64(a + x); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -8e+108) tmp = z; elseif (z <= 4.3e+74) tmp = a + x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8e+108], z, If[LessEqual[z, 4.3e+74], N[(a + x), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+108}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+74}:\\
\;\;\;\;a + x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -8.0000000000000003e108 or 4.30000000000000001e74 < z Initial program 92.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6459.7
Applied rewrites59.7%
Taylor expanded in y around 0
Applied rewrites23.0%
if -8.0000000000000003e108 < z < 4.30000000000000001e74Initial program 97.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6488.9
Applied rewrites88.9%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
Taylor expanded in b around 0
lower-+.f6431.6
Applied rewrites31.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.8e+108) z (if (<= z 9.5e+25) x z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.8e+108) {
tmp = z;
} else if (z <= 9.5e+25) {
tmp = x;
} else {
tmp = 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 <= (-1.8d+108)) then
tmp = z
else if (z <= 9.5d+25) then
tmp = x
else
tmp = 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 <= -1.8e+108) {
tmp = z;
} else if (z <= 9.5e+25) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.8e+108: tmp = z elif z <= 9.5e+25: tmp = x else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.8e+108) tmp = z; elseif (z <= 9.5e+25) tmp = x; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.8e+108) tmp = z; elseif (z <= 9.5e+25) tmp = x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.8e+108], z, If[LessEqual[z, 9.5e+25], x, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+108}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.8e108 or 9.5000000000000005e25 < z Initial program 92.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.4
Applied rewrites56.4%
Taylor expanded in y around 0
Applied rewrites21.5%
if -1.8e108 < z < 9.5000000000000005e25Initial program 97.5%
Taylor expanded in x around inf
Applied rewrites20.5%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return 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 = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.5%
Taylor expanded in x around inf
Applied rewrites15.9%
herbie shell --seed 2025114
(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)))