
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 5e+286)
t_1
(fma
(* (- x) t)
a
(fma (- (* z x) (* j i)) y (fma (- (* j t) (* b z)) c (* (* i b) a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= 5e+286) {
tmp = t_1;
} else {
tmp = fma((-x * t), a, fma(((z * x) - (j * i)), y, fma(((j * t) - (b * z)), c, ((i * b) * a))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= 5e+286) tmp = t_1; else tmp = fma(Float64(Float64(-x) * t), a, fma(Float64(Float64(z * x) - Float64(j * i)), y, fma(Float64(Float64(j * t) - Float64(b * z)), c, Float64(Float64(i * b) * a)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+286], t$95$1, N[(N[((-x) * t), $MachinePrecision] * a + N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y + N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c + N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+286}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(-x\right) \cdot t, a, \mathsf{fma}\left(z \cdot x - j \cdot i, y, \mathsf{fma}\left(j \cdot t - b \cdot z, c, \left(i \cdot b\right) \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < 5.0000000000000004e286Initial program 93.4%
if 5.0000000000000004e286 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 47.3%
Applied rewrites68.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* (- (* j c) (* a x)) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = ((j * c) - (a * x)) * t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = ((j * c) - (a * x)) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = ((j * c) - (a * x)) * t return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(Float64(j * c) - Float64(a * x)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = ((j * c) - (a * x)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(j * c), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c - a \cdot x\right) \cdot t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 91.3%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6442.0
Applied rewrites42.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* t x)) a)))
(if (<= a -1.4e+215)
t_1
(if (<= a 3.8e+184)
(fma
(- (* j c) (* a x))
t
(fma (- (* i a) (* c z)) b (* (- (* z x) (* j i)) y)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (t * x)) * a;
double tmp;
if (a <= -1.4e+215) {
tmp = t_1;
} else if (a <= 3.8e+184) {
tmp = fma(((j * c) - (a * x)), t, fma(((i * a) - (c * z)), b, (((z * x) - (j * i)) * y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * i) - Float64(t * x)) * a) tmp = 0.0 if (a <= -1.4e+215) tmp = t_1; elseif (a <= 3.8e+184) tmp = fma(Float64(Float64(j * c) - Float64(a * x)), t, fma(Float64(Float64(i * a) - Float64(c * z)), b, Float64(Float64(Float64(z * x) - Float64(j * i)) * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.4e+215], t$95$1, If[LessEqual[a, 3.8e+184], N[(N[(N[(j * c), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t + N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot i - t \cdot x\right) \cdot a\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+184}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c - a \cdot x, t, \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(z \cdot x - j \cdot i\right) \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.4e215 or 3.8000000000000001e184 < a Initial program 56.5%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.6%
Applied rewrites73.1%
if -1.4e215 < a < 3.8000000000000001e184Initial program 76.5%
Applied rewrites78.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- j) y (* b a)) i)))
(if (<= i -8.4e+158)
t_1
(if (<= i 1.15e+109)
(fma (- (* z y) (* a t)) x (* (- (* j t) (* b z)) c))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-j, y, (b * a)) * i;
double tmp;
if (i <= -8.4e+158) {
tmp = t_1;
} else if (i <= 1.15e+109) {
tmp = fma(((z * y) - (a * t)), x, (((j * t) - (b * z)) * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-j), y, Float64(b * a)) * i) tmp = 0.0 if (i <= -8.4e+158) tmp = t_1; elseif (i <= 1.15e+109) tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(Float64(j * t) - Float64(b * z)) * c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -8.4e+158], t$95$1, If[LessEqual[i, 1.15e+109], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
\mathbf{if}\;i \leq -8.4 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t - b \cdot z\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -8.3999999999999996e158 or 1.15000000000000005e109 < i Initial program 60.6%
Taylor expanded in i around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites69.1%
if -8.3999999999999996e158 < i < 1.15000000000000005e109Initial program 77.9%
Taylor expanded in i around 0
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
distribute-rgt-out--N/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- j) y (* b a)) i)))
(if (<= i -1.15e+172)
t_1
(if (<= i -4.2e+33)
(* (- (* i a) (* c z)) b)
(if (<= i -3.15e-152)
(+ (* (- a) (* t x)) (* j (- (* c t) (* i y))))
(if (<= i 1.15e+109)
(fma (* j c) t (* (- (* y z) (* a t)) x))
t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-j, y, (b * a)) * i;
double tmp;
if (i <= -1.15e+172) {
tmp = t_1;
} else if (i <= -4.2e+33) {
tmp = ((i * a) - (c * z)) * b;
} else if (i <= -3.15e-152) {
tmp = (-a * (t * x)) + (j * ((c * t) - (i * y)));
} else if (i <= 1.15e+109) {
tmp = fma((j * c), t, (((y * z) - (a * t)) * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-j), y, Float64(b * a)) * i) tmp = 0.0 if (i <= -1.15e+172) tmp = t_1; elseif (i <= -4.2e+33) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); elseif (i <= -3.15e-152) tmp = Float64(Float64(Float64(-a) * Float64(t * x)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (i <= 1.15e+109) tmp = fma(Float64(j * c), t, Float64(Float64(Float64(y * z) - Float64(a * t)) * x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -1.15e+172], t$95$1, If[LessEqual[i, -4.2e+33], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[i, -3.15e-152], N[(N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.15e+109], N[(N[(j * c), $MachinePrecision] * t + N[(N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
\mathbf{if}\;i \leq -1.15 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -4.2 \cdot 10^{+33}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{elif}\;i \leq -3.15 \cdot 10^{-152}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, t, \left(y \cdot z - a \cdot t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.15e172 or 1.15000000000000005e109 < i Initial program 60.2%
Taylor expanded in i around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites69.2%
if -1.15e172 < i < -4.2000000000000001e33Initial program 68.8%
Taylor expanded in b around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
lower-*.f64N/A
Applied rewrites38.8%
if -4.2000000000000001e33 < i < -3.1500000000000002e-152Initial program 78.8%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6446.5
Applied rewrites46.5%
if -3.1500000000000002e-152 < i < 1.15000000000000005e109Initial program 79.7%
Applied rewrites72.9%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6459.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.2
Applied rewrites59.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- j) y (* b a)) i)))
(if (<= i -1.15e+172)
t_1
(if (<= i -5e-27)
(* (- (* i a) (* c z)) b)
(if (<= i 1.15e+109) (fma (* j c) t (* (- (* y z) (* a t)) x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-j, y, (b * a)) * i;
double tmp;
if (i <= -1.15e+172) {
tmp = t_1;
} else if (i <= -5e-27) {
tmp = ((i * a) - (c * z)) * b;
} else if (i <= 1.15e+109) {
tmp = fma((j * c), t, (((y * z) - (a * t)) * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-j), y, Float64(b * a)) * i) tmp = 0.0 if (i <= -1.15e+172) tmp = t_1; elseif (i <= -5e-27) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); elseif (i <= 1.15e+109) tmp = fma(Float64(j * c), t, Float64(Float64(Float64(y * z) - Float64(a * t)) * x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -1.15e+172], t$95$1, If[LessEqual[i, -5e-27], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[i, 1.15e+109], N[(N[(j * c), $MachinePrecision] * t + N[(N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
\mathbf{if}\;i \leq -1.15 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -5 \cdot 10^{-27}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, t, \left(y \cdot z - a \cdot t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.15e172 or 1.15000000000000005e109 < i Initial program 60.2%
Taylor expanded in i around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites69.2%
if -1.15e172 < i < -5.0000000000000002e-27Initial program 71.4%
Taylor expanded in b around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
lower-*.f64N/A
Applied rewrites38.9%
if -5.0000000000000002e-27 < i < 1.15000000000000005e109Initial program 79.6%
Applied rewrites72.8%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6458.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6458.3
Applied rewrites58.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -6.2e+29)
(fma (* j c) t (* (* (- a) t) x))
(if (<= t 2.4e-32)
(* (fma (- j) y (* b a)) i)
(if (<= t 1.7e+35)
(* (fma y x (* (- c) b)) z)
(* (- (* j c) (* a x)) t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -6.2e+29) {
tmp = fma((j * c), t, ((-a * t) * x));
} else if (t <= 2.4e-32) {
tmp = fma(-j, y, (b * a)) * i;
} else if (t <= 1.7e+35) {
tmp = fma(y, x, (-c * b)) * z;
} else {
tmp = ((j * c) - (a * x)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -6.2e+29) tmp = fma(Float64(j * c), t, Float64(Float64(Float64(-a) * t) * x)); elseif (t <= 2.4e-32) tmp = Float64(fma(Float64(-j), y, Float64(b * a)) * i); elseif (t <= 1.7e+35) tmp = Float64(fma(y, x, Float64(Float64(-c) * b)) * z); else tmp = Float64(Float64(Float64(j * c) - Float64(a * x)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -6.2e+29], N[(N[(j * c), $MachinePrecision] * t + N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-32], N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 1.7e+35], N[(N[(y * x + N[((-c) * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(j * c), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, t, \left(\left(-a\right) \cdot t\right) \cdot x\right)\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-c\right) \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c - a \cdot x\right) \cdot t\\
\end{array}
\end{array}
if t < -6.1999999999999998e29Initial program 65.3%
Applied rewrites71.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.0%
Taylor expanded in t around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6458.4
Applied rewrites58.4%
if -6.1999999999999998e29 < t < 2.4000000000000001e-32Initial program 80.2%
Taylor expanded in i around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites46.1%
if 2.4000000000000001e-32 < t < 1.7000000000000001e35Initial program 77.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6442.4
Applied rewrites42.4%
if 1.7000000000000001e35 < t Initial program 63.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i a) (* c z)) b)) (t_2 (* (- (* j c) (* a x)) t)))
(if (<= t -6.2e+29)
t_2
(if (<= t -3.2e-66)
t_1
(if (<= t -4.7e-186)
(* (- (* z x) (* j i)) y)
(if (<= t 4.9e+17) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double t_2 = ((j * c) - (a * x)) * t;
double tmp;
if (t <= -6.2e+29) {
tmp = t_2;
} else if (t <= -3.2e-66) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = ((z * x) - (j * i)) * y;
} else if (t <= 4.9e+17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((i * a) - (c * z)) * b
t_2 = ((j * c) - (a * x)) * t
if (t <= (-6.2d+29)) then
tmp = t_2
else if (t <= (-3.2d-66)) then
tmp = t_1
else if (t <= (-4.7d-186)) then
tmp = ((z * x) - (j * i)) * y
else if (t <= 4.9d+17) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double t_2 = ((j * c) - (a * x)) * t;
double tmp;
if (t <= -6.2e+29) {
tmp = t_2;
} else if (t <= -3.2e-66) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = ((z * x) - (j * i)) * y;
} else if (t <= 4.9e+17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * a) - (c * z)) * b t_2 = ((j * c) - (a * x)) * t tmp = 0 if t <= -6.2e+29: tmp = t_2 elif t <= -3.2e-66: tmp = t_1 elif t <= -4.7e-186: tmp = ((z * x) - (j * i)) * y elif t <= 4.9e+17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * a) - Float64(c * z)) * b) t_2 = Float64(Float64(Float64(j * c) - Float64(a * x)) * t) tmp = 0.0 if (t <= -6.2e+29) tmp = t_2; elseif (t <= -3.2e-66) tmp = t_1; elseif (t <= -4.7e-186) tmp = Float64(Float64(Float64(z * x) - Float64(j * i)) * y); elseif (t <= 4.9e+17) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * a) - (c * z)) * b; t_2 = ((j * c) - (a * x)) * t; tmp = 0.0; if (t <= -6.2e+29) tmp = t_2; elseif (t <= -3.2e-66) tmp = t_1; elseif (t <= -4.7e-186) tmp = ((z * x) - (j * i)) * y; elseif (t <= 4.9e+17) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(j * c), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -6.2e+29], t$95$2, If[LessEqual[t, -3.2e-66], t$95$1, If[LessEqual[t, -4.7e-186], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 4.9e+17], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
t_2 := \left(j \cdot c - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.1999999999999998e29 or 4.9e17 < t Initial program 64.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
if -6.1999999999999998e29 < t < -3.19999999999999982e-66 or -4.6999999999999997e-186 < t < 4.9e17Initial program 80.1%
Taylor expanded in b around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
lower-*.f64N/A
Applied rewrites45.3%
if -3.19999999999999982e-66 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.0
Applied rewrites46.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j c) (* a x)) t)))
(if (<= t -6.2e+29)
t_1
(if (<= t 2.4e-32)
(* (fma (- j) y (* b a)) i)
(if (<= t 1.7e+35) (* (fma y x (* (- c) b)) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * c) - (a * x)) * t;
double tmp;
if (t <= -6.2e+29) {
tmp = t_1;
} else if (t <= 2.4e-32) {
tmp = fma(-j, y, (b * a)) * i;
} else if (t <= 1.7e+35) {
tmp = fma(y, x, (-c * b)) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * c) - Float64(a * x)) * t) tmp = 0.0 if (t <= -6.2e+29) tmp = t_1; elseif (t <= 2.4e-32) tmp = Float64(fma(Float64(-j), y, Float64(b * a)) * i); elseif (t <= 1.7e+35) tmp = Float64(fma(y, x, Float64(Float64(-c) * b)) * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * c), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -6.2e+29], t$95$1, If[LessEqual[t, 2.4e-32], N[(N[((-j) * y + N[(b * a), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 1.7e+35], N[(N[(y * x + N[((-c) * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-c\right) \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.1999999999999998e29 or 1.7000000000000001e35 < t Initial program 64.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6461.7
Applied rewrites61.7%
if -6.1999999999999998e29 < t < 2.4000000000000001e-32Initial program 80.2%
Taylor expanded in i around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
lower-*.f64N/A
Applied rewrites46.1%
if 2.4000000000000001e-32 < t < 1.7000000000000001e35Initial program 77.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
*-commutativeN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6442.4
Applied rewrites42.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* j c) (* a x)) t))) (if (<= t -6.2e+29) t_1 (if (<= t 4.9e+17) (* (- (* i a) (* c z)) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * c) - (a * x)) * t;
double tmp;
if (t <= -6.2e+29) {
tmp = t_1;
} else if (t <= 4.9e+17) {
tmp = ((i * a) - (c * z)) * 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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((j * c) - (a * x)) * t
if (t <= (-6.2d+29)) then
tmp = t_1
else if (t <= 4.9d+17) then
tmp = ((i * a) - (c * z)) * 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 c, double i, double j) {
double t_1 = ((j * c) - (a * x)) * t;
double tmp;
if (t <= -6.2e+29) {
tmp = t_1;
} else if (t <= 4.9e+17) {
tmp = ((i * a) - (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((j * c) - (a * x)) * t tmp = 0 if t <= -6.2e+29: tmp = t_1 elif t <= 4.9e+17: tmp = ((i * a) - (c * z)) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * c) - Float64(a * x)) * t) tmp = 0.0 if (t <= -6.2e+29) tmp = t_1; elseif (t <= 4.9e+17) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((j * c) - (a * x)) * t; tmp = 0.0; if (t <= -6.2e+29) tmp = t_1; elseif (t <= 4.9e+17) tmp = ((i * a) - (c * z)) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * c), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -6.2e+29], t$95$1, If[LessEqual[t, 4.9e+17], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c - a \cdot x\right) \cdot t\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+17}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.1999999999999998e29 or 4.9e17 < t Initial program 64.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-signN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
if -6.1999999999999998e29 < t < 4.9e17Initial program 80.1%
Taylor expanded in b around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
lower-*.f64N/A
Applied rewrites45.3%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* c t) (* i y)) j))) (if (<= j -3.3) t_1 (if (<= j 1e-98) (* (- (* b i) (* t x)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((c * t) - (i * y)) * j;
double tmp;
if (j <= -3.3) {
tmp = t_1;
} else if (j <= 1e-98) {
tmp = ((b * i) - (t * x)) * 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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((c * t) - (i * y)) * j
if (j <= (-3.3d0)) then
tmp = t_1
else if (j <= 1d-98) then
tmp = ((b * i) - (t * x)) * 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 c, double i, double j) {
double t_1 = ((c * t) - (i * y)) * j;
double tmp;
if (j <= -3.3) {
tmp = t_1;
} else if (j <= 1e-98) {
tmp = ((b * i) - (t * x)) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * t) - (i * y)) * j tmp = 0 if j <= -3.3: tmp = t_1 elif j <= 1e-98: tmp = ((b * i) - (t * x)) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * t) - Float64(i * y)) * j) tmp = 0.0 if (j <= -3.3) tmp = t_1; elseif (j <= 1e-98) tmp = Float64(Float64(Float64(b * i) - Float64(t * x)) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((c * t) - (i * y)) * j; tmp = 0.0; if (j <= -3.3) tmp = t_1; elseif (j <= 1e-98) tmp = ((b * i) - (t * x)) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -3.3], t$95$1, If[LessEqual[j, 1e-98], N[(N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot t - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -3.3:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 10^{-98}:\\
\;\;\;\;\left(b \cdot i - t \cdot x\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -3.2999999999999998 or 9.99999999999999939e-99 < j Initial program 74.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6454.5
Applied rewrites54.5%
if -3.2999999999999998 < j < 9.99999999999999939e-99Initial program 71.4%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.7%
Applied rewrites46.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= y -1.6e+97) (* (- i) (* y j)) (if (<= y 4e+209) (* (- (* b i) (* t x)) a) (* (* y z) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -1.6e+97) {
tmp = -i * (y * j);
} else if (y <= 4e+209) {
tmp = ((b * i) - (t * x)) * a;
} else {
tmp = (y * z) * x;
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (y <= (-1.6d+97)) then
tmp = -i * (y * j)
else if (y <= 4d+209) then
tmp = ((b * i) - (t * x)) * a
else
tmp = (y * z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -1.6e+97) {
tmp = -i * (y * j);
} else if (y <= 4e+209) {
tmp = ((b * i) - (t * x)) * a;
} else {
tmp = (y * z) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -1.6e+97: tmp = -i * (y * j) elif y <= 4e+209: tmp = ((b * i) - (t * x)) * a else: tmp = (y * z) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -1.6e+97) tmp = Float64(Float64(-i) * Float64(y * j)); elseif (y <= 4e+209) tmp = Float64(Float64(Float64(b * i) - Float64(t * x)) * a); else tmp = Float64(Float64(y * z) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -1.6e+97) tmp = -i * (y * j); elseif (y <= 4e+209) tmp = ((b * i) - (t * x)) * a; else tmp = (y * z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -1.6e+97], N[((-i) * N[(y * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+209], N[(N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+97}:\\
\;\;\;\;\left(-i\right) \cdot \left(y \cdot j\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+209}:\\
\;\;\;\;\left(b \cdot i - t \cdot x\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot z\right) \cdot x\\
\end{array}
\end{array}
if y < -1.60000000000000008e97Initial program 61.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6446.0
Applied rewrites46.0%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6438.1
Applied rewrites38.1%
if -1.60000000000000008e97 < y < 4.0000000000000003e209Initial program 77.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites42.5%
Applied rewrites42.1%
if 4.0000000000000003e209 < y Initial program 58.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.7
Applied rewrites50.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j t) c)))
(if (<= t -1.8e+260)
t_1
(if (<= t -1.15e+37)
(* (* (- a) t) x)
(if (<= t -8.5e-67)
(* (* b a) i)
(if (<= t -4.7e-186)
(* (* y x) z)
(if (<= t 1.16e-231)
(* (* b i) a)
(if (<= t 3.5e+17)
(* (* (- c) b) z)
(if (<= t 5.5e+214) (* (- t) (* a x)) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_1;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = (b * a) * i;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 1.16e-231) {
tmp = (b * i) * a;
} else if (t <= 3.5e+17) {
tmp = (-c * b) * z;
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * t) * c
if (t <= (-1.8d+260)) then
tmp = t_1
else if (t <= (-1.15d+37)) then
tmp = (-a * t) * x
else if (t <= (-8.5d-67)) then
tmp = (b * a) * i
else if (t <= (-4.7d-186)) then
tmp = (y * x) * z
else if (t <= 1.16d-231) then
tmp = (b * i) * a
else if (t <= 3.5d+17) then
tmp = (-c * b) * z
else if (t <= 5.5d+214) then
tmp = -t * (a * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_1;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = (b * a) * i;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 1.16e-231) {
tmp = (b * i) * a;
} else if (t <= 3.5e+17) {
tmp = (-c * b) * z;
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c tmp = 0 if t <= -1.8e+260: tmp = t_1 elif t <= -1.15e+37: tmp = (-a * t) * x elif t <= -8.5e-67: tmp = (b * a) * i elif t <= -4.7e-186: tmp = (y * x) * z elif t <= 1.16e-231: tmp = (b * i) * a elif t <= 3.5e+17: tmp = (-c * b) * z elif t <= 5.5e+214: tmp = -t * (a * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -1.8e+260) tmp = t_1; elseif (t <= -1.15e+37) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (t <= -8.5e-67) tmp = Float64(Float64(b * a) * i); elseif (t <= -4.7e-186) tmp = Float64(Float64(y * x) * z); elseif (t <= 1.16e-231) tmp = Float64(Float64(b * i) * a); elseif (t <= 3.5e+17) tmp = Float64(Float64(Float64(-c) * b) * z); elseif (t <= 5.5e+214) tmp = Float64(Float64(-t) * Float64(a * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * t) * c; tmp = 0.0; if (t <= -1.8e+260) tmp = t_1; elseif (t <= -1.15e+37) tmp = (-a * t) * x; elseif (t <= -8.5e-67) tmp = (b * a) * i; elseif (t <= -4.7e-186) tmp = (y * x) * z; elseif (t <= 1.16e-231) tmp = (b * i) * a; elseif (t <= 3.5e+17) tmp = (-c * b) * z; elseif (t <= 5.5e+214) tmp = -t * (a * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -1.8e+260], t$95$1, If[LessEqual[t, -1.15e+37], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, -8.5e-67], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, -4.7e-186], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1.16e-231], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 3.5e+17], N[(N[((-c) * b), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 5.5e+214], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{+37}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-67}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{-231}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(-c\right) \cdot b\right) \cdot z\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+214}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7999999999999999e260 or 5.5000000000000003e214 < t Initial program 57.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6445.9
Applied rewrites45.9%
if -1.7999999999999999e260 < t < -1.15000000000000001e37Initial program 66.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6432.4
Applied rewrites32.4%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6434.0
Applied rewrites34.0%
if -1.15000000000000001e37 < t < -8.49999999999999993e-67Initial program 78.2%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.9%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6417.9
Applied rewrites17.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.9
Applied rewrites24.9%
if -8.49999999999999993e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6425.5
Applied rewrites25.5%
if -4.6999999999999997e-186 < t < 1.16e-231Initial program 80.9%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.6%
Taylor expanded in x around 0
lower-*.f6427.5
Applied rewrites27.5%
if 1.16e-231 < t < 3.5e17Initial program 80.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.1
Applied rewrites45.1%
Taylor expanded in x around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6425.7
Applied rewrites25.7%
if 3.5e17 < t < 5.5000000000000003e214Initial program 67.6%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.3%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6444.1
Applied rewrites44.1%
Taylor expanded in x around inf
lift-*.f6430.5
Applied rewrites30.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j t) c)))
(if (<= t -1.8e+260)
t_1
(if (<= t -1.15e+37)
(* (* (- a) t) x)
(if (<= t -8.5e-67)
(* (* b a) i)
(if (<= t -4.7e-186)
(* (* y x) z)
(if (<= t 5.5e-163)
(* (* b i) a)
(if (<= t 3.5e+17)
(* (- b) (* c z))
(if (<= t 5.5e+214) (* (- t) (* a x)) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_1;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = (b * a) * i;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 5.5e-163) {
tmp = (b * i) * a;
} else if (t <= 3.5e+17) {
tmp = -b * (c * z);
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * t) * c
if (t <= (-1.8d+260)) then
tmp = t_1
else if (t <= (-1.15d+37)) then
tmp = (-a * t) * x
else if (t <= (-8.5d-67)) then
tmp = (b * a) * i
else if (t <= (-4.7d-186)) then
tmp = (y * x) * z
else if (t <= 5.5d-163) then
tmp = (b * i) * a
else if (t <= 3.5d+17) then
tmp = -b * (c * z)
else if (t <= 5.5d+214) then
tmp = -t * (a * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_1;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = (b * a) * i;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 5.5e-163) {
tmp = (b * i) * a;
} else if (t <= 3.5e+17) {
tmp = -b * (c * z);
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c tmp = 0 if t <= -1.8e+260: tmp = t_1 elif t <= -1.15e+37: tmp = (-a * t) * x elif t <= -8.5e-67: tmp = (b * a) * i elif t <= -4.7e-186: tmp = (y * x) * z elif t <= 5.5e-163: tmp = (b * i) * a elif t <= 3.5e+17: tmp = -b * (c * z) elif t <= 5.5e+214: tmp = -t * (a * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -1.8e+260) tmp = t_1; elseif (t <= -1.15e+37) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (t <= -8.5e-67) tmp = Float64(Float64(b * a) * i); elseif (t <= -4.7e-186) tmp = Float64(Float64(y * x) * z); elseif (t <= 5.5e-163) tmp = Float64(Float64(b * i) * a); elseif (t <= 3.5e+17) tmp = Float64(Float64(-b) * Float64(c * z)); elseif (t <= 5.5e+214) tmp = Float64(Float64(-t) * Float64(a * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * t) * c; tmp = 0.0; if (t <= -1.8e+260) tmp = t_1; elseif (t <= -1.15e+37) tmp = (-a * t) * x; elseif (t <= -8.5e-67) tmp = (b * a) * i; elseif (t <= -4.7e-186) tmp = (y * x) * z; elseif (t <= 5.5e-163) tmp = (b * i) * a; elseif (t <= 3.5e+17) tmp = -b * (c * z); elseif (t <= 5.5e+214) tmp = -t * (a * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -1.8e+260], t$95$1, If[LessEqual[t, -1.15e+37], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, -8.5e-67], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, -4.7e-186], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 5.5e-163], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 3.5e+17], N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+214], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{+37}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-67}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-163}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+17}:\\
\;\;\;\;\left(-b\right) \cdot \left(c \cdot z\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+214}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7999999999999999e260 or 5.5000000000000003e214 < t Initial program 57.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6445.9
Applied rewrites45.9%
if -1.7999999999999999e260 < t < -1.15000000000000001e37Initial program 66.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6432.4
Applied rewrites32.4%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6434.0
Applied rewrites34.0%
if -1.15000000000000001e37 < t < -8.49999999999999993e-67Initial program 78.2%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.9%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6417.9
Applied rewrites17.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.9
Applied rewrites24.9%
if -8.49999999999999993e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6425.5
Applied rewrites25.5%
if -4.6999999999999997e-186 < t < 5.4999999999999998e-163Initial program 81.4%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.8%
Taylor expanded in x around 0
lower-*.f6427.1
Applied rewrites27.1%
if 5.4999999999999998e-163 < t < 3.5e17Initial program 79.4%
Taylor expanded in c around inf
remove-double-negN/A
mul-1-negN/A
distribute-lft-out--N/A
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites34.0%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6424.1
Applied rewrites24.1%
if 3.5e17 < t < 5.5000000000000003e214Initial program 67.6%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.3%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6444.1
Applied rewrites44.1%
Taylor expanded in x around inf
lift-*.f6430.5
Applied rewrites30.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j t) c)))
(if (<= t -1.8e+260)
t_1
(if (<= t -1.15e+37)
(* (* (- a) t) x)
(if (<= t -8.5e-67)
(* (* b a) i)
(if (<= t -4.7e-186)
(* (* y x) z)
(if (<= t 2.05e-239)
(* (* b i) a)
(if (<= t 0.08)
(* (- i) (* y j))
(if (<= t 5.5e+214) (* (- t) (* a x)) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_1;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = (b * a) * i;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 2.05e-239) {
tmp = (b * i) * a;
} else if (t <= 0.08) {
tmp = -i * (y * j);
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * t) * c
if (t <= (-1.8d+260)) then
tmp = t_1
else if (t <= (-1.15d+37)) then
tmp = (-a * t) * x
else if (t <= (-8.5d-67)) then
tmp = (b * a) * i
else if (t <= (-4.7d-186)) then
tmp = (y * x) * z
else if (t <= 2.05d-239) then
tmp = (b * i) * a
else if (t <= 0.08d0) then
tmp = -i * (y * j)
else if (t <= 5.5d+214) then
tmp = -t * (a * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_1;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = (b * a) * i;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 2.05e-239) {
tmp = (b * i) * a;
} else if (t <= 0.08) {
tmp = -i * (y * j);
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c tmp = 0 if t <= -1.8e+260: tmp = t_1 elif t <= -1.15e+37: tmp = (-a * t) * x elif t <= -8.5e-67: tmp = (b * a) * i elif t <= -4.7e-186: tmp = (y * x) * z elif t <= 2.05e-239: tmp = (b * i) * a elif t <= 0.08: tmp = -i * (y * j) elif t <= 5.5e+214: tmp = -t * (a * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -1.8e+260) tmp = t_1; elseif (t <= -1.15e+37) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (t <= -8.5e-67) tmp = Float64(Float64(b * a) * i); elseif (t <= -4.7e-186) tmp = Float64(Float64(y * x) * z); elseif (t <= 2.05e-239) tmp = Float64(Float64(b * i) * a); elseif (t <= 0.08) tmp = Float64(Float64(-i) * Float64(y * j)); elseif (t <= 5.5e+214) tmp = Float64(Float64(-t) * Float64(a * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * t) * c; tmp = 0.0; if (t <= -1.8e+260) tmp = t_1; elseif (t <= -1.15e+37) tmp = (-a * t) * x; elseif (t <= -8.5e-67) tmp = (b * a) * i; elseif (t <= -4.7e-186) tmp = (y * x) * z; elseif (t <= 2.05e-239) tmp = (b * i) * a; elseif (t <= 0.08) tmp = -i * (y * j); elseif (t <= 5.5e+214) tmp = -t * (a * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -1.8e+260], t$95$1, If[LessEqual[t, -1.15e+37], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, -8.5e-67], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, -4.7e-186], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 2.05e-239], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 0.08], N[((-i) * N[(y * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+214], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{+37}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-67}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-239}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\mathbf{elif}\;t \leq 0.08:\\
\;\;\;\;\left(-i\right) \cdot \left(y \cdot j\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+214}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7999999999999999e260 or 5.5000000000000003e214 < t Initial program 57.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6445.9
Applied rewrites45.9%
if -1.7999999999999999e260 < t < -1.15000000000000001e37Initial program 66.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6432.4
Applied rewrites32.4%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6434.0
Applied rewrites34.0%
if -1.15000000000000001e37 < t < -8.49999999999999993e-67Initial program 78.2%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.9%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6417.9
Applied rewrites17.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.9
Applied rewrites24.9%
if -8.49999999999999993e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6425.5
Applied rewrites25.5%
if -4.6999999999999997e-186 < t < 2.04999999999999996e-239Initial program 80.9%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.5%
Taylor expanded in x around 0
lower-*.f6427.4
Applied rewrites27.4%
if 2.04999999999999996e-239 < t < 0.0800000000000000017Initial program 80.7%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6434.1
Applied rewrites34.1%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6426.3
Applied rewrites26.3%
if 0.0800000000000000017 < t < 5.5000000000000003e214Initial program 68.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites45.9%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6443.7
Applied rewrites43.7%
Taylor expanded in x around inf
lift-*.f6429.7
Applied rewrites29.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* b a) i)) (t_2 (* (* j t) c)))
(if (<= t -1.8e+260)
t_2
(if (<= t -1.15e+37)
(* (* (- a) t) x)
(if (<= t -8.5e-67)
t_1
(if (<= t -4.7e-186)
(* (* y x) z)
(if (<= t 3.8e+17)
t_1
(if (<= t 5.5e+214) (* (- t) (* a x)) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double t_2 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_2;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 3.8e+17) {
tmp = t_1;
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} 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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * a) * i
t_2 = (j * t) * c
if (t <= (-1.8d+260)) then
tmp = t_2
else if (t <= (-1.15d+37)) then
tmp = (-a * t) * x
else if (t <= (-8.5d-67)) then
tmp = t_1
else if (t <= (-4.7d-186)) then
tmp = (y * x) * z
else if (t <= 3.8d+17) then
tmp = t_1
else if (t <= 5.5d+214) then
tmp = -t * (a * x)
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 c, double i, double j) {
double t_1 = (b * a) * i;
double t_2 = (j * t) * c;
double tmp;
if (t <= -1.8e+260) {
tmp = t_2;
} else if (t <= -1.15e+37) {
tmp = (-a * t) * x;
} else if (t <= -8.5e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 3.8e+17) {
tmp = t_1;
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * a) * i t_2 = (j * t) * c tmp = 0 if t <= -1.8e+260: tmp = t_2 elif t <= -1.15e+37: tmp = (-a * t) * x elif t <= -8.5e-67: tmp = t_1 elif t <= -4.7e-186: tmp = (y * x) * z elif t <= 3.8e+17: tmp = t_1 elif t <= 5.5e+214: tmp = -t * (a * x) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * a) * i) t_2 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -1.8e+260) tmp = t_2; elseif (t <= -1.15e+37) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (t <= -8.5e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = Float64(Float64(y * x) * z); elseif (t <= 3.8e+17) tmp = t_1; elseif (t <= 5.5e+214) tmp = Float64(Float64(-t) * Float64(a * x)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (b * a) * i; t_2 = (j * t) * c; tmp = 0.0; if (t <= -1.8e+260) tmp = t_2; elseif (t <= -1.15e+37) tmp = (-a * t) * x; elseif (t <= -8.5e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = (y * x) * z; elseif (t <= 3.8e+17) tmp = t_1; elseif (t <= 5.5e+214) tmp = -t * (a * x); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -1.8e+260], t$95$2, If[LessEqual[t, -1.15e+37], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, -8.5e-67], t$95$1, If[LessEqual[t, -4.7e-186], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 3.8e+17], t$95$1, If[LessEqual[t, 5.5e+214], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i\\
t_2 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+260}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{+37}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+214}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.7999999999999999e260 or 5.5000000000000003e214 < t Initial program 57.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6445.9
Applied rewrites45.9%
if -1.7999999999999999e260 < t < -1.15000000000000001e37Initial program 66.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6432.4
Applied rewrites32.4%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6434.0
Applied rewrites34.0%
if -1.15000000000000001e37 < t < -8.49999999999999993e-67 or -4.6999999999999997e-186 < t < 3.8e17Initial program 80.2%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites33.4%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6410.9
Applied rewrites10.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
if -8.49999999999999993e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6425.5
Applied rewrites25.5%
if 3.8e17 < t < 5.5000000000000003e214Initial program 80.2%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites33.4%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6430.1
Applied rewrites30.1%
Taylor expanded in x around inf
lift-*.f6411.8
Applied rewrites11.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* b a) i)) (t_2 (* (* j t) c)))
(if (<= t -2.1e+22)
t_2
(if (<= t -8.5e-67)
t_1
(if (<= t -4.7e-186)
(* (* y x) z)
(if (<= t 3.8e+17)
t_1
(if (<= t 5.5e+214) (* (- t) (* a x)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double t_2 = (j * t) * c;
double tmp;
if (t <= -2.1e+22) {
tmp = t_2;
} else if (t <= -8.5e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 3.8e+17) {
tmp = t_1;
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} 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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * a) * i
t_2 = (j * t) * c
if (t <= (-2.1d+22)) then
tmp = t_2
else if (t <= (-8.5d-67)) then
tmp = t_1
else if (t <= (-4.7d-186)) then
tmp = (y * x) * z
else if (t <= 3.8d+17) then
tmp = t_1
else if (t <= 5.5d+214) then
tmp = -t * (a * x)
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 c, double i, double j) {
double t_1 = (b * a) * i;
double t_2 = (j * t) * c;
double tmp;
if (t <= -2.1e+22) {
tmp = t_2;
} else if (t <= -8.5e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 3.8e+17) {
tmp = t_1;
} else if (t <= 5.5e+214) {
tmp = -t * (a * x);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * a) * i t_2 = (j * t) * c tmp = 0 if t <= -2.1e+22: tmp = t_2 elif t <= -8.5e-67: tmp = t_1 elif t <= -4.7e-186: tmp = (y * x) * z elif t <= 3.8e+17: tmp = t_1 elif t <= 5.5e+214: tmp = -t * (a * x) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * a) * i) t_2 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -2.1e+22) tmp = t_2; elseif (t <= -8.5e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = Float64(Float64(y * x) * z); elseif (t <= 3.8e+17) tmp = t_1; elseif (t <= 5.5e+214) tmp = Float64(Float64(-t) * Float64(a * x)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (b * a) * i; t_2 = (j * t) * c; tmp = 0.0; if (t <= -2.1e+22) tmp = t_2; elseif (t <= -8.5e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = (y * x) * z; elseif (t <= 3.8e+17) tmp = t_1; elseif (t <= 5.5e+214) tmp = -t * (a * x); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -2.1e+22], t$95$2, If[LessEqual[t, -8.5e-67], t$95$1, If[LessEqual[t, -4.7e-186], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 3.8e+17], t$95$1, If[LessEqual[t, 5.5e+214], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i\\
t_2 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+214}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.0999999999999998e22 or 5.5000000000000003e214 < t Initial program 63.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6438.3
Applied rewrites38.3%
if -2.0999999999999998e22 < t < -8.49999999999999993e-67 or -4.6999999999999997e-186 < t < 3.8e17Initial program 80.4%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites33.5%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6410.7
Applied rewrites10.7%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.5
Applied rewrites25.5%
if -8.49999999999999993e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6425.5
Applied rewrites25.5%
if 3.8e17 < t < 5.5000000000000003e214Initial program 80.4%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites33.5%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6430.1
Applied rewrites30.1%
Taylor expanded in x around inf
lift-*.f6411.7
Applied rewrites11.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* b a) i)))
(if (<= t -2.1e+22)
(* (* j t) c)
(if (<= t -8.5e-67)
t_1
(if (<= t -4.7e-186)
(* (* y x) z)
(if (<= t 2.6e+83) t_1 (* (* c t) j)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double tmp;
if (t <= -2.1e+22) {
tmp = (j * t) * c;
} else if (t <= -8.5e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 2.6e+83) {
tmp = t_1;
} else {
tmp = (c * t) * j;
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (b * a) * i
if (t <= (-2.1d+22)) then
tmp = (j * t) * c
else if (t <= (-8.5d-67)) then
tmp = t_1
else if (t <= (-4.7d-186)) then
tmp = (y * x) * z
else if (t <= 2.6d+83) then
tmp = t_1
else
tmp = (c * t) * j
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double tmp;
if (t <= -2.1e+22) {
tmp = (j * t) * c;
} else if (t <= -8.5e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * x) * z;
} else if (t <= 2.6e+83) {
tmp = t_1;
} else {
tmp = (c * t) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * a) * i tmp = 0 if t <= -2.1e+22: tmp = (j * t) * c elif t <= -8.5e-67: tmp = t_1 elif t <= -4.7e-186: tmp = (y * x) * z elif t <= 2.6e+83: tmp = t_1 else: tmp = (c * t) * j return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * a) * i) tmp = 0.0 if (t <= -2.1e+22) tmp = Float64(Float64(j * t) * c); elseif (t <= -8.5e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = Float64(Float64(y * x) * z); elseif (t <= 2.6e+83) tmp = t_1; else tmp = Float64(Float64(c * t) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (b * a) * i; tmp = 0.0; if (t <= -2.1e+22) tmp = (j * t) * c; elseif (t <= -8.5e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = (y * x) * z; elseif (t <= 2.6e+83) tmp = t_1; else tmp = (c * t) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t, -2.1e+22], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, -8.5e-67], t$95$1, If[LessEqual[t, -4.7e-186], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 2.6e+83], t$95$1, N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+22}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if t < -2.0999999999999998e22Initial program 65.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6444.2
Applied rewrites44.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6435.6
Applied rewrites35.6%
if -2.0999999999999998e22 < t < -8.49999999999999993e-67 or -4.6999999999999997e-186 < t < 2.6000000000000001e83Initial program 79.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites34.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6412.6
Applied rewrites12.6%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if -8.49999999999999993e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6425.5
Applied rewrites25.5%
if 2.6000000000000001e83 < t Initial program 79.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6434.3
Applied rewrites34.3%
Taylor expanded in y around 0
lift-*.f6412.2
Applied rewrites12.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* b a) i)))
(if (<= t -2.1e+22)
(* (* j t) c)
(if (<= t -9e-67)
t_1
(if (<= t -4.7e-186)
(* (* y z) x)
(if (<= t 2.6e+83) t_1 (* (* c t) j)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double tmp;
if (t <= -2.1e+22) {
tmp = (j * t) * c;
} else if (t <= -9e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * z) * x;
} else if (t <= 2.6e+83) {
tmp = t_1;
} else {
tmp = (c * t) * j;
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (b * a) * i
if (t <= (-2.1d+22)) then
tmp = (j * t) * c
else if (t <= (-9d-67)) then
tmp = t_1
else if (t <= (-4.7d-186)) then
tmp = (y * z) * x
else if (t <= 2.6d+83) then
tmp = t_1
else
tmp = (c * t) * j
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double tmp;
if (t <= -2.1e+22) {
tmp = (j * t) * c;
} else if (t <= -9e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * z) * x;
} else if (t <= 2.6e+83) {
tmp = t_1;
} else {
tmp = (c * t) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * a) * i tmp = 0 if t <= -2.1e+22: tmp = (j * t) * c elif t <= -9e-67: tmp = t_1 elif t <= -4.7e-186: tmp = (y * z) * x elif t <= 2.6e+83: tmp = t_1 else: tmp = (c * t) * j return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * a) * i) tmp = 0.0 if (t <= -2.1e+22) tmp = Float64(Float64(j * t) * c); elseif (t <= -9e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = Float64(Float64(y * z) * x); elseif (t <= 2.6e+83) tmp = t_1; else tmp = Float64(Float64(c * t) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (b * a) * i; tmp = 0.0; if (t <= -2.1e+22) tmp = (j * t) * c; elseif (t <= -9e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = (y * z) * x; elseif (t <= 2.6e+83) tmp = t_1; else tmp = (c * t) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t, -2.1e+22], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, -9e-67], t$95$1, If[LessEqual[t, -4.7e-186], N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 2.6e+83], t$95$1, N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+22}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot z\right) \cdot x\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\
\end{array}
\end{array}
if t < -2.0999999999999998e22Initial program 65.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6444.2
Applied rewrites44.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6435.6
Applied rewrites35.6%
if -2.0999999999999998e22 < t < -9.00000000000000031e-67 or -4.6999999999999997e-186 < t < 2.6000000000000001e83Initial program 79.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites34.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6412.6
Applied rewrites12.6%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if -9.00000000000000031e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6426.2
Applied rewrites26.2%
if 2.6000000000000001e83 < t Initial program 79.3%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6434.3
Applied rewrites34.3%
Taylor expanded in y around 0
lift-*.f6412.2
Applied rewrites12.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* b a) i)) (t_2 (* (* j t) c)))
(if (<= t -2.1e+22)
t_2
(if (<= t -9e-67)
t_1
(if (<= t -4.7e-186) (* (* y z) x) (if (<= t 2.6e+83) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double t_2 = (j * t) * c;
double tmp;
if (t <= -2.1e+22) {
tmp = t_2;
} else if (t <= -9e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * z) * x;
} else if (t <= 2.6e+83) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * a) * i
t_2 = (j * t) * c
if (t <= (-2.1d+22)) then
tmp = t_2
else if (t <= (-9d-67)) then
tmp = t_1
else if (t <= (-4.7d-186)) then
tmp = (y * z) * x
else if (t <= 2.6d+83) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double t_2 = (j * t) * c;
double tmp;
if (t <= -2.1e+22) {
tmp = t_2;
} else if (t <= -9e-67) {
tmp = t_1;
} else if (t <= -4.7e-186) {
tmp = (y * z) * x;
} else if (t <= 2.6e+83) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * a) * i t_2 = (j * t) * c tmp = 0 if t <= -2.1e+22: tmp = t_2 elif t <= -9e-67: tmp = t_1 elif t <= -4.7e-186: tmp = (y * z) * x elif t <= 2.6e+83: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * a) * i) t_2 = Float64(Float64(j * t) * c) tmp = 0.0 if (t <= -2.1e+22) tmp = t_2; elseif (t <= -9e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = Float64(Float64(y * z) * x); elseif (t <= 2.6e+83) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (b * a) * i; t_2 = (j * t) * c; tmp = 0.0; if (t <= -2.1e+22) tmp = t_2; elseif (t <= -9e-67) tmp = t_1; elseif (t <= -4.7e-186) tmp = (y * z) * x; elseif (t <= 2.6e+83) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -2.1e+22], t$95$2, If[LessEqual[t, -9e-67], t$95$1, If[LessEqual[t, -4.7e-186], N[(N[(y * z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 2.6e+83], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i\\
t_2 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot z\right) \cdot x\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.0999999999999998e22 or 2.6000000000000001e83 < t Initial program 63.9%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6436.3
Applied rewrites36.3%
if -2.0999999999999998e22 < t < -9.00000000000000031e-67 or -4.6999999999999997e-186 < t < 2.6000000000000001e83Initial program 79.3%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites34.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6412.6
Applied rewrites12.6%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
if -9.00000000000000031e-67 < t < -4.6999999999999997e-186Initial program 79.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6426.2
Applied rewrites26.2%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= j -410000000.0) (* (* j c) t) (if (<= j 3.25e-71) (* (* b a) i) (* (* j t) c))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -410000000.0) {
tmp = (j * c) * t;
} else if (j <= 3.25e-71) {
tmp = (b * a) * i;
} else {
tmp = (j * t) * c;
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-410000000.0d0)) then
tmp = (j * c) * t
else if (j <= 3.25d-71) then
tmp = (b * a) * i
else
tmp = (j * t) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -410000000.0) {
tmp = (j * c) * t;
} else if (j <= 3.25e-71) {
tmp = (b * a) * i;
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -410000000.0: tmp = (j * c) * t elif j <= 3.25e-71: tmp = (b * a) * i else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -410000000.0) tmp = Float64(Float64(j * c) * t); elseif (j <= 3.25e-71) tmp = Float64(Float64(b * a) * i); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -410000000.0) tmp = (j * c) * t; elseif (j <= 3.25e-71) tmp = (b * a) * i; else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -410000000.0], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, 3.25e-71], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -410000000:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\mathbf{elif}\;j \leq 3.25 \cdot 10^{-71}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if j < -4.1e8Initial program 72.6%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6461.5
Applied rewrites61.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.4
Applied rewrites35.4%
if -4.1e8 < j < 3.25000000000000003e-71Initial program 71.4%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.3%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6424.7
Applied rewrites24.7%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.4
Applied rewrites27.4%
if 3.25000000000000003e-71 < j Initial program 75.7%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6451.5
Applied rewrites51.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6429.4
Applied rewrites29.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j c) t))) (if (<= j -410000000.0) t_1 (if (<= j 3.25e-71) (* (* b a) i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * t;
double tmp;
if (j <= -410000000.0) {
tmp = t_1;
} else if (j <= 3.25e-71) {
tmp = (b * a) * i;
} 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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * c) * t
if (j <= (-410000000.0d0)) then
tmp = t_1
else if (j <= 3.25d-71) then
tmp = (b * a) * i
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 c, double i, double j) {
double t_1 = (j * c) * t;
double tmp;
if (j <= -410000000.0) {
tmp = t_1;
} else if (j <= 3.25e-71) {
tmp = (b * a) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * t tmp = 0 if j <= -410000000.0: tmp = t_1 elif j <= 3.25e-71: tmp = (b * a) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * t) tmp = 0.0 if (j <= -410000000.0) tmp = t_1; elseif (j <= 3.25e-71) tmp = Float64(Float64(b * a) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * c) * t; tmp = 0.0; if (j <= -410000000.0) tmp = t_1; elseif (j <= 3.25e-71) tmp = (b * a) * i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[j, -410000000.0], t$95$1, If[LessEqual[j, 3.25e-71], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot t\\
\mathbf{if}\;j \leq -410000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.25 \cdot 10^{-71}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -4.1e8 or 3.25000000000000003e-71 < j Initial program 74.4%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6455.8
Applied rewrites55.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f6431.8
Applied rewrites31.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6432.3
Applied rewrites32.3%
if -4.1e8 < j < 3.25000000000000003e-71Initial program 71.4%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.3%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6424.7
Applied rewrites24.7%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.4
Applied rewrites27.4%
(FPCore (x y z t a b c i j) :precision binary64 (* (* b a) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * a) * i;
}
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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (b * a) * i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * a) * i;
}
def code(x, y, z, t, a, b, c, i, j): return (b * a) * i
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(b * a) * i) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (b * a) * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot a\right) \cdot i
\end{array}
Initial program 73.0%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6422.0
Applied rewrites22.0%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j) :precision binary64 (* b (* i a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return b * (i * 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, c, i, j)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = b * (i * a)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return b * (i * a);
}
def code(x, y, z, t, a, b, c, i, j): return b * (i * a)
function code(x, y, z, t, a, b, c, i, j) return Float64(b * Float64(i * a)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = b * (i * a); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(b * N[(i * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(i \cdot a\right)
\end{array}
Initial program 73.0%
Taylor expanded in a around inf
distribute-lft-out--N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.6%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6422.0
Applied rewrites22.0%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.2
Applied rewrites22.2%
herbie shell --seed 2025130
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))