
(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 29 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 (+ (* (- 1.0 y) z) (* t b)))))
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 = ((1.0 - y) * z) + (t * b);
}
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 = ((1.0 - y) * z) + (t * b);
}
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 = ((1.0 - y) * z) + (t * b) 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(Float64(1.0 - y) * z) + Float64(t * b)); 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 = ((1.0 - y) * z) + (t * b); 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[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + N[(t * b), $MachinePrecision]), $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(1 - y\right) \cdot z + t \cdot b\\
\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 z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6425.1
Applied rewrites25.1%
Taylor expanded in t around inf
Applied rewrites40.5%
(FPCore (x y z t a b) :precision binary64 (+ x (- (fma (- b a) t (* (- y 2.0) b)) (fma (- y 1.0) z (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (fma((b - a), t, ((y - 2.0) * b)) - fma((y - 1.0), z, -a));
}
function code(x, y, z, t, a, b) return Float64(x + Float64(fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b)) - fma(Float64(y - 1.0), z, Float64(-a)))) end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) - \mathsf{fma}\left(y - 1, z, -a\right)\right)
\end{array}
Initial program 95.5%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.5
Applied rewrites96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2.3e+95)
(+ (* (- 1.0 y) z) t_1)
(if (<= b 1.15e+35)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(if (<= b 6.2e+116) (+ (* (- 1.0 t) a) t_1) (+ x t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2.3e+95) {
tmp = ((1.0 - y) * z) + t_1;
} else if (b <= 1.15e+35) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else if (b <= 6.2e+116) {
tmp = ((1.0 - t) * a) + t_1;
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2.3e+95) tmp = Float64(Float64(Float64(1.0 - y) * z) + t_1); elseif (b <= 1.15e+35) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); elseif (b <= 6.2e+116) tmp = Float64(Float64(Float64(1.0 - t) * a) + t_1); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.3e+95], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[b, 1.15e+35], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+116], N[(N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+95}:\\
\;\;\;\;\left(1 - y\right) \cdot z + t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{+116}:\\
\;\;\;\;\left(1 - t\right) \cdot a + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -2.29999999999999997e95Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
if -2.29999999999999997e95 < b < 1.1499999999999999e35Initial program 98.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-*.f6487.5
Applied rewrites87.5%
if 1.1499999999999999e35 < b < 6.19999999999999992e116Initial program 94.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.5
Applied rewrites62.5%
if 6.19999999999999992e116 < b Initial program 89.4%
Taylor expanded in x around inf
Applied rewrites84.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2.3e+95)
(+ z t_1)
(if (<= b 1.15e+35)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(if (<= b 6.2e+116) (+ (* (- 1.0 t) a) t_1) (+ x t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2.3e+95) {
tmp = z + t_1;
} else if (b <= 1.15e+35) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else if (b <= 6.2e+116) {
tmp = ((1.0 - t) * a) + t_1;
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2.3e+95) tmp = Float64(z + t_1); elseif (b <= 1.15e+35) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); elseif (b <= 6.2e+116) tmp = Float64(Float64(Float64(1.0 - t) * a) + t_1); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.3e+95], N[(z + t$95$1), $MachinePrecision], If[LessEqual[b, 1.15e+35], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+116], N[(N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+95}:\\
\;\;\;\;z + t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{+116}:\\
\;\;\;\;\left(1 - t\right) \cdot a + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -2.29999999999999997e95Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in y around 0
Applied rewrites80.2%
if -2.29999999999999997e95 < b < 1.1499999999999999e35Initial program 98.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-*.f6487.5
Applied rewrites87.5%
if 1.1499999999999999e35 < b < 6.19999999999999992e116Initial program 94.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.5
Applied rewrites62.5%
if 6.19999999999999992e116 < b Initial program 89.4%
Taylor expanded in x around inf
Applied rewrites84.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
(if (<= z -1.5e+120)
t_1
(if (<= z 6.8e+115) (- (fma (- (+ t y) 2.0) b x) (* (- t 1.0) a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - fma((t - 1.0), a, ((y - 1.0) * z));
double tmp;
if (z <= -1.5e+120) {
tmp = t_1;
} else if (z <= 6.8e+115) {
tmp = fma(((t + y) - 2.0), b, x) - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))) tmp = 0.0 if (z <= -1.5e+120) tmp = t_1; elseif (z <= 6.8e+115) tmp = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+120], t$95$1, If[LessEqual[z, 6.8e+115], N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5e120 or 6.8000000000000001e115 < z Initial program 90.6%
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.2
Applied rewrites83.2%
if -1.5e120 < z < 6.8000000000000001e115Initial 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-*.f6487.4
Applied rewrites87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2.3e+95)
(+ z t_1)
(if (<= b 1.15e+35)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(if (<= b 5.2e+116) (+ (* (- a) t) t_1) (+ x t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2.3e+95) {
tmp = z + t_1;
} else if (b <= 1.15e+35) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else if (b <= 5.2e+116) {
tmp = (-a * t) + t_1;
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2.3e+95) tmp = Float64(z + t_1); elseif (b <= 1.15e+35) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); elseif (b <= 5.2e+116) tmp = Float64(Float64(Float64(-a) * t) + t_1); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.3e+95], N[(z + t$95$1), $MachinePrecision], If[LessEqual[b, 1.15e+35], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e+116], N[(N[((-a) * t), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+95}:\\
\;\;\;\;z + t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+116}:\\
\;\;\;\;\left(-a\right) \cdot t + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -2.29999999999999997e95Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in y around 0
Applied rewrites80.2%
if -2.29999999999999997e95 < b < 1.1499999999999999e35Initial program 98.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-*.f6487.5
Applied rewrites87.5%
if 1.1499999999999999e35 < b < 5.19999999999999973e116Initial program 94.4%
Taylor expanded in t around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6454.4
Applied rewrites54.4%
if 5.19999999999999973e116 < b Initial program 89.4%
Taylor expanded in x around inf
Applied rewrites84.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2.3e+95)
(+ z t_1)
(if (<= b 1.15e+35)
(- x (fma t a (* (- y 1.0) z)))
(if (<= b 5.2e+116) (+ (* (- a) t) t_1) (+ x t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2.3e+95) {
tmp = z + t_1;
} else if (b <= 1.15e+35) {
tmp = x - fma(t, a, ((y - 1.0) * z));
} else if (b <= 5.2e+116) {
tmp = (-a * t) + t_1;
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2.3e+95) tmp = Float64(z + t_1); elseif (b <= 1.15e+35) tmp = Float64(x - fma(t, a, Float64(Float64(y - 1.0) * z))); elseif (b <= 5.2e+116) tmp = Float64(Float64(Float64(-a) * t) + t_1); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.3e+95], N[(z + t$95$1), $MachinePrecision], If[LessEqual[b, 1.15e+35], N[(x - N[(t * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e+116], N[(N[((-a) * t), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+95}:\\
\;\;\;\;z + t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - \mathsf{fma}\left(t, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+116}:\\
\;\;\;\;\left(-a\right) \cdot t + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -2.29999999999999997e95Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in y around 0
Applied rewrites80.2%
if -2.29999999999999997e95 < b < 1.1499999999999999e35Initial program 98.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-*.f6487.5
Applied rewrites87.5%
Taylor expanded in t around inf
Applied rewrites74.7%
if 1.1499999999999999e35 < b < 5.19999999999999973e116Initial program 94.4%
Taylor expanded in t around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6454.4
Applied rewrites54.4%
if 5.19999999999999973e116 < b Initial program 89.4%
Taylor expanded in x around inf
Applied rewrites84.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2.3e+95)
(+ z t_1)
(if (<= b 4.9e+19) (- x (fma t a (* (- y 1.0) z))) (+ x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2.3e+95) {
tmp = z + t_1;
} else if (b <= 4.9e+19) {
tmp = x - fma(t, a, ((y - 1.0) * z));
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2.3e+95) tmp = Float64(z + t_1); elseif (b <= 4.9e+19) tmp = Float64(x - fma(t, a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.3e+95], N[(z + t$95$1), $MachinePrecision], If[LessEqual[b, 4.9e+19], N[(x - N[(t * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{+95}:\\
\;\;\;\;z + t\_1\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{+19}:\\
\;\;\;\;x - \mathsf{fma}\left(t, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -2.29999999999999997e95Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in y around 0
Applied rewrites80.2%
if -2.29999999999999997e95 < b < 4.9e19Initial program 98.7%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6488.0
Applied rewrites88.0%
Taylor expanded in t around inf
Applied rewrites75.1%
if 4.9e19 < b Initial program 91.4%
Taylor expanded in x around inf
Applied rewrites75.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -1.32e+76)
(+ z t_1)
(if (<= b 2.1e+18) (- x (fma z (- y 1.0) (- a))) (+ x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -1.32e+76) {
tmp = z + t_1;
} else if (b <= 2.1e+18) {
tmp = x - fma(z, (y - 1.0), -a);
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -1.32e+76) tmp = Float64(z + t_1); elseif (b <= 2.1e+18) tmp = Float64(x - fma(z, Float64(y - 1.0), Float64(-a))); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.32e+76], N[(z + t$95$1), $MachinePrecision], If[LessEqual[b, 2.1e+18], N[(x - N[(z * N[(y - 1.0), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.32 \cdot 10^{+76}:\\
\;\;\;\;z + t\_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+18}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y - 1, -a\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -1.31999999999999999e76Initial program 89.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.0
Applied rewrites79.0%
Taylor expanded in y around 0
Applied rewrites78.7%
if -1.31999999999999999e76 < b < 2.1e18Initial program 98.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6488.8
Applied rewrites88.8%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6467.0
Applied rewrites67.0%
if 2.1e18 < b Initial program 91.4%
Taylor expanded in x around inf
Applied rewrites75.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2.8e+95)
(+ z t_1)
(if (<= b -3.8e-35)
(+ x (* (- b a) t))
(if (<= b -2.1e-149)
(- x (* z (- y 1.0)))
(if (<= b 2.1e+18) (- x (fma z y (- a))) (+ x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2.8e+95) {
tmp = z + t_1;
} else if (b <= -3.8e-35) {
tmp = x + ((b - a) * t);
} else if (b <= -2.1e-149) {
tmp = x - (z * (y - 1.0));
} else if (b <= 2.1e+18) {
tmp = x - fma(z, y, -a);
} else {
tmp = x + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2.8e+95) tmp = Float64(z + t_1); elseif (b <= -3.8e-35) tmp = Float64(x + Float64(Float64(b - a) * t)); elseif (b <= -2.1e-149) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 2.1e+18) tmp = Float64(x - fma(z, y, Float64(-a))); else tmp = Float64(x + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.8e+95], N[(z + t$95$1), $MachinePrecision], If[LessEqual[b, -3.8e-35], N[(x + N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.1e-149], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+18], N[(x - N[(z * y + (-a)), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.8 \cdot 10^{+95}:\\
\;\;\;\;z + t\_1\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-35}:\\
\;\;\;\;x + \left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq -2.1 \cdot 10^{-149}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+18}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y, -a\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if b < -2.7999999999999998e95Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
Taylor expanded in y around 0
Applied rewrites80.2%
if -2.7999999999999998e95 < b < -3.8000000000000001e-35Initial program 96.2%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.7
Applied rewrites97.7%
Taylor expanded in t around inf
*-commutativeN/A
lift--.f64N/A
lift-*.f6448.0
Applied rewrites48.0%
if -3.8000000000000001e-35 < b < -2.10000000000000011e-149Initial program 99.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-*.f6489.5
Applied rewrites89.5%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6455.8
Applied rewrites55.8%
if -2.10000000000000011e-149 < b < 2.1e18Initial program 99.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-*.f6492.7
Applied rewrites92.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6469.6
Applied rewrites69.6%
Taylor expanded in y around inf
Applied rewrites57.0%
if 2.1e18 < b Initial program 91.4%
Taylor expanded in x around inf
Applied rewrites75.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* z (- y 1.0)))))
(if (<= z -1.5e+120)
t_1
(if (<= z 5e-26)
(+ x (* (- (+ y t) 2.0) b))
(if (<= z 2.55e+122) (+ x (* (- b a) t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (z * (y - 1.0));
double tmp;
if (z <= -1.5e+120) {
tmp = t_1;
} else if (z <= 5e-26) {
tmp = x + (((y + t) - 2.0) * b);
} else if (z <= 2.55e+122) {
tmp = x + ((b - a) * t);
} 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 - (z * (y - 1.0d0))
if (z <= (-1.5d+120)) then
tmp = t_1
else if (z <= 5d-26) then
tmp = x + (((y + t) - 2.0d0) * b)
else if (z <= 2.55d+122) then
tmp = x + ((b - a) * t)
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 - (z * (y - 1.0));
double tmp;
if (z <= -1.5e+120) {
tmp = t_1;
} else if (z <= 5e-26) {
tmp = x + (((y + t) - 2.0) * b);
} else if (z <= 2.55e+122) {
tmp = x + ((b - a) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (z * (y - 1.0)) tmp = 0 if z <= -1.5e+120: tmp = t_1 elif z <= 5e-26: tmp = x + (((y + t) - 2.0) * b) elif z <= 2.55e+122: tmp = x + ((b - a) * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(z * Float64(y - 1.0))) tmp = 0.0 if (z <= -1.5e+120) tmp = t_1; elseif (z <= 5e-26) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); elseif (z <= 2.55e+122) tmp = Float64(x + Float64(Float64(b - a) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (z * (y - 1.0)); tmp = 0.0; if (z <= -1.5e+120) tmp = t_1; elseif (z <= 5e-26) tmp = x + (((y + t) - 2.0) * b); elseif (z <= 2.55e+122) tmp = x + ((b - a) * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+120], t$95$1, If[LessEqual[z, 5e-26], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e+122], N[(x + N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot \left(y - 1\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-26}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+122}:\\
\;\;\;\;x + \left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5e120 or 2.55e122 < z Initial program 90.6%
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.3
Applied rewrites83.3%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6469.2
Applied rewrites69.2%
if -1.5e120 < z < 5.00000000000000019e-26Initial program 98.0%
Taylor expanded in x around inf
Applied rewrites61.0%
if 5.00000000000000019e-26 < z < 2.55e122Initial program 95.9%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.0
Applied rewrites97.0%
Taylor expanded in t around inf
*-commutativeN/A
lift--.f64N/A
lift-*.f6448.9
Applied rewrites48.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -2.8e+95)
t_1
(if (<= b -3.8e-35)
(+ x (* (- b a) t))
(if (<= b -2.1e-149)
(- x (* z (- y 1.0)))
(if (<= b 5.6e+28) (- x (fma z y (- a))) 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 <= -2.8e+95) {
tmp = t_1;
} else if (b <= -3.8e-35) {
tmp = x + ((b - a) * t);
} else if (b <= -2.1e-149) {
tmp = x - (z * (y - 1.0));
} else if (b <= 5.6e+28) {
tmp = x - fma(z, y, -a);
} 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 <= -2.8e+95) tmp = t_1; elseif (b <= -3.8e-35) tmp = Float64(x + Float64(Float64(b - a) * t)); elseif (b <= -2.1e-149) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 5.6e+28) tmp = Float64(x - fma(z, y, Float64(-a))); 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, -2.8e+95], t$95$1, If[LessEqual[b, -3.8e-35], N[(x + N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.1e-149], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e+28], N[(x - N[(z * y + (-a)), $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 -2.8 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-35}:\\
\;\;\;\;x + \left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq -2.1 \cdot 10^{-149}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+28}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y, -a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.7999999999999998e95 or 5.6000000000000003e28 < b Initial program 90.4%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.5
Applied rewrites71.5%
if -2.7999999999999998e95 < b < -3.8000000000000001e-35Initial program 96.2%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.7
Applied rewrites97.7%
Taylor expanded in t around inf
*-commutativeN/A
lift--.f64N/A
lift-*.f6448.0
Applied rewrites48.0%
if -3.8000000000000001e-35 < b < -2.10000000000000011e-149Initial program 99.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-*.f6489.5
Applied rewrites89.5%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6455.8
Applied rewrites55.8%
if -2.10000000000000011e-149 < b < 5.6000000000000003e28Initial program 99.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-*.f6492.0
Applied rewrites92.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6469.1
Applied rewrites69.1%
Taylor expanded in y around inf
Applied rewrites56.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -2.8e+95)
t_1
(if (<= b -3.8e-35)
(+ x (* (- b a) t))
(if (<= b 1.15e+35) (- 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 <= -2.8e+95) {
tmp = t_1;
} else if (b <= -3.8e-35) {
tmp = x + ((b - a) * t);
} else if (b <= 1.15e+35) {
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 <= (-2.8d+95)) then
tmp = t_1
else if (b <= (-3.8d-35)) then
tmp = x + ((b - a) * t)
else if (b <= 1.15d+35) 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 <= -2.8e+95) {
tmp = t_1;
} else if (b <= -3.8e-35) {
tmp = x + ((b - a) * t);
} else if (b <= 1.15e+35) {
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 <= -2.8e+95: tmp = t_1 elif b <= -3.8e-35: tmp = x + ((b - a) * t) elif b <= 1.15e+35: 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 <= -2.8e+95) tmp = t_1; elseif (b <= -3.8e-35) tmp = Float64(x + Float64(Float64(b - a) * t)); elseif (b <= 1.15e+35) 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 <= -2.8e+95) tmp = t_1; elseif (b <= -3.8e-35) tmp = x + ((b - a) * t); elseif (b <= 1.15e+35) 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, -2.8e+95], t$95$1, If[LessEqual[b, -3.8e-35], N[(x + N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e+35], 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 -2.8 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-35}:\\
\;\;\;\;x + \left(b - a\right) \cdot t\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.7999999999999998e95 or 1.1499999999999999e35 < b Initial program 90.4%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.9
Applied rewrites71.9%
if -2.7999999999999998e95 < b < -3.8000000000000001e-35Initial program 96.2%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6497.7
Applied rewrites97.7%
Taylor expanded in t around inf
*-commutativeN/A
lift--.f64N/A
lift-*.f6448.0
Applied rewrites48.0%
if -3.8000000000000001e-35 < b < 1.1499999999999999e35Initial program 99.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-*.f6491.4
Applied rewrites91.4%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6456.0
Applied rewrites56.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- (+ t y) 2.0) b))) (if (<= b -2.5e+75) t_1 (if (<= b 1.15e+35) (- 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 <= -2.5e+75) {
tmp = t_1;
} else if (b <= 1.15e+35) {
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 <= (-2.5d+75)) then
tmp = t_1
else if (b <= 1.15d+35) 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 <= -2.5e+75) {
tmp = t_1;
} else if (b <= 1.15e+35) {
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 <= -2.5e+75: tmp = t_1 elif b <= 1.15e+35: 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 <= -2.5e+75) tmp = t_1; elseif (b <= 1.15e+35) 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 <= -2.5e+75) tmp = t_1; elseif (b <= 1.15e+35) 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, -2.5e+75], t$95$1, If[LessEqual[b, 1.15e+35], 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 -2.5 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.5000000000000001e75 or 1.1499999999999999e35 < b Initial program 90.4%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.1
Applied rewrites71.1%
if -2.5000000000000001e75 < b < 1.1499999999999999e35Initial program 98.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6488.4
Applied rewrites88.4%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -9.2e+85)
t_1
(if (<= t -4.05e-16)
(* (- b z) y)
(if (<= t 4800000.0) (- x (- (- z) a)) 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 <= -9.2e+85) {
tmp = t_1;
} else if (t <= -4.05e-16) {
tmp = (b - z) * y;
} else if (t <= 4800000.0) {
tmp = x - (-z - 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 = (b - a) * t
if (t <= (-9.2d+85)) then
tmp = t_1
else if (t <= (-4.05d-16)) then
tmp = (b - z) * y
else if (t <= 4800000.0d0) then
tmp = x - (-z - 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 = (b - a) * t;
double tmp;
if (t <= -9.2e+85) {
tmp = t_1;
} else if (t <= -4.05e-16) {
tmp = (b - z) * y;
} else if (t <= 4800000.0) {
tmp = x - (-z - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -9.2e+85: tmp = t_1 elif t <= -4.05e-16: tmp = (b - z) * y elif t <= 4800000.0: tmp = x - (-z - a) 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 <= -9.2e+85) tmp = t_1; elseif (t <= -4.05e-16) tmp = Float64(Float64(b - z) * y); elseif (t <= 4800000.0) tmp = Float64(x - Float64(Float64(-z) - a)); 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 <= -9.2e+85) tmp = t_1; elseif (t <= -4.05e-16) tmp = (b - z) * y; elseif (t <= 4800000.0) tmp = x - (-z - a); 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, -9.2e+85], t$95$1, If[LessEqual[t, -4.05e-16], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 4800000.0], N[(x - N[((-z) - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.05 \cdot 10^{-16}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 4800000:\\
\;\;\;\;x - \left(\left(-z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.1999999999999996e85 or 4.8e6 < t Initial program 92.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.2
Applied rewrites68.2%
if -9.1999999999999996e85 < t < -4.05000000000000024e-16Initial program 96.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6436.1
Applied rewrites36.1%
if -4.05000000000000024e-16 < t < 4.8e6Initial program 97.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6471.2
Applied rewrites71.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6470.8
Applied rewrites70.8%
Taylor expanded in y around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6451.4
Applied rewrites51.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b a) t))) (if (<= t -1.95e+76) t_1 (if (<= t 3.9e+75) (- x (* z (- y 1.0))) 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 <= -1.95e+76) {
tmp = t_1;
} else if (t <= 3.9e+75) {
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 = (b - a) * t
if (t <= (-1.95d+76)) then
tmp = t_1
else if (t <= 3.9d+75) 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 = (b - a) * t;
double tmp;
if (t <= -1.95e+76) {
tmp = t_1;
} else if (t <= 3.9e+75) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -1.95e+76: tmp = t_1 elif t <= 3.9e+75: tmp = x - (z * (y - 1.0)) 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 <= -1.95e+76) tmp = t_1; elseif (t <= 3.9e+75) 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 = (b - a) * t; tmp = 0.0; if (t <= -1.95e+76) tmp = t_1; elseif (t <= 3.9e+75) 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[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.95e+76], t$95$1, If[LessEqual[t, 3.9e+75], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+75}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.94999999999999995e76 or 3.90000000000000038e75 < t Initial program 91.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.0
Applied rewrites72.0%
if -1.94999999999999995e76 < t < 3.90000000000000038e75Initial program 97.7%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6471.0
Applied rewrites71.0%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6451.0
Applied rewrites51.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -9.2e+85)
t_1
(if (<= t -4e-16)
(* (- b z) y)
(if (<= t 3e-206)
(- x (- a))
(if (<= t 31500000000.0) (- x (* z y)) 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 <= -9.2e+85) {
tmp = t_1;
} else if (t <= -4e-16) {
tmp = (b - z) * y;
} else if (t <= 3e-206) {
tmp = x - -a;
} else if (t <= 31500000000.0) {
tmp = x - (z * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 <= (-9.2d+85)) then
tmp = t_1
else if (t <= (-4d-16)) then
tmp = (b - z) * y
else if (t <= 3d-206) then
tmp = x - -a
else if (t <= 31500000000.0d0) then
tmp = x - (z * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -9.2e+85) {
tmp = t_1;
} else if (t <= -4e-16) {
tmp = (b - z) * y;
} else if (t <= 3e-206) {
tmp = x - -a;
} else if (t <= 31500000000.0) {
tmp = x - (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -9.2e+85: tmp = t_1 elif t <= -4e-16: tmp = (b - z) * y elif t <= 3e-206: tmp = x - -a elif t <= 31500000000.0: tmp = x - (z * y) 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 <= -9.2e+85) tmp = t_1; elseif (t <= -4e-16) tmp = Float64(Float64(b - z) * y); elseif (t <= 3e-206) tmp = Float64(x - Float64(-a)); elseif (t <= 31500000000.0) tmp = Float64(x - Float64(z * y)); 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 <= -9.2e+85) tmp = t_1; elseif (t <= -4e-16) tmp = (b - z) * y; elseif (t <= 3e-206) tmp = x - -a; elseif (t <= 31500000000.0) tmp = x - (z * y); 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, -9.2e+85], t$95$1, If[LessEqual[t, -4e-16], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 3e-206], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 31500000000.0], N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-16}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-206}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 31500000000:\\
\;\;\;\;x - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.1999999999999996e85 or 3.15e10 < t Initial program 92.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.5
Applied rewrites68.5%
if -9.1999999999999996e85 < t < -3.9999999999999999e-16Initial program 96.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6436.1
Applied rewrites36.1%
if -3.9999999999999999e-16 < t < 3.0000000000000002e-206Initial 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-*.f6470.6
Applied rewrites70.6%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6470.6
Applied rewrites70.6%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6438.8
Applied rewrites38.8%
if 3.0000000000000002e-206 < t < 3.15e10Initial 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-*.f6472.5
Applied rewrites72.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -9.2e+85)
t_1
(if (<= t -4e-16) (* (- b z) y) (if (<= t 1900000.0) (- x (- a)) 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 <= -9.2e+85) {
tmp = t_1;
} else if (t <= -4e-16) {
tmp = (b - z) * y;
} else if (t <= 1900000.0) {
tmp = x - -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 = (b - a) * t
if (t <= (-9.2d+85)) then
tmp = t_1
else if (t <= (-4d-16)) then
tmp = (b - z) * y
else if (t <= 1900000.0d0) then
tmp = x - -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 = (b - a) * t;
double tmp;
if (t <= -9.2e+85) {
tmp = t_1;
} else if (t <= -4e-16) {
tmp = (b - z) * y;
} else if (t <= 1900000.0) {
tmp = x - -a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -9.2e+85: tmp = t_1 elif t <= -4e-16: tmp = (b - z) * y elif t <= 1900000.0: tmp = x - -a 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 <= -9.2e+85) tmp = t_1; elseif (t <= -4e-16) tmp = Float64(Float64(b - z) * y); elseif (t <= 1900000.0) tmp = Float64(x - Float64(-a)); 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 <= -9.2e+85) tmp = t_1; elseif (t <= -4e-16) tmp = (b - z) * y; elseif (t <= 1900000.0) tmp = x - -a; 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, -9.2e+85], t$95$1, If[LessEqual[t, -4e-16], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1900000.0], N[(x - (-a)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-16}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 1900000:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.1999999999999996e85 or 1.9e6 < t Initial program 92.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.2
Applied rewrites68.2%
if -9.1999999999999996e85 < t < -3.9999999999999999e-16Initial program 96.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6436.1
Applied rewrites36.1%
if -3.9999999999999999e-16 < t < 1.9e6Initial program 97.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6471.3
Applied rewrites71.3%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6470.9
Applied rewrites70.9%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -1.95e+76)
t_1
(if (<= t -0.000175)
(* (- 1.0 y) z)
(if (<= t 1900000.0) (- x (- a)) 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 <= -1.95e+76) {
tmp = t_1;
} else if (t <= -0.000175) {
tmp = (1.0 - y) * z;
} else if (t <= 1900000.0) {
tmp = x - -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 = (b - a) * t
if (t <= (-1.95d+76)) then
tmp = t_1
else if (t <= (-0.000175d0)) then
tmp = (1.0d0 - y) * z
else if (t <= 1900000.0d0) then
tmp = x - -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 = (b - a) * t;
double tmp;
if (t <= -1.95e+76) {
tmp = t_1;
} else if (t <= -0.000175) {
tmp = (1.0 - y) * z;
} else if (t <= 1900000.0) {
tmp = x - -a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -1.95e+76: tmp = t_1 elif t <= -0.000175: tmp = (1.0 - y) * z elif t <= 1900000.0: tmp = x - -a 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 <= -1.95e+76) tmp = t_1; elseif (t <= -0.000175) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 1900000.0) tmp = Float64(x - Float64(-a)); 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 <= -1.95e+76) tmp = t_1; elseif (t <= -0.000175) tmp = (1.0 - y) * z; elseif (t <= 1900000.0) tmp = x - -a; 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, -1.95e+76], t$95$1, If[LessEqual[t, -0.000175], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1900000.0], N[(x - (-a)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -0.000175:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 1900000:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.94999999999999995e76 or 1.9e6 < t Initial program 92.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.7
Applied rewrites67.7%
if -1.94999999999999995e76 < t < -1.74999999999999998e-4Initial program 97.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.6
Applied rewrites33.6%
if -1.74999999999999998e-4 < t < 1.9e6Initial 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-*.f6471.2
Applied rewrites71.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6470.7
Applied rewrites70.7%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6438.6
Applied rewrites38.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 y) z))) (if (<= z -4.2e+123) t_1 (if (<= z 6.5e+114) (fma t b 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 <= -4.2e+123) {
tmp = t_1;
} else if (z <= 6.5e+114) {
tmp = fma(t, b, 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 <= -4.2e+123) tmp = t_1; elseif (z <= 6.5e+114) tmp = fma(t, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -4.2e+123], t$95$1, If[LessEqual[z, 6.5e+114], N[(t * b + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.19999999999999988e123 or 6.5000000000000001e114 < z Initial program 90.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.6
Applied rewrites63.6%
if -4.19999999999999988e123 < z < 6.5000000000000001e114Initial program 97.6%
Taylor expanded in x around inf
Applied rewrites59.2%
Taylor expanded in t around inf
Applied rewrites36.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6436.2
Applied rewrites36.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 t) a))) (if (<= a -1.58e+32) t_1 (if (<= a 5e+130) (fma t b x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - t) * a;
double tmp;
if (a <= -1.58e+32) {
tmp = t_1;
} else if (a <= 5e+130) {
tmp = fma(t, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - t) * a) tmp = 0.0 if (a <= -1.58e+32) tmp = t_1; elseif (a <= 5e+130) tmp = fma(t, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.58e+32], t$95$1, If[LessEqual[a, 5e+130], N[(t * b + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -1.58 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+130}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.58000000000000006e32 or 4.9999999999999996e130 < a Initial program 92.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6458.0
Applied rewrites58.0%
if -1.58000000000000006e32 < a < 4.9999999999999996e130Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites60.9%
Taylor expanded in t around inf
Applied rewrites39.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.4e+20) (* (- z) y) (if (<= y 3.3e+58) (fma t b x) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+20) {
tmp = -z * y;
} else if (y <= 3.3e+58) {
tmp = fma(t, b, x);
} else {
tmp = b * y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.4e+20) tmp = Float64(Float64(-z) * y); elseif (y <= 3.3e+58) tmp = fma(t, b, x); else tmp = Float64(b * y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.4e+20], N[((-z) * y), $MachinePrecision], If[LessEqual[y, 3.3e+58], N[(t * b + x), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+20}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -2.4e20Initial program 91.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.3
Applied rewrites65.3%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6436.5
Applied rewrites36.5%
if -2.4e20 < y < 3.29999999999999983e58Initial program 98.2%
Taylor expanded in x around inf
Applied rewrites50.7%
Taylor expanded in t around inf
Applied rewrites39.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6439.3
Applied rewrites39.3%
if 3.29999999999999983e58 < y Initial program 92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.2
Applied rewrites69.2%
Taylor expanded in z around 0
Applied rewrites35.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.85e+129)
(* b t)
(if (<= t -0.00018)
(* (- z) y)
(if (<= t 7.2e+77) (- x (- a)) (* (- a) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.85e+129) {
tmp = b * t;
} else if (t <= -0.00018) {
tmp = -z * y;
} else if (t <= 7.2e+77) {
tmp = x - -a;
} else {
tmp = -a * 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) :: tmp
if (t <= (-1.85d+129)) then
tmp = b * t
else if (t <= (-0.00018d0)) then
tmp = -z * y
else if (t <= 7.2d+77) then
tmp = x - -a
else
tmp = -a * t
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 <= -1.85e+129) {
tmp = b * t;
} else if (t <= -0.00018) {
tmp = -z * y;
} else if (t <= 7.2e+77) {
tmp = x - -a;
} else {
tmp = -a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.85e+129: tmp = b * t elif t <= -0.00018: tmp = -z * y elif t <= 7.2e+77: tmp = x - -a else: tmp = -a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.85e+129) tmp = Float64(b * t); elseif (t <= -0.00018) tmp = Float64(Float64(-z) * y); elseif (t <= 7.2e+77) tmp = Float64(x - Float64(-a)); else tmp = Float64(Float64(-a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.85e+129) tmp = b * t; elseif (t <= -0.00018) tmp = -z * y; elseif (t <= 7.2e+77) tmp = x - -a; else tmp = -a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.85e+129], N[(b * t), $MachinePrecision], If[LessEqual[t, -0.00018], N[((-z) * y), $MachinePrecision], If[LessEqual[t, 7.2e+77], N[(x - (-a)), $MachinePrecision], N[((-a) * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+129}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -0.00018:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+77}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\end{array}
\end{array}
if t < -1.84999999999999989e129Initial program 90.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.8
Applied rewrites76.8%
Taylor expanded in a around 0
Applied rewrites39.8%
if -1.84999999999999989e129 < t < -1.80000000000000011e-4Initial program 96.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.4
Applied rewrites33.4%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6420.5
Applied rewrites20.5%
if -1.80000000000000011e-4 < t < 7.1999999999999996e77Initial 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-*.f6470.7
Applied rewrites70.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6467.6
Applied rewrites67.6%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6436.1
Applied rewrites36.1%
if 7.1999999999999996e77 < t Initial program 91.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.1
Applied rewrites71.1%
Taylor expanded in a around inf
mul-1-negN/A
lift-neg.f6440.3
Applied rewrites40.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9.8e+132) (* b t) (if (<= t -5.4e-14) (* b y) (if (<= t 7.2e+77) (- x (- a)) (* (- a) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.8e+132) {
tmp = b * t;
} else if (t <= -5.4e-14) {
tmp = b * y;
} else if (t <= 7.2e+77) {
tmp = x - -a;
} else {
tmp = -a * 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) :: tmp
if (t <= (-9.8d+132)) then
tmp = b * t
else if (t <= (-5.4d-14)) then
tmp = b * y
else if (t <= 7.2d+77) then
tmp = x - -a
else
tmp = -a * t
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 <= -9.8e+132) {
tmp = b * t;
} else if (t <= -5.4e-14) {
tmp = b * y;
} else if (t <= 7.2e+77) {
tmp = x - -a;
} else {
tmp = -a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.8e+132: tmp = b * t elif t <= -5.4e-14: tmp = b * y elif t <= 7.2e+77: tmp = x - -a else: tmp = -a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.8e+132) tmp = Float64(b * t); elseif (t <= -5.4e-14) tmp = Float64(b * y); elseif (t <= 7.2e+77) tmp = Float64(x - Float64(-a)); else tmp = Float64(Float64(-a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.8e+132) tmp = b * t; elseif (t <= -5.4e-14) tmp = b * y; elseif (t <= 7.2e+77) tmp = x - -a; else tmp = -a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.8e+132], N[(b * t), $MachinePrecision], If[LessEqual[t, -5.4e-14], N[(b * y), $MachinePrecision], If[LessEqual[t, 7.2e+77], N[(x - (-a)), $MachinePrecision], N[((-a) * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+132}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-14}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+77}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\end{array}
\end{array}
if t < -9.8000000000000003e132Initial program 90.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.4
Applied rewrites77.4%
Taylor expanded in a around 0
Applied rewrites40.2%
if -9.8000000000000003e132 < t < -5.3999999999999997e-14Initial program 96.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.0
Applied rewrites34.0%
Taylor expanded in z around 0
Applied rewrites17.7%
if -5.3999999999999997e-14 < t < 7.1999999999999996e77Initial 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-*.f6470.7
Applied rewrites70.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6467.6
Applied rewrites67.6%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6436.1
Applied rewrites36.1%
if 7.1999999999999996e77 < t Initial program 91.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.1
Applied rewrites71.1%
Taylor expanded in a around inf
mul-1-negN/A
lift-neg.f6440.3
Applied rewrites40.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9.8e+132) (* b t) (if (<= t -5.4e-14) (* b y) (if (<= t 4800000.0) (- x (- a)) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.8e+132) {
tmp = b * t;
} else if (t <= -5.4e-14) {
tmp = b * y;
} else if (t <= 4800000.0) {
tmp = x - -a;
} 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) :: tmp
if (t <= (-9.8d+132)) then
tmp = b * t
else if (t <= (-5.4d-14)) then
tmp = b * y
else if (t <= 4800000.0d0) then
tmp = x - -a
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 tmp;
if (t <= -9.8e+132) {
tmp = b * t;
} else if (t <= -5.4e-14) {
tmp = b * y;
} else if (t <= 4800000.0) {
tmp = x - -a;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.8e+132: tmp = b * t elif t <= -5.4e-14: tmp = b * y elif t <= 4800000.0: tmp = x - -a else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.8e+132) tmp = Float64(b * t); elseif (t <= -5.4e-14) tmp = Float64(b * y); elseif (t <= 4800000.0) tmp = Float64(x - Float64(-a)); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.8e+132) tmp = b * t; elseif (t <= -5.4e-14) tmp = b * y; elseif (t <= 4800000.0) tmp = x - -a; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.8e+132], N[(b * t), $MachinePrecision], If[LessEqual[t, -5.4e-14], N[(b * y), $MachinePrecision], If[LessEqual[t, 4800000.0], N[(x - (-a)), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+132}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-14}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t \leq 4800000:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -9.8000000000000003e132 or 4.8e6 < t Initial program 92.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
Taylor expanded in a around 0
Applied rewrites35.9%
if -9.8000000000000003e132 < t < -5.3999999999999997e-14Initial program 96.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.0
Applied rewrites34.0%
Taylor expanded in z around 0
Applied rewrites17.7%
if -5.3999999999999997e-14 < t < 4.8e6Initial program 97.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6471.2
Applied rewrites71.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6470.8
Applied rewrites70.8%
Taylor expanded in z around 0
mul-1-negN/A
lift-neg.f6438.6
Applied rewrites38.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -9.8e+132)
(* b t)
(if (<= t -6e-146)
(* b y)
(if (<= t 6.1e-207) a (if (<= t 4800000.0) x (* b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.8e+132) {
tmp = b * t;
} else if (t <= -6e-146) {
tmp = b * y;
} else if (t <= 6.1e-207) {
tmp = a;
} else if (t <= 4800000.0) {
tmp = 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) :: tmp
if (t <= (-9.8d+132)) then
tmp = b * t
else if (t <= (-6d-146)) then
tmp = b * y
else if (t <= 6.1d-207) then
tmp = a
else if (t <= 4800000.0d0) then
tmp = 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 tmp;
if (t <= -9.8e+132) {
tmp = b * t;
} else if (t <= -6e-146) {
tmp = b * y;
} else if (t <= 6.1e-207) {
tmp = a;
} else if (t <= 4800000.0) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.8e+132: tmp = b * t elif t <= -6e-146: tmp = b * y elif t <= 6.1e-207: tmp = a elif t <= 4800000.0: tmp = x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.8e+132) tmp = Float64(b * t); elseif (t <= -6e-146) tmp = Float64(b * y); elseif (t <= 6.1e-207) tmp = a; elseif (t <= 4800000.0) tmp = x; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.8e+132) tmp = b * t; elseif (t <= -6e-146) tmp = b * y; elseif (t <= 6.1e-207) tmp = a; elseif (t <= 4800000.0) tmp = x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.8e+132], N[(b * t), $MachinePrecision], If[LessEqual[t, -6e-146], N[(b * y), $MachinePrecision], If[LessEqual[t, 6.1e-207], a, If[LessEqual[t, 4800000.0], x, N[(b * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+132}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-146}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{-207}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 4800000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -9.8000000000000003e132 or 4.8e6 < t Initial program 92.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
Taylor expanded in a around 0
Applied rewrites35.9%
if -9.8000000000000003e132 < t < -6.00000000000000038e-146Initial program 97.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6436.0
Applied rewrites36.0%
Taylor expanded in z around 0
Applied rewrites19.4%
if -6.00000000000000038e-146 < t < 6.10000000000000008e-207Initial program 97.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6420.4
Applied rewrites20.4%
Taylor expanded in t around 0
Applied rewrites20.4%
if 6.10000000000000008e-207 < t < 4.8e6Initial program 98.0%
Taylor expanded in x around inf
Applied rewrites19.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -0.0029) (* b t) (if (<= t 4800000.0) x (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -0.0029) {
tmp = b * t;
} else if (t <= 4800000.0) {
tmp = 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) :: tmp
if (t <= (-0.0029d0)) then
tmp = b * t
else if (t <= 4800000.0d0) then
tmp = 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 tmp;
if (t <= -0.0029) {
tmp = b * t;
} else if (t <= 4800000.0) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -0.0029: tmp = b * t elif t <= 4800000.0: tmp = x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -0.0029) tmp = Float64(b * t); elseif (t <= 4800000.0) tmp = x; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -0.0029) tmp = b * t; elseif (t <= 4800000.0) tmp = x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -0.0029], N[(b * t), $MachinePrecision], If[LessEqual[t, 4800000.0], x, N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0029:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 4800000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -0.0029 or 4.8e6 < t Initial program 93.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.9
Applied rewrites63.9%
Taylor expanded in a around 0
Applied rewrites32.9%
if -0.0029 < t < 4.8e6Initial program 97.8%
Taylor expanded in x around inf
Applied rewrites20.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.8e+79) x (if (<= x 1.32e+23) a x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+79) {
tmp = x;
} else if (x <= 1.32e+23) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 <= (-8.8d+79)) then
tmp = x
else if (x <= 1.32d+23) then
tmp = a
else
tmp = x
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 <= -8.8e+79) {
tmp = x;
} else if (x <= 1.32e+23) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.8e+79: tmp = x elif x <= 1.32e+23: tmp = a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.8e+79) tmp = x; elseif (x <= 1.32e+23) tmp = a; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8.8e+79) tmp = x; elseif (x <= 1.32e+23) tmp = a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.8e+79], x, If[LessEqual[x, 1.32e+23], a, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+79}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+23}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -8.7999999999999996e79 or 1.3199999999999999e23 < x Initial program 95.5%
Taylor expanded in x around inf
Applied rewrites32.0%
if -8.7999999999999996e79 < x < 1.3199999999999999e23Initial program 95.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.4
Applied rewrites33.4%
Taylor expanded in t around 0
Applied rewrites13.2%
(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.7%
herbie shell --seed 2025115
(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)))