
(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 18 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 (* t (- b a)))))
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 = t * (b - a);
}
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 = t * (b - a);
}
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 = t * (b - a) 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(t * Float64(b - a)); 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 = t * (b - a); 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[(t * N[(b - a), $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}:\\
\;\;\;\;t \cdot \left(b - a\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.1%
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.1%
Taylor expanded in t around inf
Applied rewrites33.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ x (* b (- (+ t y) 2.0))) (* z (- y 1.0)))))
(if (<= z -160000000000.0)
t_1
(if (<= z 7.5e+164)
(+ (- x (* a (- t 1.0))) (* (- (+ y t) 2.0) b))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
double tmp;
if (z <= -160000000000.0) {
tmp = t_1;
} else if (z <= 7.5e+164) {
tmp = (x - (a * (t - 1.0))) + (((y + 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 + (b * ((t + y) - 2.0d0))) - (z * (y - 1.0d0))
if (z <= (-160000000000.0d0)) then
tmp = t_1
else if (z <= 7.5d+164) then
tmp = (x - (a * (t - 1.0d0))) + (((y + 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 + (b * ((t + y) - 2.0))) - (z * (y - 1.0));
double tmp;
if (z <= -160000000000.0) {
tmp = t_1;
} else if (z <= 7.5e+164) {
tmp = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (b * ((t + y) - 2.0))) - (z * (y - 1.0)) tmp = 0 if z <= -160000000000.0: tmp = t_1 elif z <= 7.5e+164: tmp = (x - (a * (t - 1.0))) + (((y + t) - 2.0) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))) - Float64(z * Float64(y - 1.0))) tmp = 0.0 if (z <= -160000000000.0) tmp = t_1; elseif (z <= 7.5e+164) tmp = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(Float64(Float64(y + 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 + (b * ((t + y) - 2.0))) - (z * (y - 1.0)); tmp = 0.0; if (z <= -160000000000.0) tmp = t_1; elseif (z <= 7.5e+164) tmp = (x - (a * (t - 1.0))) + (((y + 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[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -160000000000.0], t$95$1, If[LessEqual[z, 7.5e+164], N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{if}\;z \leq -160000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+164}:\\
\;\;\;\;\left(x - a \cdot \left(t - 1\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e11 or 7.49999999999999976e164 < z Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
if -1.6e11 < z < 7.49999999999999976e164Initial program 95.1%
Taylor expanded in z around 0
Applied rewrites73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- x (* a (- t 1.0))) (* (- y 2.0) b))))
(if (<= a -1e+48)
t_1
(if (<= a 4.6e+72) (- (+ 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 - 2.0) * b);
double tmp;
if (a <= -1e+48) {
tmp = t_1;
} else if (a <= 4.6e+72) {
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 - 2.0d0) * b)
if (a <= (-1d+48)) then
tmp = t_1
else if (a <= 4.6d+72) 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 - 2.0) * b);
double tmp;
if (a <= -1e+48) {
tmp = t_1;
} else if (a <= 4.6e+72) {
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 - 2.0) * b) tmp = 0 if a <= -1e+48: tmp = t_1 elif a <= 4.6e+72: 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(y - 2.0) * b)) tmp = 0.0 if (a <= -1e+48) tmp = t_1; elseif (a <= 4.6e+72) 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 - 2.0) * b); tmp = 0.0; if (a <= -1e+48) tmp = t_1; elseif (a <= 4.6e+72) 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[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+48], t$95$1, If[LessEqual[a, 4.6e+72], 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(y - 2\right) \cdot b\\
\mathbf{if}\;a \leq -1 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{+72}:\\
\;\;\;\;\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.00000000000000004e48 or 4.6e72 < a Initial program 95.1%
Taylor expanded in z around 0
Applied rewrites73.2%
Taylor expanded in t around 0
Applied rewrites61.9%
if -1.00000000000000004e48 < a < 4.6e72Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- y 1.0))))
(if (<= z -1.28e+94)
(- (* b (- t 2.0)) t_1)
(if (<= z 8.8e+164)
(+ (- x (* a (- t 1.0))) (* (- y 2.0) b))
(- x (fma -1.0 a t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y - 1.0);
double tmp;
if (z <= -1.28e+94) {
tmp = (b * (t - 2.0)) - t_1;
} else if (z <= 8.8e+164) {
tmp = (x - (a * (t - 1.0))) + ((y - 2.0) * b);
} else {
tmp = x - fma(-1.0, a, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y - 1.0)) tmp = 0.0 if (z <= -1.28e+94) tmp = Float64(Float64(b * Float64(t - 2.0)) - t_1); elseif (z <= 8.8e+164) tmp = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(Float64(y - 2.0) * b)); else tmp = Float64(x - fma(-1.0, a, t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.28e+94], N[(N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 8.8e+164], N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(x - N[(-1.0 * a + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y - 1\right)\\
\mathbf{if}\;z \leq -1.28 \cdot 10^{+94}:\\
\;\;\;\;b \cdot \left(t - 2\right) - t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+164}:\\
\;\;\;\;\left(x - a \cdot \left(t - 1\right)\right) + \left(y - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, t\_1\right)\\
\end{array}
\end{array}
if z < -1.2800000000000001e94Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in y around 0
Applied rewrites49.3%
if -1.2800000000000001e94 < z < 8.80000000000000022e164Initial program 95.1%
Taylor expanded in z around 0
Applied rewrites73.2%
Taylor expanded in t around 0
Applied rewrites61.9%
if 8.80000000000000022e164 < z Initial program 95.1%
Taylor expanded in t around 0
Applied rewrites68.8%
Taylor expanded in y around inf
Applied rewrites50.5%
Taylor expanded in b around 0
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -4.4e+39)
t_1
(if (<= t 6.6e+97) (- (+ x (* b (- 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 = t * (b - a);
double tmp;
if (t <= -4.4e+39) {
tmp = t_1;
} else if (t <= 6.6e+97) {
tmp = (x + (b * (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 = t * (b - a)
if (t <= (-4.4d+39)) then
tmp = t_1
else if (t <= 6.6d+97) then
tmp = (x + (b * (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 = t * (b - a);
double tmp;
if (t <= -4.4e+39) {
tmp = t_1;
} else if (t <= 6.6e+97) {
tmp = (x + (b * (y - 2.0))) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -4.4e+39: tmp = t_1 elif t <= 6.6e+97: tmp = (x + (b * (y - 2.0))) - (z * (y - 1.0)) 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 <= -4.4e+39) tmp = t_1; elseif (t <= 6.6e+97) tmp = Float64(Float64(x + Float64(b * Float64(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 = t * (b - a); tmp = 0.0; if (t <= -4.4e+39) tmp = t_1; elseif (t <= 6.6e+97) tmp = (x + (b * (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[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e+39], t$95$1, If[LessEqual[t, 6.6e+97], N[(N[(x + N[(b * N[(y - 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 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+97}:\\
\;\;\;\;\left(x + b \cdot \left(y - 2\right)\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.4000000000000003e39 or 6.6000000000000003e97 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -4.4000000000000003e39 < t < 6.6000000000000003e97Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in t around 0
Applied rewrites59.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- y 1.0))))
(if (<= z -18.5)
(- (* b (- t 2.0)) t_1)
(if (<= z 8.8e+164)
(+ (- x (* a (- t 1.0))) (* b y))
(- x (fma -1.0 a t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y - 1.0);
double tmp;
if (z <= -18.5) {
tmp = (b * (t - 2.0)) - t_1;
} else if (z <= 8.8e+164) {
tmp = (x - (a * (t - 1.0))) + (b * y);
} else {
tmp = x - fma(-1.0, a, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y - 1.0)) tmp = 0.0 if (z <= -18.5) tmp = Float64(Float64(b * Float64(t - 2.0)) - t_1); elseif (z <= 8.8e+164) tmp = Float64(Float64(x - Float64(a * Float64(t - 1.0))) + Float64(b * y)); else tmp = Float64(x - fma(-1.0, a, t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -18.5], N[(N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 8.8e+164], N[(N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(-1.0 * a + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y - 1\right)\\
\mathbf{if}\;z \leq -18.5:\\
\;\;\;\;b \cdot \left(t - 2\right) - t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+164}:\\
\;\;\;\;\left(x - a \cdot \left(t - 1\right)\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, t\_1\right)\\
\end{array}
\end{array}
if z < -18.5Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in y around 0
Applied rewrites49.3%
if -18.5 < z < 8.80000000000000022e164Initial program 95.1%
Taylor expanded in z around 0
Applied rewrites73.2%
Taylor expanded in y around inf
Applied rewrites56.1%
if 8.80000000000000022e164 < z Initial program 95.1%
Taylor expanded in t around 0
Applied rewrites68.8%
Taylor expanded in y around inf
Applied rewrites50.5%
Taylor expanded in b around 0
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* b (- (+ t y) 2.0)) (* z -1.0))))
(if (<= b -6.5e+50)
t_1
(if (<= b 170000.0) (- x (fma -1.0 a (* z (- y 1.0)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * ((t + y) - 2.0)) - (z * -1.0);
double tmp;
if (b <= -6.5e+50) {
tmp = t_1;
} else if (b <= 170000.0) {
tmp = x - fma(-1.0, a, (z * (y - 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(Float64(t + y) - 2.0)) - Float64(z * -1.0)) tmp = 0.0 if (b <= -6.5e+50) tmp = t_1; elseif (b <= 170000.0) tmp = Float64(x - fma(-1.0, a, Float64(z * Float64(y - 1.0)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] - N[(z * -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.5e+50], t$95$1, If[LessEqual[b, 170000.0], N[(x - N[(-1.0 * a + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right) - z \cdot -1\\
\mathbf{if}\;b \leq -6.5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 170000:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.5000000000000003e50 or 1.7e5 < b Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in y around 0
Applied rewrites46.5%
if -6.5000000000000003e50 < b < 1.7e5Initial program 95.1%
Taylor expanded in t around 0
Applied rewrites68.8%
Taylor expanded in y around inf
Applied rewrites50.5%
Taylor expanded in b around 0
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -2.7e+70)
t_1
(if (<= t 6.6e+97) (- x (fma -1.0 a (* z (- y 1.0)))) 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 <= -2.7e+70) {
tmp = t_1;
} else if (t <= 6.6e+97) {
tmp = x - fma(-1.0, a, (z * (y - 1.0)));
} 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 <= -2.7e+70) tmp = t_1; elseif (t <= 6.6e+97) tmp = Float64(x - fma(-1.0, a, Float64(z * Float64(y - 1.0)))); 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, -2.7e+70], t$95$1, If[LessEqual[t, 6.6e+97], N[(x - N[(-1.0 * a + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+97}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.7e70 or 6.6000000000000003e97 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -2.7e70 < t < 6.6000000000000003e97Initial program 95.1%
Taylor expanded in t around 0
Applied rewrites68.8%
Taylor expanded in y around inf
Applied rewrites50.5%
Taylor expanded in b around 0
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -1.18e+30)
t_1
(if (<= t 3.2e-142)
(+ (- x (* -1.0 a)) (* b y))
(if (<= t 6.6e+97) (- x (* z (- y 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -1.18e+30) {
tmp = t_1;
} else if (t <= 3.2e-142) {
tmp = (x - (-1.0 * a)) + (b * y);
} else if (t <= 6.6e+97) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-1.18d+30)) then
tmp = t_1
else if (t <= 3.2d-142) then
tmp = (x - ((-1.0d0) * a)) + (b * y)
else if (t <= 6.6d+97) then
tmp = x - (z * (y - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -1.18e+30) {
tmp = t_1;
} else if (t <= 3.2e-142) {
tmp = (x - (-1.0 * a)) + (b * y);
} else if (t <= 6.6e+97) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -1.18e+30: tmp = t_1 elif t <= 3.2e-142: tmp = (x - (-1.0 * a)) + (b * y) elif t <= 6.6e+97: tmp = x - (z * (y - 1.0)) 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.18e+30) tmp = t_1; elseif (t <= 3.2e-142) tmp = Float64(Float64(x - Float64(-1.0 * a)) + Float64(b * y)); elseif (t <= 6.6e+97) tmp = Float64(x - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -1.18e+30) tmp = t_1; elseif (t <= 3.2e-142) tmp = (x - (-1.0 * a)) + (b * y); elseif (t <= 6.6e+97) tmp = x - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.18e+30], t$95$1, If[LessEqual[t, 3.2e-142], N[(N[(x - N[(-1.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+97], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.18 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-142}:\\
\;\;\;\;\left(x - -1 \cdot a\right) + b \cdot y\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+97}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.18e30 or 6.6000000000000003e97 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -1.18e30 < t < 3.1999999999999998e-142Initial program 95.1%
Taylor expanded in z around 0
Applied rewrites73.2%
Taylor expanded in y around inf
Applied rewrites56.1%
Taylor expanded in t around 0
Applied rewrites40.0%
if 3.1999999999999998e-142 < t < 6.6000000000000003e97Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in b around 0
Applied rewrites42.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* z (- y 1.0)))) (t_2 (* t (- b a))))
(if (<= t -2.7e+70)
t_2
(if (<= t 2.15e-280)
t_1
(if (<= t 2.9e-143)
(- (* b (- y 2.0)) (* y z))
(if (<= t 6.6e+97) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (z * (y - 1.0));
double t_2 = t * (b - a);
double tmp;
if (t <= -2.7e+70) {
tmp = t_2;
} else if (t <= 2.15e-280) {
tmp = t_1;
} else if (t <= 2.9e-143) {
tmp = (b * (y - 2.0)) - (y * z);
} else if (t <= 6.6e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (z * (y - 1.0d0))
t_2 = t * (b - a)
if (t <= (-2.7d+70)) then
tmp = t_2
else if (t <= 2.15d-280) then
tmp = t_1
else if (t <= 2.9d-143) then
tmp = (b * (y - 2.0d0)) - (y * z)
else if (t <= 6.6d+97) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (z * (y - 1.0));
double t_2 = t * (b - a);
double tmp;
if (t <= -2.7e+70) {
tmp = t_2;
} else if (t <= 2.15e-280) {
tmp = t_1;
} else if (t <= 2.9e-143) {
tmp = (b * (y - 2.0)) - (y * z);
} else if (t <= 6.6e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (z * (y - 1.0)) t_2 = t * (b - a) tmp = 0 if t <= -2.7e+70: tmp = t_2 elif t <= 2.15e-280: tmp = t_1 elif t <= 2.9e-143: tmp = (b * (y - 2.0)) - (y * z) elif t <= 6.6e+97: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(z * Float64(y - 1.0))) t_2 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -2.7e+70) tmp = t_2; elseif (t <= 2.15e-280) tmp = t_1; elseif (t <= 2.9e-143) tmp = Float64(Float64(b * Float64(y - 2.0)) - Float64(y * z)); elseif (t <= 6.6e+97) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (z * (y - 1.0)); t_2 = t * (b - a); tmp = 0.0; if (t <= -2.7e+70) tmp = t_2; elseif (t <= 2.15e-280) tmp = t_1; elseif (t <= 2.9e-143) tmp = (b * (y - 2.0)) - (y * z); elseif (t <= 6.6e+97) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+70], t$95$2, If[LessEqual[t, 2.15e-280], t$95$1, If[LessEqual[t, 2.9e-143], N[(N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+97], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot \left(y - 1\right)\\
t_2 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+70}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{-280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-143}:\\
\;\;\;\;b \cdot \left(y - 2\right) - y \cdot z\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.7e70 or 6.6000000000000003e97 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -2.7e70 < t < 2.1499999999999999e-280 or 2.9000000000000001e-143 < t < 6.6000000000000003e97Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in b around 0
Applied rewrites42.4%
if 2.1499999999999999e-280 < t < 2.9000000000000001e-143Initial program 95.1%
Taylor expanded in t around 0
Applied rewrites68.8%
Taylor expanded in y around inf
Applied rewrites50.5%
Taylor expanded in x around 0
Applied rewrites37.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -2.7e+70) t_1 (if (<= t 6.6e+97) (- x (* z (- y 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -2.7e+70) {
tmp = t_1;
} else if (t <= 6.6e+97) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-2.7d+70)) then
tmp = t_1
else if (t <= 6.6d+97) then
tmp = x - (z * (y - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -2.7e+70) {
tmp = t_1;
} else if (t <= 6.6e+97) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -2.7e+70: tmp = t_1 elif t <= 6.6e+97: tmp = x - (z * (y - 1.0)) 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 <= -2.7e+70) tmp = t_1; elseif (t <= 6.6e+97) tmp = Float64(x - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -2.7e+70) tmp = t_1; elseif (t <= 6.6e+97) tmp = x - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+70], t$95$1, If[LessEqual[t, 6.6e+97], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+97}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.7e70 or 6.6000000000000003e97 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -2.7e70 < t < 6.6000000000000003e97Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in b around 0
Applied rewrites42.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -4.4e+69) t_1 (if (<= t 3.15e+15) (* y (- b z)) 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 <= -4.4e+69) {
tmp = t_1;
} else if (t <= 3.15e+15) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-4.4d+69)) then
tmp = t_1
else if (t <= 3.15d+15) then
tmp = y * (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -4.4e+69) {
tmp = t_1;
} else if (t <= 3.15e+15) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -4.4e+69: tmp = t_1 elif t <= 3.15e+15: tmp = y * (b - z) 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 <= -4.4e+69) tmp = t_1; elseif (t <= 3.15e+15) tmp = Float64(y * Float64(b - z)); 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 <= -4.4e+69) tmp = t_1; elseif (t <= 3.15e+15) tmp = y * (b - z); 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, -4.4e+69], t$95$1, If[LessEqual[t, 3.15e+15], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.15 \cdot 10^{+15}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.4000000000000003e69 or 3.15e15 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -4.4000000000000003e69 < t < 3.15e15Initial program 95.1%
Taylor expanded in y around inf
Applied rewrites33.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -1.95e+26) t_1 (if (<= t 380000000000.0) (* y b) 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.95e+26) {
tmp = t_1;
} else if (t <= 380000000000.0) {
tmp = y * 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 = t * (b - a)
if (t <= (-1.95d+26)) then
tmp = t_1
else if (t <= 380000000000.0d0) then
tmp = y * 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 = t * (b - a);
double tmp;
if (t <= -1.95e+26) {
tmp = t_1;
} else if (t <= 380000000000.0) {
tmp = y * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -1.95e+26: tmp = t_1 elif t <= 380000000000.0: tmp = y * b 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.95e+26) tmp = t_1; elseif (t <= 380000000000.0) tmp = Float64(y * b); 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.95e+26) tmp = t_1; elseif (t <= 380000000000.0) tmp = y * b; 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.95e+26], t$95$1, If[LessEqual[t, 380000000000.0], N[(y * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 380000000000:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.95e26 or 3.8e11 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites33.5%
if -1.95e26 < t < 3.8e11Initial program 95.1%
Taylor expanded in y around inf
Applied rewrites33.4%
Taylor expanded in z around 0
Applied rewrites17.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.6e+64) (* b t) (if (<= b 1.55e+53) (* a (- 1.0 t)) (if (<= b 6.2e+183) (* y b) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.6e+64) {
tmp = b * t;
} else if (b <= 1.55e+53) {
tmp = a * (1.0 - t);
} else if (b <= 6.2e+183) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-4.6d+64)) then
tmp = b * t
else if (b <= 1.55d+53) then
tmp = a * (1.0d0 - t)
else if (b <= 6.2d+183) then
tmp = y * b
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.6e+64) {
tmp = b * t;
} else if (b <= 1.55e+53) {
tmp = a * (1.0 - t);
} else if (b <= 6.2e+183) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.6e+64: tmp = b * t elif b <= 1.55e+53: tmp = a * (1.0 - t) elif b <= 6.2e+183: tmp = y * b else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.6e+64) tmp = Float64(b * t); elseif (b <= 1.55e+53) tmp = Float64(a * Float64(1.0 - t)); elseif (b <= 6.2e+183) tmp = Float64(y * b); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.6e+64) tmp = b * t; elseif (b <= 1.55e+53) tmp = a * (1.0 - t); elseif (b <= 6.2e+183) tmp = y * b; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.6e+64], N[(b * t), $MachinePrecision], If[LessEqual[b, 1.55e+53], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+183], N[(y * b), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+64}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+53}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{+183}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -4.6e64 or 6.1999999999999997e183 < b Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in t around inf
Applied rewrites18.2%
if -4.6e64 < b < 1.5500000000000001e53Initial program 95.1%
Taylor expanded in a around inf
Applied rewrites28.3%
if 1.5500000000000001e53 < b < 6.1999999999999997e183Initial program 95.1%
Taylor expanded in y around inf
Applied rewrites33.4%
Taylor expanded in z around 0
Applied rewrites17.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.15e+24) (* b t) (if (<= t 6.2e+68) (* y b) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+24) {
tmp = b * t;
} else if (t <= 6.2e+68) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.15d+24)) then
tmp = b * t
else if (t <= 6.2d+68) then
tmp = y * b
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+24) {
tmp = b * t;
} else if (t <= 6.2e+68) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.15e+24: tmp = b * t elif t <= 6.2e+68: tmp = y * b else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.15e+24) tmp = Float64(b * t); elseif (t <= 6.2e+68) tmp = Float64(y * b); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.15e+24) tmp = b * t; elseif (t <= 6.2e+68) tmp = y * b; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.15e+24], N[(b * t), $MachinePrecision], If[LessEqual[t, 6.2e+68], N[(y * b), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+24}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+68}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -2.14999999999999994e24 or 6.1999999999999997e68 < t Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in t around inf
Applied rewrites18.2%
if -2.14999999999999994e24 < t < 6.1999999999999997e68Initial program 95.1%
Taylor expanded in y around inf
Applied rewrites33.4%
Taylor expanded in z around 0
Applied rewrites17.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.3e-8) (* b t) (if (<= t 3.4e-181) a (if (<= t 6.5e+34) z (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.3e-8) {
tmp = b * t;
} else if (t <= 3.4e-181) {
tmp = a;
} else if (t <= 6.5e+34) {
tmp = z;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-4.3d-8)) then
tmp = b * t
else if (t <= 3.4d-181) then
tmp = a
else if (t <= 6.5d+34) then
tmp = z
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.3e-8) {
tmp = b * t;
} else if (t <= 3.4e-181) {
tmp = a;
} else if (t <= 6.5e+34) {
tmp = z;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.3e-8: tmp = b * t elif t <= 3.4e-181: tmp = a elif t <= 6.5e+34: tmp = z else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.3e-8) tmp = Float64(b * t); elseif (t <= 3.4e-181) tmp = a; elseif (t <= 6.5e+34) tmp = z; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.3e-8) tmp = b * t; elseif (t <= 3.4e-181) tmp = a; elseif (t <= 6.5e+34) tmp = z; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.3e-8], N[(b * t), $MachinePrecision], If[LessEqual[t, 3.4e-181], a, If[LessEqual[t, 6.5e+34], z, N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-8}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-181}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+34}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -4.3000000000000001e-8 or 6.50000000000000017e34 < t Initial program 95.1%
Taylor expanded in a around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites59.9%
Taylor expanded in t around inf
Applied rewrites18.2%
if -4.3000000000000001e-8 < t < 3.4e-181Initial program 95.1%
Taylor expanded in a around inf
Applied rewrites28.3%
Taylor expanded in t around 0
Applied rewrites11.0%
if 3.4e-181 < t < 6.50000000000000017e34Initial program 95.1%
Taylor expanded in z around inf
Applied rewrites28.9%
Taylor expanded in y around 0
Applied rewrites11.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a 5.3e+126) z a))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 5.3e+126) {
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 <= 5.3d+126) 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 <= 5.3e+126) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 5.3e+126: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 5.3e+126) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 5.3e+126) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 5.3e+126], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.3 \cdot 10^{+126}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 5.30000000000000028e126Initial program 95.1%
Taylor expanded in z around inf
Applied rewrites28.9%
Taylor expanded in y around 0
Applied rewrites11.1%
if 5.30000000000000028e126 < a Initial program 95.1%
Taylor expanded in a around inf
Applied rewrites28.3%
Taylor expanded in t around 0
Applied rewrites11.0%
(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.1%
Taylor expanded in a around inf
Applied rewrites28.3%
Taylor expanded in t around 0
Applied rewrites11.0%
herbie shell --seed 2025160
(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)))