
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (- (+ (fma (- b a) t (* (- y 2.0) b)) x) (fma (- y 1.0) z (- a))))
double code(double x, double y, double z, double t, double a, double b) {
return (fma((b - a), t, ((y - 2.0) * b)) + x) - fma((y - 1.0), z, -a);
}
function code(x, y, z, t, a, b) return Float64(Float64(fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b)) + x) - fma(Float64(y - 1.0), z, Float64(-a))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) + x\right) - \mathsf{fma}\left(y - 1, z, -a\right)
\end{array}
Initial program 95.1%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)))
(if (<= z -6.5e-7)
t_1
(if (<= z -8.4e-265)
(* (- b a) t)
(if (<= z 2.3e-269)
x
(if (<= z 2.3e-250)
(* b y)
(if (<= z 2.8e+124) (* (- 1.0 t) a) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -6.5e-7) {
tmp = t_1;
} else if (z <= -8.4e-265) {
tmp = (b - a) * t;
} else if (z <= 2.3e-269) {
tmp = x;
} else if (z <= 2.3e-250) {
tmp = b * y;
} else if (z <= 2.8e+124) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - y) * z
if (z <= (-6.5d-7)) then
tmp = t_1
else if (z <= (-8.4d-265)) then
tmp = (b - a) * t
else if (z <= 2.3d-269) then
tmp = x
else if (z <= 2.3d-250) then
tmp = b * y
else if (z <= 2.8d+124) then
tmp = (1.0d0 - t) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -6.5e-7) {
tmp = t_1;
} else if (z <= -8.4e-265) {
tmp = (b - a) * t;
} else if (z <= 2.3e-269) {
tmp = x;
} else if (z <= 2.3e-250) {
tmp = b * y;
} else if (z <= 2.8e+124) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z tmp = 0 if z <= -6.5e-7: tmp = t_1 elif z <= -8.4e-265: tmp = (b - a) * t elif z <= 2.3e-269: tmp = x elif z <= 2.3e-250: tmp = b * y elif z <= 2.8e+124: tmp = (1.0 - t) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if (z <= -6.5e-7) tmp = t_1; elseif (z <= -8.4e-265) tmp = Float64(Float64(b - a) * t); elseif (z <= 2.3e-269) tmp = x; elseif (z <= 2.3e-250) tmp = Float64(b * y); elseif (z <= 2.8e+124) tmp = Float64(Float64(1.0 - t) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; tmp = 0.0; if (z <= -6.5e-7) tmp = t_1; elseif (z <= -8.4e-265) tmp = (b - a) * t; elseif (z <= 2.3e-269) tmp = x; elseif (z <= 2.3e-250) tmp = b * y; elseif (z <= 2.8e+124) tmp = (1.0 - t) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -6.5e-7], t$95$1, If[LessEqual[z, -8.4e-265], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 2.3e-269], x, If[LessEqual[z, 2.3e-250], N[(b * y), $MachinePrecision], If[LessEqual[z, 2.8e+124], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.4 \cdot 10^{-265}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-269}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-250}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+124}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.50000000000000024e-7 or 2.8e124 < z Initial program 92.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6455.2
Applied rewrites55.2%
if -6.50000000000000024e-7 < z < -8.40000000000000015e-265Initial program 98.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6438.0
Applied rewrites38.0%
if -8.40000000000000015e-265 < z < 2.3e-269Initial program 96.7%
Taylor expanded in x around inf
Applied rewrites22.1%
if 2.3e-269 < z < 2.2999999999999999e-250Initial program 99.2%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6444.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6444.5
Applied rewrites44.5%
Taylor expanded in y around inf
+-commutativeN/A
lower-*.f6419.0
Applied rewrites19.0%
if 2.2999999999999999e-250 < z < 2.8e124Initial program 96.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.3
Applied rewrites32.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* z y))) (t_2 (* (- (+ t y) 2.0) b)))
(if (<= b -1.26e+42)
t_2
(if (<= b -1.15e-287)
t_1
(if (<= b 4e-236) (- x (* a (- t 1.0))) (if (<= b 1.5e+45) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (z * y);
double t_2 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.26e+42) {
tmp = t_2;
} else if (b <= -1.15e-287) {
tmp = t_1;
} else if (b <= 4e-236) {
tmp = x - (a * (t - 1.0));
} else if (b <= 1.5e+45) {
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)
t_2 = ((t + y) - 2.0d0) * b
if (b <= (-1.26d+42)) then
tmp = t_2
else if (b <= (-1.15d-287)) then
tmp = t_1
else if (b <= 4d-236) then
tmp = x - (a * (t - 1.0d0))
else if (b <= 1.5d+45) 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);
double t_2 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.26e+42) {
tmp = t_2;
} else if (b <= -1.15e-287) {
tmp = t_1;
} else if (b <= 4e-236) {
tmp = x - (a * (t - 1.0));
} else if (b <= 1.5e+45) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (z * y) t_2 = ((t + y) - 2.0) * b tmp = 0 if b <= -1.26e+42: tmp = t_2 elif b <= -1.15e-287: tmp = t_1 elif b <= 4e-236: tmp = x - (a * (t - 1.0)) elif b <= 1.5e+45: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(z * y)) t_2 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.26e+42) tmp = t_2; elseif (b <= -1.15e-287) tmp = t_1; elseif (b <= 4e-236) tmp = Float64(x - Float64(a * Float64(t - 1.0))); elseif (b <= 1.5e+45) 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); t_2 = ((t + y) - 2.0) * b; tmp = 0.0; if (b <= -1.26e+42) tmp = t_2; elseif (b <= -1.15e-287) tmp = t_1; elseif (b <= 4e-236) tmp = x - (a * (t - 1.0)); elseif (b <= 1.5e+45) 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 * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.26e+42], t$95$2, If[LessEqual[b, -1.15e-287], t$95$1, If[LessEqual[b, 4e-236], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e+45], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot y\\
t_2 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.26 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -1.15 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-236}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.26e42 or 1.50000000000000005e45 < b Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6470.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6470.8
Applied rewrites70.8%
if -1.26e42 < b < -1.14999999999999993e-287 or 4.0000000000000002e-236 < b < 1.50000000000000005e45Initial program 98.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6488.2
Applied rewrites88.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6443.9
Applied rewrites43.9%
if -1.14999999999999993e-287 < b < 4.0000000000000002e-236Initial program 99.5%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6462.8
Applied rewrites62.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -6.4e+44)
(+ (* (- 1.0 t) a) t_1)
(if (<= b 4.4e+121)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(+ (* (- 1.0 y) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -6.4e+44) {
tmp = ((1.0 - t) * a) + t_1;
} else if (b <= 4.4e+121) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = ((1.0 - y) * z) + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -6.4e+44) tmp = Float64(Float64(Float64(1.0 - t) * a) + t_1); elseif (b <= 4.4e+121) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(Float64(Float64(1.0 - y) * z) + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.4e+44], N[(N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[b, 4.4e+121], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(1 - t\right) \cdot a + t\_1\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{+121}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - y\right) \cdot z + t\_1\\
\end{array}
\end{array}
if b < -6.40000000000000009e44Initial program 89.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.6
Applied rewrites77.6%
if -6.40000000000000009e44 < b < 4.40000000000000003e121Initial program 98.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6486.2
Applied rewrites86.2%
if 4.40000000000000003e121 < b Initial program 89.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6482.4
Applied rewrites82.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- 1.0 t) a) (* (- (+ y t) 2.0) b))))
(if (<= b -6.4e+44)
t_1
(if (<= b 2.8e+45) (- x (fma (- t 1.0) a (* (- y 1.0) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((1.0 - t) * a) + (((y + t) - 2.0) * b);
double tmp;
if (b <= -6.4e+44) {
tmp = t_1;
} else if (b <= 2.8e+45) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(1.0 - t) * a) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -6.4e+44) tmp = t_1; elseif (b <= 2.8e+45) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.4e+44], t$95$1, If[LessEqual[b, 2.8e+45], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -6.4 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+45}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.40000000000000009e44 or 2.7999999999999999e45 < b Initial program 90.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.1
Applied rewrites77.1%
if -6.40000000000000009e44 < b < 2.7999999999999999e45Initial program 98.9%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6489.6
Applied rewrites89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (* (- (+ y t) 2.0) b))))
(if (<= b -8.5e+45)
t_1
(if (<= b 1.42e+124) (- x (fma (- t 1.0) a (* (- y 1.0) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (((y + t) - 2.0) * b);
double tmp;
if (b <= -8.5e+45) {
tmp = t_1;
} else if (b <= 1.42e+124) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -8.5e+45) tmp = t_1; elseif (b <= 1.42e+124) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8.5e+45], t$95$1, If[LessEqual[b, 1.42e+124], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -8.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.42 \cdot 10^{+124}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.4999999999999996e45 or 1.42e124 < b Initial program 89.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.2
Applied rewrites79.2%
Taylor expanded in t around 0
Applied rewrites78.8%
if -8.4999999999999996e45 < b < 1.42e124Initial program 98.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6486.1
Applied rewrites86.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y) z)))
(if (<= b -3.5e+44)
(* b y)
(if (<= b -4e-274)
t_1
(if (<= b 3.5e-236) x (if (<= b 1.6e+95) t_1 (* b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -y * z;
double tmp;
if (b <= -3.5e+44) {
tmp = b * y;
} else if (b <= -4e-274) {
tmp = t_1;
} else if (b <= 3.5e-236) {
tmp = x;
} else if (b <= 1.6e+95) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = -y * z
if (b <= (-3.5d+44)) then
tmp = b * y
else if (b <= (-4d-274)) then
tmp = t_1
else if (b <= 3.5d-236) then
tmp = x
else if (b <= 1.6d+95) then
tmp = t_1
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 t_1 = -y * z;
double tmp;
if (b <= -3.5e+44) {
tmp = b * y;
} else if (b <= -4e-274) {
tmp = t_1;
} else if (b <= 3.5e-236) {
tmp = x;
} else if (b <= 1.6e+95) {
tmp = t_1;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -y * z tmp = 0 if b <= -3.5e+44: tmp = b * y elif b <= -4e-274: tmp = t_1 elif b <= 3.5e-236: tmp = x elif b <= 1.6e+95: tmp = t_1 else: tmp = b * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-y) * z) tmp = 0.0 if (b <= -3.5e+44) tmp = Float64(b * y); elseif (b <= -4e-274) tmp = t_1; elseif (b <= 3.5e-236) tmp = x; elseif (b <= 1.6e+95) tmp = t_1; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -y * z; tmp = 0.0; if (b <= -3.5e+44) tmp = b * y; elseif (b <= -4e-274) tmp = t_1; elseif (b <= 3.5e-236) tmp = x; elseif (b <= 1.6e+95) tmp = t_1; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-y) * z), $MachinePrecision]}, If[LessEqual[b, -3.5e+44], N[(b * y), $MachinePrecision], If[LessEqual[b, -4e-274], t$95$1, If[LessEqual[b, 3.5e-236], x, If[LessEqual[b, 1.6e+95], t$95$1, N[(b * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) \cdot z\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+44}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;b \leq -4 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-236}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -3.4999999999999999e44Initial program 89.7%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in y around inf
+-commutativeN/A
lower-*.f6433.4
Applied rewrites33.4%
if -3.4999999999999999e44 < b < -3.99999999999999986e-274 or 3.49999999999999994e-236 < b < 1.6e95Initial program 98.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6435.1
Applied rewrites35.1%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6424.0
Applied rewrites24.0%
if -3.99999999999999986e-274 < b < 3.49999999999999994e-236Initial program 99.5%
Taylor expanded in x around inf
Applied rewrites23.3%
if 1.6e95 < b Initial program 90.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6438.6
Applied rewrites38.6%
Taylor expanded in a around 0
Applied rewrites34.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3.8e-5)
t_1
(if (<= y -3.8e-263)
(* (- 1.0 t) a)
(if (<= y 1.18e+17) (* (- t 2.0) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3.8e-5) {
tmp = t_1;
} else if (y <= -3.8e-263) {
tmp = (1.0 - t) * a;
} else if (y <= 1.18e+17) {
tmp = (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 = (b - z) * y
if (y <= (-3.8d-5)) then
tmp = t_1
else if (y <= (-3.8d-263)) then
tmp = (1.0d0 - t) * a
else if (y <= 1.18d+17) then
tmp = (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 = (b - z) * y;
double tmp;
if (y <= -3.8e-5) {
tmp = t_1;
} else if (y <= -3.8e-263) {
tmp = (1.0 - t) * a;
} else if (y <= 1.18e+17) {
tmp = (t - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -3.8e-5: tmp = t_1 elif y <= -3.8e-263: tmp = (1.0 - t) * a elif y <= 1.18e+17: tmp = (t - 2.0) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3.8e-5) tmp = t_1; elseif (y <= -3.8e-263) tmp = Float64(Float64(1.0 - t) * a); elseif (y <= 1.18e+17) tmp = 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 = (b - z) * y; tmp = 0.0; if (y <= -3.8e-5) tmp = t_1; elseif (y <= -3.8e-263) tmp = (1.0 - t) * a; elseif (y <= 1.18e+17) tmp = (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[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.8e-5], t$95$1, If[LessEqual[y, -3.8e-263], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 1.18e+17], N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-263}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{+17}:\\
\;\;\;\;\left(t - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.8000000000000002e-5 or 1.18e17 < y Initial program 92.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6464.2
Applied rewrites64.2%
if -3.8000000000000002e-5 < y < -3.80000000000000005e-263Initial program 97.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.0
Applied rewrites34.0%
if -3.80000000000000005e-263 < y < 1.18e17Initial program 97.8%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6433.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6433.9
Applied rewrites33.9%
Taylor expanded in y around 0
Applied rewrites33.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3.8e-5)
t_1
(if (<= y -2.45e-269)
(* (- 1.0 t) a)
(if (<= y 8.8e+17) (* (- b a) t) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3.8e-5) {
tmp = t_1;
} else if (y <= -2.45e-269) {
tmp = (1.0 - t) * a;
} else if (y <= 8.8e+17) {
tmp = (b - 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 = (b - z) * y
if (y <= (-3.8d-5)) then
tmp = t_1
else if (y <= (-2.45d-269)) then
tmp = (1.0d0 - t) * a
else if (y <= 8.8d+17) then
tmp = (b - 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 = (b - z) * y;
double tmp;
if (y <= -3.8e-5) {
tmp = t_1;
} else if (y <= -2.45e-269) {
tmp = (1.0 - t) * a;
} else if (y <= 8.8e+17) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -3.8e-5: tmp = t_1 elif y <= -2.45e-269: tmp = (1.0 - t) * a elif y <= 8.8e+17: tmp = (b - a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3.8e-5) tmp = t_1; elseif (y <= -2.45e-269) tmp = Float64(Float64(1.0 - t) * a); elseif (y <= 8.8e+17) tmp = Float64(Float64(b - a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -3.8e-5) tmp = t_1; elseif (y <= -2.45e-269) tmp = (1.0 - t) * a; elseif (y <= 8.8e+17) tmp = (b - a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.8e-5], t$95$1, If[LessEqual[y, -2.45e-269], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 8.8e+17], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.45 \cdot 10^{-269}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+17}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.8000000000000002e-5 or 8.8e17 < y Initial program 92.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6464.3
Applied rewrites64.3%
if -3.8000000000000002e-5 < y < -2.45e-269Initial program 97.8%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.1
Applied rewrites34.1%
if -2.45e-269 < y < 8.8e17Initial program 97.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (* (- (+ y t) 2.0) b))))
(if (<= b -3.3e+44)
t_1
(if (<= b 2.1e+45) (- x (fma (- y 1.0) z (- a))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (((y + t) - 2.0) * b);
double tmp;
if (b <= -3.3e+44) {
tmp = t_1;
} else if (b <= 2.1e+45) {
tmp = x - fma((y - 1.0), z, -a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -3.3e+44) tmp = t_1; elseif (b <= 2.1e+45) tmp = Float64(x - fma(Float64(y - 1.0), z, Float64(-a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.3e+44], t$95$1, If[LessEqual[b, 2.1e+45], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -3.3 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+45}:\\
\;\;\;\;x - \mathsf{fma}\left(y - 1, z, -a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.30000000000000013e44 or 2.09999999999999995e45 < b Initial program 90.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Taylor expanded in t around 0
Applied rewrites75.4%
if -3.30000000000000013e44 < b < 2.09999999999999995e45Initial program 99.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6499.1
Applied rewrites99.1%
Taylor expanded in x around inf
Applied rewrites68.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.04e+49) (+ x (* (- (+ y t) 2.0) b)) (if (<= b 9.5e+67) (- x (fma (- y 1.0) z (- a))) (* (- (+ t y) 2.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.04e+49) {
tmp = x + (((y + t) - 2.0) * b);
} else if (b <= 9.5e+67) {
tmp = x - fma((y - 1.0), z, -a);
} else {
tmp = ((t + y) - 2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.04e+49) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); elseif (b <= 9.5e+67) tmp = Float64(x - fma(Float64(y - 1.0), z, Float64(-a))); else tmp = Float64(Float64(Float64(t + y) - 2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.04e+49], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e+67], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.04 \cdot 10^{+49}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+67}:\\
\;\;\;\;x - \mathsf{fma}\left(y - 1, z, -a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -1.03999999999999998e49Initial program 89.7%
Taylor expanded in x around inf
Applied rewrites78.0%
if -1.03999999999999998e49 < b < 9.5000000000000002e67Initial program 98.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6498.8
Applied rewrites98.8%
Taylor expanded in x around inf
Applied rewrites67.4%
if 9.5000000000000002e67 < b Initial program 90.5%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6473.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6473.2
Applied rewrites73.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.96e+49) (fma (- t 2.0) b (* b y)) (if (<= b 9.5e+67) (- x (fma (- y 1.0) z (- a))) (* (- (+ t y) 2.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.96e+49) {
tmp = fma((t - 2.0), b, (b * y));
} else if (b <= 9.5e+67) {
tmp = x - fma((y - 1.0), z, -a);
} else {
tmp = ((t + y) - 2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.96e+49) tmp = fma(Float64(t - 2.0), b, Float64(b * y)); elseif (b <= 9.5e+67) tmp = Float64(x - fma(Float64(y - 1.0), z, Float64(-a))); else tmp = Float64(Float64(Float64(t + y) - 2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.96e+49], N[(N[(t - 2.0), $MachinePrecision] * b + N[(b * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e+67], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.96 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, b \cdot y\right)\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+67}:\\
\;\;\;\;x - \mathsf{fma}\left(y - 1, z, -a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -1.96000000000000012e49Initial program 89.7%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6472.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6472.0
Applied rewrites72.0%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
distribute-lft-outN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6470.3
Applied rewrites70.3%
if -1.96000000000000012e49 < b < 9.5000000000000002e67Initial program 98.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6498.8
Applied rewrites98.8%
Taylor expanded in x around inf
Applied rewrites67.4%
if 9.5000000000000002e67 < b Initial program 90.5%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6473.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6473.2
Applied rewrites73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.96e+49)
t_1
(if (<= b 9.5e+67) (- x (fma (- y 1.0) z (- a))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.96e+49) {
tmp = t_1;
} else if (b <= 9.5e+67) {
tmp = x - fma((y - 1.0), z, -a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.96e+49) tmp = t_1; elseif (b <= 9.5e+67) tmp = Float64(x - fma(Float64(y - 1.0), z, Float64(-a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.96e+49], t$95$1, If[LessEqual[b, 9.5e+67], N[(x - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.96 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+67}:\\
\;\;\;\;x - \mathsf{fma}\left(y - 1, z, -a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.96000000000000012e49 or 9.5000000000000002e67 < b Initial program 90.1%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6472.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6472.6
Applied rewrites72.6%
if -1.96000000000000012e49 < b < 9.5000000000000002e67Initial program 98.5%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6498.8
Applied rewrites98.8%
Taylor expanded in x around inf
Applied rewrites67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -8.4e+34)
t_1
(if (<= y 14500000.0) (- x (fma (- t 1.0) a (- z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -8.4e+34) {
tmp = t_1;
} else if (y <= 14500000.0) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -8.4e+34) tmp = t_1; elseif (y <= 14500000.0) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -8.4e+34], t$95$1, If[LessEqual[y, 14500000.0], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -8.4 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 14500000:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.4000000000000007e34 or 1.45e7 < y Initial program 92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.3
Applied rewrites66.3%
if -8.4000000000000007e34 < y < 1.45e7Initial program 97.8%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6469.8
Applied rewrites69.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6468.6
Applied rewrites68.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y) z)))
(if (<= y -8.8e+29)
t_1
(if (<= y 5600000.0) (* (- 1.0 t) a) (if (<= y 9.8e+274) t_1 (* b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -y * z;
double tmp;
if (y <= -8.8e+29) {
tmp = t_1;
} else if (y <= 5600000.0) {
tmp = (1.0 - t) * a;
} else if (y <= 9.8e+274) {
tmp = t_1;
} else {
tmp = b * y;
}
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 = -y * z
if (y <= (-8.8d+29)) then
tmp = t_1
else if (y <= 5600000.0d0) then
tmp = (1.0d0 - t) * a
else if (y <= 9.8d+274) then
tmp = t_1
else
tmp = b * y
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 * z;
double tmp;
if (y <= -8.8e+29) {
tmp = t_1;
} else if (y <= 5600000.0) {
tmp = (1.0 - t) * a;
} else if (y <= 9.8e+274) {
tmp = t_1;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -y * z tmp = 0 if y <= -8.8e+29: tmp = t_1 elif y <= 5600000.0: tmp = (1.0 - t) * a elif y <= 9.8e+274: tmp = t_1 else: tmp = b * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-y) * z) tmp = 0.0 if (y <= -8.8e+29) tmp = t_1; elseif (y <= 5600000.0) tmp = Float64(Float64(1.0 - t) * a); elseif (y <= 9.8e+274) tmp = t_1; else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -y * z; tmp = 0.0; if (y <= -8.8e+29) tmp = t_1; elseif (y <= 5600000.0) tmp = (1.0 - t) * a; elseif (y <= 9.8e+274) tmp = t_1; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-y) * z), $MachinePrecision]}, If[LessEqual[y, -8.8e+29], t$95$1, If[LessEqual[y, 5600000.0], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 9.8e+274], t$95$1, N[(b * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) \cdot z\\
\mathbf{if}\;y \leq -8.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5600000:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+274}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -8.8000000000000005e29 or 5.6e6 < y < 9.8000000000000005e274Initial program 92.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6437.8
Applied rewrites37.8%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6437.7
Applied rewrites37.7%
if -8.8000000000000005e29 < y < 5.6e6Initial program 97.8%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.3
Applied rewrites33.3%
if 9.8000000000000005e274 < y Initial program 80.9%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6446.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6446.0
Applied rewrites46.0%
Taylor expanded in y around inf
+-commutativeN/A
lower-*.f6444.6
Applied rewrites44.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.15e+44) (* b y) (if (<= b -7.5e-133) z (if (<= b 2.4e+63) x (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+44) {
tmp = b * y;
} else if (b <= -7.5e-133) {
tmp = z;
} else if (b <= 2.4e+63) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.15d+44)) then
tmp = b * y
else if (b <= (-7.5d-133)) then
tmp = z
else if (b <= 2.4d+63) then
tmp = x
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+44) {
tmp = b * y;
} else if (b <= -7.5e-133) {
tmp = z;
} else if (b <= 2.4e+63) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.15e+44: tmp = b * y elif b <= -7.5e-133: tmp = z elif b <= 2.4e+63: tmp = x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+44) tmp = Float64(b * y); elseif (b <= -7.5e-133) tmp = z; elseif (b <= 2.4e+63) tmp = x; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.15e+44) tmp = b * y; elseif (b <= -7.5e-133) tmp = z; elseif (b <= 2.4e+63) tmp = x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+44], N[(b * y), $MachinePrecision], If[LessEqual[b, -7.5e-133], z, If[LessEqual[b, 2.4e+63], x, N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+44}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;b \leq -7.5 \cdot 10^{-133}:\\
\;\;\;\;z\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -1.15000000000000002e44Initial program 89.7%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6471.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in y around inf
+-commutativeN/A
lower-*.f6433.4
Applied rewrites33.4%
if -1.15000000000000002e44 < b < -7.4999999999999999e-133Initial program 98.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.4
Applied rewrites34.4%
Taylor expanded in y around 0
Applied rewrites12.6%
if -7.4999999999999999e-133 < b < 2.4e63Initial program 98.7%
Taylor expanded in x around inf
Applied rewrites22.0%
if 2.4e63 < b Initial program 90.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6438.8
Applied rewrites38.8%
Taylor expanded in a around 0
Applied rewrites33.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.15e+44) (* b y) (if (<= b -7.5e-133) z (if (<= b 5.9e-89) x (* b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+44) {
tmp = b * y;
} else if (b <= -7.5e-133) {
tmp = z;
} else if (b <= 5.9e-89) {
tmp = x;
} else {
tmp = b * y;
}
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.15d+44)) then
tmp = b * y
else if (b <= (-7.5d-133)) then
tmp = z
else if (b <= 5.9d-89) then
tmp = x
else
tmp = b * y
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.15e+44) {
tmp = b * y;
} else if (b <= -7.5e-133) {
tmp = z;
} else if (b <= 5.9e-89) {
tmp = x;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.15e+44: tmp = b * y elif b <= -7.5e-133: tmp = z elif b <= 5.9e-89: tmp = x else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+44) tmp = Float64(b * y); elseif (b <= -7.5e-133) tmp = z; elseif (b <= 5.9e-89) tmp = x; else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.15e+44) tmp = b * y; elseif (b <= -7.5e-133) tmp = z; elseif (b <= 5.9e-89) tmp = x; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+44], N[(b * y), $MachinePrecision], If[LessEqual[b, -7.5e-133], z, If[LessEqual[b, 5.9e-89], x, N[(b * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+44}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;b \leq -7.5 \cdot 10^{-133}:\\
\;\;\;\;z\\
\mathbf{elif}\;b \leq 5.9 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if b < -1.15000000000000002e44 or 5.90000000000000021e-89 < b Initial program 91.7%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6461.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6461.2
Applied rewrites61.2%
Taylor expanded in y around inf
+-commutativeN/A
lower-*.f6428.5
Applied rewrites28.5%
if -1.15000000000000002e44 < b < -7.4999999999999999e-133Initial program 98.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6434.4
Applied rewrites34.4%
Taylor expanded in y around 0
Applied rewrites12.6%
if -7.4999999999999999e-133 < b < 5.90000000000000021e-89Initial program 99.2%
Taylor expanded in x around inf
Applied rewrites22.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- (+ t y) 2.0) b))) (if (<= b -1.45e+44) t_1 (if (<= b 2.1e+45) (- 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 + y) - 2.0) * b;
double tmp;
if (b <= -1.45e+44) {
tmp = t_1;
} else if (b <= 2.1e+45) {
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 + y) - 2.0d0) * b
if (b <= (-1.45d+44)) then
tmp = t_1
else if (b <= 2.1d+45) 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 + y) - 2.0) * b;
double tmp;
if (b <= -1.45e+44) {
tmp = t_1;
} else if (b <= 2.1e+45) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t + y) - 2.0) * b tmp = 0 if b <= -1.45e+44: tmp = t_1 elif b <= 2.1e+45: tmp = x - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.45e+44) tmp = t_1; elseif (b <= 2.1e+45) 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 + y) - 2.0) * b; tmp = 0.0; if (b <= -1.45e+44) tmp = t_1; elseif (b <= 2.1e+45) tmp = x - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.45e+44], t$95$1, If[LessEqual[b, 2.1e+45], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+45}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.4500000000000001e44 or 2.09999999999999995e45 < b Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6470.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6470.9
Applied rewrites70.9%
if -1.4500000000000001e44 < b < 2.09999999999999995e45Initial program 99.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6489.6
Applied rewrites89.6%
Taylor expanded in z around inf
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- (+ t y) 2.0) b))) (if (<= b -1.26e+42) t_1 (if (<= b 1.5e+45) (- x (* z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.26e+42) {
tmp = t_1;
} else if (b <= 1.5e+45) {
tmp = x - (z * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((t + y) - 2.0d0) * b
if (b <= (-1.26d+42)) then
tmp = t_1
else if (b <= 1.5d+45) then
tmp = x - (z * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.26e+42) {
tmp = t_1;
} else if (b <= 1.5e+45) {
tmp = x - (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t + y) - 2.0) * b tmp = 0 if b <= -1.26e+42: tmp = t_1 elif b <= 1.5e+45: tmp = x - (z * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.26e+42) tmp = t_1; elseif (b <= 1.5e+45) tmp = Float64(x - Float64(z * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t + y) - 2.0) * b; tmp = 0.0; if (b <= -1.26e+42) tmp = t_1; elseif (b <= 1.5e+45) tmp = x - (z * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.26e+42], t$95$1, If[LessEqual[b, 1.5e+45], N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.26 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+45}:\\
\;\;\;\;x - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.26e42 or 1.50000000000000005e45 < b Initial program 90.0%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6470.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6470.8
Applied rewrites70.8%
if -1.26e42 < b < 1.50000000000000005e45Initial program 99.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6489.7
Applied rewrites89.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6444.8
Applied rewrites44.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 y) z))) (if (<= z -8.6e-14) t_1 (if (<= z 2.8e+124) (* (- 1.0 t) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -8.6e-14) {
tmp = t_1;
} else if (z <= 2.8e+124) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - y) * z
if (z <= (-8.6d-14)) then
tmp = t_1
else if (z <= 2.8d+124) then
tmp = (1.0d0 - t) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -8.6e-14) {
tmp = t_1;
} else if (z <= 2.8e+124) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z tmp = 0 if z <= -8.6e-14: tmp = t_1 elif z <= 2.8e+124: tmp = (1.0 - t) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if (z <= -8.6e-14) tmp = t_1; elseif (z <= 2.8e+124) tmp = Float64(Float64(1.0 - t) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; tmp = 0.0; if (z <= -8.6e-14) tmp = t_1; elseif (z <= 2.8e+124) tmp = (1.0 - t) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -8.6e-14], t$95$1, If[LessEqual[z, 2.8e+124], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+124}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.59999999999999996e-14 or 2.8e124 < z Initial program 92.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.7
Applied rewrites54.7%
if -8.59999999999999996e-14 < z < 2.8e124Initial program 97.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.7
Applied rewrites33.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -50000000000.0) x (if (<= x 4.8e-284) a (if (<= x 9.5e+113) z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -50000000000.0) {
tmp = x;
} else if (x <= 4.8e-284) {
tmp = a;
} else if (x <= 9.5e+113) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-50000000000.0d0)) then
tmp = x
else if (x <= 4.8d-284) then
tmp = a
else if (x <= 9.5d+113) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -50000000000.0) {
tmp = x;
} else if (x <= 4.8e-284) {
tmp = a;
} else if (x <= 9.5e+113) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -50000000000.0: tmp = x elif x <= 4.8e-284: tmp = a elif x <= 9.5e+113: tmp = z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -50000000000.0) tmp = x; elseif (x <= 4.8e-284) tmp = a; elseif (x <= 9.5e+113) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -50000000000.0) tmp = x; elseif (x <= 4.8e-284) tmp = a; elseif (x <= 9.5e+113) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -50000000000.0], x, If[LessEqual[x, 4.8e-284], a, If[LessEqual[x, 9.5e+113], z, x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -50000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-284}:\\
\;\;\;\;a\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+113}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5e10 or 9.5000000000000001e113 < x Initial program 95.3%
Taylor expanded in x around inf
Applied rewrites33.2%
if -5e10 < x < 4.80000000000000006e-284Initial program 94.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.8
Applied rewrites32.8%
Taylor expanded in t around 0
Applied rewrites12.8%
if 4.80000000000000006e-284 < x < 9.5000000000000001e113Initial program 95.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6431.4
Applied rewrites31.4%
Taylor expanded in y around 0
Applied rewrites12.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -50000000000.0) x (if (<= x 1.2e+43) a x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -50000000000.0) {
tmp = x;
} else if (x <= 1.2e+43) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-50000000000.0d0)) then
tmp = x
else if (x <= 1.2d+43) then
tmp = a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -50000000000.0) {
tmp = x;
} else if (x <= 1.2e+43) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -50000000000.0: tmp = x elif x <= 1.2e+43: tmp = a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -50000000000.0) tmp = x; elseif (x <= 1.2e+43) tmp = a; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -50000000000.0) tmp = x; elseif (x <= 1.2e+43) tmp = a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -50000000000.0], x, If[LessEqual[x, 1.2e+43], a, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -50000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+43}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5e10 or 1.20000000000000012e43 < x Initial program 95.3%
Taylor expanded in x around inf
Applied rewrites30.5%
if -5e10 < x < 1.20000000000000012e43Initial program 94.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.4
Applied rewrites32.4%
Taylor expanded in t around 0
Applied rewrites13.3%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.1%
Taylor expanded in x around inf
Applied rewrites15.8%
herbie shell --seed 2025088
(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)))