
(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 20 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 (fma (- (+ t y) 2.0) b (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(((t + y) - 2.0), b, (x - fma((t - 1.0), a, ((y - 1.0) * z))));
}
function code(x, y, z, t, a, b) return fma(Float64(Float64(t + y) - 2.0), b, Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(t + y\right) - 2, b, x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\right)
\end{array}
Initial program 95.4%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites97.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b (* (- 1.0 t) a))))
(if (<= b -3.8e+37)
t_1
(if (<= b 4.2e-15) (- x (fma (- t 1.0) a (* (- y 1.0) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, ((1.0 - t) * a));
double tmp;
if (b <= -3.8e+37) {
tmp = t_1;
} else if (b <= 4.2e-15) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(1.0 - t) * a)) tmp = 0.0 if (b <= -3.8e+37) tmp = t_1; elseif (b <= 4.2e-15) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.8e+37], t$95$1, If[LessEqual[b, 4.2e-15], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, \left(1 - t\right) \cdot a\right)\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{-15}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.7999999999999999e37 or 4.19999999999999962e-15 < b Initial program 95.4%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites97.5%
Taylor expanded in a around inf
associate--r+N/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.6
Applied rewrites60.6%
if -3.7999999999999999e37 < b < 4.19999999999999962e-15Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -4e+38)
(+ x t_1)
(if (<= b 7.6e+59) (- x (fma (- t 1.0) a (* (- y 1.0) z))) (+ z 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 <= -4e+38) {
tmp = x + t_1;
} else if (b <= 7.6e+59) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = z + 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 <= -4e+38) tmp = Float64(x + t_1); elseif (b <= 7.6e+59) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(z + 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, -4e+38], N[(x + t$95$1), $MachinePrecision], If[LessEqual[b, 7.6e+59], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + 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 -4 \cdot 10^{+38}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;b \leq 7.6 \cdot 10^{+59}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z + t\_1\\
\end{array}
\end{array}
if b < -3.99999999999999991e38Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites51.6%
if -3.99999999999999991e38 < b < 7.6000000000000002e59Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
if 7.6000000000000002e59 < b Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.6
Applied rewrites60.6%
Taylor expanded in y around 0
Applied rewrites47.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -1.55e+38)
(+ x t_1)
(if (<= b 5e-7) (- x (fma (- t 1.0) a (- z))) (+ z 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.55e+38) {
tmp = x + t_1;
} else if (b <= 5e-7) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = z + 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.55e+38) tmp = Float64(x + t_1); elseif (b <= 5e-7) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = Float64(z + 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.55e+38], N[(x + t$95$1), $MachinePrecision], If[LessEqual[b, 5e-7], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], N[(z + 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.55 \cdot 10^{+38}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-7}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;z + t\_1\\
\end{array}
\end{array}
if b < -1.55000000000000009e38Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites51.6%
if -1.55000000000000009e38 < b < 4.99999999999999977e-7Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6450.4
Applied rewrites50.4%
if 4.99999999999999977e-7 < b Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.6
Applied rewrites60.6%
Taylor expanded in y around 0
Applied rewrites47.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* a (- t 1.0)))) (t_2 (* (- (+ y t) 2.0) b)))
(if (<= b -4.5e+36)
(+ x t_2)
(if (<= b -3.1e-172)
t_1
(if (<= b 4.7e-259)
(- x (* z (- y 1.0)))
(if (<= b 2.5e-8) t_1 (+ z t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -4.5e+36) {
tmp = x + t_2;
} else if (b <= -3.1e-172) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 2.5e-8) {
tmp = t_1;
} else {
tmp = z + t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (a * (t - 1.0d0))
t_2 = ((y + t) - 2.0d0) * b
if (b <= (-4.5d+36)) then
tmp = x + t_2
else if (b <= (-3.1d-172)) then
tmp = t_1
else if (b <= 4.7d-259) then
tmp = x - (z * (y - 1.0d0))
else if (b <= 2.5d-8) then
tmp = t_1
else
tmp = z + t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -4.5e+36) {
tmp = x + t_2;
} else if (b <= -3.1e-172) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 2.5e-8) {
tmp = t_1;
} else {
tmp = z + t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (a * (t - 1.0)) t_2 = ((y + t) - 2.0) * b tmp = 0 if b <= -4.5e+36: tmp = x + t_2 elif b <= -3.1e-172: tmp = t_1 elif b <= 4.7e-259: tmp = x - (z * (y - 1.0)) elif b <= 2.5e-8: tmp = t_1 else: tmp = z + t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(a * Float64(t - 1.0))) t_2 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -4.5e+36) tmp = Float64(x + t_2); elseif (b <= -3.1e-172) tmp = t_1; elseif (b <= 4.7e-259) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 2.5e-8) tmp = t_1; else tmp = Float64(z + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (a * (t - 1.0)); t_2 = ((y + t) - 2.0) * b; tmp = 0.0; if (b <= -4.5e+36) tmp = x + t_2; elseif (b <= -3.1e-172) tmp = t_1; elseif (b <= 4.7e-259) tmp = x - (z * (y - 1.0)); elseif (b <= 2.5e-8) tmp = t_1; else tmp = z + t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -4.5e+36], N[(x + t$95$2), $MachinePrecision], If[LessEqual[b, -3.1e-172], t$95$1, If[LessEqual[b, 4.7e-259], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5e-8], t$95$1, N[(z + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \left(t - 1\right)\\
t_2 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -4.5 \cdot 10^{+36}:\\
\;\;\;\;x + t\_2\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{-259}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z + t\_2\\
\end{array}
\end{array}
if b < -4.49999999999999997e36Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites51.6%
if -4.49999999999999997e36 < b < -3.1000000000000003e-172 or 4.69999999999999998e-259 < b < 2.4999999999999999e-8Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
if -3.1000000000000003e-172 < b < 4.69999999999999998e-259Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6442.1
Applied rewrites42.1%
if 2.4999999999999999e-8 < b Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.6
Applied rewrites60.6%
Taylor expanded in y around 0
Applied rewrites47.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* a (- t 1.0)))) (t_2 (+ x (* (- (+ y t) 2.0) b))))
(if (<= b -4.5e+36)
t_2
(if (<= b -3.1e-172)
t_1
(if (<= b 4.7e-259)
(- x (* z (- y 1.0)))
(if (<= b 1.2e-9) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = x + (((y + t) - 2.0) * b);
double tmp;
if (b <= -4.5e+36) {
tmp = t_2;
} else if (b <= -3.1e-172) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 1.2e-9) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (a * (t - 1.0d0))
t_2 = x + (((y + t) - 2.0d0) * b)
if (b <= (-4.5d+36)) then
tmp = t_2
else if (b <= (-3.1d-172)) then
tmp = t_1
else if (b <= 4.7d-259) then
tmp = x - (z * (y - 1.0d0))
else if (b <= 1.2d-9) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = x + (((y + t) - 2.0) * b);
double tmp;
if (b <= -4.5e+36) {
tmp = t_2;
} else if (b <= -3.1e-172) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 1.2e-9) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (a * (t - 1.0)) t_2 = x + (((y + t) - 2.0) * b) tmp = 0 if b <= -4.5e+36: tmp = t_2 elif b <= -3.1e-172: tmp = t_1 elif b <= 4.7e-259: tmp = x - (z * (y - 1.0)) elif b <= 1.2e-9: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(a * Float64(t - 1.0))) t_2 = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -4.5e+36) tmp = t_2; elseif (b <= -3.1e-172) tmp = t_1; elseif (b <= 4.7e-259) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 1.2e-9) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (a * (t - 1.0)); t_2 = x + (((y + t) - 2.0) * b); tmp = 0.0; if (b <= -4.5e+36) tmp = t_2; elseif (b <= -3.1e-172) tmp = t_1; elseif (b <= 4.7e-259) tmp = x - (z * (y - 1.0)); elseif (b <= 1.2e-9) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.5e+36], t$95$2, If[LessEqual[b, -3.1e-172], t$95$1, If[LessEqual[b, 4.7e-259], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.2e-9], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \left(t - 1\right)\\
t_2 := x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -4.5 \cdot 10^{+36}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{-259}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -4.49999999999999997e36 or 1.2e-9 < b Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites51.6%
if -4.49999999999999997e36 < b < -3.1000000000000003e-172 or 4.69999999999999998e-259 < b < 1.2e-9Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
if -3.1000000000000003e-172 < b < 4.69999999999999998e-259Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6442.1
Applied rewrites42.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b a)))
(if (<= b -2.6e+15)
t_1
(if (<= b 4.7e-259)
(- x (* z (- y 1.0)))
(if (<= b 9.2e-8) (- x (* a (- t 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, a);
double tmp;
if (b <= -2.6e+15) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 9.2e-8) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, a) tmp = 0.0 if (b <= -2.6e+15) tmp = t_1; elseif (b <= 4.7e-259) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 9.2e-8) tmp = Float64(x - Float64(a * Float64(t - 1.0))); 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 + a), $MachinePrecision]}, If[LessEqual[b, -2.6e+15], t$95$1, If[LessEqual[b, 4.7e-259], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.2e-8], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{if}\;b \leq -2.6 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{-259}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-8}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.6e15 or 9.2000000000000003e-8 < b Initial program 95.4%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites97.5%
Taylor expanded in a around inf
associate--r+N/A
*-commutativeN/A
*-commutativeN/A
associate--r+N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate--l-N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.6
Applied rewrites60.6%
Taylor expanded in t around 0
Applied rewrites47.1%
if -2.6e15 < b < 4.69999999999999998e-259Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6442.1
Applied rewrites42.1%
if 4.69999999999999998e-259 < b < 9.2000000000000003e-8Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* a (- t 1.0)))) (t_2 (* (- (+ t y) 2.0) b)))
(if (<= b -3.4e+38)
t_2
(if (<= b -3.1e-172)
t_1
(if (<= b 4.7e-259) (- x (* z (- y 1.0))) (if (<= b 5e-7) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -3.4e+38) {
tmp = t_2;
} else if (b <= -3.1e-172) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 5e-7) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (a * (t - 1.0d0))
t_2 = ((t + y) - 2.0d0) * b
if (b <= (-3.4d+38)) then
tmp = t_2
else if (b <= (-3.1d-172)) then
tmp = t_1
else if (b <= 4.7d-259) then
tmp = x - (z * (y - 1.0d0))
else if (b <= 5d-7) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -3.4e+38) {
tmp = t_2;
} else if (b <= -3.1e-172) {
tmp = t_1;
} else if (b <= 4.7e-259) {
tmp = x - (z * (y - 1.0));
} else if (b <= 5e-7) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (a * (t - 1.0)) t_2 = ((t + y) - 2.0) * b tmp = 0 if b <= -3.4e+38: tmp = t_2 elif b <= -3.1e-172: tmp = t_1 elif b <= 4.7e-259: tmp = x - (z * (y - 1.0)) elif b <= 5e-7: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(a * Float64(t - 1.0))) t_2 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -3.4e+38) tmp = t_2; elseif (b <= -3.1e-172) tmp = t_1; elseif (b <= 4.7e-259) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 5e-7) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (a * (t - 1.0)); t_2 = ((t + y) - 2.0) * b; tmp = 0.0; if (b <= -3.4e+38) tmp = t_2; elseif (b <= -3.1e-172) tmp = t_1; elseif (b <= 4.7e-259) tmp = x - (z * (y - 1.0)); elseif (b <= 5e-7) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.4e+38], t$95$2, If[LessEqual[b, -3.1e-172], t$95$1, If[LessEqual[b, 4.7e-259], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-7], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \left(t - 1\right)\\
t_2 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -3.4 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{-259}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -3.39999999999999996e38 or 4.99999999999999977e-7 < b Initial program 95.4%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6438.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6438.3
Applied rewrites38.3%
if -3.39999999999999996e38 < b < -3.1000000000000003e-172 or 4.69999999999999998e-259 < b < 4.99999999999999977e-7Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
if -3.1000000000000003e-172 < b < 4.69999999999999998e-259Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6442.1
Applied rewrites42.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b a) t))) (if (<= t -2.4e+38) t_1 (if (<= t 1.05e+31) (- 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 <= -2.4e+38) {
tmp = t_1;
} else if (t <= 1.05e+31) {
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 <= (-2.4d+38)) then
tmp = t_1
else if (t <= 1.05d+31) 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 <= -2.4e+38) {
tmp = t_1;
} else if (t <= 1.05e+31) {
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 <= -2.4e+38: tmp = t_1 elif t <= 1.05e+31: 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 <= -2.4e+38) tmp = t_1; elseif (t <= 1.05e+31) 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 <= -2.4e+38) tmp = t_1; elseif (t <= 1.05e+31) 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, -2.4e+38], t$95$1, If[LessEqual[t, 1.05e+31], 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 -2.4 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+31}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.40000000000000017e38 or 1.04999999999999989e31 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -2.40000000000000017e38 < t < 1.04999999999999989e31Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6442.1
Applied rewrites42.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -2.4e+38)
t_1
(if (<= t -2.6e-213)
(- x (* z y))
(if (<= t 1e-192)
(* (- 1.0 y) z)
(if (<= t 7.8e-31)
(- x (- a))
(if (<= t 3.3e+25) (* (- b 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 <= -2.4e+38) {
tmp = t_1;
} else if (t <= -2.6e-213) {
tmp = x - (z * y);
} else if (t <= 1e-192) {
tmp = (1.0 - y) * z;
} else if (t <= 7.8e-31) {
tmp = x - -a;
} else if (t <= 3.3e+25) {
tmp = (b - 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 <= (-2.4d+38)) then
tmp = t_1
else if (t <= (-2.6d-213)) then
tmp = x - (z * y)
else if (t <= 1d-192) then
tmp = (1.0d0 - y) * z
else if (t <= 7.8d-31) then
tmp = x - -a
else if (t <= 3.3d+25) then
tmp = (b - 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 <= -2.4e+38) {
tmp = t_1;
} else if (t <= -2.6e-213) {
tmp = x - (z * y);
} else if (t <= 1e-192) {
tmp = (1.0 - y) * z;
} else if (t <= 7.8e-31) {
tmp = x - -a;
} else if (t <= 3.3e+25) {
tmp = (b - 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 <= -2.4e+38: tmp = t_1 elif t <= -2.6e-213: tmp = x - (z * y) elif t <= 1e-192: tmp = (1.0 - y) * z elif t <= 7.8e-31: tmp = x - -a elif t <= 3.3e+25: tmp = (b - 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 <= -2.4e+38) tmp = t_1; elseif (t <= -2.6e-213) tmp = Float64(x - Float64(z * y)); elseif (t <= 1e-192) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 7.8e-31) tmp = Float64(x - Float64(-a)); elseif (t <= 3.3e+25) tmp = Float64(Float64(b - 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 <= -2.4e+38) tmp = t_1; elseif (t <= -2.6e-213) tmp = x - (z * y); elseif (t <= 1e-192) tmp = (1.0 - y) * z; elseif (t <= 7.8e-31) tmp = x - -a; elseif (t <= 3.3e+25) tmp = (b - 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, -2.4e+38], t$95$1, If[LessEqual[t, -2.6e-213], N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-192], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 7.8e-31], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 3.3e+25], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-213}:\\
\;\;\;\;x - z \cdot y\\
\mathbf{elif}\;t \leq 10^{-192}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-31}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+25}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.40000000000000017e38 or 3.3000000000000001e25 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -2.40000000000000017e38 < t < -2.6000000000000001e-213Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6432.8
Applied rewrites32.8%
if -2.6000000000000001e-213 < t < 1.0000000000000001e-192Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
if 1.0000000000000001e-192 < t < 7.8000000000000003e-31Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
if 7.8000000000000003e-31 < t < 3.3000000000000001e25Initial program 95.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)) (t_2 (* (- b a) t)))
(if (<= t -1.55e+29)
t_2
(if (<= t 6.7e-211)
t_1
(if (<= t 7.8e-31) (- x (- a)) (if (<= t 3.3e+25) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double t_2 = (b - a) * t;
double tmp;
if (t <= -1.55e+29) {
tmp = t_2;
} else if (t <= 6.7e-211) {
tmp = t_1;
} else if (t <= 7.8e-31) {
tmp = x - -a;
} else if (t <= 3.3e+25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b - z) * y
t_2 = (b - a) * t
if (t <= (-1.55d+29)) then
tmp = t_2
else if (t <= 6.7d-211) then
tmp = t_1
else if (t <= 7.8d-31) then
tmp = x - -a
else if (t <= 3.3d+25) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double t_2 = (b - a) * t;
double tmp;
if (t <= -1.55e+29) {
tmp = t_2;
} else if (t <= 6.7e-211) {
tmp = t_1;
} else if (t <= 7.8e-31) {
tmp = x - -a;
} else if (t <= 3.3e+25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y t_2 = (b - a) * t tmp = 0 if t <= -1.55e+29: tmp = t_2 elif t <= 6.7e-211: tmp = t_1 elif t <= 7.8e-31: tmp = x - -a elif t <= 3.3e+25: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.55e+29) tmp = t_2; elseif (t <= 6.7e-211) tmp = t_1; elseif (t <= 7.8e-31) tmp = Float64(x - Float64(-a)); elseif (t <= 3.3e+25) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; t_2 = (b - a) * t; tmp = 0.0; if (t <= -1.55e+29) tmp = t_2; elseif (t <= 6.7e-211) tmp = t_1; elseif (t <= 7.8e-31) tmp = x - -a; elseif (t <= 3.3e+25) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.55e+29], t$95$2, If[LessEqual[t, 6.7e-211], t$95$1, If[LessEqual[t, 7.8e-31], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 3.3e+25], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 6.7 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-31}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.5499999999999999e29 or 3.3000000000000001e25 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -1.5499999999999999e29 < t < 6.70000000000000026e-211 or 7.8000000000000003e-31 < t < 3.3000000000000001e25Initial program 95.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
if 6.70000000000000026e-211 < t < 7.8000000000000003e-31Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -2.75e+16) t_1 (if (<= y 8.5e+61) (- x (* a (- t 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -2.75e+16) {
tmp = t_1;
} else if (y <= 8.5e+61) {
tmp = x - (a * (t - 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 - z) * y
if (y <= (-2.75d+16)) then
tmp = t_1
else if (y <= 8.5d+61) then
tmp = x - (a * (t - 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 - z) * y;
double tmp;
if (y <= -2.75e+16) {
tmp = t_1;
} else if (y <= 8.5e+61) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -2.75e+16: tmp = t_1 elif y <= 8.5e+61: tmp = x - (a * (t - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -2.75e+16) tmp = t_1; elseif (y <= 8.5e+61) tmp = Float64(x - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -2.75e+16) tmp = t_1; elseif (y <= 8.5e+61) tmp = x - (a * (t - 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 - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.75e+16], t$95$1, If[LessEqual[y, 8.5e+61], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -2.75 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+61}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.75e16 or 8.50000000000000035e61 < y Initial program 95.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
if -2.75e16 < y < 8.50000000000000035e61Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)) (t_2 (* (- b a) t)))
(if (<= t -1.55e+29)
t_2
(if (<= t 1e-192)
t_1
(if (<= t 2.45e-32) (- x (- a)) (if (<= t 3.3e+25) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double t_2 = (b - a) * t;
double tmp;
if (t <= -1.55e+29) {
tmp = t_2;
} else if (t <= 1e-192) {
tmp = t_1;
} else if (t <= 2.45e-32) {
tmp = x - -a;
} else if (t <= 3.3e+25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (1.0d0 - y) * z
t_2 = (b - a) * t
if (t <= (-1.55d+29)) then
tmp = t_2
else if (t <= 1d-192) then
tmp = t_1
else if (t <= 2.45d-32) then
tmp = x - -a
else if (t <= 3.3d+25) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double t_2 = (b - a) * t;
double tmp;
if (t <= -1.55e+29) {
tmp = t_2;
} else if (t <= 1e-192) {
tmp = t_1;
} else if (t <= 2.45e-32) {
tmp = x - -a;
} else if (t <= 3.3e+25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z t_2 = (b - a) * t tmp = 0 if t <= -1.55e+29: tmp = t_2 elif t <= 1e-192: tmp = t_1 elif t <= 2.45e-32: tmp = x - -a elif t <= 3.3e+25: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.55e+29) tmp = t_2; elseif (t <= 1e-192) tmp = t_1; elseif (t <= 2.45e-32) tmp = Float64(x - Float64(-a)); elseif (t <= 3.3e+25) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; t_2 = (b - a) * t; tmp = 0.0; if (t <= -1.55e+29) tmp = t_2; elseif (t <= 1e-192) tmp = t_1; elseif (t <= 2.45e-32) tmp = x - -a; elseif (t <= 3.3e+25) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.55e+29], t$95$2, If[LessEqual[t, 1e-192], t$95$1, If[LessEqual[t, 2.45e-32], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 3.3e+25], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 10^{-192}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-32}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.5499999999999999e29 or 3.3000000000000001e25 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -1.5499999999999999e29 < t < 1.0000000000000001e-192 or 2.4499999999999999e-32 < t < 3.3000000000000001e25Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
if 1.0000000000000001e-192 < t < 2.4499999999999999e-32Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)))
(if (<= z -6e+156)
t_1
(if (<= z 1.95e-120)
(* (- 1.0 t) a)
(if (<= z 5.1e+67) (- x (- a)) 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 <= -6e+156) {
tmp = t_1;
} else if (z <= 1.95e-120) {
tmp = (1.0 - t) * a;
} else if (z <= 5.1e+67) {
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 = (1.0d0 - y) * z
if (z <= (-6d+156)) then
tmp = t_1
else if (z <= 1.95d-120) then
tmp = (1.0d0 - t) * a
else if (z <= 5.1d+67) 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 = (1.0 - y) * z;
double tmp;
if (z <= -6e+156) {
tmp = t_1;
} else if (z <= 1.95e-120) {
tmp = (1.0 - t) * a;
} else if (z <= 5.1e+67) {
tmp = x - -a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z tmp = 0 if z <= -6e+156: tmp = t_1 elif z <= 1.95e-120: tmp = (1.0 - t) * a elif z <= 5.1e+67: tmp = x - -a 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 <= -6e+156) tmp = t_1; elseif (z <= 1.95e-120) tmp = Float64(Float64(1.0 - t) * a); elseif (z <= 5.1e+67) 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 = (1.0 - y) * z; tmp = 0.0; if (z <= -6e+156) tmp = t_1; elseif (z <= 1.95e-120) tmp = (1.0 - t) * a; elseif (z <= 5.1e+67) 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[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -6e+156], t$95$1, If[LessEqual[z, 1.95e-120], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[z, 5.1e+67], N[(x - (-a)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -6 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-120}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+67}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.9999999999999999e156 or 5.1000000000000002e67 < z Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
if -5.9999999999999999e156 < z < 1.9500000000000001e-120Initial program 95.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if 1.9500000000000001e-120 < z < 5.1000000000000002e67Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a) t)))
(if (<= t -1.55e+38)
t_1
(if (<= t 6.6e+25) (- x (- a)) (if (<= t 5.8e+211) (* b t) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a * t;
double tmp;
if (t <= -1.55e+38) {
tmp = t_1;
} else if (t <= 6.6e+25) {
tmp = x - -a;
} else if (t <= 5.8e+211) {
tmp = b * 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 = -a * t
if (t <= (-1.55d+38)) then
tmp = t_1
else if (t <= 6.6d+25) then
tmp = x - -a
else if (t <= 5.8d+211) then
tmp = b * 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 = -a * t;
double tmp;
if (t <= -1.55e+38) {
tmp = t_1;
} else if (t <= 6.6e+25) {
tmp = x - -a;
} else if (t <= 5.8e+211) {
tmp = b * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a * t tmp = 0 if t <= -1.55e+38: tmp = t_1 elif t <= 6.6e+25: tmp = x - -a elif t <= 5.8e+211: tmp = b * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) * t) tmp = 0.0 if (t <= -1.55e+38) tmp = t_1; elseif (t <= 6.6e+25) tmp = Float64(x - Float64(-a)); elseif (t <= 5.8e+211) tmp = Float64(b * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -a * t; tmp = 0.0; if (t <= -1.55e+38) tmp = t_1; elseif (t <= 6.6e+25) tmp = x - -a; elseif (t <= 5.8e+211) tmp = b * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) * t), $MachinePrecision]}, If[LessEqual[t, -1.55e+38], t$95$1, If[LessEqual[t, 6.6e+25], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 5.8e+211], N[(b * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot t\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+25}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+211}:\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.55000000000000009e38 or 5.8000000000000001e211 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f6418.8
Applied rewrites18.8%
if -1.55000000000000009e38 < t < 6.6000000000000002e25Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
if 6.6000000000000002e25 < t < 5.8000000000000001e211Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.55e+38)
(* (- a) t)
(if (<= t 6.6e+25)
(- x (- a))
(if (<= t 5.8e+211) (* b t) (* (- 1.0 t) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.55e+38) {
tmp = -a * t;
} else if (t <= 6.6e+25) {
tmp = x - -a;
} else if (t <= 5.8e+211) {
tmp = b * t;
} else {
tmp = (1.0 - t) * a;
}
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.55d+38)) then
tmp = -a * t
else if (t <= 6.6d+25) then
tmp = x - -a
else if (t <= 5.8d+211) then
tmp = b * t
else
tmp = (1.0d0 - t) * a
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.55e+38) {
tmp = -a * t;
} else if (t <= 6.6e+25) {
tmp = x - -a;
} else if (t <= 5.8e+211) {
tmp = b * t;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.55e+38: tmp = -a * t elif t <= 6.6e+25: tmp = x - -a elif t <= 5.8e+211: tmp = b * t else: tmp = (1.0 - t) * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.55e+38) tmp = Float64(Float64(-a) * t); elseif (t <= 6.6e+25) tmp = Float64(x - Float64(-a)); elseif (t <= 5.8e+211) tmp = Float64(b * t); else tmp = Float64(Float64(1.0 - t) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.55e+38) tmp = -a * t; elseif (t <= 6.6e+25) tmp = x - -a; elseif (t <= 5.8e+211) tmp = b * t; else tmp = (1.0 - t) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.55e+38], N[((-a) * t), $MachinePrecision], If[LessEqual[t, 6.6e+25], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 5.8e+211], N[(b * t), $MachinePrecision], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+38}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+25}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+211}:\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\end{array}
\end{array}
if t < -1.55000000000000009e38Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f6418.8
Applied rewrites18.8%
if -1.55000000000000009e38 < t < 6.6000000000000002e25Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
if 6.6000000000000002e25 < t < 5.8000000000000001e211Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.0%
if 5.8000000000000001e211 < t Initial program 95.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.6
Applied rewrites27.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.6e+38) (* b t) (if (<= t 6.6e+25) (- x (- a)) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.6e+38) {
tmp = b * t;
} else if (t <= 6.6e+25) {
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 <= (-3.6d+38)) then
tmp = b * t
else if (t <= 6.6d+25) 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 <= -3.6e+38) {
tmp = b * t;
} else if (t <= 6.6e+25) {
tmp = x - -a;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.6e+38: tmp = b * t elif t <= 6.6e+25: tmp = x - -a else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.6e+38) tmp = Float64(b * t); elseif (t <= 6.6e+25) 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 <= -3.6e+38) tmp = b * t; elseif (t <= 6.6e+25) tmp = x - -a; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.6e+38], N[(b * t), $MachinePrecision], If[LessEqual[t, 6.6e+25], N[(x - (-a)), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+38}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+25}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -3.59999999999999969e38 or 6.6000000000000002e25 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.0%
if -3.59999999999999969e38 < t < 6.6000000000000002e25Initial program 95.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6424.3
Applied rewrites24.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.6e+38) (* b t) (if (<= t 6.6e+25) x (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.6e+38) {
tmp = b * t;
} else if (t <= 6.6e+25) {
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 <= (-3.6d+38)) then
tmp = b * t
else if (t <= 6.6d+25) 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 <= -3.6e+38) {
tmp = b * t;
} else if (t <= 6.6e+25) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.6e+38: tmp = b * t elif t <= 6.6e+25: tmp = x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.6e+38) tmp = Float64(b * t); elseif (t <= 6.6e+25) 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 <= -3.6e+38) tmp = b * t; elseif (t <= 6.6e+25) tmp = x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.6e+38], N[(b * t), $MachinePrecision], If[LessEqual[t, 6.6e+25], x, N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+38}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -3.59999999999999969e38 or 6.6000000000000002e25 < t Initial program 95.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.0%
if -3.59999999999999969e38 < t < 6.6000000000000002e25Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites15.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -33000000.0) x (if (<= x 2.1e-10) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -33000000.0) {
tmp = x;
} else if (x <= 2.1e-10) {
tmp = z;
} 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 <= (-33000000.0d0)) then
tmp = x
else if (x <= 2.1d-10) then
tmp = z
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 <= -33000000.0) {
tmp = x;
} else if (x <= 2.1e-10) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -33000000.0: tmp = x elif x <= 2.1e-10: tmp = z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -33000000.0) tmp = x; elseif (x <= 2.1e-10) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -33000000.0) tmp = x; elseif (x <= 2.1e-10) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -33000000.0], x, If[LessEqual[x, 2.1e-10], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -33000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-10}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.3e7 or 2.1e-10 < x Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites15.4%
if -3.3e7 < x < 2.1e-10Initial program 95.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in y around 0
Applied rewrites11.3%
(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.4%
Taylor expanded in x around inf
Applied rewrites15.4%
herbie shell --seed 2025123
(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)))