
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)) (t_2 (* (- y 1.0) z)))
(if (<= (+ (- (- x t_2) (* (- t 1.0) a)) t_1) INFINITY)
(+ (- (fma (- 1.0 t) a x) t_2) t_1)
(* (* (- (/ b a) 1.0) a) t))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double t_2 = (y - 1.0) * z;
double tmp;
if ((((x - t_2) - ((t - 1.0) * a)) + t_1) <= ((double) INFINITY)) {
tmp = (fma((1.0 - t), a, x) - t_2) + t_1;
} else {
tmp = (((b / a) - 1.0) * a) * t;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) t_2 = Float64(Float64(y - 1.0) * z) tmp = 0.0 if (Float64(Float64(Float64(x - t_2) - Float64(Float64(t - 1.0) * a)) + t_1) <= Inf) tmp = Float64(Float64(fma(Float64(1.0 - t), a, x) - t_2) + t_1); else tmp = Float64(Float64(Float64(Float64(b / a) - 1.0) * a) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - t$95$2), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] - t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(N[(b / a), $MachinePrecision] - 1.0), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
t_2 := \left(y - 1\right) \cdot z\\
\mathbf{if}\;\left(\left(x - t\_2\right) - \left(t - 1\right) \cdot a\right) + t\_1 \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(1 - t, a, x\right) - t\_2\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{b}{a} - 1\right) \cdot a\right) \cdot t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 95.3%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6495.3
Applied rewrites95.3%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 95.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6432.9
Applied rewrites32.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -130000000.0)
(+ (- (- x (* (+ (/ (- z) y) z) y)) (* (- t 1.0) a)) (* b y))
(if (<= y 1.7)
(- (fma (- t 2.0) b x) (fma (- t 1.0) a (- z)))
(+ (fma (- b z) y (- (* (- t 2.0) b) (* a t))) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -130000000.0) {
tmp = ((x - (((-z / y) + z) * y)) - ((t - 1.0) * a)) + (b * y);
} else if (y <= 1.7) {
tmp = fma((t - 2.0), b, x) - fma((t - 1.0), a, -z);
} else {
tmp = fma((b - z), y, (((t - 2.0) * b) - (a * t))) + x;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -130000000.0) tmp = Float64(Float64(Float64(x - Float64(Float64(Float64(Float64(-z) / y) + z) * y)) - Float64(Float64(t - 1.0) * a)) + Float64(b * y)); elseif (y <= 1.7) tmp = Float64(fma(Float64(t - 2.0), b, x) - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = Float64(fma(Float64(b - z), y, Float64(Float64(Float64(t - 2.0) * b) - Float64(a * t))) + x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -130000000.0], N[(N[(N[(x - N[(N[(N[((-z) / y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7], N[(N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -130000000:\\
\;\;\;\;\left(\left(x - \left(\frac{-z}{y} + z\right) \cdot y\right) - \left(t - 1\right) \cdot a\right) + b \cdot y\\
\mathbf{elif}\;y \leq 1.7:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x\right) - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b - a \cdot t\right) + x\\
\end{array}
\end{array}
if y < -1.3e8Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6485.0
Applied rewrites85.0%
Taylor expanded in y around inf
lower-*.f6470.3
Applied rewrites70.3%
if -1.3e8 < y < 1.69999999999999996Initial program 95.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6468.8
Applied rewrites68.8%
if 1.69999999999999996 < y Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6477.5
Applied rewrites77.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7.8e-8)
(- (fma (- (+ t y) 2.0) b x) (* (- y 1.0) z))
(if (<= y 1.7)
(- (fma (- t 2.0) b x) (fma (- t 1.0) a (- z)))
(+ (fma (- b z) y (- (* (- t 2.0) b) (* a t))) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.8e-8) {
tmp = fma(((t + y) - 2.0), b, x) - ((y - 1.0) * z);
} else if (y <= 1.7) {
tmp = fma((t - 2.0), b, x) - fma((t - 1.0), a, -z);
} else {
tmp = fma((b - z), y, (((t - 2.0) * b) - (a * t))) + x;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.8e-8) tmp = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(Float64(y - 1.0) * z)); elseif (y <= 1.7) tmp = Float64(fma(Float64(t - 2.0), b, x) - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = Float64(fma(Float64(b - z), y, Float64(Float64(Float64(t - 2.0) * b) - Float64(a * t))) + x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.8e-8], N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7], N[(N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;y \leq 1.7:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x\right) - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b - a \cdot t\right) + x\\
\end{array}
\end{array}
if y < -7.7999999999999997e-8Initial program 95.3%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.4
Applied rewrites74.4%
if -7.7999999999999997e-8 < y < 1.69999999999999996Initial program 95.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6468.8
Applied rewrites68.8%
if 1.69999999999999996 < y Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6477.5
Applied rewrites77.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (fma (- (+ t y) 2.0) b x) (* (- y 1.0) z))))
(if (<= y -7.8e-8)
t_1
(if (<= y 0.039) (- (fma (- t 2.0) b x) (fma (- t 1.0) a (- z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x) - ((y - 1.0) * z);
double tmp;
if (y <= -7.8e-8) {
tmp = t_1;
} else if (y <= 0.039) {
tmp = fma((t - 2.0), b, x) - fma((t - 1.0), a, -z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(Float64(y - 1.0) * z)) tmp = 0.0 if (y <= -7.8e-8) tmp = t_1; elseif (y <= 0.039) tmp = Float64(fma(Float64(t - 2.0), b, x) - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e-8], t$95$1, If[LessEqual[y, 0.039], N[(N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(y - 1\right) \cdot z\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.039:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x\right) - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.7999999999999997e-8 or 0.0389999999999999999 < y Initial program 95.3%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.4
Applied rewrites74.4%
if -7.7999999999999997e-8 < y < 0.0389999999999999999Initial program 95.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6468.8
Applied rewrites68.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (- (+ t y) 2.0) b x)) (t_2 (- t_1 (* (- y 1.0) z)))) (if (<= z -4e+17) t_2 (if (<= z 1.25e+44) (- t_1 (* (- t 1.0) a)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x);
double t_2 = t_1 - ((y - 1.0) * z);
double tmp;
if (z <= -4e+17) {
tmp = t_2;
} else if (z <= 1.25e+44) {
tmp = t_1 - ((t - 1.0) * a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, x) t_2 = Float64(t_1 - Float64(Float64(y - 1.0) * z)) tmp = 0.0 if (z <= -4e+17) tmp = t_2; elseif (z <= 1.25e+44) tmp = Float64(t_1 - Float64(Float64(t - 1.0) * a)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+17], t$95$2, If[LessEqual[z, 1.25e+44], N[(t$95$1 - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\\
t_2 := t\_1 - \left(y - 1\right) \cdot z\\
\mathbf{if}\;z \leq -4 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+44}:\\
\;\;\;\;t\_1 - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4e17 or 1.2499999999999999e44 < z Initial program 95.3%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.4
Applied rewrites74.4%
if -4e17 < z < 1.2499999999999999e44Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (fma a (- t 1.0) (* z (- y 1.0))))))
(if (<= z -4.8e+17)
t_1
(if (<= z 1.8e+92) (- (fma (- (+ t y) 2.0) b x) (* (- t 1.0) a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - fma(a, (t - 1.0), (z * (y - 1.0)));
double tmp;
if (z <= -4.8e+17) {
tmp = t_1;
} else if (z <= 1.8e+92) {
tmp = fma(((t + y) - 2.0), b, x) - ((t - 1.0) * a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))) tmp = 0.0 if (z <= -4.8e+17) tmp = t_1; elseif (z <= 1.8e+92) tmp = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(Float64(t - 1.0) * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+17], t$95$1, If[LessEqual[z, 1.8e+92], N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+92}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.8e17 or 1.8e92 < z Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower--.f6467.7
Applied rewrites67.7%
if -4.8e17 < z < 1.8e92Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8.5e+80)
(+ (* (- a) t) (* (- (+ y t) 2.0) b))
(if (<= b 2.65e+95)
(- x (fma a (- t 1.0) (* z (- y 1.0))))
(fma (- (+ t y) 2.0) b (- x (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e+80) {
tmp = (-a * t) + (((y + t) - 2.0) * b);
} else if (b <= 2.65e+95) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = fma(((t + y) - 2.0), b, (x - -a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.5e+80) tmp = Float64(Float64(Float64(-a) * t) + Float64(Float64(Float64(y + t) - 2.0) * b)); elseif (b <= 2.65e+95) tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); else tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(x - Float64(-a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.5e+80], N[(N[((-a) * t), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.65e+95], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(x - (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{+80}:\\
\;\;\;\;\left(-a\right) \cdot t + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{+95}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x - \left(-a\right)\right)\\
\end{array}
\end{array}
if b < -8.50000000000000007e80Initial program 95.3%
Taylor expanded in t around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.8
Applied rewrites49.8%
if -8.50000000000000007e80 < b < 2.6500000000000001e95Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower--.f6467.7
Applied rewrites67.7%
if 2.6500000000000001e95 < b Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6460.3
Applied rewrites60.3%
lift--.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate--l+N/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f64N/A
lower--.f6460.3
Applied rewrites60.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- (* z y)) (* (- (+ y t) 2.0) b))))
(if (<= y -1.55e+28)
t_1
(if (<= y 44000.0) (+ x (- (* b t) (* (- t 1.0) a))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(z * y) + (((y + t) - 2.0) * b);
double tmp;
if (y <= -1.55e+28) {
tmp = t_1;
} else if (y <= 44000.0) {
tmp = x + ((b * t) - ((t - 1.0) * a));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = -(z * y) + (((y + t) - 2.0d0) * b)
if (y <= (-1.55d+28)) then
tmp = t_1
else if (y <= 44000.0d0) then
tmp = x + ((b * t) - ((t - 1.0d0) * a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(z * y) + (((y + t) - 2.0) * b);
double tmp;
if (y <= -1.55e+28) {
tmp = t_1;
} else if (y <= 44000.0) {
tmp = x + ((b * t) - ((t - 1.0) * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -(z * y) + (((y + t) - 2.0) * b) tmp = 0 if y <= -1.55e+28: tmp = t_1 elif y <= 44000.0: tmp = x + ((b * t) - ((t - 1.0) * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-Float64(z * y)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (y <= -1.55e+28) tmp = t_1; elseif (y <= 44000.0) tmp = Float64(x + Float64(Float64(b * t) - Float64(Float64(t - 1.0) * a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -(z * y) + (((y + t) - 2.0) * b); tmp = 0.0; if (y <= -1.55e+28) tmp = t_1; elseif (y <= 44000.0) tmp = x + ((b * t) - ((t - 1.0) * a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-N[(z * y), $MachinePrecision]) + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+28], t$95$1, If[LessEqual[y, 44000.0], N[(x + N[(N[(b * t), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-z \cdot y\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 44000:\\
\;\;\;\;x + \left(b \cdot t - \left(t - 1\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.55e28 or 44000 < y Initial program 95.3%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.8
Applied rewrites50.8%
if -1.55e28 < y < 44000Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6462.4
Applied rewrites62.4%
Taylor expanded in z around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f6453.0
Applied rewrites53.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -6e-88)
(- (fma t_1 b x) (- a))
(if (<= b 1.2e+36)
(+ x (- (* (- y) z) (* a t)))
(fma t_1 b (- x (- a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -6e-88) {
tmp = fma(t_1, b, x) - -a;
} else if (b <= 1.2e+36) {
tmp = x + ((-y * z) - (a * t));
} else {
tmp = fma(t_1, b, (x - -a));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -6e-88) tmp = Float64(fma(t_1, b, x) - Float64(-a)); elseif (b <= 1.2e+36) tmp = Float64(x + Float64(Float64(Float64(-y) * z) - Float64(a * t))); else tmp = fma(t_1, b, Float64(x - Float64(-a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -6e-88], N[(N[(t$95$1 * b + x), $MachinePrecision] - (-a)), $MachinePrecision], If[LessEqual[b, 1.2e+36], N[(x + N[(N[((-y) * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[(x - (-a)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -6 \cdot 10^{-88}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x\right) - \left(-a\right)\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+36}:\\
\;\;\;\;x + \left(\left(-y\right) \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x - \left(-a\right)\right)\\
\end{array}
\end{array}
if b < -5.9999999999999999e-88Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6460.3
Applied rewrites60.3%
if -5.9999999999999999e-88 < b < 1.19999999999999996e36Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.2
Applied rewrites49.2%
if 1.19999999999999996e36 < b Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6460.3
Applied rewrites60.3%
lift--.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate--l+N/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f64N/A
lower--.f6460.3
Applied rewrites60.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (fma (- (+ t y) 2.0) b x) (- a))))
(if (<= b -6e-88)
t_1
(if (<= b 1.2e+36) (+ x (- (* (- y) z) (* a t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x) - -a;
double tmp;
if (b <= -6e-88) {
tmp = t_1;
} else if (b <= 1.2e+36) {
tmp = x + ((-y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(-a)) tmp = 0.0 if (b <= -6e-88) tmp = t_1; elseif (b <= 1.2e+36) tmp = Float64(x + Float64(Float64(Float64(-y) * z) - Float64(a * t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision]}, If[LessEqual[b, -6e-88], t$95$1, If[LessEqual[b, 1.2e+36], N[(x + N[(N[((-y) * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right)\\
\mathbf{if}\;b \leq -6 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+36}:\\
\;\;\;\;x + \left(\left(-y\right) \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.9999999999999999e-88 or 1.19999999999999996e36 < b Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6460.3
Applied rewrites60.3%
if -5.9999999999999999e-88 < b < 1.19999999999999996e36Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.2
Applied rewrites49.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -4e+33)
t_1
(if (<= y 8e+15) (+ x (- (* b t) (* (- t 1.0) a))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4e+33) {
tmp = t_1;
} else if (y <= 8e+15) {
tmp = x + ((b * t) - ((t - 1.0) * a));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-4d+33)) then
tmp = t_1
else if (y <= 8d+15) then
tmp = x + ((b * t) - ((t - 1.0d0) * a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4e+33) {
tmp = t_1;
} else if (y <= 8e+15) {
tmp = x + ((b * t) - ((t - 1.0) * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -4e+33: tmp = t_1 elif y <= 8e+15: tmp = x + ((b * t) - ((t - 1.0) * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -4e+33) tmp = t_1; elseif (y <= 8e+15) tmp = Float64(x + Float64(Float64(b * t) - Float64(Float64(t - 1.0) * a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -4e+33) tmp = t_1; elseif (y <= 8e+15) tmp = x + ((b * t) - ((t - 1.0) * a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4e+33], t$95$1, If[LessEqual[y, 8e+15], N[(x + N[(N[(b * t), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -4 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+15}:\\
\;\;\;\;x + \left(b \cdot t - \left(t - 1\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999998e33 or 8e15 < y Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -3.9999999999999998e33 < y < 8e15Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6462.4
Applied rewrites62.4%
Taylor expanded in z around 0
*-commutativeN/A
lift--.f64N/A
lift-*.f6453.0
Applied rewrites53.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b) (- (- 2.0 t) y))))
(if (<= b -1.25e+89)
t_1
(if (<= b 6e+104) (+ x (- (* (- y) z) (* a t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -b * ((2.0 - t) - y);
double tmp;
if (b <= -1.25e+89) {
tmp = t_1;
} else if (b <= 6e+104) {
tmp = x + ((-y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = -b * ((2.0d0 - t) - y)
if (b <= (-1.25d+89)) then
tmp = t_1
else if (b <= 6d+104) then
tmp = x + ((-y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -b * ((2.0 - t) - y);
double tmp;
if (b <= -1.25e+89) {
tmp = t_1;
} else if (b <= 6e+104) {
tmp = x + ((-y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -b * ((2.0 - t) - y) tmp = 0 if b <= -1.25e+89: tmp = t_1 elif b <= 6e+104: tmp = x + ((-y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-b) * Float64(Float64(2.0 - t) - y)) tmp = 0.0 if (b <= -1.25e+89) tmp = t_1; elseif (b <= 6e+104) tmp = Float64(x + Float64(Float64(Float64(-y) * z) - Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -b * ((2.0 - t) - y); tmp = 0.0; if (b <= -1.25e+89) tmp = t_1; elseif (b <= 6e+104) tmp = x + ((-y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-b) * N[(N[(2.0 - t), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25e+89], t$95$1, If[LessEqual[b, 6e+104], N[(x + N[(N[((-y) * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(\left(2 - t\right) - y\right)\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+104}:\\
\;\;\;\;x + \left(\left(-y\right) \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.24999999999999996e89 or 5.99999999999999937e104 < b Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in b around -inf
associate-*r*N/A
distribute-lft-outN/A
associate--l+N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift-+.f6437.4
Applied rewrites37.4%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
associate--r+N/A
lower--.f64N/A
lower--.f6437.4
Applied rewrites37.4%
if -1.24999999999999996e89 < b < 5.99999999999999937e104Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6477.5
Applied rewrites77.5%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.2
Applied rewrites49.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -7e+32) t_1 (if (<= y 4e+14) (+ x (- (* b t) (- (- a) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -7e+32) {
tmp = t_1;
} else if (y <= 4e+14) {
tmp = x + ((b * t) - (-a - 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 = (b - z) * y
if (y <= (-7d+32)) then
tmp = t_1
else if (y <= 4d+14) then
tmp = x + ((b * t) - (-a - 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 = (b - z) * y;
double tmp;
if (y <= -7e+32) {
tmp = t_1;
} else if (y <= 4e+14) {
tmp = x + ((b * t) - (-a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -7e+32: tmp = t_1 elif y <= 4e+14: tmp = x + ((b * t) - (-a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -7e+32) tmp = t_1; elseif (y <= 4e+14) tmp = Float64(x + Float64(Float64(b * t) - Float64(Float64(-a) - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -7e+32) tmp = t_1; elseif (y <= 4e+14) tmp = x + ((b * t) - (-a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -7e+32], t$95$1, If[LessEqual[y, 4e+14], N[(x + N[(N[(b * t), $MachinePrecision] - N[((-a) - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+14}:\\
\;\;\;\;x + \left(b \cdot t - \left(\left(-a\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.0000000000000002e32 or 4e14 < y Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -7.0000000000000002e32 < y < 4e14Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in t around inf
lower-*.f6462.4
Applied rewrites62.4%
Taylor expanded in t around 0
lower--.f64N/A
mul-1-negN/A
lift-neg.f6449.3
Applied rewrites49.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -7.5e+71)
t_1
(if (<= t -8.5e+28)
(* (- b z) y)
(if (<= t 7000000000000.0) (- (fma (- y 2.0) b x) (- a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -7.5e+71) {
tmp = t_1;
} else if (t <= -8.5e+28) {
tmp = (b - z) * y;
} else if (t <= 7000000000000.0) {
tmp = fma((y - 2.0), b, x) - -a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -7.5e+71) tmp = t_1; elseif (t <= -8.5e+28) tmp = Float64(Float64(b - z) * y); elseif (t <= 7000000000000.0) tmp = Float64(fma(Float64(y - 2.0), b, x) - Float64(-a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -7.5e+71], t$95$1, If[LessEqual[t, -8.5e+28], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 7000000000000.0], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{+28}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 7000000000000:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.50000000000000007e71 or 7e12 < t Initial program 95.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -7.50000000000000007e71 < t < -8.49999999999999954e28Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -8.49999999999999954e28 < t < 7e12Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6446.7
Applied rewrites46.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -7e+32) t_1 (if (<= y 4e+14) (- (fma (- t 2.0) b x) (- a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -7e+32) {
tmp = t_1;
} else if (y <= 4e+14) {
tmp = fma((t - 2.0), b, x) - -a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -7e+32) tmp = t_1; elseif (y <= 4e+14) tmp = Float64(fma(Float64(t - 2.0), b, x) - Float64(-a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -7e+32], t$95$1, If[LessEqual[y, 4e+14], N[(N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x\right) - \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.0000000000000002e32 or 4e14 < y Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -7.0000000000000002e32 < y < 4e14Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6460.3
Applied rewrites60.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6446.4
Applied rewrites46.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -4800000000000.0)
t_1
(if (<= y -5.4e-97)
(* (- b a) t)
(if (<= y 3.5e+14) (- x (* a (- t 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4800000000000.0) {
tmp = t_1;
} else if (y <= -5.4e-97) {
tmp = (b - a) * t;
} else if (y <= 3.5e+14) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-4800000000000.0d0)) then
tmp = t_1
else if (y <= (-5.4d-97)) then
tmp = (b - a) * t
else if (y <= 3.5d+14) then
tmp = x - (a * (t - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4800000000000.0) {
tmp = t_1;
} else if (y <= -5.4e-97) {
tmp = (b - a) * t;
} else if (y <= 3.5e+14) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -4800000000000.0: tmp = t_1 elif y <= -5.4e-97: tmp = (b - a) * t elif y <= 3.5e+14: tmp = x - (a * (t - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -4800000000000.0) tmp = t_1; elseif (y <= -5.4e-97) tmp = Float64(Float64(b - a) * t); elseif (y <= 3.5e+14) tmp = Float64(x - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -4800000000000.0) tmp = t_1; elseif (y <= -5.4e-97) tmp = (b - a) * t; elseif (y <= 3.5e+14) tmp = x - (a * (t - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4800000000000.0], t$95$1, If[LessEqual[y, -5.4e-97], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 3.5e+14], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -4800000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.4 \cdot 10^{-97}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+14}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.8e12 or 3.5e14 < y Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -4.8e12 < y < -5.3999999999999997e-97Initial program 95.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -5.3999999999999997e-97 < y < 3.5e14Initial program 95.3%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.8
Applied rewrites72.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6459.4
Applied rewrites59.4%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.5
Applied rewrites41.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -4800000000000.0) t_1 (if (<= y 44000.0) (* (- b a) t) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4800000000000.0) {
tmp = t_1;
} else if (y <= 44000.0) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (b - z) * y
if (y <= (-4800000000000.0d0)) then
tmp = t_1
else if (y <= 44000.0d0) then
tmp = (b - a) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -4800000000000.0) {
tmp = t_1;
} else if (y <= 44000.0) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -4800000000000.0: tmp = t_1 elif y <= 44000.0: tmp = (b - a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -4800000000000.0) tmp = t_1; elseif (y <= 44000.0) tmp = Float64(Float64(b - a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -4800000000000.0) tmp = t_1; elseif (y <= 44000.0) tmp = (b - a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -4800000000000.0], t$95$1, If[LessEqual[y, 44000.0], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -4800000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 44000:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.8e12 or 44000 < y Initial program 95.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6433.5
Applied rewrites33.5%
if -4.8e12 < y < 44000Initial program 95.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b a) t))) (if (<= t -5.8e+71) t_1 (if (<= t 2.25e+58) (* (- 1.0 y) z) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -5.8e+71) {
tmp = t_1;
} else if (t <= 2.25e+58) {
tmp = (1.0 - y) * 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 = (b - a) * t
if (t <= (-5.8d+71)) then
tmp = t_1
else if (t <= 2.25d+58) then
tmp = (1.0d0 - y) * 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 = (b - a) * t;
double tmp;
if (t <= -5.8e+71) {
tmp = t_1;
} else if (t <= 2.25e+58) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - a) * t tmp = 0 if t <= -5.8e+71: tmp = t_1 elif t <= 2.25e+58: tmp = (1.0 - y) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -5.8e+71) tmp = t_1; elseif (t <= 2.25e+58) tmp = Float64(Float64(1.0 - y) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - a) * t; tmp = 0.0; if (t <= -5.8e+71) tmp = t_1; elseif (t <= 2.25e+58) tmp = (1.0 - y) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -5.8e+71], t$95$1, If[LessEqual[t, 2.25e+58], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+58}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000014e71 or 2.2499999999999999e58 < t Initial program 95.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.6
Applied rewrites32.6%
if -5.80000000000000014e71 < t < 2.2499999999999999e58Initial program 95.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 y) z))) (if (<= z -1e+76) t_1 (if (<= z 2.6e+21) (* (- 1.0 t) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -1e+76) {
tmp = t_1;
} else if (z <= 2.6e+21) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - y) * z
if (z <= (-1d+76)) then
tmp = t_1
else if (z <= 2.6d+21) then
tmp = (1.0d0 - t) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -1e+76) {
tmp = t_1;
} else if (z <= 2.6e+21) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z tmp = 0 if z <= -1e+76: tmp = t_1 elif z <= 2.6e+21: tmp = (1.0 - t) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if (z <= -1e+76) tmp = t_1; elseif (z <= 2.6e+21) tmp = Float64(Float64(1.0 - t) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; tmp = 0.0; if (z <= -1e+76) tmp = t_1; elseif (z <= 2.6e+21) tmp = (1.0 - t) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1e+76], t$95$1, If[LessEqual[z, 2.6e+21], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -1 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+21}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1e76 or 2.6e21 < z Initial program 95.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
if -1e76 < z < 2.6e21Initial program 95.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.3
Applied rewrites27.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.25e+14) (* b y) (if (<= y 2.85) (* (- 1.0 t) a) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.25e+14) {
tmp = b * y;
} else if (y <= 2.85) {
tmp = (1.0 - t) * a;
} else {
tmp = b * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.25d+14)) then
tmp = b * y
else if (y <= 2.85d0) then
tmp = (1.0d0 - t) * a
else
tmp = b * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.25e+14) {
tmp = b * y;
} else if (y <= 2.85) {
tmp = (1.0 - t) * a;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.25e+14: tmp = b * y elif y <= 2.85: tmp = (1.0 - t) * a else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.25e+14) tmp = Float64(b * y); elseif (y <= 2.85) tmp = Float64(Float64(1.0 - t) * a); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.25e+14) tmp = b * y; elseif (y <= 2.85) tmp = (1.0 - t) * a; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.25e+14], N[(b * y), $MachinePrecision], If[LessEqual[y, 2.85], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+14}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 2.85:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -2.25e14 or 2.85000000000000009 < y Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in b around -inf
associate-*r*N/A
distribute-lft-outN/A
associate--l+N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift-+.f6437.4
Applied rewrites37.4%
Taylor expanded in y around inf
lower-*.f6417.8
Applied rewrites17.8%
if -2.25e14 < y < 2.85000000000000009Initial program 95.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.3
Applied rewrites27.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2e+14) (* b y) (if (<= y 2.85) (* (- t) a) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e+14) {
tmp = b * y;
} else if (y <= 2.85) {
tmp = -t * a;
} else {
tmp = b * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2d+14)) then
tmp = b * y
else if (y <= 2.85d0) then
tmp = -t * a
else
tmp = b * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e+14) {
tmp = b * y;
} else if (y <= 2.85) {
tmp = -t * a;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2e+14: tmp = b * y elif y <= 2.85: tmp = -t * a else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2e+14) tmp = Float64(b * y); elseif (y <= 2.85) tmp = Float64(Float64(-t) * a); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2e+14) tmp = b * y; elseif (y <= 2.85) tmp = -t * a; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2e+14], N[(b * y), $MachinePrecision], If[LessEqual[y, 2.85], N[((-t) * a), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+14}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 2.85:\\
\;\;\;\;\left(-t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -2e14 or 2.85000000000000009 < y Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in b around -inf
associate-*r*N/A
distribute-lft-outN/A
associate--l+N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift-+.f6437.4
Applied rewrites37.4%
Taylor expanded in y around inf
lower-*.f6417.8
Applied rewrites17.8%
if -2e14 < y < 2.85000000000000009Initial program 95.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.3
Applied rewrites27.3%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6418.8
Applied rewrites18.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.2e-51) (* b y) (if (<= y 2.1) a (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.2e-51) {
tmp = b * y;
} else if (y <= 2.1) {
tmp = a;
} else {
tmp = b * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.2d-51)) then
tmp = b * y
else if (y <= 2.1d0) then
tmp = a
else
tmp = b * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.2e-51) {
tmp = b * y;
} else if (y <= 2.1) {
tmp = a;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.2e-51: tmp = b * y elif y <= 2.1: tmp = a else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.2e-51) tmp = Float64(b * y); elseif (y <= 2.1) tmp = a; else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.2e-51) tmp = b * y; elseif (y <= 2.1) tmp = a; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.2e-51], N[(b * y), $MachinePrecision], If[LessEqual[y, 2.1], a, N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-51}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 2.1:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -3.2e-51 or 2.10000000000000009 < y Initial program 95.3%
Taylor expanded in y around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
Taylor expanded in b around -inf
associate-*r*N/A
distribute-lft-outN/A
associate--l+N/A
+-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift-+.f6437.4
Applied rewrites37.4%
Taylor expanded in y around inf
lower-*.f6417.8
Applied rewrites17.8%
if -3.2e-51 < y < 2.10000000000000009Initial program 95.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.3
Applied rewrites27.3%
Taylor expanded in t around 0
Applied rewrites10.6%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 95.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.3
Applied rewrites27.3%
Taylor expanded in t around 0
Applied rewrites10.6%
herbie shell --seed 2025127
(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)))