
(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}
Sampling outcomes in binary64 precision:
Herbie found 26 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 (* (- y 1.0) z))
(t_2 (+ (- (- x t_1) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (<= t_2 INFINITY) t_2 (- x (fma (- t 1.0) a t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 1.0) * z;
double t_2 = ((x - t_1) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = x - fma((t - 1.0), a, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 1.0) * z) t_2 = Float64(Float64(Float64(x - t_1) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = Float64(x - fma(Float64(t - 1.0), a, t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - t$95$1), $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$2, Infinity], t$95$2, N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 1\right) \cdot z\\
t_2 := \left(\left(x - t\_1\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, t\_1\right)\\
\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 b around 0
Applied rewrites75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y 1.0) z)))
(if (<= (+ (- (- x t_1) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)) INFINITY)
(- (+ (fma (- b a) t (fma (- y 2.0) b x)) a) t_1)
(- x (fma (- t 1.0) a t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 1.0) * z;
double tmp;
if ((((x - t_1) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = (fma((b - a), t, fma((y - 2.0), b, x)) + a) - t_1;
} else {
tmp = x - fma((t - 1.0), a, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 1.0) * z) tmp = 0.0 if (Float64(Float64(Float64(x - t_1) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = Float64(Float64(fma(Float64(b - a), t, fma(Float64(y - 2.0), b, x)) + a) - t_1); else tmp = Float64(x - fma(Float64(t - 1.0), a, t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - t$95$1), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] - t$95$1), $MachinePrecision], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 1\right) \cdot z\\
\mathbf{if}\;\left(\left(x - t\_1\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right)\right) + a\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, t\_1\right)\\
\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%
Taylor expanded in t around 0
Applied rewrites99.2%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 0.0%
Taylor expanded in b around 0
Applied rewrites75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- b a) t (fma -2.0 b x)) a))
(t_2 (+ z (* (- (+ y t) 2.0) b))))
(if (<= b -1.1e+180)
t_2
(if (<= b -300000000.0)
t_1
(if (<= b 3.6e-8)
(- (+ x a) (* (- y 1.0) z))
(if (<= b 7e+62) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - a), t, fma(-2.0, b, x)) + a;
double t_2 = z + (((y + t) - 2.0) * b);
double tmp;
if (b <= -1.1e+180) {
tmp = t_2;
} else if (b <= -300000000.0) {
tmp = t_1;
} else if (b <= 3.6e-8) {
tmp = (x + a) - ((y - 1.0) * z);
} else if (b <= 7e+62) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(b - a), t, fma(-2.0, b, x)) + a) t_2 = Float64(z + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -1.1e+180) tmp = t_2; elseif (b <= -300000000.0) tmp = t_1; elseif (b <= 3.6e-8) tmp = Float64(Float64(x + a) - Float64(Float64(y - 1.0) * z)); elseif (b <= 7e+62) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(b - a), $MachinePrecision] * t + N[(-2.0 * b + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, Block[{t$95$2 = N[(z + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e+180], t$95$2, If[LessEqual[b, -300000000.0], t$95$1, If[LessEqual[b, 3.6e-8], N[(N[(x + a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e+62], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, x\right)\right) + a\\
t_2 := z + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{+180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -300000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-8}:\\
\;\;\;\;\left(x + a\right) - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.1e180 or 6.99999999999999967e62 < b Initial program 93.6%
Taylor expanded in z around inf
Applied rewrites89.3%
Taylor expanded in y around 0
Applied rewrites90.6%
if -1.1e180 < b < -3e8 or 3.59999999999999981e-8 < b < 6.99999999999999967e62Initial program 89.8%
Taylor expanded in t around 0
Applied rewrites94.9%
Taylor expanded in z around 0
Applied rewrites88.2%
Taylor expanded in y around 0
Applied rewrites80.1%
if -3e8 < b < 3.59999999999999981e-8Initial program 99.2%
Taylor expanded in t around 0
Applied rewrites99.2%
Taylor expanded in x around inf
Applied rewrites77.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.68e+156)
(* (- y) z)
(if (<= y -3.5e-118)
(* (- 1.0 t) a)
(if (<= y 1.15e-175)
(+ x a)
(if (<= y 9e-132) (* b t) (if (<= y 1.85e-35) z (+ (* b y) a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.68e+156) {
tmp = -y * z;
} else if (y <= -3.5e-118) {
tmp = (1.0 - t) * a;
} else if (y <= 1.15e-175) {
tmp = x + a;
} else if (y <= 9e-132) {
tmp = b * t;
} else if (y <= 1.85e-35) {
tmp = z;
} else {
tmp = (b * y) + 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 (y <= (-1.68d+156)) then
tmp = -y * z
else if (y <= (-3.5d-118)) then
tmp = (1.0d0 - t) * a
else if (y <= 1.15d-175) then
tmp = x + a
else if (y <= 9d-132) then
tmp = b * t
else if (y <= 1.85d-35) then
tmp = z
else
tmp = (b * y) + 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 (y <= -1.68e+156) {
tmp = -y * z;
} else if (y <= -3.5e-118) {
tmp = (1.0 - t) * a;
} else if (y <= 1.15e-175) {
tmp = x + a;
} else if (y <= 9e-132) {
tmp = b * t;
} else if (y <= 1.85e-35) {
tmp = z;
} else {
tmp = (b * y) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.68e+156: tmp = -y * z elif y <= -3.5e-118: tmp = (1.0 - t) * a elif y <= 1.15e-175: tmp = x + a elif y <= 9e-132: tmp = b * t elif y <= 1.85e-35: tmp = z else: tmp = (b * y) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.68e+156) tmp = Float64(Float64(-y) * z); elseif (y <= -3.5e-118) tmp = Float64(Float64(1.0 - t) * a); elseif (y <= 1.15e-175) tmp = Float64(x + a); elseif (y <= 9e-132) tmp = Float64(b * t); elseif (y <= 1.85e-35) tmp = z; else tmp = Float64(Float64(b * y) + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.68e+156) tmp = -y * z; elseif (y <= -3.5e-118) tmp = (1.0 - t) * a; elseif (y <= 1.15e-175) tmp = x + a; elseif (y <= 9e-132) tmp = b * t; elseif (y <= 1.85e-35) tmp = z; else tmp = (b * y) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.68e+156], N[((-y) * z), $MachinePrecision], If[LessEqual[y, -3.5e-118], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 1.15e-175], N[(x + a), $MachinePrecision], If[LessEqual[y, 9e-132], N[(b * t), $MachinePrecision], If[LessEqual[y, 1.85e-35], z, N[(N[(b * y), $MachinePrecision] + a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.68 \cdot 10^{+156}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-118}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-175}:\\
\;\;\;\;x + a\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-132}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-35}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;b \cdot y + a\\
\end{array}
\end{array}
if y < -1.68e156Initial program 96.6%
Taylor expanded in z around inf
Applied rewrites59.1%
Taylor expanded in y around inf
Applied rewrites59.1%
if -1.68e156 < y < -3.5e-118Initial program 100.0%
Taylor expanded in a around inf
Applied rewrites47.2%
if -3.5e-118 < y < 1.15e-175Initial program 97.2%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in z around 0
Applied rewrites77.5%
Taylor expanded in x around inf
Applied rewrites40.3%
if 1.15e-175 < y < 8.9999999999999999e-132Initial program 87.5%
Taylor expanded in t around inf
Applied rewrites62.7%
Taylor expanded in a around 0
Applied rewrites62.8%
if 8.9999999999999999e-132 < y < 1.8499999999999999e-35Initial program 95.6%
Taylor expanded in z around inf
Applied rewrites46.0%
Taylor expanded in y around 0
Applied rewrites46.0%
if 1.8499999999999999e-35 < y Initial program 90.3%
Taylor expanded in t around 0
Applied rewrites90.3%
Taylor expanded in z around 0
Applied rewrites75.7%
Taylor expanded in y around inf
Applied rewrites36.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (* (- (+ y t) 2.0) b))))
(if (<= b -1.1e+180)
t_1
(if (<= b -350000000.0)
(+ (fma (- b a) t (fma -2.0 b x)) a)
(if (<= b 3.6e+62) (- 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 = z + (((y + t) - 2.0) * b);
double tmp;
if (b <= -1.1e+180) {
tmp = t_1;
} else if (b <= -350000000.0) {
tmp = fma((b - a), t, fma(-2.0, b, x)) + a;
} else if (b <= 3.6e+62) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -1.1e+180) tmp = t_1; elseif (b <= -350000000.0) tmp = Float64(fma(Float64(b - a), t, fma(-2.0, b, x)) + a); elseif (b <= 3.6e+62) 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[(z + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e+180], t$95$1, If[LessEqual[b, -350000000.0], N[(N[(N[(b - a), $MachinePrecision] * t + N[(-2.0 * b + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[b, 3.6e+62], 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 := z + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -350000000:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, x\right)\right) + a\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{+62}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.1e180 or 3.6e62 < b Initial program 93.6%
Taylor expanded in z around inf
Applied rewrites89.3%
Taylor expanded in y around 0
Applied rewrites90.6%
if -1.1e180 < b < -3.5e8Initial program 86.0%
Taylor expanded in t around 0
Applied rewrites93.0%
Taylor expanded in z around 0
Applied rewrites86.5%
Taylor expanded in y around 0
Applied rewrites77.6%
if -3.5e8 < b < 3.6e62Initial program 99.2%
Taylor expanded in b around 0
Applied rewrites92.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -350000000.0)
(+ (fma (- b a) t (fma (- y 2.0) b x)) a)
(if (<= b 46.0)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(fma (- a) (- t 1.0) (fma (- (+ t y) 2.0) b x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -350000000.0) {
tmp = fma((b - a), t, fma((y - 2.0), b, x)) + a;
} else if (b <= 46.0) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = fma(-a, (t - 1.0), fma(((t + y) - 2.0), b, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -350000000.0) tmp = Float64(fma(Float64(b - a), t, fma(Float64(y - 2.0), b, x)) + a); elseif (b <= 46.0) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = fma(Float64(-a), Float64(t - 1.0), fma(Float64(Float64(t + y) - 2.0), b, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -350000000.0], N[(N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[b, 46.0], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(t - 1.0), $MachinePrecision] + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -350000000:\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right)\right) + a\\
\mathbf{elif}\;b \leq 46:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, t - 1, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
\end{array}
\end{array}
if b < -3.5e8Initial program 91.6%
Taylor expanded in t around 0
Applied rewrites94.4%
Taylor expanded in z around 0
Applied rewrites87.2%
if -3.5e8 < b < 46Initial program 99.2%
Taylor expanded in b around 0
Applied rewrites94.5%
if 46 < b Initial program 91.9%
Taylor expanded in z around 0
Applied rewrites91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -2.75e+41)
t_1
(if (<= y -6.5e-68)
(* (- b a) t)
(if (<= y 2.4e-254)
(- (+ x a) (- z))
(if (<= y 2.05e+83) (fma (- t 2.0) b x) 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+41) {
tmp = t_1;
} else if (y <= -6.5e-68) {
tmp = (b - a) * t;
} else if (y <= 2.4e-254) {
tmp = (x + a) - -z;
} else if (y <= 2.05e+83) {
tmp = fma((t - 2.0), b, x);
} 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+41) tmp = t_1; elseif (y <= -6.5e-68) tmp = Float64(Float64(b - a) * t); elseif (y <= 2.4e-254) tmp = Float64(Float64(x + a) - Float64(-z)); elseif (y <= 2.05e+83) tmp = fma(Float64(t - 2.0), b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.75e+41], t$95$1, If[LessEqual[y, -6.5e-68], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 2.4e-254], N[(N[(x + a), $MachinePrecision] - (-z)), $MachinePrecision], If[LessEqual[y, 2.05e+83], N[(N[(t - 2.0), $MachinePrecision] * b + x), $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^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-68}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-254}:\\
\;\;\;\;\left(x + a\right) - \left(-z\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.7500000000000002e41 or 2.05e83 < y Initial program 93.3%
Taylor expanded in y around inf
Applied rewrites71.9%
if -2.7500000000000002e41 < y < -6.4999999999999997e-68Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites62.8%
if -6.4999999999999997e-68 < y < 2.40000000000000002e-254Initial program 97.1%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites60.2%
Taylor expanded in y around 0
Applied rewrites60.2%
if 2.40000000000000002e-254 < y < 2.05e83Initial program 95.4%
Taylor expanded in x around inf
Applied rewrites63.2%
Taylor expanded in y around 0
Applied rewrites58.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6458.1
Applied rewrites58.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -350000000.0) (not (<= b 46.0))) (+ (fma (- b a) t (fma (- y 2.0) b x)) a) (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -350000000.0) || !(b <= 46.0)) {
tmp = fma((b - a), t, fma((y - 2.0), b, x)) + a;
} else {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -350000000.0) || !(b <= 46.0)) tmp = Float64(fma(Float64(b - a), t, fma(Float64(y - 2.0), b, x)) + a); else tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -350000000.0], N[Not[LessEqual[b, 46.0]], $MachinePrecision]], N[(N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -350000000 \lor \neg \left(b \leq 46\right):\\
\;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right)\right) + a\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\end{array}
\end{array}
if b < -3.5e8 or 46 < b Initial program 91.8%
Taylor expanded in t around 0
Applied rewrites94.0%
Taylor expanded in z around 0
Applied rewrites88.3%
if -3.5e8 < b < 46Initial program 99.2%
Taylor expanded in b around 0
Applied rewrites94.5%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -2.75e+41)
t_1
(if (<= y -6.5e-68)
(* (- b a) t)
(if (<= y 6.6e-22)
(- (+ x a) (- z))
(if (<= y 2.05e+83) (+ x (* t b)) 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+41) {
tmp = t_1;
} else if (y <= -6.5e-68) {
tmp = (b - a) * t;
} else if (y <= 6.6e-22) {
tmp = (x + a) - -z;
} else if (y <= 2.05e+83) {
tmp = x + (t * b);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-2.75d+41)) then
tmp = t_1
else if (y <= (-6.5d-68)) then
tmp = (b - a) * t
else if (y <= 6.6d-22) then
tmp = (x + a) - -z
else if (y <= 2.05d+83) then
tmp = x + (t * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -2.75e+41) {
tmp = t_1;
} else if (y <= -6.5e-68) {
tmp = (b - a) * t;
} else if (y <= 6.6e-22) {
tmp = (x + a) - -z;
} else if (y <= 2.05e+83) {
tmp = x + (t * b);
} 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+41: tmp = t_1 elif y <= -6.5e-68: tmp = (b - a) * t elif y <= 6.6e-22: tmp = (x + a) - -z elif y <= 2.05e+83: tmp = x + (t * b) 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+41) tmp = t_1; elseif (y <= -6.5e-68) tmp = Float64(Float64(b - a) * t); elseif (y <= 6.6e-22) tmp = Float64(Float64(x + a) - Float64(-z)); elseif (y <= 2.05e+83) tmp = Float64(x + Float64(t * b)); 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+41) tmp = t_1; elseif (y <= -6.5e-68) tmp = (b - a) * t; elseif (y <= 6.6e-22) tmp = (x + a) - -z; elseif (y <= 2.05e+83) tmp = x + (t * b); 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+41], t$95$1, If[LessEqual[y, -6.5e-68], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 6.6e-22], N[(N[(x + a), $MachinePrecision] - (-z)), $MachinePrecision], If[LessEqual[y, 2.05e+83], N[(x + N[(t * b), $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^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-68}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-22}:\\
\;\;\;\;\left(x + a\right) - \left(-z\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+83}:\\
\;\;\;\;x + t \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.7500000000000002e41 or 2.05e83 < y Initial program 93.3%
Taylor expanded in y around inf
Applied rewrites71.9%
if -2.7500000000000002e41 < y < -6.4999999999999997e-68Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites62.8%
if -6.4999999999999997e-68 < y < 6.6000000000000002e-22Initial program 96.5%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites55.5%
Taylor expanded in y around 0
Applied rewrites55.5%
if 6.6000000000000002e-22 < y < 2.05e83Initial program 94.7%
Taylor expanded in x around inf
Applied rewrites81.8%
Taylor expanded in t around inf
Applied rewrites64.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -4.4e+31)
t_1
(if (<= t -1.8e-99)
(* (- 1.0 y) z)
(if (<= t 7e-237) (+ x a) (if (<= t 2.6e+16) (+ (* b y) 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 <= -4.4e+31) {
tmp = t_1;
} else if (t <= -1.8e-99) {
tmp = (1.0 - y) * z;
} else if (t <= 7e-237) {
tmp = x + a;
} else if (t <= 2.6e+16) {
tmp = (b * y) + 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 <= (-4.4d+31)) then
tmp = t_1
else if (t <= (-1.8d-99)) then
tmp = (1.0d0 - y) * z
else if (t <= 7d-237) then
tmp = x + a
else if (t <= 2.6d+16) then
tmp = (b * y) + 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 <= -4.4e+31) {
tmp = t_1;
} else if (t <= -1.8e-99) {
tmp = (1.0 - y) * z;
} else if (t <= 7e-237) {
tmp = x + a;
} else if (t <= 2.6e+16) {
tmp = (b * y) + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -4.4e+31: tmp = t_1 elif t <= -1.8e-99: tmp = (1.0 - y) * z elif t <= 7e-237: tmp = x + a elif t <= 2.6e+16: tmp = (b * y) + 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 <= -4.4e+31) tmp = t_1; elseif (t <= -1.8e-99) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 7e-237) tmp = Float64(x + a); elseif (t <= 2.6e+16) tmp = Float64(Float64(b * y) + 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 <= -4.4e+31) tmp = t_1; elseif (t <= -1.8e-99) tmp = (1.0 - y) * z; elseif (t <= 7e-237) tmp = x + a; elseif (t <= 2.6e+16) tmp = (b * y) + 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, -4.4e+31], t$95$1, If[LessEqual[t, -1.8e-99], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 7e-237], N[(x + a), $MachinePrecision], If[LessEqual[t, 2.6e+16], N[(N[(b * y), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-99}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-237}:\\
\;\;\;\;x + a\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+16}:\\
\;\;\;\;b \cdot y + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.4000000000000002e31 or 2.6e16 < t Initial program 91.8%
Taylor expanded in t around inf
Applied rewrites63.4%
if -4.4000000000000002e31 < t < -1.8e-99Initial program 96.4%
Taylor expanded in z around inf
Applied rewrites54.8%
if -1.8e-99 < t < 6.99999999999999966e-237Initial program 100.0%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in z around 0
Applied rewrites65.3%
Taylor expanded in x around inf
Applied rewrites42.9%
if 6.99999999999999966e-237 < t < 2.6e16Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites98.4%
Taylor expanded in z around 0
Applied rewrites74.9%
Taylor expanded in y around inf
Applied rewrites48.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.75e+41)
(* (- y) z)
(if (<= y 1.15e-175)
(+ x a)
(if (<= y 9e-132) (* b t) (if (<= y 1.9e-35) z (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.75e+41) {
tmp = -y * z;
} else if (y <= 1.15e-175) {
tmp = x + a;
} else if (y <= 9e-132) {
tmp = b * t;
} else if (y <= 1.9e-35) {
tmp = z;
} else {
tmp = y * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.75d+41)) then
tmp = -y * z
else if (y <= 1.15d-175) then
tmp = x + a
else if (y <= 9d-132) then
tmp = b * t
else if (y <= 1.9d-35) then
tmp = z
else
tmp = y * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.75e+41) {
tmp = -y * z;
} else if (y <= 1.15e-175) {
tmp = x + a;
} else if (y <= 9e-132) {
tmp = b * t;
} else if (y <= 1.9e-35) {
tmp = z;
} else {
tmp = y * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.75e+41: tmp = -y * z elif y <= 1.15e-175: tmp = x + a elif y <= 9e-132: tmp = b * t elif y <= 1.9e-35: tmp = z else: tmp = y * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.75e+41) tmp = Float64(Float64(-y) * z); elseif (y <= 1.15e-175) tmp = Float64(x + a); elseif (y <= 9e-132) tmp = Float64(b * t); elseif (y <= 1.9e-35) tmp = z; else tmp = Float64(y * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.75e+41) tmp = -y * z; elseif (y <= 1.15e-175) tmp = x + a; elseif (y <= 9e-132) tmp = b * t; elseif (y <= 1.9e-35) tmp = z; else tmp = y * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.75e+41], N[((-y) * z), $MachinePrecision], If[LessEqual[y, 1.15e-175], N[(x + a), $MachinePrecision], If[LessEqual[y, 9e-132], N[(b * t), $MachinePrecision], If[LessEqual[y, 1.9e-35], z, N[(y * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{+41}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-175}:\\
\;\;\;\;x + a\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-132}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-35}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;y \cdot b\\
\end{array}
\end{array}
if y < -2.7500000000000002e41Initial program 98.1%
Taylor expanded in z around inf
Applied rewrites45.7%
Taylor expanded in y around inf
Applied rewrites45.7%
if -2.7500000000000002e41 < y < 1.15e-175Initial program 98.0%
Taylor expanded in t around 0
Applied rewrites99.0%
Taylor expanded in z around 0
Applied rewrites81.7%
Taylor expanded in x around inf
Applied rewrites38.5%
if 1.15e-175 < y < 8.9999999999999999e-132Initial program 87.5%
Taylor expanded in t around inf
Applied rewrites62.7%
Taylor expanded in a around 0
Applied rewrites62.8%
if 8.9999999999999999e-132 < y < 1.9000000000000001e-35Initial program 95.6%
Taylor expanded in z around inf
Applied rewrites46.0%
Taylor expanded in y around 0
Applied rewrites46.0%
if 1.9000000000000001e-35 < y Initial program 90.3%
Taylor expanded in t around 0
Applied rewrites90.3%
Taylor expanded in b around inf
Applied rewrites49.0%
Taylor expanded in y around inf
Applied rewrites35.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.8e+174)
t_1
(if (<= b -26500000.0)
(+ (fma (- y 2.0) b x) a)
(if (<= b 6.6e+27) (- x (* (- y 1.0) z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.8e+174) {
tmp = t_1;
} else if (b <= -26500000.0) {
tmp = fma((y - 2.0), b, x) + a;
} else if (b <= 6.6e+27) {
tmp = x - ((y - 1.0) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.8e+174) tmp = t_1; elseif (b <= -26500000.0) tmp = Float64(fma(Float64(y - 2.0), b, x) + a); elseif (b <= 6.6e+27) tmp = Float64(x - Float64(Float64(y - 1.0) * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.8e+174], t$95$1, If[LessEqual[b, -26500000.0], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[b, 6.6e+27], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{+174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -26500000:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+27}:\\
\;\;\;\;x - \left(y - 1\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.8000000000000001e174 or 6.5999999999999996e27 < b Initial program 94.0%
Taylor expanded in b around inf
Applied rewrites82.2%
if -1.8000000000000001e174 < b < -2.65e7Initial program 85.7%
Taylor expanded in t around 0
Applied rewrites92.8%
Taylor expanded in z around 0
Applied rewrites86.2%
Taylor expanded in t around 0
Applied rewrites51.3%
if -2.65e7 < b < 6.5999999999999996e27Initial program 99.2%
Taylor expanded in t around 0
Applied rewrites99.2%
Taylor expanded in x around inf
Applied rewrites66.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -4e+107)
t_1
(if (<= b -3e-13)
(- (+ x a) (* z y))
(if (<= b 6.6e+27) (- x (* (- y 1.0) z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -4e+107) {
tmp = t_1;
} else if (b <= -3e-13) {
tmp = (x + a) - (z * y);
} else if (b <= 6.6e+27) {
tmp = x - ((y - 1.0) * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((t + y) - 2.0d0) * b
if (b <= (-4d+107)) then
tmp = t_1
else if (b <= (-3d-13)) then
tmp = (x + a) - (z * y)
else if (b <= 6.6d+27) then
tmp = x - ((y - 1.0d0) * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -4e+107) {
tmp = t_1;
} else if (b <= -3e-13) {
tmp = (x + a) - (z * y);
} else if (b <= 6.6e+27) {
tmp = x - ((y - 1.0) * z);
} 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 <= -4e+107: tmp = t_1 elif b <= -3e-13: tmp = (x + a) - (z * y) elif b <= 6.6e+27: tmp = x - ((y - 1.0) * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -4e+107) tmp = t_1; elseif (b <= -3e-13) tmp = Float64(Float64(x + a) - Float64(z * y)); elseif (b <= 6.6e+27) tmp = Float64(x - Float64(Float64(y - 1.0) * z)); 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 <= -4e+107) tmp = t_1; elseif (b <= -3e-13) tmp = (x + a) - (z * y); elseif (b <= 6.6e+27) tmp = x - ((y - 1.0) * z); 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, -4e+107], t$95$1, If[LessEqual[b, -3e-13], N[(N[(x + a), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.6e+27], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -4 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-13}:\\
\;\;\;\;\left(x + a\right) - z \cdot y\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+27}:\\
\;\;\;\;x - \left(y - 1\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.9999999999999999e107 or 6.5999999999999996e27 < b Initial program 91.9%
Taylor expanded in b around inf
Applied rewrites77.0%
if -3.9999999999999999e107 < b < -2.99999999999999984e-13Initial program 89.7%
Taylor expanded in t around 0
Applied rewrites93.1%
Taylor expanded in x around inf
Applied rewrites56.9%
Taylor expanded in y around inf
Applied rewrites52.7%
if -2.99999999999999984e-13 < b < 6.5999999999999996e27Initial program 99.2%
Taylor expanded in t around 0
Applied rewrites99.2%
Taylor expanded in x around inf
Applied rewrites66.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -8.7e+83)
t_1
(if (<= b -4.5e+39)
(* (- 1.0 t) a)
(if (<= b 6.6e+27) (- x (* (- y 1.0) z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -8.7e+83) {
tmp = t_1;
} else if (b <= -4.5e+39) {
tmp = (1.0 - t) * a;
} else if (b <= 6.6e+27) {
tmp = x - ((y - 1.0) * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((t + y) - 2.0d0) * b
if (b <= (-8.7d+83)) then
tmp = t_1
else if (b <= (-4.5d+39)) then
tmp = (1.0d0 - t) * a
else if (b <= 6.6d+27) then
tmp = x - ((y - 1.0d0) * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -8.7e+83) {
tmp = t_1;
} else if (b <= -4.5e+39) {
tmp = (1.0 - t) * a;
} else if (b <= 6.6e+27) {
tmp = x - ((y - 1.0) * z);
} 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 <= -8.7e+83: tmp = t_1 elif b <= -4.5e+39: tmp = (1.0 - t) * a elif b <= 6.6e+27: tmp = x - ((y - 1.0) * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -8.7e+83) tmp = t_1; elseif (b <= -4.5e+39) tmp = Float64(Float64(1.0 - t) * a); elseif (b <= 6.6e+27) tmp = Float64(x - Float64(Float64(y - 1.0) * z)); 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 <= -8.7e+83) tmp = t_1; elseif (b <= -4.5e+39) tmp = (1.0 - t) * a; elseif (b <= 6.6e+27) tmp = x - ((y - 1.0) * z); 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, -8.7e+83], t$95$1, If[LessEqual[b, -4.5e+39], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 6.6e+27], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -8.7 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -4.5 \cdot 10^{+39}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+27}:\\
\;\;\;\;x - \left(y - 1\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.7000000000000005e83 or 6.5999999999999996e27 < b Initial program 90.5%
Taylor expanded in b around inf
Applied rewrites73.3%
if -8.7000000000000005e83 < b < -4.49999999999999996e39Initial program 90.9%
Taylor expanded in a around inf
Applied rewrites68.1%
if -4.49999999999999996e39 < b < 6.5999999999999996e27Initial program 99.3%
Taylor expanded in t around 0
Applied rewrites99.3%
Taylor expanded in x around inf
Applied rewrites65.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1e+206) (* (- a) t) (if (or (<= t -160000000.0) (not (<= t 2.4e+102))) (* b t) (+ (* b y) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1e+206) {
tmp = -a * t;
} else if ((t <= -160000000.0) || !(t <= 2.4e+102)) {
tmp = b * t;
} else {
tmp = (b * y) + 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 <= (-1d+206)) then
tmp = -a * t
else if ((t <= (-160000000.0d0)) .or. (.not. (t <= 2.4d+102))) then
tmp = b * t
else
tmp = (b * y) + 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 <= -1e+206) {
tmp = -a * t;
} else if ((t <= -160000000.0) || !(t <= 2.4e+102)) {
tmp = b * t;
} else {
tmp = (b * y) + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1e+206: tmp = -a * t elif (t <= -160000000.0) or not (t <= 2.4e+102): tmp = b * t else: tmp = (b * y) + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1e+206) tmp = Float64(Float64(-a) * t); elseif ((t <= -160000000.0) || !(t <= 2.4e+102)) tmp = Float64(b * t); else tmp = Float64(Float64(b * y) + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1e+206) tmp = -a * t; elseif ((t <= -160000000.0) || ~((t <= 2.4e+102))) tmp = b * t; else tmp = (b * y) + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1e+206], N[((-a) * t), $MachinePrecision], If[Or[LessEqual[t, -160000000.0], N[Not[LessEqual[t, 2.4e+102]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(N[(b * y), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+206}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{elif}\;t \leq -160000000 \lor \neg \left(t \leq 2.4 \cdot 10^{+102}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;b \cdot y + a\\
\end{array}
\end{array}
if t < -1e206Initial program 84.0%
Taylor expanded in t around inf
Applied rewrites88.2%
Taylor expanded in a around inf
Applied rewrites53.1%
if -1e206 < t < -1.6e8 or 2.39999999999999994e102 < t Initial program 94.1%
Taylor expanded in t around inf
Applied rewrites56.6%
Taylor expanded in a around 0
Applied rewrites39.6%
if -1.6e8 < t < 2.39999999999999994e102Initial program 97.9%
Taylor expanded in t around 0
Applied rewrites98.6%
Taylor expanded in z around 0
Applied rewrites70.8%
Taylor expanded in y around inf
Applied rewrites38.8%
Final simplification40.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4e+107) (not (<= b 3.3e+22))) (+ z (* (- (+ y t) 2.0) b)) (- (+ x a) (* (- y 1.0) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4e+107) || !(b <= 3.3e+22)) {
tmp = z + (((y + t) - 2.0) * b);
} else {
tmp = (x + a) - ((y - 1.0) * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4d+107)) .or. (.not. (b <= 3.3d+22))) then
tmp = z + (((y + t) - 2.0d0) * b)
else
tmp = (x + a) - ((y - 1.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4e+107) || !(b <= 3.3e+22)) {
tmp = z + (((y + t) - 2.0) * b);
} else {
tmp = (x + a) - ((y - 1.0) * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4e+107) or not (b <= 3.3e+22): tmp = z + (((y + t) - 2.0) * b) else: tmp = (x + a) - ((y - 1.0) * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4e+107) || !(b <= 3.3e+22)) tmp = Float64(z + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = Float64(Float64(x + a) - Float64(Float64(y - 1.0) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4e+107) || ~((b <= 3.3e+22))) tmp = z + (((y + t) - 2.0) * b); else tmp = (x + a) - ((y - 1.0) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4e+107], N[Not[LessEqual[b, 3.3e+22]], $MachinePrecision]], N[(z + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+107} \lor \neg \left(b \leq 3.3 \cdot 10^{+22}\right):\\
\;\;\;\;z + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + a\right) - \left(y - 1\right) \cdot z\\
\end{array}
\end{array}
if b < -3.9999999999999999e107 or 3.2999999999999998e22 < b Initial program 92.1%
Taylor expanded in z around inf
Applied rewrites81.2%
Taylor expanded in y around 0
Applied rewrites82.2%
if -3.9999999999999999e107 < b < 3.2999999999999998e22Initial program 97.4%
Taylor expanded in t around 0
Applied rewrites98.0%
Taylor expanded in x around inf
Applied rewrites71.6%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4e+107) (not (<= b 66000.0))) (+ x (* (- (+ y t) 2.0) b)) (- (+ x a) (* (- y 1.0) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4e+107) || !(b <= 66000.0)) {
tmp = x + (((y + t) - 2.0) * b);
} else {
tmp = (x + a) - ((y - 1.0) * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4d+107)) .or. (.not. (b <= 66000.0d0))) then
tmp = x + (((y + t) - 2.0d0) * b)
else
tmp = (x + a) - ((y - 1.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4e+107) || !(b <= 66000.0)) {
tmp = x + (((y + t) - 2.0) * b);
} else {
tmp = (x + a) - ((y - 1.0) * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4e+107) or not (b <= 66000.0): tmp = x + (((y + t) - 2.0) * b) else: tmp = (x + a) - ((y - 1.0) * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4e+107) || !(b <= 66000.0)) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = Float64(Float64(x + a) - Float64(Float64(y - 1.0) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4e+107) || ~((b <= 66000.0))) tmp = x + (((y + t) - 2.0) * b); else tmp = (x + a) - ((y - 1.0) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4e+107], N[Not[LessEqual[b, 66000.0]], $MachinePrecision]], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+107} \lor \neg \left(b \leq 66000\right):\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + a\right) - \left(y - 1\right) \cdot z\\
\end{array}
\end{array}
if b < -3.9999999999999999e107 or 66000 < b Initial program 92.6%
Taylor expanded in x around inf
Applied rewrites78.8%
if -3.9999999999999999e107 < b < 66000Initial program 97.3%
Taylor expanded in t around 0
Applied rewrites98.0%
Taylor expanded in x around inf
Applied rewrites71.8%
Final simplification74.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.5e+134) (not (<= b 3.3e+22))) (* (- (+ t y) 2.0) b) (- (+ x a) (* (- y 1.0) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.5e+134) || !(b <= 3.3e+22)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = (x + a) - ((y - 1.0) * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-6.5d+134)) .or. (.not. (b <= 3.3d+22))) then
tmp = ((t + y) - 2.0d0) * b
else
tmp = (x + a) - ((y - 1.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.5e+134) || !(b <= 3.3e+22)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = (x + a) - ((y - 1.0) * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.5e+134) or not (b <= 3.3e+22): tmp = ((t + y) - 2.0) * b else: tmp = (x + a) - ((y - 1.0) * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.5e+134) || !(b <= 3.3e+22)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = Float64(Float64(x + a) - Float64(Float64(y - 1.0) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -6.5e+134) || ~((b <= 3.3e+22))) tmp = ((t + y) - 2.0) * b; else tmp = (x + a) - ((y - 1.0) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.5e+134], N[Not[LessEqual[b, 3.3e+22]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(N[(x + a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+134} \lor \neg \left(b \leq 3.3 \cdot 10^{+22}\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + a\right) - \left(y - 1\right) \cdot z\\
\end{array}
\end{array}
if b < -6.5e134 or 3.2999999999999998e22 < b Initial program 92.7%
Taylor expanded in b around inf
Applied rewrites77.3%
if -6.5e134 < b < 3.2999999999999998e22Initial program 96.9%
Taylor expanded in t around 0
Applied rewrites97.5%
Taylor expanded in x around inf
Applied rewrites70.9%
Final simplification73.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -2.75e+41)
t_1
(if (<= y -6.5e-68)
(* (- b a) t)
(if (<= y 6.2e+67) (- (+ x a) (- z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -2.75e+41) {
tmp = t_1;
} else if (y <= -6.5e-68) {
tmp = (b - a) * t;
} else if (y <= 6.2e+67) {
tmp = (x + a) - -z;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-2.75d+41)) then
tmp = t_1
else if (y <= (-6.5d-68)) then
tmp = (b - a) * t
else if (y <= 6.2d+67) then
tmp = (x + a) - -z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -2.75e+41) {
tmp = t_1;
} else if (y <= -6.5e-68) {
tmp = (b - a) * t;
} else if (y <= 6.2e+67) {
tmp = (x + a) - -z;
} 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+41: tmp = t_1 elif y <= -6.5e-68: tmp = (b - a) * t elif y <= 6.2e+67: tmp = (x + a) - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -2.75e+41) tmp = t_1; elseif (y <= -6.5e-68) tmp = Float64(Float64(b - a) * t); elseif (y <= 6.2e+67) tmp = Float64(Float64(x + a) - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -2.75e+41) tmp = t_1; elseif (y <= -6.5e-68) tmp = (b - a) * t; elseif (y <= 6.2e+67) tmp = (x + a) - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.75e+41], t$95$1, If[LessEqual[y, -6.5e-68], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 6.2e+67], N[(N[(x + a), $MachinePrecision] - (-z)), $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^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-68}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+67}:\\
\;\;\;\;\left(x + a\right) - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.7500000000000002e41 or 6.19999999999999992e67 < y Initial program 93.3%
Taylor expanded in y around inf
Applied rewrites71.9%
if -2.7500000000000002e41 < y < -6.4999999999999997e-68Initial program 100.0%
Taylor expanded in t around inf
Applied rewrites62.8%
if -6.4999999999999997e-68 < y < 6.19999999999999992e67Initial program 96.3%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites54.7%
Taylor expanded in y around 0
Applied rewrites53.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -160000000.0)
t_1
(if (<= t 3e-174) (* (- b z) y) (if (<= t 2.6e+16) (+ (* b y) 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 <= -160000000.0) {
tmp = t_1;
} else if (t <= 3e-174) {
tmp = (b - z) * y;
} else if (t <= 2.6e+16) {
tmp = (b * y) + 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 <= (-160000000.0d0)) then
tmp = t_1
else if (t <= 3d-174) then
tmp = (b - z) * y
else if (t <= 2.6d+16) then
tmp = (b * y) + 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 <= -160000000.0) {
tmp = t_1;
} else if (t <= 3e-174) {
tmp = (b - z) * y;
} else if (t <= 2.6e+16) {
tmp = (b * y) + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -160000000.0: tmp = t_1 elif t <= 3e-174: tmp = (b - z) * y elif t <= 2.6e+16: tmp = (b * y) + 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 <= -160000000.0) tmp = t_1; elseif (t <= 3e-174) tmp = Float64(Float64(b - z) * y); elseif (t <= 2.6e+16) tmp = Float64(Float64(b * y) + 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 <= -160000000.0) tmp = t_1; elseif (t <= 3e-174) tmp = (b - z) * y; elseif (t <= 2.6e+16) tmp = (b * y) + 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, -160000000.0], t$95$1, If[LessEqual[t, 3e-174], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.6e+16], N[(N[(b * y), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -160000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-174}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+16}:\\
\;\;\;\;b \cdot y + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6e8 or 2.6e16 < t Initial program 92.2%
Taylor expanded in t around inf
Applied rewrites62.0%
if -1.6e8 < t < 3.00000000000000021e-174Initial program 97.4%
Taylor expanded in y around inf
Applied rewrites45.3%
if 3.00000000000000021e-174 < t < 2.6e16Initial program 100.0%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in z around 0
Applied rewrites78.7%
Taylor expanded in y around inf
Applied rewrites48.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)))
(if (<= z -9.5e+79)
t_1
(if (<= z 6.6e-227) (+ (* b y) a) (if (<= z 2.7e+119) (+ 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 <= -9.5e+79) {
tmp = t_1;
} else if (z <= 6.6e-227) {
tmp = (b * y) + a;
} else if (z <= 2.7e+119) {
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 <= (-9.5d+79)) then
tmp = t_1
else if (z <= 6.6d-227) then
tmp = (b * y) + a
else if (z <= 2.7d+119) 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 <= -9.5e+79) {
tmp = t_1;
} else if (z <= 6.6e-227) {
tmp = (b * y) + a;
} else if (z <= 2.7e+119) {
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 <= -9.5e+79: tmp = t_1 elif z <= 6.6e-227: tmp = (b * y) + a elif z <= 2.7e+119: 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 <= -9.5e+79) tmp = t_1; elseif (z <= 6.6e-227) tmp = Float64(Float64(b * y) + a); elseif (z <= 2.7e+119) tmp = Float64(x + 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 <= -9.5e+79) tmp = t_1; elseif (z <= 6.6e-227) tmp = (b * y) + a; elseif (z <= 2.7e+119) 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, -9.5e+79], t$95$1, If[LessEqual[z, 6.6e-227], N[(N[(b * y), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[z, 2.7e+119], 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 -9.5 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-227}:\\
\;\;\;\;b \cdot y + a\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+119}:\\
\;\;\;\;x + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.49999999999999994e79 or 2.6999999999999998e119 < z Initial program 90.9%
Taylor expanded in z around inf
Applied rewrites61.5%
if -9.49999999999999994e79 < z < 6.5999999999999999e-227Initial program 97.8%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in z around 0
Applied rewrites92.7%
Taylor expanded in y around inf
Applied rewrites42.5%
if 6.5999999999999999e-227 < z < 2.6999999999999998e119Initial program 97.4%
Taylor expanded in t around 0
Applied rewrites97.4%
Taylor expanded in z around 0
Applied rewrites84.0%
Taylor expanded in x around inf
Applied rewrites39.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.95e+58) (* b t) (if (<= t 2.5e+42) (+ x a) (if (<= t 2.4e+102) (* y b) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.95e+58) {
tmp = b * t;
} else if (t <= 2.5e+42) {
tmp = x + a;
} else if (t <= 2.4e+102) {
tmp = y * b;
} 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 <= (-4.95d+58)) then
tmp = b * t
else if (t <= 2.5d+42) then
tmp = x + a
else if (t <= 2.4d+102) then
tmp = y * b
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 <= -4.95e+58) {
tmp = b * t;
} else if (t <= 2.5e+42) {
tmp = x + a;
} else if (t <= 2.4e+102) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.95e+58: tmp = b * t elif t <= 2.5e+42: tmp = x + a elif t <= 2.4e+102: tmp = y * b else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.95e+58) tmp = Float64(b * t); elseif (t <= 2.5e+42) tmp = Float64(x + a); elseif (t <= 2.4e+102) tmp = Float64(y * b); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.95e+58) tmp = b * t; elseif (t <= 2.5e+42) tmp = x + a; elseif (t <= 2.4e+102) tmp = y * b; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.95e+58], N[(b * t), $MachinePrecision], If[LessEqual[t, 2.5e+42], N[(x + a), $MachinePrecision], If[LessEqual[t, 2.4e+102], N[(y * b), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.95 \cdot 10^{+58}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+42}:\\
\;\;\;\;x + a\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+102}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -4.95000000000000002e58 or 2.39999999999999994e102 < t Initial program 90.7%
Taylor expanded in t around inf
Applied rewrites66.6%
Taylor expanded in a around 0
Applied rewrites41.3%
if -4.95000000000000002e58 < t < 2.50000000000000003e42Initial program 98.6%
Taylor expanded in t around 0
Applied rewrites98.6%
Taylor expanded in z around 0
Applied rewrites69.4%
Taylor expanded in x around inf
Applied rewrites36.5%
if 2.50000000000000003e42 < t < 2.39999999999999994e102Initial program 92.9%
Taylor expanded in t around 0
Applied rewrites100.0%
Taylor expanded in b around inf
Applied rewrites45.0%
Taylor expanded in y around inf
Applied rewrites38.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.95e+58) (not (<= t 1.6e+42))) (* b t) (+ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.95e+58) || !(t <= 1.6e+42)) {
tmp = b * t;
} else {
tmp = x + 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 <= (-4.95d+58)) .or. (.not. (t <= 1.6d+42))) then
tmp = b * t
else
tmp = x + 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 <= -4.95e+58) || !(t <= 1.6e+42)) {
tmp = b * t;
} else {
tmp = x + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.95e+58) or not (t <= 1.6e+42): tmp = b * t else: tmp = x + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.95e+58) || !(t <= 1.6e+42)) tmp = Float64(b * t); else tmp = Float64(x + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.95e+58) || ~((t <= 1.6e+42))) tmp = b * t; else tmp = x + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.95e+58], N[Not[LessEqual[t, 1.6e+42]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(x + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.95 \cdot 10^{+58} \lor \neg \left(t \leq 1.6 \cdot 10^{+42}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + a\\
\end{array}
\end{array}
if t < -4.95000000000000002e58 or 1.60000000000000001e42 < t Initial program 91.0%
Taylor expanded in t around inf
Applied rewrites64.7%
Taylor expanded in a around 0
Applied rewrites37.2%
if -4.95000000000000002e58 < t < 1.60000000000000001e42Initial program 98.6%
Taylor expanded in t around 0
Applied rewrites98.6%
Taylor expanded in z around 0
Applied rewrites69.4%
Taylor expanded in x around inf
Applied rewrites36.5%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.8e+159) (not (<= z 1.55e+121))) z (+ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.8e+159) || !(z <= 1.55e+121)) {
tmp = z;
} else {
tmp = x + 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 ((z <= (-7.8d+159)) .or. (.not. (z <= 1.55d+121))) then
tmp = z
else
tmp = x + 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 ((z <= -7.8e+159) || !(z <= 1.55e+121)) {
tmp = z;
} else {
tmp = x + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.8e+159) or not (z <= 1.55e+121): tmp = z else: tmp = x + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.8e+159) || !(z <= 1.55e+121)) tmp = z; else tmp = Float64(x + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.8e+159) || ~((z <= 1.55e+121))) tmp = z; else tmp = x + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.8e+159], N[Not[LessEqual[z, 1.55e+121]], $MachinePrecision]], z, N[(x + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+159} \lor \neg \left(z \leq 1.55 \cdot 10^{+121}\right):\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x + a\\
\end{array}
\end{array}
if z < -7.8000000000000001e159 or 1.55000000000000004e121 < z Initial program 90.8%
Taylor expanded in z around inf
Applied rewrites66.5%
Taylor expanded in y around 0
Applied rewrites31.0%
if -7.8000000000000001e159 < z < 1.55000000000000004e121Initial program 97.2%
Taylor expanded in t around 0
Applied rewrites97.8%
Taylor expanded in z around 0
Applied rewrites86.7%
Taylor expanded in x around inf
Applied rewrites31.9%
Final simplification31.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.5e-21) z (if (<= z 1.3e+121) x z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e-21) {
tmp = z;
} else if (z <= 1.3e+121) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.5d-21)) then
tmp = z
else if (z <= 1.3d+121) then
tmp = x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e-21) {
tmp = z;
} else if (z <= 1.3e+121) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.5e-21: tmp = z elif z <= 1.3e+121: tmp = x else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e-21) tmp = z; elseif (z <= 1.3e+121) tmp = x; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.5e-21) tmp = z; elseif (z <= 1.3e+121) tmp = x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.5e-21], z, If[LessEqual[z, 1.3e+121], x, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-21}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+121}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -4.49999999999999968e-21 or 1.2999999999999999e121 < z Initial program 92.1%
Taylor expanded in z around inf
Applied rewrites53.4%
Taylor expanded in y around 0
Applied rewrites22.6%
if -4.49999999999999968e-21 < z < 1.2999999999999999e121Initial program 97.9%
Taylor expanded in x around inf
Applied rewrites24.5%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.3%
Taylor expanded in x around inf
Applied rewrites16.2%
herbie shell --seed 2025019
(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)))