
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
Herbie found 16 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 (* (- t 1.0) a)) (t_2 (* (- (+ y t) 2.0) b)))
(if (<= (+ (- (- x (* (- y 1.0) z)) t_1) t_2) INFINITY)
(+ (- (- x (fma z y (- z))) t_1) t_2)
(* y (- b z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * a;
double t_2 = ((y + t) - 2.0) * b;
double tmp;
if ((((x - ((y - 1.0) * z)) - t_1) + t_2) <= ((double) INFINITY)) {
tmp = ((x - fma(z, y, -z)) - t_1) + t_2;
} else {
tmp = y * (b - z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * a) t_2 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - t_1) + t_2) <= Inf) tmp = Float64(Float64(Float64(x - fma(z, y, Float64(-z))) - t_1) + t_2); else tmp = Float64(y * Float64(b - z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], Infinity], N[(N[(N[(x - N[(z * y + (-z)), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot a\\
t_2 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;\left(\left(x - \left(y - 1\right) \cdot z\right) - t\_1\right) + t\_2 \leq \infty:\\
\;\;\;\;\left(\left(x - \mathsf{fma}\left(z, y, -z\right)\right) - t\_1\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(b - z\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 95.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
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 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
(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 (* y (- b z)))))
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 = y * (b - z);
}
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 = y * (b - z);
}
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 = y * (b - z) 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(y * Float64(b - z)); 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 = y * (b - z); 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[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(b - z\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 95.5%
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 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- (- x (fma z y (- z))) (* (- t 1.0) a)) (* b y))))
(if (<= y -6e+17)
t_1
(if (<= y 2.5e+59) (- (+ x (+ z (* b (- t 2.0)))) (* a (- t 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - fma(z, y, -z)) - ((t - 1.0) * a)) + (b * y);
double tmp;
if (y <= -6e+17) {
tmp = t_1;
} else if (y <= 2.5e+59) {
tmp = (x + (z + (b * (t - 2.0)))) - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - fma(z, y, Float64(-z))) - Float64(Float64(t - 1.0) * a)) + Float64(b * y)) tmp = 0.0 if (y <= -6e+17) tmp = t_1; elseif (y <= 2.5e+59) tmp = Float64(Float64(x + Float64(z + Float64(b * Float64(t - 2.0)))) - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(z * y + (-z)), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+17], t$95$1, If[LessEqual[y, 2.5e+59], N[(N[(x + N[(z + N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - \mathsf{fma}\left(z, y, -z\right)\right) - \left(t - 1\right) \cdot a\right) + b \cdot y\\
\mathbf{if}\;y \leq -6 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+59}:\\
\;\;\;\;\left(x + \left(z + b \cdot \left(t - 2\right)\right)\right) - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6e17 or 2.4999999999999999e59 < y Initial program 95.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
Taylor expanded in y around inf
lower-*.f6478.5
Applied rewrites78.5%
if -6e17 < y < 2.4999999999999999e59Initial program 95.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6469.6
Applied rewrites69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- x (* a (- t 1.0))) (* (- (+ y t) 2.0) b))))
(if (<= a -1.72e+27)
t_1
(if (<= a 1.1e-38) (- (+ x (* b (- (+ t y) 2.0))) (* z (- y 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
double tmp;
if (a <= -1.72e+27) {
tmp = t_1;
} else if (a <= 1.1e-38) {
tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x - (a * (t - 1.0d0))) + (((y + t) - 2.0d0) * b)
if (a <= (-1.72d+27)) then
tmp = t_1
else if (a <= 1.1d-38) then
tmp = (x + (b * ((t + y) - 2.0d0))) - (z * (y - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
double tmp;
if (a <= -1.72e+27) {
tmp = t_1;
} else if (a <= 1.1e-38) {
tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b) tmp = 0 if a <= -1.72e+27: tmp = t_1 elif a <= 1.1e-38: tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (a <= -1.72e+27) tmp = t_1; elseif (a <= 1.1e-38) tmp = Float64(Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))) - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b); tmp = 0.0; if (a <= -1.72e+27) tmp = t_1; elseif (a <= 1.1e-38) tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.72e+27], t$95$1, If[LessEqual[a, 1.1e-38], N[(N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - a \cdot \left(t - 1\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;a \leq -1.72 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-38}:\\
\;\;\;\;\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.7199999999999999e27 or 1.10000000000000004e-38 < a Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
if -1.7199999999999999e27 < a < 1.10000000000000004e-38Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.0
Applied rewrites73.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- (+ x z) (* (- t 1.0) a)) (* b y))))
(if (<= a -1.85e-17)
t_1
(if (<= a 1.45e+91)
(- (+ x (* b (- (+ t y) 2.0))) (* z (- y 1.0)))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y);
double tmp;
if (a <= -1.85e-17) {
tmp = t_1;
} else if (a <= 1.45e+91) {
tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((x + z) - ((t - 1.0d0) * a)) + (b * y)
if (a <= (-1.85d-17)) then
tmp = t_1
else if (a <= 1.45d+91) then
tmp = (x + (b * ((t + y) - 2.0d0))) - (z * (y - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y);
double tmp;
if (a <= -1.85e-17) {
tmp = t_1;
} else if (a <= 1.45e+91) {
tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y) tmp = 0 if a <= -1.85e-17: tmp = t_1 elif a <= 1.45e+91: tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + z) - Float64(Float64(t - 1.0) * a)) + Float64(b * y)) tmp = 0.0 if (a <= -1.85e-17) tmp = t_1; elseif (a <= 1.45e+91) tmp = Float64(Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))) - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y); tmp = 0.0; if (a <= -1.85e-17) tmp = t_1; elseif (a <= 1.45e+91) tmp = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + z), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.85e-17], t$95$1, If[LessEqual[a, 1.45e+91], N[(N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z\right) - \left(t - 1\right) \cdot a\right) + b \cdot y\\
\mathbf{if}\;a \leq -1.85 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+91}:\\
\;\;\;\;\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.8499999999999999e-17 or 1.45000000000000007e91 < a Initial program 95.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
Taylor expanded in y around inf
lower-*.f6478.5
Applied rewrites78.5%
Taylor expanded in y around 0
lower-+.f6465.6
Applied rewrites65.6%
if -1.8499999999999999e-17 < a < 1.45000000000000007e91Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.0
Applied rewrites73.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.9e+40)
(+ (- x (* z (- y 1.0))) (* b y))
(if (<= y 3.5e+59)
(+ (- x (* a (- t 1.0))) (* (- t 2.0) b))
(if (<= y 2e+168) (+ (fma (- 1.0 t) a x) (* b y)) (* y (- b z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.9e+40) {
tmp = (x - (z * (y - 1.0))) + (b * y);
} else if (y <= 3.5e+59) {
tmp = (x - (a * (t - 1.0))) + ((t - 2.0) * b);
} else if (y <= 2e+168) {
tmp = fma((1.0 - t), a, x) + (b * y);
} else {
tmp = y * (b - z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.9e+40) tmp = Float64(Float64(x - Float64(z * Float64(y - 1.0))) + Float64(b * y)); elseif (y <= 3.5e+59) tmp = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(Float64(t - 2.0) * b)); elseif (y <= 2e+168) tmp = Float64(fma(Float64(1.0 - t), a, x) + Float64(b * y)); else tmp = Float64(y * Float64(b - z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.9e+40], N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+59], N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+168], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+40}:\\
\;\;\;\;\left(x - z \cdot \left(y - 1\right)\right) + b \cdot y\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+59}:\\
\;\;\;\;\left(x - a \cdot \left(t - 1\right)\right) + \left(t - 2\right) \cdot b\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\end{array}
\end{array}
if y < -2.90000000000000017e40Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
Taylor expanded in y around inf
lower-*.f6456.3
Applied rewrites56.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6453.7
Applied rewrites53.7%
if -2.90000000000000017e40 < y < 3.5e59Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
Taylor expanded in y around 0
Applied rewrites60.0%
if 3.5e59 < y < 1.9999999999999999e168Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
Taylor expanded in y around inf
lower-*.f6456.3
Applied rewrites56.3%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6456.3
Applied rewrites56.3%
if 1.9999999999999999e168 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- (+ x z) (* (- t 1.0) a)) (* b y))))
(if (<= a -1.7e-18)
t_1
(if (<= a 3.35e+90) (+ (- x (* z (- y 1.0))) (* (- t 2.0) b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y);
double tmp;
if (a <= -1.7e-18) {
tmp = t_1;
} else if (a <= 3.35e+90) {
tmp = (x - (z * (y - 1.0))) + ((t - 2.0) * 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 = ((x + z) - ((t - 1.0d0) * a)) + (b * y)
if (a <= (-1.7d-18)) then
tmp = t_1
else if (a <= 3.35d+90) then
tmp = (x - (z * (y - 1.0d0))) + ((t - 2.0d0) * 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 = ((x + z) - ((t - 1.0) * a)) + (b * y);
double tmp;
if (a <= -1.7e-18) {
tmp = t_1;
} else if (a <= 3.35e+90) {
tmp = (x - (z * (y - 1.0))) + ((t - 2.0) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y) tmp = 0 if a <= -1.7e-18: tmp = t_1 elif a <= 3.35e+90: tmp = (x - (z * (y - 1.0))) + ((t - 2.0) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + z) - Float64(Float64(t - 1.0) * a)) + Float64(b * y)) tmp = 0.0 if (a <= -1.7e-18) tmp = t_1; elseif (a <= 3.35e+90) tmp = Float64(Float64(x - Float64(z * Float64(y - 1.0))) + Float64(Float64(t - 2.0) * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + z) - ((t - 1.0) * a)) + (b * y); tmp = 0.0; if (a <= -1.7e-18) tmp = t_1; elseif (a <= 3.35e+90) tmp = (x - (z * (y - 1.0))) + ((t - 2.0) * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + z), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e-18], t$95$1, If[LessEqual[a, 3.35e+90], N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z\right) - \left(t - 1\right) \cdot a\right) + b \cdot y\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.35 \cdot 10^{+90}:\\
\;\;\;\;\left(x - z \cdot \left(y - 1\right)\right) + \left(t - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.70000000000000001e-18 or 3.3500000000000001e90 < a Initial program 95.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
Taylor expanded in y around inf
lower-*.f6478.5
Applied rewrites78.5%
Taylor expanded in y around 0
lower-+.f6465.6
Applied rewrites65.6%
if -1.70000000000000001e-18 < a < 3.3500000000000001e90Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6449.7
Applied rewrites49.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Taylor expanded in y around 0
Applied rewrites62.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma (- 1.0 t) a x) (* b y))))
(if (<= a -1.7e-18)
t_1
(if (<= a 3.35e+90) (+ (- x (* z (- y 1.0))) (* b t)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - t), a, x) + (b * y);
double tmp;
if (a <= -1.7e-18) {
tmp = t_1;
} else if (a <= 3.35e+90) {
tmp = (x - (z * (y - 1.0))) + (b * t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(1.0 - t), a, x) + Float64(b * y)) tmp = 0.0 if (a <= -1.7e-18) tmp = t_1; elseif (a <= 3.35e+90) tmp = Float64(Float64(x - Float64(z * Float64(y - 1.0))) + Float64(b * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e-18], t$95$1, If[LessEqual[a, 3.35e+90], N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - t, a, x\right) + b \cdot y\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.35 \cdot 10^{+90}:\\
\;\;\;\;\left(x - z \cdot \left(y - 1\right)\right) + b \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.70000000000000001e-18 or 3.3500000000000001e90 < a Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
Taylor expanded in y around inf
lower-*.f6456.3
Applied rewrites56.3%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6456.3
Applied rewrites56.3%
if -1.70000000000000001e-18 < a < 3.3500000000000001e90Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6449.7
Applied rewrites49.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
lower-*.f6456.7
Applied rewrites56.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -1.8e+108)
t_1
(if (<= t 3.4e+134) (+ (fma (- 1.0 t) a x) (* b y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -1.8e+108) {
tmp = t_1;
} else if (t <= 3.4e+134) {
tmp = fma((1.0 - t), a, x) + (b * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -1.8e+108) tmp = t_1; elseif (t <= 3.4e+134) tmp = Float64(fma(Float64(1.0 - t), a, x) + Float64(b * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e+108], t$95$1, If[LessEqual[t, 3.4e+134], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.8e108 or 3.40000000000000018e134 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -1.8e108 < t < 3.40000000000000018e134Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
Taylor expanded in y around inf
lower-*.f6456.3
Applied rewrites56.3%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6456.3
Applied rewrites56.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -1.85e+92)
t_1
(if (<= t 2.6e+54) (+ (- x (* a -1.0)) (* b y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -1.85e+92) {
tmp = t_1;
} else if (t <= 2.6e+54) {
tmp = (x - (a * -1.0)) + (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 = t * (b - a)
if (t <= (-1.85d+92)) then
tmp = t_1
else if (t <= 2.6d+54) then
tmp = (x - (a * (-1.0d0))) + (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 = t * (b - a);
double tmp;
if (t <= -1.85e+92) {
tmp = t_1;
} else if (t <= 2.6e+54) {
tmp = (x - (a * -1.0)) + (b * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -1.85e+92: tmp = t_1 elif t <= 2.6e+54: tmp = (x - (a * -1.0)) + (b * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -1.85e+92) tmp = t_1; elseif (t <= 2.6e+54) tmp = Float64(Float64(x - Float64(a * -1.0)) + Float64(b * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -1.85e+92) tmp = t_1; elseif (t <= 2.6e+54) tmp = (x - (a * -1.0)) + (b * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.85e+92], t$95$1, If[LessEqual[t, 2.6e+54], N[(N[(x - N[(a * -1.0), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+54}:\\
\;\;\;\;\left(x - a \cdot -1\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.84999999999999999e92 or 2.60000000000000007e54 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -1.84999999999999999e92 < t < 2.60000000000000007e54Initial program 95.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6473.2
Applied rewrites73.2%
Taylor expanded in y around inf
lower-*.f6456.3
Applied rewrites56.3%
Taylor expanded in t around 0
Applied rewrites40.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))) (t_2 (* t (- b a))))
(if (<= t -1e+91)
t_2
(if (<= t 3.35e-158)
t_1
(if (<= t 6.8e-56) a (if (<= t 9.7e+36) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double t_2 = t * (b - a);
double tmp;
if (t <= -1e+91) {
tmp = t_2;
} else if (t <= 3.35e-158) {
tmp = t_1;
} else if (t <= 6.8e-56) {
tmp = a;
} else if (t <= 9.7e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (b - z)
t_2 = t * (b - a)
if (t <= (-1d+91)) then
tmp = t_2
else if (t <= 3.35d-158) then
tmp = t_1
else if (t <= 6.8d-56) then
tmp = a
else if (t <= 9.7d+36) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double t_2 = t * (b - a);
double tmp;
if (t <= -1e+91) {
tmp = t_2;
} else if (t <= 3.35e-158) {
tmp = t_1;
} else if (t <= 6.8e-56) {
tmp = a;
} else if (t <= 9.7e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) t_2 = t * (b - a) tmp = 0 if t <= -1e+91: tmp = t_2 elif t <= 3.35e-158: tmp = t_1 elif t <= 6.8e-56: tmp = a elif t <= 9.7e+36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) t_2 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -1e+91) tmp = t_2; elseif (t <= 3.35e-158) tmp = t_1; elseif (t <= 6.8e-56) tmp = a; elseif (t <= 9.7e+36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); t_2 = t * (b - a); tmp = 0.0; if (t <= -1e+91) tmp = t_2; elseif (t <= 3.35e-158) tmp = t_1; elseif (t <= 6.8e-56) tmp = a; elseif (t <= 9.7e+36) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+91], t$95$2, If[LessEqual[t, 3.35e-158], t$95$1, If[LessEqual[t, 6.8e-56], a, If[LessEqual[t, 9.7e+36], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
t_2 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1 \cdot 10^{+91}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.35 \cdot 10^{-158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-56}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 9.7 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.00000000000000008e91 or 9.69999999999999966e36 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -1.00000000000000008e91 < t < 3.35e-158 or 6.79999999999999964e-56 < t < 9.69999999999999966e36Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
if 3.35e-158 < t < 6.79999999999999964e-56Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -1.9e-8) t_1 (if (<= t 240000.0) (- a (* a t)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -1.9e-8) {
tmp = t_1;
} else if (t <= 240000.0) {
tmp = a - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-1.9d-8)) then
tmp = t_1
else if (t <= 240000.0d0) then
tmp = a - (a * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -1.9e-8) {
tmp = t_1;
} else if (t <= 240000.0) {
tmp = a - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -1.9e-8: tmp = t_1 elif t <= 240000.0: tmp = a - (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -1.9e-8) tmp = t_1; elseif (t <= 240000.0) tmp = Float64(a - Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -1.9e-8) tmp = t_1; elseif (t <= 240000.0) tmp = a - (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e-8], t$95$1, If[LessEqual[t, 240000.0], N[(a - N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 240000:\\
\;\;\;\;a - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.90000000000000014e-8 or 2.4e5 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -1.90000000000000014e-8 < t < 2.4e5Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f6424.4
Applied rewrites24.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
add-flipN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
add-flipN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6428.6
Applied rewrites28.6%
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-neg.f64N/A
fp-cancel-sub-signN/A
lift-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.95e+92) (* y b) (if (<= b 8e+126) (- a (* a t)) (* y b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.95e+92) {
tmp = y * b;
} else if (b <= 8e+126) {
tmp = a - (a * t);
} 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 (b <= (-1.95d+92)) then
tmp = y * b
else if (b <= 8d+126) then
tmp = a - (a * t)
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 (b <= -1.95e+92) {
tmp = y * b;
} else if (b <= 8e+126) {
tmp = a - (a * t);
} else {
tmp = y * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.95e+92: tmp = y * b elif b <= 8e+126: tmp = a - (a * t) else: tmp = y * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.95e+92) tmp = Float64(y * b); elseif (b <= 8e+126) tmp = Float64(a - Float64(a * t)); else tmp = Float64(y * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.95e+92) tmp = y * b; elseif (b <= 8e+126) tmp = a - (a * t); else tmp = y * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.95e+92], N[(y * b), $MachinePrecision], If[LessEqual[b, 8e+126], N[(a - N[(a * t), $MachinePrecision]), $MachinePrecision], N[(y * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{+92}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+126}:\\
\;\;\;\;a - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot b\\
\end{array}
\end{array}
if b < -1.95000000000000006e92 or 7.9999999999999994e126 < b Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
Taylor expanded in z around 0
Applied rewrites17.1%
if -1.95000000000000006e92 < b < 7.9999999999999994e126Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f6424.4
Applied rewrites24.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
add-flipN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
add-flipN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6428.6
Applied rewrites28.6%
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-neg.f64N/A
fp-cancel-sub-signN/A
lift-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.7e+31) (* y b) (if (<= y 2.6e+59) a (* y b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.7e+31) {
tmp = y * b;
} else if (y <= 2.6e+59) {
tmp = a;
} 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 <= (-6.7d+31)) then
tmp = y * b
else if (y <= 2.6d+59) then
tmp = a
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 <= -6.7e+31) {
tmp = y * b;
} else if (y <= 2.6e+59) {
tmp = a;
} else {
tmp = y * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.7e+31: tmp = y * b elif y <= 2.6e+59: tmp = a else: tmp = y * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.7e+31) tmp = Float64(y * b); elseif (y <= 2.6e+59) tmp = a; else tmp = Float64(y * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.7e+31) tmp = y * b; elseif (y <= 2.6e+59) tmp = a; else tmp = y * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.7e+31], N[(y * b), $MachinePrecision], If[LessEqual[y, 2.6e+59], a, N[(y * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.7 \cdot 10^{+31}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+59}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;y \cdot b\\
\end{array}
\end{array}
if y < -6.70000000000000016e31 or 2.59999999999999999e59 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
Taylor expanded in z around 0
Applied rewrites17.1%
if -6.70000000000000016e31 < y < 2.59999999999999999e59Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6.2e+80) a (if (<= a 7e-49) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.2e+80) {
tmp = a;
} else if (a <= 7e-49) {
tmp = z;
} else {
tmp = 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 (a <= (-6.2d+80)) then
tmp = a
else if (a <= 7d-49) then
tmp = z
else
tmp = 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 (a <= -6.2e+80) {
tmp = a;
} else if (a <= 7e-49) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.2e+80: tmp = a elif a <= 7e-49: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.2e+80) tmp = a; elseif (a <= 7e-49) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.2e+80) tmp = a; elseif (a <= 7e-49) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.2e+80], a, If[LessEqual[a, 7e-49], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+80}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 7 \cdot 10^{-49}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -6.19999999999999976e80 or 7.00000000000000012e-49 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.2%
if -6.19999999999999976e80 < a < 7.00000000000000012e-49Initial program 95.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
mul-1-negN/A
lower-neg.f6495.5
Applied rewrites95.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.9
Applied rewrites28.9%
Taylor expanded in y around 0
Applied rewrites11.4%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.2%
herbie shell --seed 2025155
(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)))