
(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
(let* ((t_1 (- t (- 2.0 y))))
(if (<=
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))
INFINITY)
(fma (- 1.0 t) a (fma b t_1 (fma z (- 1.0 y) x)))
(fma t_1 b (* a (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t - (2.0 - y);
double tmp;
if ((((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = fma((1.0 - t), a, fma(b, t_1, fma(z, (1.0 - y), x)));
} else {
tmp = fma(t_1, b, (a * -t));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t - Float64(2.0 - y)) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = fma(Float64(1.0 - t), a, fma(b, t_1, fma(z, Float64(1.0 - y), x))); else tmp = fma(t_1, b, Float64(a * Float64(-t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(1.0 - t), $MachinePrecision] * a + N[(b * t$95$1 + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[(a * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \left(2 - y\right)\\
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(b, t\_1, \mathsf{fma}\left(z, 1 - y, x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, a \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 95.5%
Applied rewrites97.9%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6450.5
Applied rewrites50.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6451.4
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
lift--.f64N/A
lift--.f6451.4
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
*-rgt-identityN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
metadata-evalN/A
lower-*.f64N/A
Applied rewrites51.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.5e+35)
(fma (- t (- 2.0 y)) b (fma (- 1.0 y) z x))
(if (<= y 1.6e-6)
(fma (- 1.0 t) a (+ x (+ z (* b (- t 2.0)))))
(- (+ x (* b (- y 2.0))) (fma -1.0 a (* z (- y 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.5e+35) {
tmp = fma((t - (2.0 - y)), b, fma((1.0 - y), z, x));
} else if (y <= 1.6e-6) {
tmp = fma((1.0 - t), a, (x + (z + (b * (t - 2.0)))));
} else {
tmp = (x + (b * (y - 2.0))) - fma(-1.0, a, (z * (y - 1.0)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.5e+35) tmp = fma(Float64(t - Float64(2.0 - y)), b, fma(Float64(1.0 - y), z, x)); elseif (y <= 1.6e-6) tmp = fma(Float64(1.0 - t), a, Float64(x + Float64(z + Float64(b * Float64(t - 2.0))))); else tmp = Float64(Float64(x + Float64(b * Float64(y - 2.0))) - fma(-1.0, a, Float64(z * Float64(y - 1.0)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.5e+35], N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-6], N[(N[(1.0 - t), $MachinePrecision] * a + N[(x + N[(z + N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * a + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(t - \left(2 - y\right), b, \mathsf{fma}\left(1 - y, z, x\right)\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x + \left(z + b \cdot \left(t - 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + b \cdot \left(y - 2\right)\right) - \mathsf{fma}\left(-1, a, z \cdot \left(y - 1\right)\right)\\
\end{array}
\end{array}
if y < -3.5000000000000001e35Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
if -3.5000000000000001e35 < y < 1.5999999999999999e-6Initial program 95.5%
Applied rewrites97.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if 1.5999999999999999e-6 < y Initial program 95.5%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.8
Applied rewrites69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t (- 2.0 y)) b (fma (- 1.0 y) z x))))
(if (<= y -3.5e+35)
t_1
(if (<= y 1.55e-6) (fma (- 1.0 t) a (+ x (+ z (* b (- t 2.0))))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - (2.0 - y)), b, fma((1.0 - y), z, x));
double tmp;
if (y <= -3.5e+35) {
tmp = t_1;
} else if (y <= 1.55e-6) {
tmp = fma((1.0 - t), a, (x + (z + (b * (t - 2.0)))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - Float64(2.0 - y)), b, fma(Float64(1.0 - y), z, x)) tmp = 0.0 if (y <= -3.5e+35) tmp = t_1; elseif (y <= 1.55e-6) tmp = fma(Float64(1.0 - t), a, Float64(x + Float64(z + Float64(b * Float64(t - 2.0))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+35], t$95$1, If[LessEqual[y, 1.55e-6], N[(N[(1.0 - t), $MachinePrecision] * a + N[(x + N[(z + N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - \left(2 - y\right), b, \mathsf{fma}\left(1 - y, z, x\right)\right)\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x + \left(z + b \cdot \left(t - 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.5000000000000001e35 or 1.55e-6 < y Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
if -3.5000000000000001e35 < y < 1.55e-6Initial program 95.5%
Applied rewrites97.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6470.4
Applied rewrites70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t (- 2.0 y)) b (fma (- 1.0 y) z x))))
(if (<= b -65000000000.0)
t_1
(if (<= b 1.35e-35) (- x (fma a (- t 1.0) (* z (- y 1.0)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - (2.0 - y)), b, fma((1.0 - y), z, x));
double tmp;
if (b <= -65000000000.0) {
tmp = t_1;
} else if (b <= 1.35e-35) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - Float64(2.0 - y)), b, fma(Float64(1.0 - y), z, x)) tmp = 0.0 if (b <= -65000000000.0) tmp = t_1; elseif (b <= 1.35e-35) tmp = Float64(x - fma(a, Float64(t - 1.0), 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[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -65000000000.0], t$95$1, If[LessEqual[b, 1.35e-35], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - \left(2 - y\right), b, \mathsf{fma}\left(1 - y, z, x\right)\right)\\
\mathbf{if}\;b \leq -65000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.35 \cdot 10^{-35}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.5e10 or 1.3499999999999999e-35 < b Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
if -6.5e10 < b < 1.3499999999999999e-35Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* b (- (+ t y) 2.0)))))
(if (<= b -1.02e+110)
t_1
(if (<= b 1.15e-21) (- x (fma a (- t 1.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 + (b * ((t + y) - 2.0));
double tmp;
if (b <= -1.02e+110) {
tmp = t_1;
} else if (b <= 1.15e-21) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))) tmp = 0.0 if (b <= -1.02e+110) tmp = t_1; elseif (b <= 1.15e-21) tmp = Float64(x - fma(a, Float64(t - 1.0), 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[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.02e+110], t$95$1, If[LessEqual[b, 1.15e-21], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -1.02 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.02e110 or 1.15e-21 < b Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6451.3
Applied rewrites51.3%
if -1.02e110 < b < 1.15e-21Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.6
Applied rewrites67.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (fma a (- t 1.0) (* z -1.0)))))
(if (<= a -1.95e+96)
t_1
(if (<= a 1.55e+147) (fma (- t 2.0) b (fma (- 1.0 y) z x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - fma(a, (t - 1.0), (z * -1.0));
double tmp;
if (a <= -1.95e+96) {
tmp = t_1;
} else if (a <= 1.55e+147) {
tmp = fma((t - 2.0), b, fma((1.0 - y), z, x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - fma(a, Float64(t - 1.0), Float64(z * -1.0))) tmp = 0.0 if (a <= -1.95e+96) tmp = t_1; elseif (a <= 1.55e+147) tmp = fma(Float64(t - 2.0), b, fma(Float64(1.0 - y), z, x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.95e+96], t$95$1, If[LessEqual[a, 1.55e+147], N[(N[(t - 2.0), $MachinePrecision] * b + N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(a, t - 1, z \cdot -1\right)\\
\mathbf{if}\;a \leq -1.95 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(1 - y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.95e96 or 1.55e147 < a Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around 0
Applied rewrites51.3%
if -1.95e96 < a < 1.55e147Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in y around 0
Applied rewrites62.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* b (- (+ t y) 2.0)))))
(if (<= b -7.8e+96)
t_1
(if (<= b 1.15e-21) (- 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 = x + (b * ((t + y) - 2.0));
double tmp;
if (b <= -7.8e+96) {
tmp = t_1;
} else if (b <= 1.15e-21) {
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(x + Float64(b * Float64(Float64(t + y) - 2.0))) tmp = 0.0 if (b <= -7.8e+96) tmp = t_1; elseif (b <= 1.15e-21) 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[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7.8e+96], t$95$1, If[LessEqual[b, 1.15e-21], 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 := x + b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -7.8 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -7.8e96 or 1.15e-21 < b Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6451.3
Applied rewrites51.3%
if -7.8e96 < b < 1.15e-21Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.6
Applied rewrites67.6%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (* z (- (/ b z) 1.0))))) (if (<= y -1e+24) t_1 (if (<= y 195.0) (fma (- t 2.0) b (+ z x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (z * ((b / z) - 1.0));
double tmp;
if (y <= -1e+24) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = fma((t - 2.0), b, (z + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(z * Float64(Float64(b / z) - 1.0))) tmp = 0.0 if (y <= -1e+24) tmp = t_1; elseif (y <= 195.0) tmp = fma(Float64(t - 2.0), b, Float64(z + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(z * N[(N[(b / z), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+24], t$95$1, If[LessEqual[y, 195.0], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot \left(\frac{b}{z} - 1\right)\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999998e23 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.7
Applied rewrites33.7%
if -9.9999999999999998e23 < y < 195Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
lift--.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
add-flip-revN/A
mul-1-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
+-commutativeN/A
lower-+.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -1e+24) t_1 (if (<= y 195.0) (fma (- t 2.0) b (+ z x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -1e+24) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = fma((t - 2.0), b, (z + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -1e+24) tmp = t_1; elseif (y <= 195.0) tmp = fma(Float64(t - 2.0), b, Float64(z + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+24], t$95$1, If[LessEqual[y, 195.0], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999998e23 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -9.9999999999999998e23 < y < 195Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
lift--.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
add-flip-revN/A
mul-1-negN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
+-commutativeN/A
lower-+.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- (+ t y) 2.0)))) (if (<= b -3.55e+96) t_1 (if (<= b 4.6e+16) (- x (* 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);
double tmp;
if (b <= -3.55e+96) {
tmp = t_1;
} else if (b <= 4.6e+16) {
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 = b * ((t + y) - 2.0d0)
if (b <= (-3.55d+96)) then
tmp = t_1
else if (b <= 4.6d+16) 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 = b * ((t + y) - 2.0);
double tmp;
if (b <= -3.55e+96) {
tmp = t_1;
} else if (b <= 4.6e+16) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * ((t + y) - 2.0) tmp = 0 if b <= -3.55e+96: tmp = t_1 elif b <= 4.6e+16: tmp = x - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -3.55e+96) tmp = t_1; elseif (b <= 4.6e+16) 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 = b * ((t + y) - 2.0); tmp = 0.0; if (b <= -3.55e+96) tmp = t_1; elseif (b <= 4.6e+16) 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[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.55e+96], t$95$1, If[LessEqual[b, 4.6e+16], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -3.55 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{+16}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.54999999999999977e96 or 4.6e16 < b Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.2
Applied rewrites37.2%
if -3.54999999999999977e96 < b < 4.6e16Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6442.0
Applied rewrites42.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -1e+24) t_1 (if (<= y 195.0) (+ x (* b (- t 2.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -1e+24) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = x + (b * (t - 2.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 = y * (b - z)
if (y <= (-1d+24)) then
tmp = t_1
else if (y <= 195.0d0) then
tmp = x + (b * (t - 2.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 = y * (b - z);
double tmp;
if (y <= -1e+24) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = x + (b * (t - 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -1e+24: tmp = t_1 elif y <= 195.0: tmp = x + (b * (t - 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -1e+24) tmp = t_1; elseif (y <= 195.0) tmp = Float64(x + Float64(b * Float64(t - 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -1e+24) tmp = t_1; elseif (y <= 195.0) tmp = x + (b * (t - 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+24], t$95$1, If[LessEqual[y, 195.0], N[(x + N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;x + b \cdot \left(t - 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999998e23 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -9.9999999999999998e23 < y < 195Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6451.3
Applied rewrites51.3%
Taylor expanded in y around 0
Applied rewrites37.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -5.8e+35) t_1 (if (<= y 195.0) (- x (* a (- t 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -5.8e+35) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = x - (a * (t - 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 = y * (b - z)
if (y <= (-5.8d+35)) then
tmp = t_1
else if (y <= 195.0d0) then
tmp = x - (a * (t - 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 = y * (b - z);
double tmp;
if (y <= -5.8e+35) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -5.8e+35: tmp = t_1 elif y <= 195.0: tmp = x - (a * (t - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -5.8e+35) tmp = t_1; elseif (y <= 195.0) tmp = Float64(x - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -5.8e+35) tmp = t_1; elseif (y <= 195.0) tmp = x - (a * (t - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+35], t$95$1, If[LessEqual[y, 195.0], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.79999999999999989e35 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -5.79999999999999989e35 < y < 195Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.6
Applied rewrites67.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6442.7
Applied rewrites42.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -1.06e+37) t_1 (if (<= t 7e+142) (- 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.06e+37) {
tmp = t_1;
} else if (t <= 7e+142) {
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.06d+37)) then
tmp = t_1
else if (t <= 7d+142) 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.06e+37) {
tmp = t_1;
} else if (t <= 7e+142) {
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.06e+37: tmp = t_1 elif t <= 7e+142: 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.06e+37) tmp = t_1; elseif (t <= 7e+142) 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.06e+37) tmp = t_1; elseif (t <= 7e+142) 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.06e+37], t$95$1, If[LessEqual[t, 7e+142], 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.06 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+142}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.06e37 or 6.99999999999999995e142 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
if -1.06e37 < t < 6.99999999999999995e142Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6442.0
Applied rewrites42.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))))
(if (<= y -4e+35)
t_1
(if (<= y -3.15e-264)
(* t (- b a))
(if (<= y 195.0) (- x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -4e+35) {
tmp = t_1;
} else if (y <= -3.15e-264) {
tmp = t * (b - a);
} else if (y <= 195.0) {
tmp = x - (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 = y * (b - z)
if (y <= (-4d+35)) then
tmp = t_1
else if (y <= (-3.15d-264)) then
tmp = t * (b - a)
else if (y <= 195.0d0) then
tmp = x - (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 = y * (b - z);
double tmp;
if (y <= -4e+35) {
tmp = t_1;
} else if (y <= -3.15e-264) {
tmp = t * (b - a);
} else if (y <= 195.0) {
tmp = x - (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -4e+35: tmp = t_1 elif y <= -3.15e-264: tmp = t * (b - a) elif y <= 195.0: tmp = x - (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -4e+35) tmp = t_1; elseif (y <= -3.15e-264) tmp = Float64(t * Float64(b - a)); elseif (y <= 195.0) tmp = Float64(x - Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -4e+35) tmp = t_1; elseif (y <= -3.15e-264) tmp = t * (b - a); elseif (y <= 195.0) tmp = x - (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+35], t$95$1, If[LessEqual[y, -3.15e-264], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 195.0], N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -4 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.15 \cdot 10^{-264}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;x - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999999e35 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -3.9999999999999999e35 < y < -3.1499999999999999e-264Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
if -3.1499999999999999e-264 < y < 195Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.6
Applied rewrites67.6%
Taylor expanded in t around inf
lower-*.f6433.5
Applied rewrites33.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -4e+35) t_1 (if (<= y 5.1e-22) (* t (- b a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -4e+35) {
tmp = t_1;
} else if (y <= 5.1e-22) {
tmp = t * (b - 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 = y * (b - z)
if (y <= (-4d+35)) then
tmp = t_1
else if (y <= 5.1d-22) then
tmp = t * (b - 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 = y * (b - z);
double tmp;
if (y <= -4e+35) {
tmp = t_1;
} else if (y <= 5.1e-22) {
tmp = t * (b - a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -4e+35: tmp = t_1 elif y <= 5.1e-22: tmp = t * (b - a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -4e+35) tmp = t_1; elseif (y <= 5.1e-22) tmp = Float64(t * Float64(b - a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b - z); tmp = 0.0; if (y <= -4e+35) tmp = t_1; elseif (y <= 5.1e-22) tmp = t * (b - a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+35], t$95$1, If[LessEqual[y, 5.1e-22], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -4 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-22}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999999e35 or 5.10000000000000022e-22 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -3.9999999999999999e35 < y < 5.10000000000000022e-22Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* -1.0 z))) (t_2 (* t (- b a))))
(if (<= t -6.5e+36)
t_2
(if (<= t -4.4e-154)
t_1
(if (<= t 1.6e-239) (* b (- y 2.0)) (if (<= t 11000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (-1.0 * z);
double t_2 = t * (b - a);
double tmp;
if (t <= -6.5e+36) {
tmp = t_2;
} else if (t <= -4.4e-154) {
tmp = t_1;
} else if (t <= 1.6e-239) {
tmp = b * (y - 2.0);
} else if (t <= 11000.0) {
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 - ((-1.0d0) * z)
t_2 = t * (b - a)
if (t <= (-6.5d+36)) then
tmp = t_2
else if (t <= (-4.4d-154)) then
tmp = t_1
else if (t <= 1.6d-239) then
tmp = b * (y - 2.0d0)
else if (t <= 11000.0d0) 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 - (-1.0 * z);
double t_2 = t * (b - a);
double tmp;
if (t <= -6.5e+36) {
tmp = t_2;
} else if (t <= -4.4e-154) {
tmp = t_1;
} else if (t <= 1.6e-239) {
tmp = b * (y - 2.0);
} else if (t <= 11000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (-1.0 * z) t_2 = t * (b - a) tmp = 0 if t <= -6.5e+36: tmp = t_2 elif t <= -4.4e-154: tmp = t_1 elif t <= 1.6e-239: tmp = b * (y - 2.0) elif t <= 11000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(-1.0 * z)) t_2 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -6.5e+36) tmp = t_2; elseif (t <= -4.4e-154) tmp = t_1; elseif (t <= 1.6e-239) tmp = Float64(b * Float64(y - 2.0)); elseif (t <= 11000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (-1.0 * z); t_2 = t * (b - a); tmp = 0.0; if (t <= -6.5e+36) tmp = t_2; elseif (t <= -4.4e-154) tmp = t_1; elseif (t <= 1.6e-239) tmp = b * (y - 2.0); elseif (t <= 11000.0) 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[(-1.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+36], t$95$2, If[LessEqual[t, -4.4e-154], t$95$1, If[LessEqual[t, 1.6e-239], N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 11000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - -1 \cdot z\\
t_2 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+36}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-239}:\\
\;\;\;\;b \cdot \left(y - 2\right)\\
\mathbf{elif}\;t \leq 11000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.4999999999999998e36 or 11000 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
if -6.4999999999999998e36 < t < -4.40000000000000015e-154 or 1.6e-239 < t < 11000Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
if -4.40000000000000015e-154 < t < 1.6e-239Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.2
Applied rewrites37.2%
Taylor expanded in t around 0
lower--.f6424.0
Applied rewrites24.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* -1.0 z))) (t_2 (* a (- 1.0 t))))
(if (<= a -9.5e-21)
t_2
(if (<= a -1.7e-265)
(* t b)
(if (<= a 9.6e-81)
t_1
(if (<= a 6.5e+60) (* b (- y 2.0)) (if (<= a 1.5e+138) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (-1.0 * z);
double t_2 = a * (1.0 - t);
double tmp;
if (a <= -9.5e-21) {
tmp = t_2;
} else if (a <= -1.7e-265) {
tmp = t * b;
} else if (a <= 9.6e-81) {
tmp = t_1;
} else if (a <= 6.5e+60) {
tmp = b * (y - 2.0);
} else if (a <= 1.5e+138) {
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 - ((-1.0d0) * z)
t_2 = a * (1.0d0 - t)
if (a <= (-9.5d-21)) then
tmp = t_2
else if (a <= (-1.7d-265)) then
tmp = t * b
else if (a <= 9.6d-81) then
tmp = t_1
else if (a <= 6.5d+60) then
tmp = b * (y - 2.0d0)
else if (a <= 1.5d+138) 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 - (-1.0 * z);
double t_2 = a * (1.0 - t);
double tmp;
if (a <= -9.5e-21) {
tmp = t_2;
} else if (a <= -1.7e-265) {
tmp = t * b;
} else if (a <= 9.6e-81) {
tmp = t_1;
} else if (a <= 6.5e+60) {
tmp = b * (y - 2.0);
} else if (a <= 1.5e+138) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (-1.0 * z) t_2 = a * (1.0 - t) tmp = 0 if a <= -9.5e-21: tmp = t_2 elif a <= -1.7e-265: tmp = t * b elif a <= 9.6e-81: tmp = t_1 elif a <= 6.5e+60: tmp = b * (y - 2.0) elif a <= 1.5e+138: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(-1.0 * z)) t_2 = Float64(a * Float64(1.0 - t)) tmp = 0.0 if (a <= -9.5e-21) tmp = t_2; elseif (a <= -1.7e-265) tmp = Float64(t * b); elseif (a <= 9.6e-81) tmp = t_1; elseif (a <= 6.5e+60) tmp = Float64(b * Float64(y - 2.0)); elseif (a <= 1.5e+138) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (-1.0 * z); t_2 = a * (1.0 - t); tmp = 0.0; if (a <= -9.5e-21) tmp = t_2; elseif (a <= -1.7e-265) tmp = t * b; elseif (a <= 9.6e-81) tmp = t_1; elseif (a <= 6.5e+60) tmp = b * (y - 2.0); elseif (a <= 1.5e+138) 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[(-1.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e-21], t$95$2, If[LessEqual[a, -1.7e-265], N[(t * b), $MachinePrecision], If[LessEqual[a, 9.6e-81], t$95$1, If[LessEqual[a, 6.5e+60], N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e+138], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - -1 \cdot z\\
t_2 := a \cdot \left(1 - t\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-265}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+60}:\\
\;\;\;\;b \cdot \left(y - 2\right)\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -9.4999999999999994e-21 or 1.50000000000000005e138 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
if -9.4999999999999994e-21 < a < -1.7e-265Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
Taylor expanded in a around 0
Applied rewrites17.5%
if -1.7e-265 < a < 9.5999999999999996e-81 or 6.49999999999999931e60 < a < 1.50000000000000005e138Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
if 9.5999999999999996e-81 < a < 6.49999999999999931e60Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
add-flip-revN/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-+l+N/A
Applied rewrites74.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.2
Applied rewrites37.2%
Taylor expanded in t around 0
lower--.f6424.0
Applied rewrites24.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (- 1.0 t))))
(if (<= a -9.5e-21)
t_1
(if (<= a -1.7e-265) (* t b) (if (<= a 1.5e+138) (- x (* -1.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (1.0 - t);
double tmp;
if (a <= -9.5e-21) {
tmp = t_1;
} else if (a <= -1.7e-265) {
tmp = t * b;
} else if (a <= 1.5e+138) {
tmp = x - (-1.0 * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (1.0d0 - t)
if (a <= (-9.5d-21)) then
tmp = t_1
else if (a <= (-1.7d-265)) then
tmp = t * b
else if (a <= 1.5d+138) then
tmp = x - ((-1.0d0) * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (1.0 - t);
double tmp;
if (a <= -9.5e-21) {
tmp = t_1;
} else if (a <= -1.7e-265) {
tmp = t * b;
} else if (a <= 1.5e+138) {
tmp = x - (-1.0 * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (1.0 - t) tmp = 0 if a <= -9.5e-21: tmp = t_1 elif a <= -1.7e-265: tmp = t * b elif a <= 1.5e+138: tmp = x - (-1.0 * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(1.0 - t)) tmp = 0.0 if (a <= -9.5e-21) tmp = t_1; elseif (a <= -1.7e-265) tmp = Float64(t * b); elseif (a <= 1.5e+138) tmp = Float64(x - Float64(-1.0 * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (1.0 - t); tmp = 0.0; if (a <= -9.5e-21) tmp = t_1; elseif (a <= -1.7e-265) tmp = t * b; elseif (a <= 1.5e+138) tmp = x - (-1.0 * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e-21], t$95$1, If[LessEqual[a, -1.7e-265], N[(t * b), $MachinePrecision], If[LessEqual[a, 1.5e+138], N[(x - N[(-1.0 * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-265}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+138}:\\
\;\;\;\;x - -1 \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.4999999999999994e-21 or 1.50000000000000005e138 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
if -9.4999999999999994e-21 < a < -1.7e-265Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
Taylor expanded in a around 0
Applied rewrites17.5%
if -1.7e-265 < a < 1.50000000000000005e138Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -9.8e+66) (* t b) (if (<= b 8e+34) (- x (* -1.0 z)) (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.8e+66) {
tmp = t * b;
} else if (b <= 8e+34) {
tmp = x - (-1.0 * z);
} else {
tmp = t * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-9.8d+66)) then
tmp = t * b
else if (b <= 8d+34) then
tmp = x - ((-1.0d0) * z)
else
tmp = t * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.8e+66) {
tmp = t * b;
} else if (b <= 8e+34) {
tmp = x - (-1.0 * z);
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.8e+66: tmp = t * b elif b <= 8e+34: tmp = x - (-1.0 * z) else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.8e+66) tmp = Float64(t * b); elseif (b <= 8e+34) tmp = Float64(x - Float64(-1.0 * z)); else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -9.8e+66) tmp = t * b; elseif (b <= 8e+34) tmp = x - (-1.0 * z); else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.8e+66], N[(t * b), $MachinePrecision], If[LessEqual[b, 8e+34], N[(x - N[(-1.0 * z), $MachinePrecision]), $MachinePrecision], N[(t * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{+66}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+34}:\\
\;\;\;\;x - -1 \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
\end{array}
if b < -9.7999999999999995e66 or 7.99999999999999956e34 < b Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
Taylor expanded in a around 0
Applied rewrites17.5%
if -9.7999999999999995e66 < b < 7.99999999999999956e34Initial program 95.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6.9e+37) (* t b) (if (<= t -2.75e-154) a (if (<= t 8.2e+14) (* y b) (* t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.9e+37) {
tmp = t * b;
} else if (t <= -2.75e-154) {
tmp = a;
} else if (t <= 8.2e+14) {
tmp = y * b;
} else {
tmp = t * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-6.9d+37)) then
tmp = t * b
else if (t <= (-2.75d-154)) then
tmp = a
else if (t <= 8.2d+14) then
tmp = y * b
else
tmp = t * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.9e+37) {
tmp = t * b;
} else if (t <= -2.75e-154) {
tmp = a;
} else if (t <= 8.2e+14) {
tmp = y * b;
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.9e+37: tmp = t * b elif t <= -2.75e-154: tmp = a elif t <= 8.2e+14: tmp = y * b else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.9e+37) tmp = Float64(t * b); elseif (t <= -2.75e-154) tmp = a; elseif (t <= 8.2e+14) tmp = Float64(y * b); else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.9e+37) tmp = t * b; elseif (t <= -2.75e-154) tmp = a; elseif (t <= 8.2e+14) tmp = y * b; else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.9e+37], N[(t * b), $MachinePrecision], If[LessEqual[t, -2.75e-154], a, If[LessEqual[t, 8.2e+14], N[(y * b), $MachinePrecision], N[(t * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.9 \cdot 10^{+37}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;t \leq -2.75 \cdot 10^{-154}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+14}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
\end{array}
if t < -6.8999999999999996e37 or 8.2e14 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
Taylor expanded in a around 0
Applied rewrites17.5%
if -6.8999999999999996e37 < t < -2.75000000000000001e-154Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
Taylor expanded in t around 0
Applied rewrites11.3%
if -2.75000000000000001e-154 < t < 8.2e14Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
Taylor expanded in z around 0
Applied rewrites18.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6.9e+37) (* t b) (if (<= t 2.15) a (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.9e+37) {
tmp = t * b;
} else if (t <= 2.15) {
tmp = a;
} else {
tmp = t * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-6.9d+37)) then
tmp = t * b
else if (t <= 2.15d0) then
tmp = a
else
tmp = t * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.9e+37) {
tmp = t * b;
} else if (t <= 2.15) {
tmp = a;
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.9e+37: tmp = t * b elif t <= 2.15: tmp = a else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.9e+37) tmp = Float64(t * b); elseif (t <= 2.15) tmp = a; else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.9e+37) tmp = t * b; elseif (t <= 2.15) tmp = a; else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.9e+37], N[(t * b), $MachinePrecision], If[LessEqual[t, 2.15], a, N[(t * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.9 \cdot 10^{+37}:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;t \leq 2.15:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
\end{array}
if t < -6.8999999999999996e37 or 2.14999999999999991 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
Taylor expanded in a around 0
Applied rewrites17.5%
if -6.8999999999999996e37 < t < 2.14999999999999991Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
Taylor expanded in t around 0
Applied rewrites11.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.3e+163) a (if (<= a 1.03e+18) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.3e+163) {
tmp = a;
} else if (a <= 1.03e+18) {
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 <= (-1.3d+163)) then
tmp = a
else if (a <= 1.03d+18) 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 <= -1.3e+163) {
tmp = a;
} else if (a <= 1.03e+18) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.3e+163: tmp = a elif a <= 1.03e+18: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.3e+163) tmp = a; elseif (a <= 1.03e+18) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.3e+163) tmp = a; elseif (a <= 1.03e+18) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.3e+163], a, If[LessEqual[a, 1.03e+18], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+163}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.03 \cdot 10^{+18}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.3000000000000001e163 or 1.03e18 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
Taylor expanded in t around 0
Applied rewrites11.3%
if -1.3000000000000001e163 < a < 1.03e18Initial program 95.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6427.7
Applied rewrites27.7%
Taylor expanded in y around 0
Applied rewrites10.6%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
Taylor expanded in t around 0
Applied rewrites11.3%
herbie shell --seed 2025156
(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)))