
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (<= t_1 INFINITY) t_1 (* (- b z) y))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (b - z) * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (b - z) * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (b - z) * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(b - z) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (b - z) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\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 y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.7
Applied rewrites70.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.35e+35) (not (<= b 4.9e+65))) (+ (* (- 1.0 y) z) (* (- (+ y t) 2.0) b)) (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.35e+35) || !(b <= 4.9e+65)) {
tmp = ((1.0 - y) * z) + (((y + t) - 2.0) * b);
} 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 <= -1.35e+35) || !(b <= 4.9e+65)) tmp = Float64(Float64(Float64(1.0 - y) * z) + Float64(Float64(Float64(y + t) - 2.0) * b)); 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, -1.35e+35], N[Not[LessEqual[b, 4.9e+65]], $MachinePrecision]], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $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 -1.35 \cdot 10^{+35} \lor \neg \left(b \leq 4.9 \cdot 10^{+65}\right):\\
\;\;\;\;\left(1 - y\right) \cdot z + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\end{array}
\end{array}
if b < -1.35000000000000001e35 or 4.89999999999999956e65 < b Initial program 89.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -1.35000000000000001e35 < b < 4.89999999999999956e65Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6490.5
Applied rewrites90.5%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -4.2e+31)
t_1
(if (<= t -4.3e-145)
(* (- 1.0 y) z)
(if (<= t -1.4e-236)
(- x (- a))
(if (<= t 8.2e+49) (* (- b z) y) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -4.2e+31) {
tmp = t_1;
} else if (t <= -4.3e-145) {
tmp = (1.0 - y) * z;
} else if (t <= -1.4e-236) {
tmp = x - -a;
} else if (t <= 8.2e+49) {
tmp = (b - z) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - a) * t
if (t <= (-4.2d+31)) then
tmp = t_1
else if (t <= (-4.3d-145)) then
tmp = (1.0d0 - y) * z
else if (t <= (-1.4d-236)) then
tmp = x - -a
else if (t <= 8.2d+49) then
tmp = (b - z) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -4.2e+31) {
tmp = t_1;
} else if (t <= -4.3e-145) {
tmp = (1.0 - y) * z;
} else if (t <= -1.4e-236) {
tmp = x - -a;
} else if (t <= 8.2e+49) {
tmp = (b - z) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -4.2e+31: tmp = t_1 elif t <= -4.3e-145: tmp = (1.0 - y) * z elif t <= -1.4e-236: tmp = x - -a elif t <= 8.2e+49: tmp = (b - z) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -4.2e+31) tmp = t_1; elseif (t <= -4.3e-145) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= -1.4e-236) tmp = Float64(x - Float64(-a)); elseif (t <= 8.2e+49) tmp = Float64(Float64(b - z) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -4.2e+31) tmp = t_1; elseif (t <= -4.3e-145) tmp = (1.0 - y) * z; elseif (t <= -1.4e-236) tmp = x - -a; elseif (t <= 8.2e+49) tmp = (b - z) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.2e+31], t$95$1, If[LessEqual[t, -4.3e-145], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, -1.4e-236], N[(x - (-a)), $MachinePrecision], If[LessEqual[t, 8.2e+49], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.3 \cdot 10^{-145}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-236}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+49}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.19999999999999958e31 or 8.2e49 < t Initial program 94.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.5
Applied rewrites76.5%
if -4.19999999999999958e31 < t < -4.2999999999999999e-145Initial program 97.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6455.6
Applied rewrites55.6%
if -4.2999999999999999e-145 < t < -1.39999999999999993e-236Initial program 94.4%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6446.6
Applied rewrites46.6%
Taylor expanded in t around 0
mul-1-negN/A
lift-neg.f6446.6
Applied rewrites46.6%
if -1.39999999999999993e-236 < t < 8.2e49Initial program 98.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6445.7
Applied rewrites45.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.1e+63) (not (<= b 4.5e+126))) (+ x (* (- (+ y t) 2.0) b)) (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.1e+63) || !(b <= 4.5e+126)) {
tmp = x + (((y + t) - 2.0) * b);
} 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 <= -1.1e+63) || !(b <= 4.5e+126)) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); 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, -1.1e+63], N[Not[LessEqual[b, 4.5e+126]], $MachinePrecision]], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $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 -1.1 \cdot 10^{+63} \lor \neg \left(b \leq 4.5 \cdot 10^{+126}\right):\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\end{array}
\end{array}
if b < -1.0999999999999999e63 or 4.49999999999999974e126 < b Initial program 87.8%
Taylor expanded in x around inf
Applied rewrites82.0%
if -1.0999999999999999e63 < b < 4.49999999999999974e126Initial program 99.5%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6487.7
Applied rewrites87.7%
Final simplification86.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* (- (+ y t) 2.0) b))))
(if (<= b -1.5e+26)
t_1
(if (<= b -6.8e-97)
(- x (fma z (- y 1.0) (- a)))
(if (<= b 4.9e+65) (- x (fma (- t 1.0) a (- z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (((y + t) - 2.0) * b);
double tmp;
if (b <= -1.5e+26) {
tmp = t_1;
} else if (b <= -6.8e-97) {
tmp = x - fma(z, (y - 1.0), -a);
} else if (b <= 4.9e+65) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -1.5e+26) tmp = t_1; elseif (b <= -6.8e-97) tmp = Float64(x - fma(z, Float64(y - 1.0), Float64(-a))); elseif (b <= 4.9e+65) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.5e+26], t$95$1, If[LessEqual[b, -6.8e-97], N[(x - N[(z * N[(y - 1.0), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.9e+65], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.5 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -6.8 \cdot 10^{-97}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y - 1, -a\right)\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{+65}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.49999999999999999e26 or 4.89999999999999956e65 < b Initial program 89.0%
Taylor expanded in x around inf
Applied rewrites74.6%
if -1.49999999999999999e26 < b < -6.7999999999999998e-97Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6484.7
Applied rewrites84.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6469.7
Applied rewrites69.7%
if -6.7999999999999998e-97 < b < 4.89999999999999956e65Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6491.5
Applied rewrites91.5%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6476.7
Applied rewrites76.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -1.32e+50)
t_1
(if (<= t -1.85e-204)
(- x (* z (- y 1.0)))
(if (<= t 88000000.0) (- x (fma -1.0 a (- z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -1.32e+50) {
tmp = t_1;
} else if (t <= -1.85e-204) {
tmp = x - (z * (y - 1.0));
} else if (t <= 88000000.0) {
tmp = x - fma(-1.0, a, -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -1.32e+50) tmp = t_1; elseif (t <= -1.85e-204) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (t <= 88000000.0) tmp = Float64(x - fma(-1.0, a, Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.32e+50], t$95$1, If[LessEqual[t, -1.85e-204], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 88000000.0], N[(x - N[(-1.0 * a + (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-204}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;t \leq 88000000:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.3199999999999999e50 or 8.8e7 < t Initial program 94.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.2
Applied rewrites76.2%
if -1.3199999999999999e50 < t < -1.8499999999999999e-204Initial program 96.1%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6477.5
Applied rewrites77.5%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6468.1
Applied rewrites68.1%
if -1.8499999999999999e-204 < t < 8.8e7Initial program 98.8%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6451.9
Applied rewrites51.9%
Taylor expanded in t around 0
Applied rewrites51.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.32e+50) (not (<= t 310000000.0))) (* (- b a) t) (- x (fma z (- y 1.0) (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.32e+50) || !(t <= 310000000.0)) {
tmp = (b - a) * t;
} else {
tmp = x - fma(z, (y - 1.0), -a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.32e+50) || !(t <= 310000000.0)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(x - fma(z, Float64(y - 1.0), Float64(-a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.32e+50], N[Not[LessEqual[t, 310000000.0]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(x - N[(z * N[(y - 1.0), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.32 \cdot 10^{+50} \lor \neg \left(t \leq 310000000\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y - 1, -a\right)\\
\end{array}
\end{array}
if t < -1.3199999999999999e50 or 3.1e8 < t Initial program 94.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.2
Applied rewrites76.2%
if -1.3199999999999999e50 < t < 3.1e8Initial program 97.7%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6471.4
Applied rewrites71.4%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6470.8
Applied rewrites70.8%
Final simplification73.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -4.2e+31)
t_1
(if (<= t -2.2e-143)
(* (- 1.0 y) z)
(if (<= t 90000000.0) (+ x (* b y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -4.2e+31) {
tmp = t_1;
} else if (t <= -2.2e-143) {
tmp = (1.0 - y) * z;
} else if (t <= 90000000.0) {
tmp = x + (b * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - a) * t
if (t <= (-4.2d+31)) then
tmp = t_1
else if (t <= (-2.2d-143)) then
tmp = (1.0d0 - y) * z
else if (t <= 90000000.0d0) then
tmp = x + (b * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -4.2e+31) {
tmp = t_1;
} else if (t <= -2.2e-143) {
tmp = (1.0 - y) * z;
} else if (t <= 90000000.0) {
tmp = x + (b * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -4.2e+31: tmp = t_1 elif t <= -2.2e-143: tmp = (1.0 - y) * z elif t <= 90000000.0: tmp = x + (b * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -4.2e+31) tmp = t_1; elseif (t <= -2.2e-143) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 90000000.0) tmp = Float64(x + Float64(b * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -4.2e+31) tmp = t_1; elseif (t <= -2.2e-143) tmp = (1.0 - y) * z; elseif (t <= 90000000.0) tmp = x + (b * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.2e+31], t$95$1, If[LessEqual[t, -2.2e-143], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 90000000.0], N[(x + N[(b * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-143}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 90000000:\\
\;\;\;\;x + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.19999999999999958e31 or 9e7 < t Initial program 94.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.3
Applied rewrites75.3%
if -4.19999999999999958e31 < t < -2.19999999999999989e-143Initial program 97.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6455.6
Applied rewrites55.6%
if -2.19999999999999989e-143 < t < 9e7Initial program 97.9%
Taylor expanded in x around inf
Applied rewrites50.7%
Taylor expanded in y around inf
lower-*.f6443.0
Applied rewrites43.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t) a)))
(if (<= t -4e+31)
t_1
(if (<= t -1.25e-51) (* (- z) y) (if (<= t 4.5e+15) (- x (- a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -t * a;
double tmp;
if (t <= -4e+31) {
tmp = t_1;
} else if (t <= -1.25e-51) {
tmp = -z * y;
} else if (t <= 4.5e+15) {
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 = -t * a
if (t <= (-4d+31)) then
tmp = t_1
else if (t <= (-1.25d-51)) then
tmp = -z * y
else if (t <= 4.5d+15) 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 = -t * a;
double tmp;
if (t <= -4e+31) {
tmp = t_1;
} else if (t <= -1.25e-51) {
tmp = -z * y;
} else if (t <= 4.5e+15) {
tmp = x - -a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -t * a tmp = 0 if t <= -4e+31: tmp = t_1 elif t <= -1.25e-51: tmp = -z * y elif t <= 4.5e+15: tmp = x - -a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-t) * a) tmp = 0.0 if (t <= -4e+31) tmp = t_1; elseif (t <= -1.25e-51) tmp = Float64(Float64(-z) * y); elseif (t <= 4.5e+15) tmp = Float64(x - Float64(-a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -t * a; tmp = 0.0; if (t <= -4e+31) tmp = t_1; elseif (t <= -1.25e-51) tmp = -z * y; elseif (t <= 4.5e+15) tmp = x - -a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-t) * a), $MachinePrecision]}, If[LessEqual[t, -4e+31], t$95$1, If[LessEqual[t, -1.25e-51], N[((-z) * y), $MachinePrecision], If[LessEqual[t, 4.5e+15], N[(x - (-a)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot a\\
\mathbf{if}\;t \leq -4 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-51}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;x - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.9999999999999999e31 or 4.5e15 < t Initial program 94.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6451.0
Applied rewrites51.0%
if -3.9999999999999999e31 < t < -1.25000000000000001e-51Initial program 94.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6458.8
Applied rewrites58.8%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6453.6
Applied rewrites53.6%
if -1.25000000000000001e-51 < t < 4.5e15Initial program 98.2%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6469.6
Applied rewrites69.6%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6435.3
Applied rewrites35.3%
Taylor expanded in t around 0
mul-1-negN/A
lift-neg.f6435.3
Applied rewrites35.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.15e+27) (not (<= y 3.6e+55))) (* (- b z) y) (- x (fma t a (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.15e+27) || !(y <= 3.6e+55)) {
tmp = (b - z) * y;
} else {
tmp = x - fma(t, a, -z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.15e+27) || !(y <= 3.6e+55)) tmp = Float64(Float64(b - z) * y); else tmp = Float64(x - fma(t, a, Float64(-z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.15e+27], N[Not[LessEqual[y, 3.6e+55]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(x - N[(t * a + (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+27} \lor \neg \left(y \leq 3.6 \cdot 10^{+55}\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t, a, -z\right)\\
\end{array}
\end{array}
if y < -2.15000000000000004e27 or 3.59999999999999987e55 < y Initial program 93.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
if -2.15000000000000004e27 < y < 3.59999999999999987e55Initial program 98.6%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
Applied rewrites64.0%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.32e+50) (not (<= t 310000000.0))) (* (- b a) t) (- x (* z (- y 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.32e+50) || !(t <= 310000000.0)) {
tmp = (b - a) * t;
} else {
tmp = x - (z * (y - 1.0));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.32d+50)) .or. (.not. (t <= 310000000.0d0))) then
tmp = (b - a) * t
else
tmp = x - (z * (y - 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.32e+50) || !(t <= 310000000.0)) {
tmp = (b - a) * t;
} else {
tmp = x - (z * (y - 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.32e+50) or not (t <= 310000000.0): tmp = (b - a) * t else: tmp = x - (z * (y - 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.32e+50) || !(t <= 310000000.0)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(x - Float64(z * Float64(y - 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.32e+50) || ~((t <= 310000000.0))) tmp = (b - a) * t; else tmp = x - (z * (y - 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.32e+50], N[Not[LessEqual[t, 310000000.0]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.32 \cdot 10^{+50} \lor \neg \left(t \leq 310000000\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\end{array}
\end{array}
if t < -1.3199999999999999e50 or 3.1e8 < t Initial program 94.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.2
Applied rewrites76.2%
if -1.3199999999999999e50 < t < 3.1e8Initial program 97.7%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6471.4
Applied rewrites71.4%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6454.8
Applied rewrites54.8%
Final simplification65.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.35e+35) (not (<= b 4.9e+65))) (* (- (+ t y) 2.0) b) (- x (* a (- t 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.35e+35) || !(b <= 4.9e+65)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = x - (a * (t - 1.0));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.35d+35)) .or. (.not. (b <= 4.9d+65))) then
tmp = ((t + y) - 2.0d0) * b
else
tmp = x - (a * (t - 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.35e+35) || !(b <= 4.9e+65)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = x - (a * (t - 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.35e+35) or not (b <= 4.9e+65): tmp = ((t + y) - 2.0) * b else: tmp = x - (a * (t - 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.35e+35) || !(b <= 4.9e+65)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = Float64(x - Float64(a * Float64(t - 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.35e+35) || ~((b <= 4.9e+65))) tmp = ((t + y) - 2.0) * b; else tmp = x - (a * (t - 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.35e+35], N[Not[LessEqual[b, 4.9e+65]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{+35} \lor \neg \left(b \leq 4.9 \cdot 10^{+65}\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\end{array}
\end{array}
if b < -1.35000000000000001e35 or 4.89999999999999956e65 < b Initial program 89.0%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
if -1.35000000000000001e35 < b < 4.89999999999999956e65Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6490.5
Applied rewrites90.5%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6461.0
Applied rewrites61.0%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.85e-8) (* b t) (if (<= t -1.95e-236) x (if (<= t 9.5e+69) (* b y) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.85e-8) {
tmp = b * t;
} else if (t <= -1.95e-236) {
tmp = x;
} else if (t <= 9.5e+69) {
tmp = b * y;
} 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 <= (-1.85d-8)) then
tmp = b * t
else if (t <= (-1.95d-236)) then
tmp = x
else if (t <= 9.5d+69) then
tmp = b * y
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 <= -1.85e-8) {
tmp = b * t;
} else if (t <= -1.95e-236) {
tmp = x;
} else if (t <= 9.5e+69) {
tmp = b * y;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.85e-8: tmp = b * t elif t <= -1.95e-236: tmp = x elif t <= 9.5e+69: tmp = b * y else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.85e-8) tmp = Float64(b * t); elseif (t <= -1.95e-236) tmp = x; elseif (t <= 9.5e+69) tmp = Float64(b * y); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.85e-8) tmp = b * t; elseif (t <= -1.95e-236) tmp = x; elseif (t <= 9.5e+69) tmp = b * y; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.85e-8], N[(b * t), $MachinePrecision], If[LessEqual[t, -1.95e-236], x, If[LessEqual[t, 9.5e+69], N[(b * y), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{-8}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{-236}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+69}:\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -1.85e-8 or 9.4999999999999995e69 < t Initial program 95.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.9
Applied rewrites70.9%
Taylor expanded in a around 0
Applied rewrites31.3%
if -1.85e-8 < t < -1.95e-236Initial program 95.2%
Taylor expanded in x around inf
Applied rewrites24.3%
if -1.95e-236 < t < 9.4999999999999995e69Initial program 97.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6444.9
Applied rewrites44.9%
Taylor expanded in z around 0
Applied rewrites29.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5.5e-60) (* b t) (if (<= b 3.5e-285) a (if (<= b 1.46e+54) x (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e-60) {
tmp = b * t;
} else if (b <= 3.5e-285) {
tmp = a;
} else if (b <= 1.46e+54) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-5.5d-60)) then
tmp = b * t
else if (b <= 3.5d-285) then
tmp = a
else if (b <= 1.46d+54) then
tmp = x
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e-60) {
tmp = b * t;
} else if (b <= 3.5e-285) {
tmp = a;
} else if (b <= 1.46e+54) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5.5e-60: tmp = b * t elif b <= 3.5e-285: tmp = a elif b <= 1.46e+54: tmp = x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.5e-60) tmp = Float64(b * t); elseif (b <= 3.5e-285) tmp = a; elseif (b <= 1.46e+54) tmp = x; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5.5e-60) tmp = b * t; elseif (b <= 3.5e-285) tmp = a; elseif (b <= 1.46e+54) tmp = x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.5e-60], N[(b * t), $MachinePrecision], If[LessEqual[b, 3.5e-285], a, If[LessEqual[b, 1.46e+54], x, N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-60}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-285}:\\
\;\;\;\;a\\
\mathbf{elif}\;b \leq 1.46 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -5.4999999999999997e-60 or 1.46000000000000003e54 < b Initial program 90.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6442.2
Applied rewrites42.2%
Taylor expanded in a around 0
Applied rewrites33.9%
if -5.4999999999999997e-60 < b < 3.5000000000000004e-285Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6449.7
Applied rewrites49.7%
Taylor expanded in t around 0
Applied rewrites21.0%
if 3.5000000000000004e-285 < b < 1.46000000000000003e54Initial program 100.0%
Taylor expanded in x around inf
Applied rewrites24.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.2e+31) (not (<= t 5.2e-7))) (* (- b a) t) (* (- 1.0 y) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.2e+31) || !(t <= 5.2e-7)) {
tmp = (b - a) * t;
} else {
tmp = (1.0 - y) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-4.2d+31)) .or. (.not. (t <= 5.2d-7))) then
tmp = (b - a) * t
else
tmp = (1.0d0 - y) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.2e+31) || !(t <= 5.2e-7)) {
tmp = (b - a) * t;
} else {
tmp = (1.0 - y) * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.2e+31) or not (t <= 5.2e-7): tmp = (b - a) * t else: tmp = (1.0 - y) * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.2e+31) || !(t <= 5.2e-7)) tmp = Float64(Float64(b - a) * t); else tmp = Float64(Float64(1.0 - y) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.2e+31) || ~((t <= 5.2e-7))) tmp = (b - a) * t; else tmp = (1.0 - y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.2e+31], N[Not[LessEqual[t, 5.2e-7]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+31} \lor \neg \left(t \leq 5.2 \cdot 10^{-7}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\end{array}
\end{array}
if t < -4.19999999999999958e31 or 5.19999999999999998e-7 < t Initial program 93.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if -4.19999999999999958e31 < t < 5.19999999999999998e-7Initial program 98.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6439.3
Applied rewrites39.3%
Final simplification56.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -21.0) (not (<= z 2.35e+83))) (* (- 1.0 y) z) (* (- 1.0 t) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -21.0) || !(z <= 2.35e+83)) {
tmp = (1.0 - y) * z;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-21.0d0)) .or. (.not. (z <= 2.35d+83))) then
tmp = (1.0d0 - y) * z
else
tmp = (1.0d0 - t) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -21.0) || !(z <= 2.35e+83)) {
tmp = (1.0 - y) * z;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -21.0) or not (z <= 2.35e+83): tmp = (1.0 - y) * z else: tmp = (1.0 - t) * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -21.0) || !(z <= 2.35e+83)) tmp = Float64(Float64(1.0 - y) * z); else tmp = Float64(Float64(1.0 - t) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -21.0) || ~((z <= 2.35e+83))) tmp = (1.0 - y) * z; else tmp = (1.0 - t) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -21.0], N[Not[LessEqual[z, 2.35e+83]], $MachinePrecision]], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -21 \lor \neg \left(z \leq 2.35 \cdot 10^{+83}\right):\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\end{array}
\end{array}
if z < -21 or 2.3499999999999999e83 < z Initial program 91.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.7
Applied rewrites54.7%
if -21 < z < 2.3499999999999999e83Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6442.3
Applied rewrites42.3%
Final simplification47.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4e+50) (not (<= t 4.5e+15))) (* (- t) a) (- x (- a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4e+50) || !(t <= 4.5e+15)) {
tmp = -t * a;
} 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 <= (-4d+50)) .or. (.not. (t <= 4.5d+15))) then
tmp = -t * a
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 <= -4e+50) || !(t <= 4.5e+15)) {
tmp = -t * a;
} else {
tmp = x - -a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4e+50) or not (t <= 4.5e+15): tmp = -t * a else: tmp = x - -a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4e+50) || !(t <= 4.5e+15)) tmp = Float64(Float64(-t) * a); else tmp = Float64(x - Float64(-a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4e+50) || ~((t <= 4.5e+15))) tmp = -t * a; else tmp = x - -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4e+50], N[Not[LessEqual[t, 4.5e+15]], $MachinePrecision]], N[((-t) * a), $MachinePrecision], N[(x - (-a)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+50} \lor \neg \left(t \leq 4.5 \cdot 10^{+15}\right):\\
\;\;\;\;\left(-t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - \left(-a\right)\\
\end{array}
\end{array}
if t < -4.0000000000000003e50 or 4.5e15 < t Initial program 94.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6451.4
Applied rewrites51.4%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6451.4
Applied rewrites51.4%
if -4.0000000000000003e50 < t < 4.5e15Initial program 97.8%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6470.9
Applied rewrites70.9%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6434.0
Applied rewrites34.0%
Taylor expanded in t around 0
mul-1-negN/A
lift-neg.f6433.3
Applied rewrites33.3%
Final simplification41.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.2e+25) (not (<= b 1.52e+54))) (* b t) (- x (- a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.2e+25) || !(b <= 1.52e+54)) {
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 ((b <= (-3.2d+25)) .or. (.not. (b <= 1.52d+54))) 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 ((b <= -3.2e+25) || !(b <= 1.52e+54)) {
tmp = b * t;
} else {
tmp = x - -a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.2e+25) or not (b <= 1.52e+54): tmp = b * t else: tmp = x - -a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.2e+25) || !(b <= 1.52e+54)) tmp = Float64(b * t); else tmp = Float64(x - Float64(-a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.2e+25) || ~((b <= 1.52e+54))) tmp = b * t; else tmp = x - -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.2e+25], N[Not[LessEqual[b, 1.52e+54]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(x - (-a)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.2 \cdot 10^{+25} \lor \neg \left(b \leq 1.52 \cdot 10^{+54}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;x - \left(-a\right)\\
\end{array}
\end{array}
if b < -3.1999999999999999e25 or 1.51999999999999999e54 < b Initial program 89.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6443.9
Applied rewrites43.9%
Taylor expanded in a around 0
Applied rewrites36.6%
if -3.1999999999999999e25 < b < 1.51999999999999999e54Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6490.4
Applied rewrites90.4%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6460.5
Applied rewrites60.5%
Taylor expanded in t around 0
mul-1-negN/A
lift-neg.f6431.2
Applied rewrites31.2%
Final simplification33.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.12e+116) z (if (<= z 1.45e+81) x z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.12e+116) {
tmp = z;
} else if (z <= 1.45e+81) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.12d+116)) then
tmp = z
else if (z <= 1.45d+81) then
tmp = x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.12e+116) {
tmp = z;
} else if (z <= 1.45e+81) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.12e+116: tmp = z elif z <= 1.45e+81: tmp = x else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.12e+116) tmp = z; elseif (z <= 1.45e+81) tmp = x; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.12e+116) tmp = z; elseif (z <= 1.45e+81) tmp = x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.12e+116], z, If[LessEqual[z, 1.45e+81], x, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+116}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.12e116 or 1.45e81 < z Initial program 89.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.7
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites24.4%
if -1.12e116 < z < 1.45e81Initial program 100.0%
Taylor expanded in x around inf
Applied rewrites18.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.2e+79) x (if (<= x 6.5e+30) a x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+79) {
tmp = x;
} else if (x <= 6.5e+30) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-5.2d+79)) then
tmp = x
else if (x <= 6.5d+30) then
tmp = a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+79) {
tmp = x;
} else if (x <= 6.5e+30) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.2e+79: tmp = x elif x <= 6.5e+30: tmp = a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.2e+79) tmp = x; elseif (x <= 6.5e+30) tmp = a; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5.2e+79) tmp = x; elseif (x <= 6.5e+30) tmp = a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.2e+79], x, If[LessEqual[x, 6.5e+30], a, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+79}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+30}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.20000000000000029e79 or 6.5e30 < x Initial program 96.8%
Taylor expanded in x around inf
Applied rewrites30.2%
if -5.20000000000000029e79 < x < 6.5e30Initial program 95.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6439.1
Applied rewrites39.1%
Taylor expanded in t around 0
Applied rewrites14.7%
(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 96.1%
Taylor expanded in x around inf
Applied rewrites13.4%
herbie shell --seed 2025083
(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)))