
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (- 1.0 y) z (- x (fma (- (- 2.0 y) t) b (* a (- t 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((1.0 - y), z, (x - fma(((2.0 - y) - t), b, (a * (t - 1.0)))));
}
function code(x, y, z, t, a, b) return fma(Float64(1.0 - y), z, Float64(x - fma(Float64(Float64(2.0 - y) - t), b, Float64(a * Float64(t - 1.0))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(1.0 - y), $MachinePrecision] * z + N[(x - N[(N[(N[(2.0 - y), $MachinePrecision] - t), $MachinePrecision] * b + N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - y, z, x - \mathsf{fma}\left(\left(2 - y\right) - t, b, a \cdot \left(t - 1\right)\right)\right)
\end{array}
Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
(FPCore (x y z t a b) :precision binary64 (fma (- t (- 2.0 y)) b (fma (- 1.0 t) a (fma (- 1.0 y) z x))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((t - (2.0 - y)), b, fma((1.0 - t), a, fma((1.0 - y), z, x)));
}
function code(x, y, z, t, a, b) return fma(Float64(t - Float64(2.0 - y)), b, fma(Float64(1.0 - t), a, fma(Float64(1.0 - y), z, x))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t - \left(2 - y\right), b, \mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(1 - y, z, x\right)\right)\right)
\end{array}
Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.4
lift--.f64N/A
sub-negate-revN/A
lift-+.f64N/A
associate--r+N/A
sub-negateN/A
lower--.f64N/A
lower--.f6497.4
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6497.8
lift--.f64N/A
Applied rewrites97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 y) z (- x (* t (+ a (* -1.0 b)))))))
(if (<= t -3e-31)
t_1
(if (<= t 3e+25)
(fma (- 1.0 y) z (- x (fma -1.0 a (* b (- 2.0 y)))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - y), z, (x - (t * (a + (-1.0 * b)))));
double tmp;
if (t <= -3e-31) {
tmp = t_1;
} else if (t <= 3e+25) {
tmp = fma((1.0 - y), z, (x - fma(-1.0, a, (b * (2.0 - y)))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - y), z, Float64(x - Float64(t * Float64(a + Float64(-1.0 * b))))) tmp = 0.0 if (t <= -3e-31) tmp = t_1; elseif (t <= 3e+25) tmp = fma(Float64(1.0 - y), z, Float64(x - fma(-1.0, a, Float64(b * Float64(2.0 - y))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z + N[(x - N[(t * N[(a + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3e-31], t$95$1, If[LessEqual[t, 3e+25], N[(N[(1.0 - y), $MachinePrecision] * z + N[(x - N[(-1.0 * a + N[(b * N[(2.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - y, z, x - t \cdot \left(a + -1 \cdot b\right)\right)\\
\mathbf{if}\;t \leq -3 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x - \mathsf{fma}\left(-1, a, b \cdot \left(2 - y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.99999999999999981e-31 or 3.00000000000000006e25 < t Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
if -2.99999999999999981e-31 < t < 3.00000000000000006e25Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.2
Applied rewrites69.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 y) z (- x (* t (+ a (* -1.0 b)))))))
(if (<= t -3700000.0)
t_1
(if (<= t 3e+25) (+ a (+ x (fma b (- y 2.0) (* z (- 1.0 y))))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - y), z, (x - (t * (a + (-1.0 * b)))));
double tmp;
if (t <= -3700000.0) {
tmp = t_1;
} else if (t <= 3e+25) {
tmp = a + (x + fma(b, (y - 2.0), (z * (1.0 - y))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - y), z, Float64(x - Float64(t * Float64(a + Float64(-1.0 * b))))) tmp = 0.0 if (t <= -3700000.0) tmp = t_1; elseif (t <= 3e+25) tmp = Float64(a + Float64(x + fma(b, Float64(y - 2.0), Float64(z * Float64(1.0 - y))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z + N[(x - N[(t * N[(a + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3700000.0], t$95$1, If[LessEqual[t, 3e+25], N[(a + N[(x + N[(b * N[(y - 2.0), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - y, z, x - t \cdot \left(a + -1 \cdot b\right)\right)\\
\mathbf{if}\;t \leq -3700000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;a + \left(x + \mathsf{fma}\left(b, y - 2, z \cdot \left(1 - y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.7e6 or 3.00000000000000006e25 < t Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
if -3.7e6 < t < 3.00000000000000006e25Initial program 95.5%
Taylor expanded in y around inf
lower-*.f6477.5
Applied rewrites77.5%
lift-+.f64N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
*-rgt-identityN/A
+-commutativeN/A
lower-fma.f64N/A
*-rgt-identityN/A
lower-+.f6478.0
Applied rewrites78.0%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6469.4
Applied rewrites69.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t (- 2.0 y)) b (fma z (- 1.0 y) x))))
(if (<= y -3.15e-9)
t_1
(if (<= y 1.8e-7) (- (+ x z) (fma a (- t 1.0) (* b (- 2.0 t)))) 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(z, (1.0 - y), x));
double tmp;
if (y <= -3.15e-9) {
tmp = t_1;
} else if (y <= 1.8e-7) {
tmp = (x + z) - fma(a, (t - 1.0), (b * (2.0 - t)));
} 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(z, Float64(1.0 - y), x)) tmp = 0.0 if (y <= -3.15e-9) tmp = t_1; elseif (y <= 1.8e-7) tmp = Float64(Float64(x + z) - fma(a, Float64(t - 1.0), Float64(b * Float64(2.0 - t)))); 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[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.15e-9], t$95$1, If[LessEqual[y, 1.8e-7], N[(N[(x + z), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision] + N[(b * N[(2.0 - t), $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(z, 1 - y, x\right)\right)\\
\mathbf{if}\;y \leq -3.15 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;\left(x + z\right) - \mathsf{fma}\left(a, t - 1, b \cdot \left(2 - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.1500000000000001e-9 or 1.79999999999999997e-7 < 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.2
Applied rewrites73.2%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f6474.2
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flip-revN/A
sub-negate-revN/A
lift--.f64N/A
lower--.f6474.2
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
Applied rewrites74.2%
if -3.1500000000000001e-9 < y < 1.79999999999999997e-7Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.9
Applied rewrites70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- 1.0 y) x)))
(if (<= a -2500.0)
(fma (- 1.0 t) a t_1)
(if (<= a 3.4e+116)
(fma (- t (- 2.0 y)) b t_1)
(fma (- 1.0 y) z (fma a (- 1.0 t) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (1.0 - y), x);
double tmp;
if (a <= -2500.0) {
tmp = fma((1.0 - t), a, t_1);
} else if (a <= 3.4e+116) {
tmp = fma((t - (2.0 - y)), b, t_1);
} else {
tmp = fma((1.0 - y), z, fma(a, (1.0 - t), x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(1.0 - y), x) tmp = 0.0 if (a <= -2500.0) tmp = fma(Float64(1.0 - t), a, t_1); elseif (a <= 3.4e+116) tmp = fma(Float64(t - Float64(2.0 - y)), b, t_1); else tmp = fma(Float64(1.0 - y), z, fma(a, Float64(1.0 - t), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2500.0], N[(N[(1.0 - t), $MachinePrecision] * a + t$95$1), $MachinePrecision], If[LessEqual[a, 3.4e+116], N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + t$95$1), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, 1 - y, x\right)\\
\mathbf{if}\;a \leq -2500:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, t\_1\right)\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(t - \left(2 - y\right), b, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(a, 1 - t, x\right)\right)\\
\end{array}
\end{array}
if a < -2500Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
*-commutativeN/A
associate--l-N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
sub-negate-revN/A
remove-double-negN/A
mul-1-negN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
remove-double-negN/A
sub-negate-revN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites67.2%
if -2500 < a < 3.40000000000000023e116Initial 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.2
Applied rewrites73.2%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f6474.2
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flip-revN/A
sub-negate-revN/A
lift--.f64N/A
lower--.f6474.2
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
Applied rewrites74.2%
if 3.40000000000000023e116 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
fp-cancel-sign-subN/A
+-commutativeN/A
*-commutativeN/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
lift-*.f64N/A
sub-negate-revN/A
lift-*.f64N/A
distribute-rgt-neg-outN/A
*-rgt-identityN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
Applied rewrites67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- y (- 2.0 t)) b (- x (* z -1.0)))))
(if (<= b -4.8e+129)
t_1
(if (<= b 5.4e+98) (fma (- 1.0 y) z (fma a (- 1.0 t) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y - (2.0 - t)), b, (x - (z * -1.0)));
double tmp;
if (b <= -4.8e+129) {
tmp = t_1;
} else if (b <= 5.4e+98) {
tmp = fma((1.0 - y), z, fma(a, (1.0 - t), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(y - Float64(2.0 - t)), b, Float64(x - Float64(z * -1.0))) tmp = 0.0 if (b <= -4.8e+129) tmp = t_1; elseif (b <= 5.4e+98) tmp = fma(Float64(1.0 - y), z, fma(a, Float64(1.0 - t), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - N[(2.0 - t), $MachinePrecision]), $MachinePrecision] * b + N[(x - N[(z * -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.8e+129], t$95$1, If[LessEqual[b, 5.4e+98], N[(N[(1.0 - y), $MachinePrecision] * z + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - \left(2 - t\right), b, x - z \cdot -1\right)\\
\mathbf{if}\;b \leq -4.8 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(a, 1 - t, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.7999999999999997e129 or 5.4e98 < 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.2
Applied rewrites73.2%
Taylor expanded in y around 0
Applied rewrites60.1%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites60.1%
if -4.7999999999999997e129 < b < 5.4e98Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
fp-cancel-sign-subN/A
+-commutativeN/A
*-commutativeN/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
lift-*.f64N/A
sub-negate-revN/A
lift-*.f64N/A
distribute-rgt-neg-outN/A
*-rgt-identityN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
Applied rewrites67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t (- 2.0 y)) b)))
(if (<= b -1.25e+154)
t_1
(if (<= b 3.8e+101) (fma (- 1.0 y) z (fma a (- 1.0 t) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - (2.0 - y)) * b;
double tmp;
if (b <= -1.25e+154) {
tmp = t_1;
} else if (b <= 3.8e+101) {
tmp = fma((1.0 - y), z, fma(a, (1.0 - t), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - Float64(2.0 - y)) * b) tmp = 0.0 if (b <= -1.25e+154) tmp = t_1; elseif (b <= 3.8e+101) tmp = fma(Float64(1.0 - y), z, fma(a, Float64(1.0 - t), x)); 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), $MachinePrecision]}, If[LessEqual[b, -1.25e+154], t$95$1, If[LessEqual[b, 3.8e+101], N[(N[(1.0 - y), $MachinePrecision] * z + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - \left(2 - y\right)\right) \cdot b\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(a, 1 - t, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.25000000000000001e154 or 3.7999999999999998e101 < b Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-rgt-neg-outN/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
sub-negate-revN/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
associate--l-N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
if -1.25000000000000001e154 < b < 3.7999999999999998e101Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
fp-cancel-sign-subN/A
+-commutativeN/A
*-commutativeN/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
lift-*.f64N/A
sub-negate-revN/A
lift-*.f64N/A
distribute-rgt-neg-outN/A
*-rgt-identityN/A
lift--.f64N/A
sub-negate-revN/A
*-commutativeN/A
Applied rewrites67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t (- 2.0 y)) b)))
(if (<= b -1.25e+154)
t_1
(if (<= b 3.8e+101) (fma (- 1.0 t) a (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - (2.0 - y)) * b;
double tmp;
if (b <= -1.25e+154) {
tmp = t_1;
} else if (b <= 3.8e+101) {
tmp = fma((1.0 - t), a, fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - Float64(2.0 - y)) * b) tmp = 0.0 if (b <= -1.25e+154) tmp = t_1; elseif (b <= 3.8e+101) tmp = fma(Float64(1.0 - t), a, fma(z, Float64(1.0 - y), x)); 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), $MachinePrecision]}, If[LessEqual[b, -1.25e+154], t$95$1, If[LessEqual[b, 3.8e+101], N[(N[(1.0 - t), $MachinePrecision] * a + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - \left(2 - y\right)\right) \cdot b\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.25000000000000001e154 or 3.7999999999999998e101 < b Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.8%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.5
Applied rewrites37.5%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-rgt-neg-outN/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
sub-negate-revN/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
associate--l-N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
if -1.25000000000000001e154 < b < 3.7999999999999998e101Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
*-commutativeN/A
associate--l-N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
sub-negate-revN/A
remove-double-negN/A
mul-1-negN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
remove-double-negN/A
sub-negate-revN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
Applied rewrites67.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -3.55e+75)
t_1
(if (<= t 2.3e+31) (- x (fma -1.0 a (* z (- y 1.0)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3.55e+75) {
tmp = t_1;
} else if (t <= 2.3e+31) {
tmp = x - fma(-1.0, a, (z * (y - 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -3.55e+75) tmp = t_1; elseif (t <= 2.3e+31) tmp = Float64(x - fma(-1.0, a, Float64(z * Float64(y - 1.0)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.55e+75], t$95$1, If[LessEqual[t, 2.3e+31], N[(x - N[(-1.0 * a + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -3.55 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+31}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.54999999999999991e75 or 2.3e31 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -3.54999999999999991e75 < t < 2.3e31Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6450.4
Applied rewrites50.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -5.6e+67) t_1 (if (<= t 2.3e+31) (- 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 <= -5.6e+67) {
tmp = t_1;
} else if (t <= 2.3e+31) {
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 <= (-5.6d+67)) then
tmp = t_1
else if (t <= 2.3d+31) 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 <= -5.6e+67) {
tmp = t_1;
} else if (t <= 2.3e+31) {
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 <= -5.6e+67: tmp = t_1 elif t <= 2.3e+31: 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 <= -5.6e+67) tmp = t_1; elseif (t <= 2.3e+31) 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 <= -5.6e+67) tmp = t_1; elseif (t <= 2.3e+31) 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, -5.6e+67], t$95$1, If[LessEqual[t, 2.3e+31], 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 -5.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+31}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.5999999999999995e67 or 2.3e31 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -5.5999999999999995e67 < t < 2.3e31Initial 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.2
Applied rewrites73.2%
Taylor expanded in y around 0
Applied rewrites60.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6441.3
Applied rewrites41.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -7.5e-28) t_1 (if (<= y 2.9e+16) (- 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 <= -7.5e-28) {
tmp = t_1;
} else if (y <= 2.9e+16) {
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 <= (-7.5d-28)) then
tmp = t_1
else if (y <= 2.9d+16) 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 <= -7.5e-28) {
tmp = t_1;
} else if (y <= 2.9e+16) {
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 <= -7.5e-28: tmp = t_1 elif y <= 2.9e+16: 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 <= -7.5e-28) tmp = t_1; elseif (y <= 2.9e+16) 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 <= -7.5e-28) tmp = t_1; elseif (y <= 2.9e+16) 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, -7.5e-28], t$95$1, If[LessEqual[y, 2.9e+16], 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 -7.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;x - a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5000000000000003e-28 or 2.9e16 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.0
Applied rewrites32.0%
if -7.5000000000000003e-28 < y < 2.9e16Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in t around inf
lower-*.f6432.8
Applied rewrites32.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -3.5e+61) t_1 (if (<= t 2.3e+31) (* y (- b z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3.5e+61) {
tmp = t_1;
} else if (t <= 2.3e+31) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-3.5d+61)) then
tmp = t_1
else if (t <= 2.3d+31) then
tmp = y * (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3.5e+61) {
tmp = t_1;
} else if (t <= 2.3e+31) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -3.5e+61: tmp = t_1 elif t <= 2.3e+31: tmp = y * (b - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -3.5e+61) tmp = t_1; elseif (t <= 2.3e+31) tmp = Float64(y * Float64(b - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -3.5e+61) tmp = t_1; elseif (t <= 2.3e+31) tmp = y * (b - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e+61], t$95$1, If[LessEqual[t, 2.3e+31], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.50000000000000018e61 or 2.3e31 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -3.50000000000000018e61 < t < 2.3e31Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.0
Applied rewrites32.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -3700000.0) t_1 (if (<= t 2.8e+30) (* y b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3700000.0) {
tmp = t_1;
} else if (t <= 2.8e+30) {
tmp = y * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-3700000.0d0)) then
tmp = t_1
else if (t <= 2.8d+30) then
tmp = y * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3700000.0) {
tmp = t_1;
} else if (t <= 2.8e+30) {
tmp = y * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -3700000.0: tmp = t_1 elif t <= 2.8e+30: tmp = y * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -3700000.0) tmp = t_1; elseif (t <= 2.8e+30) tmp = Float64(y * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -3700000.0) tmp = t_1; elseif (t <= 2.8e+30) tmp = y * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3700000.0], t$95$1, If[LessEqual[t, 2.8e+30], N[(y * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -3700000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+30}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.7e6 or 2.79999999999999983e30 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -3.7e6 < t < 2.79999999999999983e30Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.0
Applied rewrites32.0%
Taylor expanded in z around 0
Applied rewrites17.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.1e+188) (* y b) (if (<= b 8.1e+133) (* a (- 1.0 t)) (* y b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.1e+188) {
tmp = y * b;
} else if (b <= 8.1e+133) {
tmp = a * (1.0 - t);
} else {
tmp = y * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.1d+188)) then
tmp = y * b
else if (b <= 8.1d+133) then
tmp = a * (1.0d0 - t)
else
tmp = y * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.1e+188) {
tmp = y * b;
} else if (b <= 8.1e+133) {
tmp = a * (1.0 - t);
} else {
tmp = y * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.1e+188: tmp = y * b elif b <= 8.1e+133: tmp = a * (1.0 - t) else: tmp = y * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.1e+188) tmp = Float64(y * b); elseif (b <= 8.1e+133) tmp = Float64(a * Float64(1.0 - t)); else tmp = Float64(y * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.1e+188) tmp = y * b; elseif (b <= 8.1e+133) tmp = a * (1.0 - t); else tmp = y * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.1e+188], N[(y * b), $MachinePrecision], If[LessEqual[b, 8.1e+133], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], N[(y * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{+188}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;b \leq 8.1 \cdot 10^{+133}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot b\\
\end{array}
\end{array}
if b < -1.09999999999999999e188 or 8.0999999999999996e133 < b Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.0
Applied rewrites32.0%
Taylor expanded in z around 0
Applied rewrites17.1%
if -1.09999999999999999e188 < b < 8.0999999999999996e133Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2e+70) (* b t) (if (<= t 3.45e+106) (* y b) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2e+70) {
tmp = b * t;
} else if (t <= 3.45e+106) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2d+70)) then
tmp = b * t
else if (t <= 3.45d+106) then
tmp = y * b
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2e+70) {
tmp = b * t;
} else if (t <= 3.45e+106) {
tmp = y * b;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2e+70: tmp = b * t elif t <= 3.45e+106: tmp = y * b else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2e+70) tmp = Float64(b * t); elseif (t <= 3.45e+106) tmp = Float64(y * b); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2e+70) tmp = b * t; elseif (t <= 3.45e+106) tmp = y * b; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2e+70], N[(b * t), $MachinePrecision], If[LessEqual[t, 3.45e+106], N[(y * b), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+70}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{+106}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -2.00000000000000015e70 or 3.4499999999999999e106 < t 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.2
Applied rewrites73.2%
Taylor expanded in t around inf
lower-*.f6417.9
Applied rewrites17.9%
if -2.00000000000000015e70 < t < 3.4499999999999999e106Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.0
Applied rewrites32.0%
Taylor expanded in z around 0
Applied rewrites17.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.5e+24) (* b t) (if (<= t 3.5e+130) z (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.5e+24) {
tmp = b * t;
} else if (t <= 3.5e+130) {
tmp = z;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-7.5d+24)) then
tmp = b * t
else if (t <= 3.5d+130) then
tmp = z
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.5e+24) {
tmp = b * t;
} else if (t <= 3.5e+130) {
tmp = z;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.5e+24: tmp = b * t elif t <= 3.5e+130: tmp = z else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.5e+24) tmp = Float64(b * t); elseif (t <= 3.5e+130) tmp = z; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.5e+24) tmp = b * t; elseif (t <= 3.5e+130) tmp = z; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.5e+24], N[(b * t), $MachinePrecision], If[LessEqual[t, 3.5e+130], z, N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+24}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+130}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -7.50000000000000014e24 or 3.5000000000000001e130 < t 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.2
Applied rewrites73.2%
Taylor expanded in t around inf
lower-*.f6417.9
Applied rewrites17.9%
if -7.50000000000000014e24 < t < 3.5000000000000001e130Initial program 95.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.1
Applied rewrites28.1%
Taylor expanded in y around 0
Applied rewrites11.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.8e+85) a (if (<= a 6.5e+111) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.8e+85) {
tmp = a;
} else if (a <= 6.5e+111) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-5.8d+85)) then
tmp = a
else if (a <= 6.5d+111) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.8e+85) {
tmp = a;
} else if (a <= 6.5e+111) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.8e+85: tmp = a elif a <= 6.5e+111: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.8e+85) tmp = a; elseif (a <= 6.5e+111) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.8e+85) tmp = a; elseif (a <= 6.5e+111) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.8e+85], a, If[LessEqual[a, 6.5e+111], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+111}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -5.79999999999999995e85 or 6.5000000000000002e111 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
if -5.79999999999999995e85 < a < 6.5000000000000002e111Initial program 95.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.1
Applied rewrites28.1%
Taylor expanded in y around 0
Applied rewrites11.3%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in t around 0
Applied rewrites11.1%
herbie shell --seed 2025154
(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)))