
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (- (+ t y) 2.0) 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 + y) - 2.0), b, fma((1.0 - t), a, fma((1.0 - y), z, x)));
}
function code(x, y, z, t, a, b) return fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(1.0 - t), a, fma(Float64(1.0 - y), z, x))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(t + y), $MachinePrecision] - 2.0), $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(\left(t + y\right) - 2, 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.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.5e+35)
(fma (- (+ y t) 2.0) b (fma z (- 1.0 y) x))
(if (<= y 1.6e-6)
(+ x (+ z (fma a (- 1.0 t) (* b (- t 2.0)))))
(+ a (+ x (fma b (- y 2.0) (* z (- 1.0 y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.5e+35) {
tmp = fma(((y + t) - 2.0), b, fma(z, (1.0 - y), x));
} else if (y <= 1.6e-6) {
tmp = x + (z + fma(a, (1.0 - t), (b * (t - 2.0))));
} else {
tmp = a + (x + fma(b, (y - 2.0), (z * (1.0 - y))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.5e+35) tmp = fma(Float64(Float64(y + t) - 2.0), b, fma(z, Float64(1.0 - y), x)); elseif (y <= 1.6e-6) tmp = Float64(x + Float64(z + fma(a, Float64(1.0 - t), Float64(b * Float64(t - 2.0))))); else tmp = Float64(a + Float64(x + fma(b, Float64(y - 2.0), Float64(z * Float64(1.0 - y))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.5e+35], N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-6], N[(x + N[(z + N[(a * N[(1.0 - t), $MachinePrecision] + N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(x + N[(b * N[(y - 2.0), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(\left(y + t\right) - 2, b, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-6}:\\
\;\;\;\;x + \left(z + \mathsf{fma}\left(a, 1 - t, b \cdot \left(t - 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(x + \mathsf{fma}\left(b, y - 2, z \cdot \left(1 - y\right)\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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
Applied rewrites74.2%
if -3.5000000000000001e35 < y < 1.5999999999999999e-6Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if 1.5999999999999999e-6 < y Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.6
Applied rewrites70.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.4e+178)
(+ (fma (- 1.0 t) a x) (* b y))
(if (<= a 9e+145)
(fma (- (+ y t) 2.0) b (fma z (- 1.0 y) x))
(+ x (fma a (- 1.0 t) (* z (- 1.0 y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.4e+178) {
tmp = fma((1.0 - t), a, x) + (b * y);
} else if (a <= 9e+145) {
tmp = fma(((y + t) - 2.0), b, fma(z, (1.0 - y), x));
} else {
tmp = x + fma(a, (1.0 - t), (z * (1.0 - y)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.4e+178) tmp = Float64(fma(Float64(1.0 - t), a, x) + Float64(b * y)); elseif (a <= 9e+145) tmp = fma(Float64(Float64(y + t) - 2.0), b, fma(z, Float64(1.0 - y), x)); else tmp = Float64(x + fma(a, Float64(1.0 - t), Float64(z * Float64(1.0 - y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.4e+178], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+145], N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+178}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) + b \cdot y\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{fma}\left(\left(y + t\right) - 2, b, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(a, 1 - t, z \cdot \left(1 - y\right)\right)\\
\end{array}
\end{array}
if a < -1.39999999999999997e178Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6450.5
Applied rewrites50.5%
Taylor expanded in y around inf
lower-*.f6434.1
Applied rewrites34.1%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6457.4
Applied rewrites57.4%
if -1.39999999999999997e178 < a < 8.9999999999999996e145Initial 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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
Applied rewrites74.2%
if 8.9999999999999996e145 < a Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.6
Applied rewrites70.6%
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 (- 1.0 t) (* z (- 1.0 y)))) 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, (1.0 - t), (z * (1.0 - y)));
} 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(1.0 - t), 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[(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[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $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, 1 - t, z \cdot \left(1 - y\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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
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%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.6
Applied rewrites70.6%
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 (+ (fma (- 1.0 t) a x) (* b y))))
(if (<= a -8.2e+177)
t_1
(if (<= a 8.4e+130) (fma (- t 2.0) b (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 = fma((1.0 - t), a, x) + (b * y);
double tmp;
if (a <= -8.2e+177) {
tmp = t_1;
} else if (a <= 8.4e+130) {
tmp = fma((t - 2.0), b, fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(1.0 - t), a, x) + Float64(b * y)) tmp = 0.0 if (a <= -8.2e+177) tmp = t_1; elseif (a <= 8.4e+130) tmp = fma(Float64(t - 2.0), b, 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[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.2e+177], t$95$1, If[LessEqual[a, 8.4e+130], N[(N[(t - 2.0), $MachinePrecision] * b + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - t, a, x\right) + b \cdot y\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.4 \cdot 10^{+130}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.20000000000000029e177 or 8.39999999999999962e130 < a Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6450.5
Applied rewrites50.5%
Taylor expanded in y around inf
lower-*.f6434.1
Applied rewrites34.1%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6457.4
Applied rewrites57.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6457.4
Applied rewrites57.4%
if -8.20000000000000029e177 < a < 8.39999999999999962e130Initial 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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
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.2e+96)
t_1
(if (<= b 1.15e-21) (+ a (+ x (* z (- 1.0 y)))) 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.2e+96) {
tmp = t_1;
} else if (b <= 1.15e-21) {
tmp = a + (x + (z * (1.0 - y)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (b * ((t + y) - 2.0d0))
if (b <= (-7.2d+96)) then
tmp = t_1
else if (b <= 1.15d-21) then
tmp = a + (x + (z * (1.0d0 - y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (b * ((t + y) - 2.0));
double tmp;
if (b <= -7.2e+96) {
tmp = t_1;
} else if (b <= 1.15e-21) {
tmp = a + (x + (z * (1.0 - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (b * ((t + y) - 2.0)) tmp = 0 if b <= -7.2e+96: tmp = t_1 elif b <= 1.15e-21: tmp = a + (x + (z * (1.0 - y))) 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.2e+96) tmp = t_1; elseif (b <= 1.15e-21) tmp = Float64(a + Float64(x + Float64(z * Float64(1.0 - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (b * ((t + y) - 2.0)); tmp = 0.0; if (b <= -7.2e+96) tmp = t_1; elseif (b <= 1.15e-21) tmp = a + (x + (z * (1.0 - y))); else tmp = t_1; end tmp_2 = 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.2e+96], t$95$1, If[LessEqual[b, 1.15e-21], N[(a + N[(x + N[(z * N[(1.0 - y), $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.2 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;a + \left(x + z \cdot \left(1 - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -7.20000000000000026e96 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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
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.20000000000000026e96 < b < 1.15e-21Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.6
Applied rewrites70.6%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))))
(if (<= y -2.3e+22)
t_1
(if (<= y 1.15e-66)
(fma (- t 2.0) b (+ x z))
(if (<= y 3.5e+208) (+ a (+ x (* z (- 1.0 y)))) 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 <= -2.3e+22) {
tmp = t_1;
} else if (y <= 1.15e-66) {
tmp = fma((t - 2.0), b, (x + z));
} else if (y <= 3.5e+208) {
tmp = a + (x + (z * (1.0 - y)));
} 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 <= -2.3e+22) tmp = t_1; elseif (y <= 1.15e-66) tmp = fma(Float64(t - 2.0), b, Float64(x + z)); elseif (y <= 3.5e+208) tmp = Float64(a + Float64(x + 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[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+22], t$95$1, If[LessEqual[y, 1.15e-66], N[(N[(t - 2.0), $MachinePrecision] * b + N[(x + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+208], N[(a + N[(x + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x + z\right)\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+208}:\\
\;\;\;\;a + \left(x + z \cdot \left(1 - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3000000000000002e22 or 3.50000000000000016e208 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -2.3000000000000002e22 < y < 1.14999999999999996e-66Initial 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
sub-flipN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity46.2
Applied rewrites46.2%
if 1.14999999999999996e-66 < y < 3.50000000000000016e208Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
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.6
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6470.6
Applied rewrites70.6%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -2.3e+22) t_1 (if (<= y 195.0) (fma (- t 2.0) b (+ x z)) 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 <= -2.3e+22) {
tmp = t_1;
} else if (y <= 195.0) {
tmp = fma((t - 2.0), b, (x + z));
} 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 <= -2.3e+22) tmp = t_1; elseif (y <= 195.0) tmp = fma(Float64(t - 2.0), b, Float64(x + z)); 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, -2.3e+22], t$95$1, If[LessEqual[y, 195.0], N[(N[(t - 2.0), $MachinePrecision] * b + N[(x + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3000000000000002e22 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -2.3000000000000002e22 < 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
sub-flipN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity46.2
Applied rewrites46.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* y (- b z)))) (if (<= y -2.3e+22) 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 <= -2.3e+22) {
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 <= (-2.3d+22)) 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 <= -2.3e+22) {
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 <= -2.3e+22: 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 <= -2.3e+22) 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 <= -2.3e+22) 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, -2.3e+22], 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 -2.3 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 195:\\
\;\;\;\;x + b \cdot \left(t - 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3000000000000002e22 or 195 < y Initial program 95.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.2
Applied rewrites33.2%
if -2.3000000000000002e22 < 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%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6437.5
Applied rewrites37.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 (* t (- b a)))) (if (<= t -3.7e+36) t_1 (if (<= t 10200.0) (+ z x) 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.7e+36) {
tmp = t_1;
} else if (t <= 10200.0) {
tmp = z + x;
} 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.7d+36)) then
tmp = t_1
else if (t <= 10200.0d0) then
tmp = z + x
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.7e+36) {
tmp = t_1;
} else if (t <= 10200.0) {
tmp = z + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -3.7e+36: tmp = t_1 elif t <= 10200.0: tmp = z + x 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.7e+36) tmp = t_1; elseif (t <= 10200.0) tmp = Float64(z + x); 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.7e+36) tmp = t_1; elseif (t <= 10200.0) tmp = z + x; 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.7e+36], t$95$1, If[LessEqual[t, 10200.0], N[(z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10200:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.70000000000000029e36 or 10200 < t Initial program 95.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6433.1
Applied rewrites33.1%
if -3.70000000000000029e36 < t < 10200Initial 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%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity24.7
Applied rewrites24.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (- 1.0 t))))
(if (<= a -9.2e-21)
t_1
(if (<= a -1.35e-265) (* b t) (if (<= a 7.2e+138) (+ z x) 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.2e-21) {
tmp = t_1;
} else if (a <= -1.35e-265) {
tmp = b * t;
} else if (a <= 7.2e+138) {
tmp = z + x;
} 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.2d-21)) then
tmp = t_1
else if (a <= (-1.35d-265)) then
tmp = b * t
else if (a <= 7.2d+138) then
tmp = z + x
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.2e-21) {
tmp = t_1;
} else if (a <= -1.35e-265) {
tmp = b * t;
} else if (a <= 7.2e+138) {
tmp = z + x;
} 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.2e-21: tmp = t_1 elif a <= -1.35e-265: tmp = b * t elif a <= 7.2e+138: tmp = z + x 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.2e-21) tmp = t_1; elseif (a <= -1.35e-265) tmp = Float64(b * t); elseif (a <= 7.2e+138) tmp = Float64(z + x); 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.2e-21) tmp = t_1; elseif (a <= -1.35e-265) tmp = b * t; elseif (a <= 7.2e+138) tmp = z + x; 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.2e-21], t$95$1, If[LessEqual[a, -1.35e-265], N[(b * t), $MachinePrecision], If[LessEqual[a, 7.2e+138], N[(z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right)\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{-265}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+138}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.19999999999999998e-21 or 7.2000000000000002e138 < a Initial program 95.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.7
Applied rewrites28.7%
if -9.19999999999999998e-21 < a < -1.3500000000000001e-265Initial 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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
Applied rewrites74.2%
Taylor expanded in t around inf
lower-*.f6417.5
Applied rewrites17.5%
if -1.3500000000000001e-265 < a < 7.2000000000000002e138Initial 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%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity24.7
Applied rewrites24.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.6e+66) (* b t) (if (<= b 7.8e+34) (+ z x) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.6e+66) {
tmp = b * t;
} else if (b <= 7.8e+34) {
tmp = z + x;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-4.6d+66)) then
tmp = b * t
else if (b <= 7.8d+34) then
tmp = z + x
else
tmp = b * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.6e+66) {
tmp = b * t;
} else if (b <= 7.8e+34) {
tmp = z + x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.6e+66: tmp = b * t elif b <= 7.8e+34: tmp = z + x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.6e+66) tmp = Float64(b * t); elseif (b <= 7.8e+34) tmp = Float64(z + x); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.6e+66) tmp = b * t; elseif (b <= 7.8e+34) tmp = z + x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.6e+66], N[(b * t), $MachinePrecision], If[LessEqual[b, 7.8e+34], N[(z + x), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+66}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{+34}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if b < -4.6e66 or 7.80000000000000038e34 < 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
*-commutativeN/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lower-fma.f64N/A
sub-negate-revN/A
lift--.f64N/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.2
Applied rewrites74.2%
Taylor expanded in t around inf
lower-*.f6417.5
Applied rewrites17.5%
if -4.6e66 < b < 7.80000000000000038e34Initial 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%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity24.7
Applied rewrites24.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.12e+194) a (if (<= a 3e+139) (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.12e+194) {
tmp = a;
} else if (a <= 3e+139) {
tmp = z + x;
} 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.12d+194)) then
tmp = a
else if (a <= 3d+139) then
tmp = z + x
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.12e+194) {
tmp = a;
} else if (a <= 3e+139) {
tmp = z + x;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.12e+194: tmp = a elif a <= 3e+139: tmp = z + x else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.12e+194) tmp = a; elseif (a <= 3e+139) tmp = Float64(z + x); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.12e+194) tmp = a; elseif (a <= 3e+139) tmp = z + x; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.12e+194], a, If[LessEqual[a, 3e+139], N[(z + x), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{+194}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+139}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.11999999999999994e194 or 3e139 < 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.11999999999999994e194 < a < 3e139Initial 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%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity24.7
Applied rewrites24.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -8.5e+177) a (if (<= a 1.2e+16) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.5e+177) {
tmp = a;
} else if (a <= 1.2e+16) {
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 <= (-8.5d+177)) then
tmp = a
else if (a <= 1.2d+16) 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 <= -8.5e+177) {
tmp = a;
} else if (a <= 1.2e+16) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8.5e+177: tmp = a elif a <= 1.2e+16: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.5e+177) tmp = a; elseif (a <= 1.2e+16) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -8.5e+177) tmp = a; elseif (a <= 1.2e+16) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8.5e+177], a, If[LessEqual[a, 1.2e+16], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+177}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+16}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -8.5000000000000006e177 or 1.2e16 < 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 -8.5000000000000006e177 < a < 1.2e16Initial 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)))