
(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 22 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.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
(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 -4.8e+45)
t_1
(if (<= t 1.45e-5)
(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 <= -4.8e+45) {
tmp = t_1;
} else if (t <= 1.45e-5) {
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 <= -4.8e+45) tmp = t_1; elseif (t <= 1.45e-5) 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, -4.8e+45], t$95$1, If[LessEqual[t, 1.45e-5], 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 -4.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-5}:\\
\;\;\;\;\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 < -4.79999999999999979e45 or 1.45e-5 < t Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6470.6
Applied rewrites70.6%
if -4.79999999999999979e45 < t < 1.45e-5Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6470.9
Applied rewrites70.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -11200.0)
(- (+ x z) (fma a (- t 1.0) (* b (- 2.0 t))))
(if (<= a 5.5e+38)
(fma (- z) y (+ z (fma (- t (- 2.0 y)) b x)))
(- (+ x (* b (- (+ t y) 2.0))) (* a (- t 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -11200.0) {
tmp = (x + z) - fma(a, (t - 1.0), (b * (2.0 - t)));
} else if (a <= 5.5e+38) {
tmp = fma(-z, y, (z + fma((t - (2.0 - y)), b, x)));
} else {
tmp = (x + (b * ((t + y) - 2.0))) - (a * (t - 1.0));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -11200.0) tmp = Float64(Float64(x + z) - fma(a, Float64(t - 1.0), Float64(b * Float64(2.0 - t)))); elseif (a <= 5.5e+38) tmp = fma(Float64(-z), y, Float64(z + fma(Float64(t - Float64(2.0 - y)), b, x))); else tmp = Float64(Float64(x + Float64(b * Float64(Float64(t + y) - 2.0))) - Float64(a * Float64(t - 1.0))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -11200.0], N[(N[(x + z), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision] + N[(b * N[(2.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e+38], N[((-z) * y + N[(z + N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -11200:\\
\;\;\;\;\left(x + z\right) - \mathsf{fma}\left(a, t - 1, b \cdot \left(2 - t\right)\right)\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, z + \mathsf{fma}\left(t - \left(2 - y\right), b, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)\\
\end{array}
\end{array}
if a < -11200Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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 -11200 < a < 5.5000000000000003e38Initial program 95.6%
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.7
Applied rewrites73.7%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-lft-identityN/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites74.8%
if 5.5000000000000003e38 < a Initial program 95.6%
Taylor expanded in z around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- z) y (+ z (fma (- t (- 2.0 y)) b x)))))
(if (<= y -0.000195)
t_1
(if (<= y 2.9e+53) (- (+ 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(-z, y, (z + fma((t - (2.0 - y)), b, x)));
double tmp;
if (y <= -0.000195) {
tmp = t_1;
} else if (y <= 2.9e+53) {
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(-z), y, Float64(z + fma(Float64(t - Float64(2.0 - y)), b, x))) tmp = 0.0 if (y <= -0.000195) tmp = t_1; elseif (y <= 2.9e+53) 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[((-z) * y + N[(z + N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.000195], t$95$1, If[LessEqual[y, 2.9e+53], 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(-z, y, z + \mathsf{fma}\left(t - \left(2 - y\right), b, x\right)\right)\\
\mathbf{if}\;y \leq -0.000195:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+53}:\\
\;\;\;\;\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 < -1.94999999999999996e-4 or 2.9000000000000002e53 < y Initial program 95.6%
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.7
Applied rewrites73.7%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-lft-identityN/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites74.8%
if -1.94999999999999996e-4 < y < 2.9000000000000002e53Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t (- 2.0 y)) b (* (- z) y))))
(if (<= y -4.6e+69)
t_1
(if (<= y 2.4e+54) (- (+ 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, (-z * y));
double tmp;
if (y <= -4.6e+69) {
tmp = t_1;
} else if (y <= 2.4e+54) {
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, Float64(Float64(-z) * y)) tmp = 0.0 if (y <= -4.6e+69) tmp = t_1; elseif (y <= 2.4e+54) 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) * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+69], t$95$1, If[LessEqual[y, 2.4e+54], 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, \left(-z\right) \cdot y\right)\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+54}:\\
\;\;\;\;\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 < -4.60000000000000033e69 or 2.39999999999999998e54 < y Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6450.2
Applied rewrites50.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6451.1
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
lift--.f64N/A
lower--.f6451.1
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6451.1
Applied rewrites51.1%
if -4.60000000000000033e69 < y < 2.39999999999999998e54Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t (- 2.0 y)) b)))
(if (<= b -6.1e+64)
t_1
(if (<= b -3.7e-96)
(fma (- 1.0 y) z (- x (* -1.0 a)))
(if (<= b 3.7e+120) (- (+ x z) (* a (- t 1.0))) 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 <= -6.1e+64) {
tmp = t_1;
} else if (b <= -3.7e-96) {
tmp = fma((1.0 - y), z, (x - (-1.0 * a)));
} else if (b <= 3.7e+120) {
tmp = (x + z) - (a * (t - 1.0));
} 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 <= -6.1e+64) tmp = t_1; elseif (b <= -3.7e-96) tmp = fma(Float64(1.0 - y), z, Float64(x - Float64(-1.0 * a))); elseif (b <= 3.7e+120) tmp = Float64(Float64(x + z) - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.1e+64], t$95$1, If[LessEqual[b, -3.7e-96], N[(N[(1.0 - y), $MachinePrecision] * z + N[(x - N[(-1.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e+120], N[(N[(x + z), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $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 -6.1 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.7 \cdot 10^{-96}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x - -1 \cdot a\right)\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{+120}:\\
\;\;\;\;\left(x + z\right) - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.1000000000000001e64 or 3.70000000000000024e120 < b Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
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.8
Applied rewrites37.8%
if -6.1000000000000001e64 < b < -3.69999999999999986e-96Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6470.9
Applied rewrites70.9%
Taylor expanded in a around inf
lower-*.f6450.8
Applied rewrites50.8%
if -3.69999999999999986e-96 < b < 3.70000000000000024e120Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6451.4
Applied rewrites51.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t (- 2.0 y)) b (* (- z) y))))
(if (<= b -1.46e+60)
t_1
(if (<= b 3.3e+120) (- (+ x z) (* a (- t 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - (2.0 - y)), b, (-z * y));
double tmp;
if (b <= -1.46e+60) {
tmp = t_1;
} else if (b <= 3.3e+120) {
tmp = (x + z) - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - Float64(2.0 - y)), b, Float64(Float64(-z) * y)) tmp = 0.0 if (b <= -1.46e+60) tmp = t_1; elseif (b <= 3.3e+120) tmp = Float64(Float64(x + z) - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b + N[((-z) * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.46e+60], t$95$1, If[LessEqual[b, 3.3e+120], N[(N[(x + z), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - \left(2 - y\right), b, \left(-z\right) \cdot y\right)\\
\mathbf{if}\;b \leq -1.46 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{+120}:\\
\;\;\;\;\left(x + z\right) - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.4600000000000001e60 or 3.29999999999999991e120 < b Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6450.2
Applied rewrites50.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6451.1
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
lift--.f64N/A
lower--.f6451.1
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6451.1
Applied rewrites51.1%
if -1.4600000000000001e60 < b < 3.29999999999999991e120Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6451.4
Applied rewrites51.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t (- 2.0 y)) b)))
(if (<= b -2.4e+65)
t_1
(if (<= b 3.7e+120) (- (+ x z) (* a (- t 1.0))) 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 <= -2.4e+65) {
tmp = t_1;
} else if (b <= 3.7e+120) {
tmp = (x + z) - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - (2.0d0 - y)) * b
if (b <= (-2.4d+65)) then
tmp = t_1
else if (b <= 3.7d+120) then
tmp = (x + z) - (a * (t - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - (2.0 - y)) * b;
double tmp;
if (b <= -2.4e+65) {
tmp = t_1;
} else if (b <= 3.7e+120) {
tmp = (x + z) - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - (2.0 - y)) * b tmp = 0 if b <= -2.4e+65: tmp = t_1 elif b <= 3.7e+120: tmp = (x + z) - (a * (t - 1.0)) 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 <= -2.4e+65) tmp = t_1; elseif (b <= 3.7e+120) tmp = Float64(Float64(x + z) - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - (2.0 - y)) * b; tmp = 0.0; if (b <= -2.4e+65) tmp = t_1; elseif (b <= 3.7e+120) tmp = (x + z) - (a * (t - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - N[(2.0 - y), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.4e+65], t$95$1, If[LessEqual[b, 3.7e+120], N[(N[(x + z), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $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 -2.4 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{+120}:\\
\;\;\;\;\left(x + z\right) - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.4000000000000002e65 or 3.70000000000000024e120 < b Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
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.8
Applied rewrites37.8%
if -2.4000000000000002e65 < b < 3.70000000000000024e120Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6451.4
Applied rewrites51.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))))
(if (<= y -1.3e+29)
t_1
(if (<= y 1.15e-40)
(- (+ x z) (* b (- 2.0 t)))
(if (<= y 3.9e+55) (* a (- 1.0 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 <= -1.3e+29) {
tmp = t_1;
} else if (y <= 1.15e-40) {
tmp = (x + z) - (b * (2.0 - t));
} else if (y <= 3.9e+55) {
tmp = a * (1.0 - 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 <= (-1.3d+29)) then
tmp = t_1
else if (y <= 1.15d-40) then
tmp = (x + z) - (b * (2.0d0 - t))
else if (y <= 3.9d+55) then
tmp = a * (1.0d0 - 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 <= -1.3e+29) {
tmp = t_1;
} else if (y <= 1.15e-40) {
tmp = (x + z) - (b * (2.0 - t));
} else if (y <= 3.9e+55) {
tmp = a * (1.0 - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -1.3e+29: tmp = t_1 elif y <= 1.15e-40: tmp = (x + z) - (b * (2.0 - t)) elif y <= 3.9e+55: tmp = a * (1.0 - 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 <= -1.3e+29) tmp = t_1; elseif (y <= 1.15e-40) tmp = Float64(Float64(x + z) - Float64(b * Float64(2.0 - t))); elseif (y <= 3.9e+55) tmp = Float64(a * Float64(1.0 - 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 <= -1.3e+29) tmp = t_1; elseif (y <= 1.15e-40) tmp = (x + z) - (b * (2.0 - t)); elseif (y <= 3.9e+55) tmp = a * (1.0 - 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, -1.3e+29], t$95$1, If[LessEqual[y, 1.15e-40], N[(N[(x + z), $MachinePrecision] - N[(b * N[(2.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+55], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-40}:\\
\;\;\;\;\left(x + z\right) - b \cdot \left(2 - t\right)\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+55}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.3e29 or 3.90000000000000027e55 < y Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
if -1.3e29 < y < 1.15e-40Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6446.5
Applied rewrites46.5%
if 1.15e-40 < y < 3.90000000000000027e55Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- 2.0 t))) (t_2 (* y (- b z))))
(if (<= y -76.0)
t_2
(if (<= y -1.55e-189)
(- z t_1)
(if (<= y 2e-41) (- x t_1) (if (<= y 3.9e+55) (* a (- 1.0 t)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (2.0 - t);
double t_2 = y * (b - z);
double tmp;
if (y <= -76.0) {
tmp = t_2;
} else if (y <= -1.55e-189) {
tmp = z - t_1;
} else if (y <= 2e-41) {
tmp = x - t_1;
} else if (y <= 3.9e+55) {
tmp = a * (1.0 - t);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (2.0d0 - t)
t_2 = y * (b - z)
if (y <= (-76.0d0)) then
tmp = t_2
else if (y <= (-1.55d-189)) then
tmp = z - t_1
else if (y <= 2d-41) then
tmp = x - t_1
else if (y <= 3.9d+55) then
tmp = a * (1.0d0 - t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (2.0 - t);
double t_2 = y * (b - z);
double tmp;
if (y <= -76.0) {
tmp = t_2;
} else if (y <= -1.55e-189) {
tmp = z - t_1;
} else if (y <= 2e-41) {
tmp = x - t_1;
} else if (y <= 3.9e+55) {
tmp = a * (1.0 - t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (2.0 - t) t_2 = y * (b - z) tmp = 0 if y <= -76.0: tmp = t_2 elif y <= -1.55e-189: tmp = z - t_1 elif y <= 2e-41: tmp = x - t_1 elif y <= 3.9e+55: tmp = a * (1.0 - t) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(2.0 - t)) t_2 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -76.0) tmp = t_2; elseif (y <= -1.55e-189) tmp = Float64(z - t_1); elseif (y <= 2e-41) tmp = Float64(x - t_1); elseif (y <= 3.9e+55) tmp = Float64(a * Float64(1.0 - t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (2.0 - t); t_2 = y * (b - z); tmp = 0.0; if (y <= -76.0) tmp = t_2; elseif (y <= -1.55e-189) tmp = z - t_1; elseif (y <= 2e-41) tmp = x - t_1; elseif (y <= 3.9e+55) tmp = a * (1.0 - t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(2.0 - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -76.0], t$95$2, If[LessEqual[y, -1.55e-189], N[(z - t$95$1), $MachinePrecision], If[LessEqual[y, 2e-41], N[(x - t$95$1), $MachinePrecision], If[LessEqual[y, 3.9e+55], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(2 - t\right)\\
t_2 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -76:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-189}:\\
\;\;\;\;z - t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-41}:\\
\;\;\;\;x - t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+55}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -76 or 3.90000000000000027e55 < y Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
if -76 < y < -1.55e-189Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6446.5
Applied rewrites46.5%
Taylor expanded in x around 0
Applied rewrites32.6%
if -1.55e-189 < y < 2.00000000000000001e-41Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6437.3
Applied rewrites37.3%
if 2.00000000000000001e-41 < y < 3.90000000000000027e55Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))))
(if (<= y -1.3e+29)
t_1
(if (<= y 2e-41)
(- x (* b (- 2.0 t)))
(if (<= y 3.9e+55) (* a (- 1.0 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 <= -1.3e+29) {
tmp = t_1;
} else if (y <= 2e-41) {
tmp = x - (b * (2.0 - t));
} else if (y <= 3.9e+55) {
tmp = a * (1.0 - 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 <= (-1.3d+29)) then
tmp = t_1
else if (y <= 2d-41) then
tmp = x - (b * (2.0d0 - t))
else if (y <= 3.9d+55) then
tmp = a * (1.0d0 - 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 <= -1.3e+29) {
tmp = t_1;
} else if (y <= 2e-41) {
tmp = x - (b * (2.0 - t));
} else if (y <= 3.9e+55) {
tmp = a * (1.0 - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b - z) tmp = 0 if y <= -1.3e+29: tmp = t_1 elif y <= 2e-41: tmp = x - (b * (2.0 - t)) elif y <= 3.9e+55: tmp = a * (1.0 - 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 <= -1.3e+29) tmp = t_1; elseif (y <= 2e-41) tmp = Float64(x - Float64(b * Float64(2.0 - t))); elseif (y <= 3.9e+55) tmp = Float64(a * Float64(1.0 - 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 <= -1.3e+29) tmp = t_1; elseif (y <= 2e-41) tmp = x - (b * (2.0 - t)); elseif (y <= 3.9e+55) tmp = a * (1.0 - 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, -1.3e+29], t$95$1, If[LessEqual[y, 2e-41], N[(x - N[(b * N[(2.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+55], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-41}:\\
\;\;\;\;x - b \cdot \left(2 - t\right)\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+55}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.3e29 or 3.90000000000000027e55 < y Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
if -1.3e29 < y < 2.00000000000000001e-41Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6437.3
Applied rewrites37.3%
if 2.00000000000000001e-41 < y < 3.90000000000000027e55Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -4.6e+50)
t_1
(if (<= t 1.05e+28) (fma (- 1.0 y) z (* b y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -4.6e+50) {
tmp = t_1;
} else if (t <= 1.05e+28) {
tmp = fma((1.0 - y), z, (b * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -4.6e+50) tmp = t_1; elseif (t <= 1.05e+28) tmp = fma(Float64(1.0 - y), z, Float64(b * y)); 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, -4.6e+50], t$95$1, If[LessEqual[t, 1.05e+28], N[(N[(1.0 - y), $MachinePrecision] * z + N[(b * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, b \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.59999999999999994e50 or 1.04999999999999995e28 < t Initial program 95.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -4.59999999999999994e50 < t < 1.04999999999999995e28Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in y around inf
lower-*.f6441.3
Applied rewrites41.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -4.8e+45)
t_1
(if (<= t 2.5e-203)
(* y (- b z))
(if (<= t 9.2e-105)
(* (- y 2.0) b)
(if (<= t 6e+24) (* z (- 1.0 y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -4.8e+45) {
tmp = t_1;
} else if (t <= 2.5e-203) {
tmp = y * (b - z);
} else if (t <= 9.2e-105) {
tmp = (y - 2.0) * b;
} else if (t <= 6e+24) {
tmp = 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 = t * (b - a)
if (t <= (-4.8d+45)) then
tmp = t_1
else if (t <= 2.5d-203) then
tmp = y * (b - z)
else if (t <= 9.2d-105) then
tmp = (y - 2.0d0) * b
else if (t <= 6d+24) then
tmp = 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 = t * (b - a);
double tmp;
if (t <= -4.8e+45) {
tmp = t_1;
} else if (t <= 2.5e-203) {
tmp = y * (b - z);
} else if (t <= 9.2e-105) {
tmp = (y - 2.0) * b;
} else if (t <= 6e+24) {
tmp = z * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -4.8e+45: tmp = t_1 elif t <= 2.5e-203: tmp = y * (b - z) elif t <= 9.2e-105: tmp = (y - 2.0) * b elif t <= 6e+24: tmp = z * (1.0 - y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -4.8e+45) tmp = t_1; elseif (t <= 2.5e-203) tmp = Float64(y * Float64(b - z)); elseif (t <= 9.2e-105) tmp = Float64(Float64(y - 2.0) * b); elseif (t <= 6e+24) tmp = 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 = t * (b - a); tmp = 0.0; if (t <= -4.8e+45) tmp = t_1; elseif (t <= 2.5e-203) tmp = y * (b - z); elseif (t <= 9.2e-105) tmp = (y - 2.0) * b; elseif (t <= 6e+24) tmp = 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[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+45], t$95$1, If[LessEqual[t, 2.5e-203], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-105], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 6e+24], N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-203}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-105}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+24}:\\
\;\;\;\;z \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999979e45 or 5.9999999999999999e24 < t Initial program 95.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -4.79999999999999979e45 < t < 2.5000000000000001e-203Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
if 2.5000000000000001e-203 < t < 9.2000000000000004e-105Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
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.8
Applied rewrites37.8%
Taylor expanded in t around 0
lower--.f6424.6
Applied rewrites24.6%
if 9.2000000000000004e-105 < t < 5.9999999999999999e24Initial program 95.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6427.8
Applied rewrites27.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -4.8e+45) t_1 (if (<= t 8.5e+24) (* y (- b z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -4.8e+45) {
tmp = t_1;
} else if (t <= 8.5e+24) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-4.8d+45)) then
tmp = t_1
else if (t <= 8.5d+24) then
tmp = y * (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -4.8e+45) {
tmp = t_1;
} else if (t <= 8.5e+24) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -4.8e+45: tmp = t_1 elif t <= 8.5e+24: tmp = y * (b - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -4.8e+45) tmp = t_1; elseif (t <= 8.5e+24) tmp = Float64(y * Float64(b - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -4.8e+45) tmp = t_1; elseif (t <= 8.5e+24) tmp = y * (b - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+45], t$95$1, If[LessEqual[t, 8.5e+24], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+24}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999979e45 or 8.49999999999999959e24 < t Initial program 95.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -4.79999999999999979e45 < t < 8.49999999999999959e24Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -4.8e+45) t_1 (if (<= t 0.7) (* (- y 2.0) 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 <= -4.8e+45) {
tmp = t_1;
} else if (t <= 0.7) {
tmp = (y - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-4.8d+45)) then
tmp = t_1
else if (t <= 0.7d0) then
tmp = (y - 2.0d0) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -4.8e+45) {
tmp = t_1;
} else if (t <= 0.7) {
tmp = (y - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -4.8e+45: tmp = t_1 elif t <= 0.7: tmp = (y - 2.0) * 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 <= -4.8e+45) tmp = t_1; elseif (t <= 0.7) tmp = Float64(Float64(y - 2.0) * 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 <= -4.8e+45) tmp = t_1; elseif (t <= 0.7) tmp = (y - 2.0) * 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, -4.8e+45], t$95$1, If[LessEqual[t, 0.7], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 0.7:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999979e45 or 0.69999999999999996 < t Initial program 95.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7
Applied rewrites32.7%
if -4.79999999999999979e45 < t < 0.69999999999999996Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
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.8
Applied rewrites37.8%
Taylor expanded in t around 0
lower--.f6424.6
Applied rewrites24.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (- 1.0 t)))) (if (<= a -8000.0) t_1 (if (<= a 2.4e+26) (* (- y 2.0) b) 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 <= -8000.0) {
tmp = t_1;
} else if (a <= 2.4e+26) {
tmp = (y - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (1.0d0 - t)
if (a <= (-8000.0d0)) then
tmp = t_1
else if (a <= 2.4d+26) then
tmp = (y - 2.0d0) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (1.0 - t);
double tmp;
if (a <= -8000.0) {
tmp = t_1;
} else if (a <= 2.4e+26) {
tmp = (y - 2.0) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (1.0 - t) tmp = 0 if a <= -8000.0: tmp = t_1 elif a <= 2.4e+26: tmp = (y - 2.0) * b 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 <= -8000.0) tmp = t_1; elseif (a <= 2.4e+26) tmp = Float64(Float64(y - 2.0) * b); 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 <= -8000.0) tmp = t_1; elseif (a <= 2.4e+26) tmp = (y - 2.0) * b; 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, -8000.0], t$95$1, If[LessEqual[a, 2.4e+26], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right)\\
\mathbf{if}\;a \leq -8000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+26}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8e3 or 2.40000000000000005e26 < a Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
if -8e3 < a < 2.40000000000000005e26Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
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.8
Applied rewrites37.8%
Taylor expanded in t around 0
lower--.f6424.6
Applied rewrites24.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9.5e+45) (* b t) (if (<= t 3.1e-9) (* (- y 2.0) b) (* b (- t 2.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.5e+45) {
tmp = b * t;
} else if (t <= 3.1e-9) {
tmp = (y - 2.0) * b;
} else {
tmp = b * (t - 2.0);
}
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 <= (-9.5d+45)) then
tmp = b * t
else if (t <= 3.1d-9) then
tmp = (y - 2.0d0) * b
else
tmp = b * (t - 2.0d0)
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 <= -9.5e+45) {
tmp = b * t;
} else if (t <= 3.1e-9) {
tmp = (y - 2.0) * b;
} else {
tmp = b * (t - 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.5e+45: tmp = b * t elif t <= 3.1e-9: tmp = (y - 2.0) * b else: tmp = b * (t - 2.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.5e+45) tmp = Float64(b * t); elseif (t <= 3.1e-9) tmp = Float64(Float64(y - 2.0) * b); else tmp = Float64(b * Float64(t - 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.5e+45) tmp = b * t; elseif (t <= 3.1e-9) tmp = (y - 2.0) * b; else tmp = b * (t - 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.5e+45], N[(b * t), $MachinePrecision], If[LessEqual[t, 3.1e-9], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+45}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-9}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(t - 2\right)\\
\end{array}
\end{array}
if t < -9.4999999999999998e45Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
Taylor expanded in t around inf
lower-*.f6417.3
Applied rewrites17.3%
if -9.4999999999999998e45 < t < 3.10000000000000005e-9Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
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.8
Applied rewrites37.8%
Taylor expanded in t around 0
lower--.f6424.6
Applied rewrites24.6%
if 3.10000000000000005e-9 < t Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.4
Applied rewrites23.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.8e+47) (* y b) (if (<= y 0.0048) (* b (- t 2.0)) (* y b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.8e+47) {
tmp = y * b;
} else if (y <= 0.0048) {
tmp = b * (t - 2.0);
} 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 (y <= (-1.8d+47)) then
tmp = y * b
else if (y <= 0.0048d0) then
tmp = b * (t - 2.0d0)
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 (y <= -1.8e+47) {
tmp = y * b;
} else if (y <= 0.0048) {
tmp = b * (t - 2.0);
} else {
tmp = y * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.8e+47: tmp = y * b elif y <= 0.0048: tmp = b * (t - 2.0) else: tmp = y * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.8e+47) tmp = Float64(y * b); elseif (y <= 0.0048) tmp = Float64(b * Float64(t - 2.0)); else tmp = Float64(y * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.8e+47) tmp = y * b; elseif (y <= 0.0048) tmp = b * (t - 2.0); else tmp = y * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.8e+47], N[(y * b), $MachinePrecision], If[LessEqual[y, 0.0048], N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision], N[(y * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+47}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;y \leq 0.0048:\\
\;\;\;\;b \cdot \left(t - 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot b\\
\end{array}
\end{array}
if y < -1.80000000000000004e47 or 0.00479999999999999958 < y Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
Taylor expanded in z around 0
Applied rewrites18.5%
if -1.80000000000000004e47 < y < 0.00479999999999999958Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.4
Applied rewrites23.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9.5e+45) (* b t) (if (<= t 4.6e-153) (* y b) (if (<= t 9e+16) (* b -2.0) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.5e+45) {
tmp = b * t;
} else if (t <= 4.6e-153) {
tmp = y * b;
} else if (t <= 9e+16) {
tmp = b * -2.0;
} 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 <= (-9.5d+45)) then
tmp = b * t
else if (t <= 4.6d-153) then
tmp = y * b
else if (t <= 9d+16) then
tmp = b * (-2.0d0)
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 <= -9.5e+45) {
tmp = b * t;
} else if (t <= 4.6e-153) {
tmp = y * b;
} else if (t <= 9e+16) {
tmp = b * -2.0;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.5e+45: tmp = b * t elif t <= 4.6e-153: tmp = y * b elif t <= 9e+16: tmp = b * -2.0 else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.5e+45) tmp = Float64(b * t); elseif (t <= 4.6e-153) tmp = Float64(y * b); elseif (t <= 9e+16) tmp = Float64(b * -2.0); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.5e+45) tmp = b * t; elseif (t <= 4.6e-153) tmp = y * b; elseif (t <= 9e+16) tmp = b * -2.0; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.5e+45], N[(b * t), $MachinePrecision], If[LessEqual[t, 4.6e-153], N[(y * b), $MachinePrecision], If[LessEqual[t, 9e+16], N[(b * -2.0), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+45}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-153}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+16}:\\
\;\;\;\;b \cdot -2\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -9.4999999999999998e45 or 9e16 < t Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
Taylor expanded in t around inf
lower-*.f6417.3
Applied rewrites17.3%
if -9.4999999999999998e45 < t < 4.59999999999999994e-153Initial program 95.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6433.0
Applied rewrites33.0%
Taylor expanded in z around 0
Applied rewrites18.5%
if 4.59999999999999994e-153 < t < 9e16Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.4
Applied rewrites23.4%
Taylor expanded in t around 0
Applied rewrites8.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.6e+28) (* b t) (if (<= t 5.2e-150) a (if (<= t 9e+16) (* b -2.0) (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.6e+28) {
tmp = b * t;
} else if (t <= 5.2e-150) {
tmp = a;
} else if (t <= 9e+16) {
tmp = b * -2.0;
} 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 <= (-3.6d+28)) then
tmp = b * t
else if (t <= 5.2d-150) then
tmp = a
else if (t <= 9d+16) then
tmp = b * (-2.0d0)
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 <= -3.6e+28) {
tmp = b * t;
} else if (t <= 5.2e-150) {
tmp = a;
} else if (t <= 9e+16) {
tmp = b * -2.0;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.6e+28: tmp = b * t elif t <= 5.2e-150: tmp = a elif t <= 9e+16: tmp = b * -2.0 else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.6e+28) tmp = Float64(b * t); elseif (t <= 5.2e-150) tmp = a; elseif (t <= 9e+16) tmp = Float64(b * -2.0); else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.6e+28) tmp = b * t; elseif (t <= 5.2e-150) tmp = a; elseif (t <= 9e+16) tmp = b * -2.0; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.6e+28], N[(b * t), $MachinePrecision], If[LessEqual[t, 5.2e-150], a, If[LessEqual[t, 9e+16], N[(b * -2.0), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+28}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-150}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+16}:\\
\;\;\;\;b \cdot -2\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -3.5999999999999999e28 or 9e16 < t Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
Taylor expanded in t around inf
lower-*.f6417.3
Applied rewrites17.3%
if -3.5999999999999999e28 < t < 5.1999999999999995e-150Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
Taylor expanded in t around 0
Applied rewrites11.0%
if 5.1999999999999995e-150 < t < 9e16Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/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%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.4
Applied rewrites23.4%
Taylor expanded in t around 0
Applied rewrites8.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.6e+28) (* b t) (if (<= t 1.86) a (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.6e+28) {
tmp = b * t;
} else if (t <= 1.86) {
tmp = a;
} 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 <= (-3.6d+28)) then
tmp = b * t
else if (t <= 1.86d0) then
tmp = a
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 <= -3.6e+28) {
tmp = b * t;
} else if (t <= 1.86) {
tmp = a;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.6e+28: tmp = b * t elif t <= 1.86: tmp = a else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.6e+28) tmp = Float64(b * t); elseif (t <= 1.86) tmp = a; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.6e+28) tmp = b * t; elseif (t <= 1.86) tmp = a; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.6e+28], N[(b * t), $MachinePrecision], If[LessEqual[t, 1.86], a, N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+28}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 1.86:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -3.5999999999999999e28 or 1.8600000000000001 < t Initial program 95.6%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
sub-flipN/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
add-flip-revN/A
sub-negate-revN/A
Applied rewrites97.6%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.8
Applied rewrites37.8%
Taylor expanded in t around inf
lower-*.f6417.3
Applied rewrites17.3%
if -3.5999999999999999e28 < t < 1.8600000000000001Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
Taylor expanded in t around 0
Applied rewrites11.0%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 95.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6428.2
Applied rewrites28.2%
Taylor expanded in t around 0
Applied rewrites11.0%
herbie shell --seed 2025149
(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)))