
(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 21 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 INFINITY) t_1 (* b (fma (- z) c (* a i))))))
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 = b * fma(-z, c, (a * i));
}
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(b * fma(Float64(-z), c, Float64(a * i))); 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, Infinity], t$95$1, N[(b * N[((-z) * c + N[(a * i), $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 \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \mathsf{fma}\left(-z, c, a \cdot i\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)))) < +inf.0Initial program 73.2%
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 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -4.9e+171)
(* b (- (* a i) (* c z)))
(if (<= b 5.6e+145)
(fma j (- (* c t) (* i y)) (* x (- (* y z) (* a t))))
(* b (fma (- z) c (* a i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -4.9e+171) {
tmp = b * ((a * i) - (c * z));
} else if (b <= 5.6e+145) {
tmp = fma(j, ((c * t) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = b * fma(-z, c, (a * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -4.9e+171) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (b <= 5.6e+145) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = Float64(b * fma(Float64(-z), c, Float64(a * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -4.9e+171], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e+145], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[((-z) * c + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{+171}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \mathsf{fma}\left(-z, c, a \cdot i\right)\\
\end{array}
\end{array}
if b < -4.8999999999999998e171Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
if -4.8999999999999998e171 < b < 5.5999999999999997e145Initial program 73.2%
Taylor expanded in b around 0
Applied rewrites61.2%
if 5.5999999999999997e145 < b Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z))))
(t_2 (fma (- (* y z) (* t a)) x (* (* a b) i))))
(if (<= x -4e+55)
t_2
(if (<= x -6.5e-59)
(* (- (* b a) (* j y)) i)
(if (<= x -4.5e-177)
t_1
(if (<= x -2.2e-269)
(* b (- (* a i) (* c z)))
(if (<= x 4.5e-70) 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 = c * ((j * t) - (b * z));
double t_2 = fma(((y * z) - (t * a)), x, ((a * b) * i));
double tmp;
if (x <= -4e+55) {
tmp = t_2;
} else if (x <= -6.5e-59) {
tmp = ((b * a) - (j * y)) * i;
} else if (x <= -4.5e-177) {
tmp = t_1;
} else if (x <= -2.2e-269) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 4.5e-70) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) t_2 = fma(Float64(Float64(y * z) - Float64(t * a)), x, Float64(Float64(a * b) * i)) tmp = 0.0 if (x <= -4e+55) tmp = t_2; elseif (x <= -6.5e-59) tmp = Float64(Float64(Float64(b * a) - Float64(j * y)) * i); elseif (x <= -4.5e-177) tmp = t_1; elseif (x <= -2.2e-269) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (x <= 4.5e-70) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision] * x + N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e+55], t$95$2, If[LessEqual[x, -6.5e-59], N[(N[(N[(b * a), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, -4.5e-177], t$95$1, If[LessEqual[x, -2.2e-269], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-70], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
t_2 := \mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(a \cdot b\right) \cdot i\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{+55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-59}:\\
\;\;\;\;\left(b \cdot a - j \cdot y\right) \cdot i\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-269}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -4.00000000000000004e55 or 4.50000000000000022e-70 < x Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in y around 0
Applied rewrites50.9%
if -4.00000000000000004e55 < x < -6.50000000000000017e-59Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Applied rewrites38.8%
if -6.50000000000000017e-59 < x < -4.5000000000000003e-177 or -2.19999999999999984e-269 < x < 4.50000000000000022e-70Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
if -4.5000000000000003e-177 < x < -2.19999999999999984e-269Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -3e+169)
(* a (- (* b i) (* t x)))
(if (<= a -2.6e-17)
(fma (- (* y z) (* t a)) x (* (* a b) i))
(if (<= a 1.25e+192)
(+ (* x (* y z)) (* j (- (* c t) (* i y))))
(if (<= a 7.8e+248)
(* b (- (* a i) (* c z)))
(- (* (* c t) j) (* (* t x) a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -3e+169) {
tmp = a * ((b * i) - (t * x));
} else if (a <= -2.6e-17) {
tmp = fma(((y * z) - (t * a)), x, ((a * b) * i));
} else if (a <= 1.25e+192) {
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
} else if (a <= 7.8e+248) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = ((c * t) * j) - ((t * x) * a);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -3e+169) tmp = Float64(a * Float64(Float64(b * i) - Float64(t * x))); elseif (a <= -2.6e-17) tmp = fma(Float64(Float64(y * z) - Float64(t * a)), x, Float64(Float64(a * b) * i)); elseif (a <= 1.25e+192) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (a <= 7.8e+248) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = Float64(Float64(Float64(c * t) * j) - Float64(Float64(t * x) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -3e+169], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.6e-17], N[(N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision] * x + N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+192], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.8e+248], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision] - N[(N[(t * x), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+169}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(a \cdot b\right) \cdot i\right)\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+192}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{+248}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j - \left(t \cdot x\right) \cdot a\\
\end{array}
\end{array}
if a < -3e169Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if -3e169 < a < -2.60000000000000003e-17Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in y around 0
Applied rewrites50.9%
if -2.60000000000000003e-17 < a < 1.25000000000000008e192Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites49.9%
if 1.25000000000000008e192 < a < 7.7999999999999998e248Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
if 7.7999999999999998e248 < a Initial program 73.2%
Taylor expanded in t around inf
Applied rewrites39.2%
Applied rewrites34.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -2.6e-17)
(- (* x (- (* y z) (* a t))) (* -1.0 (* a (* b i))))
(if (<= a 1.25e+192)
(+ (* x (* y z)) (* j (- (* c t) (* i y))))
(if (<= a 7.8e+248)
(* b (- (* a i) (* c z)))
(- (* (* c t) j) (* (* t x) a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -2.6e-17) {
tmp = (x * ((y * z) - (a * t))) - (-1.0 * (a * (b * i)));
} else if (a <= 1.25e+192) {
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
} else if (a <= 7.8e+248) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = ((c * t) * j) - ((t * x) * a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 (a <= (-2.6d-17)) then
tmp = (x * ((y * z) - (a * t))) - ((-1.0d0) * (a * (b * i)))
else if (a <= 1.25d+192) then
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)))
else if (a <= 7.8d+248) then
tmp = b * ((a * i) - (c * z))
else
tmp = ((c * t) * j) - ((t * x) * a)
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 (a <= -2.6e-17) {
tmp = (x * ((y * z) - (a * t))) - (-1.0 * (a * (b * i)));
} else if (a <= 1.25e+192) {
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
} else if (a <= 7.8e+248) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = ((c * t) * j) - ((t * x) * a);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -2.6e-17: tmp = (x * ((y * z) - (a * t))) - (-1.0 * (a * (b * i))) elif a <= 1.25e+192: tmp = (x * (y * z)) + (j * ((c * t) - (i * y))) elif a <= 7.8e+248: tmp = b * ((a * i) - (c * z)) else: tmp = ((c * t) * j) - ((t * x) * a) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -2.6e-17) tmp = Float64(Float64(x * Float64(Float64(y * z) - Float64(a * t))) - Float64(-1.0 * Float64(a * Float64(b * i)))); elseif (a <= 1.25e+192) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (a <= 7.8e+248) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = Float64(Float64(Float64(c * t) * j) - Float64(Float64(t * x) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -2.6e-17) tmp = (x * ((y * z) - (a * t))) - (-1.0 * (a * (b * i))); elseif (a <= 1.25e+192) tmp = (x * (y * z)) + (j * ((c * t) - (i * y))); elseif (a <= 7.8e+248) tmp = b * ((a * i) - (c * z)); else tmp = ((c * t) * j) - ((t * x) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -2.6e-17], N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+192], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.8e+248], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision] - N[(N[(t * x), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right) - -1 \cdot \left(a \cdot \left(b \cdot i\right)\right)\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+192}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{+248}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j - \left(t \cdot x\right) \cdot a\\
\end{array}
\end{array}
if a < -2.60000000000000003e-17Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Taylor expanded in j around 0
Applied rewrites50.9%
if -2.60000000000000003e-17 < a < 1.25000000000000008e192Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites49.9%
if 1.25000000000000008e192 < a < 7.7999999999999998e248Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
if 7.7999999999999998e248 < a Initial program 73.2%
Taylor expanded in t around inf
Applied rewrites39.2%
Applied rewrites34.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -4.8e-23)
(* b (- (* a i) (* c z)))
(if (<= b -4e-258)
(fma (- (* y z) (* t a)) x (* (* -1.0 (* j y)) i))
(if (<= b 8e+132)
(+ (* x (* y z)) (* j (- (* c t) (* i y))))
(* b (fma (- z) c (* a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -4.8e-23) {
tmp = b * ((a * i) - (c * z));
} else if (b <= -4e-258) {
tmp = fma(((y * z) - (t * a)), x, ((-1.0 * (j * y)) * i));
} else if (b <= 8e+132) {
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
} else {
tmp = b * fma(-z, c, (a * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -4.8e-23) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (b <= -4e-258) tmp = fma(Float64(Float64(y * z) - Float64(t * a)), x, Float64(Float64(-1.0 * Float64(j * y)) * i)); elseif (b <= 8e+132) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = Float64(b * fma(Float64(-z), c, Float64(a * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -4.8e-23], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4e-258], N[(N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision] * x + N[(N[(-1.0 * N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e+132], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[((-z) * c + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{-23}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;b \leq -4 \cdot 10^{-258}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \left(-1 \cdot \left(j \cdot y\right)\right) \cdot i\right)\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+132}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \mathsf{fma}\left(-z, c, a \cdot i\right)\\
\end{array}
\end{array}
if b < -4.79999999999999993e-23Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
if -4.79999999999999993e-23 < b < -3.99999999999999982e-258Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in y around inf
Applied rewrites50.3%
if -3.99999999999999982e-258 < b < 7.99999999999999993e132Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites49.9%
if 7.99999999999999993e132 < b Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* x z) (* i j)) y)))
(if (<= y -1.86e+15)
t_1
(if (<= y -4.6e-248)
(* c (- (* j t) (* b z)))
(if (<= y 1.4e-204)
(* a (- (* b i) (* t x)))
(if (<= y 1e+126) (* b (fma (- z) c (* 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 = ((x * z) - (i * j)) * y;
double tmp;
if (y <= -1.86e+15) {
tmp = t_1;
} else if (y <= -4.6e-248) {
tmp = c * ((j * t) - (b * z));
} else if (y <= 1.4e-204) {
tmp = a * ((b * i) - (t * x));
} else if (y <= 1e+126) {
tmp = b * fma(-z, c, (a * i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * z) - Float64(i * j)) * y) tmp = 0.0 if (y <= -1.86e+15) tmp = t_1; elseif (y <= -4.6e-248) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (y <= 1.4e-204) tmp = Float64(a * Float64(Float64(b * i) - Float64(t * x))); elseif (y <= 1e+126) tmp = Float64(b * fma(Float64(-z), c, Float64(a * i))); 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[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.86e+15], t$95$1, If[LessEqual[y, -4.6e-248], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e-204], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+126], N[(b * N[((-z) * c + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot z - i \cdot j\right) \cdot y\\
\mathbf{if}\;y \leq -1.86 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-248}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-204}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{elif}\;y \leq 10^{+126}:\\
\;\;\;\;b \cdot \mathsf{fma}\left(-z, c, a \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.86e15 or 9.99999999999999925e125 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Applied rewrites39.8%
if -1.86e15 < y < -4.6e-248Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
if -4.6e-248 < y < 1.4e-204Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if 1.4e-204 < y < 9.99999999999999925e125Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* x z) (* i j)) y)))
(if (<= y -1.86e+15)
t_1
(if (<= y -4.6e-248)
(* c (- (* j t) (* b z)))
(if (<= y 1.8e-126)
(* a (- (* b i) (* t x)))
(if (<= y 1e+126) (* b (- (* a i) (* c 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 = ((x * z) - (i * j)) * y;
double tmp;
if (y <= -1.86e+15) {
tmp = t_1;
} else if (y <= -4.6e-248) {
tmp = c * ((j * t) - (b * z));
} else if (y <= 1.8e-126) {
tmp = a * ((b * i) - (t * x));
} else if (y <= 1e+126) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = ((x * z) - (i * j)) * y
if (y <= (-1.86d+15)) then
tmp = t_1
else if (y <= (-4.6d-248)) then
tmp = c * ((j * t) - (b * z))
else if (y <= 1.8d-126) then
tmp = a * ((b * i) - (t * x))
else if (y <= 1d+126) then
tmp = b * ((a * i) - (c * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * z) - (i * j)) * y;
double tmp;
if (y <= -1.86e+15) {
tmp = t_1;
} else if (y <= -4.6e-248) {
tmp = c * ((j * t) - (b * z));
} else if (y <= 1.8e-126) {
tmp = a * ((b * i) - (t * x));
} else if (y <= 1e+126) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * z) - (i * j)) * y tmp = 0 if y <= -1.86e+15: tmp = t_1 elif y <= -4.6e-248: tmp = c * ((j * t) - (b * z)) elif y <= 1.8e-126: tmp = a * ((b * i) - (t * x)) elif y <= 1e+126: tmp = b * ((a * i) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * z) - Float64(i * j)) * y) tmp = 0.0 if (y <= -1.86e+15) tmp = t_1; elseif (y <= -4.6e-248) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (y <= 1.8e-126) tmp = Float64(a * Float64(Float64(b * i) - Float64(t * x))); elseif (y <= 1e+126) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * z) - (i * j)) * y; tmp = 0.0; if (y <= -1.86e+15) tmp = t_1; elseif (y <= -4.6e-248) tmp = c * ((j * t) - (b * z)); elseif (y <= 1.8e-126) tmp = a * ((b * i) - (t * x)); elseif (y <= 1e+126) tmp = b * ((a * i) - (c * z)); 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[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.86e+15], t$95$1, If[LessEqual[y, -4.6e-248], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-126], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+126], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot z - i \cdot j\right) \cdot y\\
\mathbf{if}\;y \leq -1.86 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-248}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-126}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{elif}\;y \leq 10^{+126}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.86e15 or 9.99999999999999925e125 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Applied rewrites39.8%
if -1.86e15 < y < -4.6e-248Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
if -4.6e-248 < y < 1.8e-126Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if 1.8e-126 < y < 9.99999999999999925e125Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z)))) (t_2 (* x (- (* y z) (* a t)))))
(if (<= x -6.8e+56)
t_2
(if (<= x -6.5e-59)
(* (- (* b a) (* j y)) i)
(if (<= x -4.5e-177)
t_1
(if (<= x -2.2e-269)
(* b (- (* a i) (* c z)))
(if (<= x 2.1e+113) 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 = c * ((j * t) - (b * z));
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (x <= -6.8e+56) {
tmp = t_2;
} else if (x <= -6.5e-59) {
tmp = ((b * a) - (j * y)) * i;
} else if (x <= -4.5e-177) {
tmp = t_1;
} else if (x <= -2.2e-269) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 2.1e+113) {
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 = c * ((j * t) - (b * z))
t_2 = x * ((y * z) - (a * t))
if (x <= (-6.8d+56)) then
tmp = t_2
else if (x <= (-6.5d-59)) then
tmp = ((b * a) - (j * y)) * i
else if (x <= (-4.5d-177)) then
tmp = t_1
else if (x <= (-2.2d-269)) then
tmp = b * ((a * i) - (c * z))
else if (x <= 2.1d+113) 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 = c * ((j * t) - (b * z));
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (x <= -6.8e+56) {
tmp = t_2;
} else if (x <= -6.5e-59) {
tmp = ((b * a) - (j * y)) * i;
} else if (x <= -4.5e-177) {
tmp = t_1;
} else if (x <= -2.2e-269) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 2.1e+113) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((j * t) - (b * z)) t_2 = x * ((y * z) - (a * t)) tmp = 0 if x <= -6.8e+56: tmp = t_2 elif x <= -6.5e-59: tmp = ((b * a) - (j * y)) * i elif x <= -4.5e-177: tmp = t_1 elif x <= -2.2e-269: tmp = b * ((a * i) - (c * z)) elif x <= 2.1e+113: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) t_2 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -6.8e+56) tmp = t_2; elseif (x <= -6.5e-59) tmp = Float64(Float64(Float64(b * a) - Float64(j * y)) * i); elseif (x <= -4.5e-177) tmp = t_1; elseif (x <= -2.2e-269) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (x <= 2.1e+113) 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 = c * ((j * t) - (b * z)); t_2 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -6.8e+56) tmp = t_2; elseif (x <= -6.5e-59) tmp = ((b * a) - (j * y)) * i; elseif (x <= -4.5e-177) tmp = t_1; elseif (x <= -2.2e-269) tmp = b * ((a * i) - (c * z)); elseif (x <= 2.1e+113) 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[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+56], t$95$2, If[LessEqual[x, -6.5e-59], N[(N[(N[(b * a), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, -4.5e-177], t$95$1, If[LessEqual[x, -2.2e-269], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+113], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
t_2 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-59}:\\
\;\;\;\;\left(b \cdot a - j \cdot y\right) \cdot i\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-269}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -6.80000000000000002e56 or 2.0999999999999999e113 < x Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in x around inf
Applied rewrites39.9%
if -6.80000000000000002e56 < x < -6.50000000000000017e-59Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Applied rewrites38.8%
if -6.50000000000000017e-59 < x < -4.5000000000000003e-177 or -2.19999999999999984e-269 < x < 2.0999999999999999e113Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
if -4.5000000000000003e-177 < x < -2.19999999999999984e-269Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z)))) (t_2 (* x (- (* y z) (* a t)))))
(if (<= x -9.2e+58)
t_2
(if (<= x -1.2e+28)
(* j (- (* c t) (* i y)))
(if (<= x -3.5e-47)
(* a (- (* b i) (* t x)))
(if (<= x -4.5e-177)
t_1
(if (<= x -2.2e-269)
(* b (- (* a i) (* c z)))
(if (<= x 2.1e+113) 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 = c * ((j * t) - (b * z));
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (x <= -9.2e+58) {
tmp = t_2;
} else if (x <= -1.2e+28) {
tmp = j * ((c * t) - (i * y));
} else if (x <= -3.5e-47) {
tmp = a * ((b * i) - (t * x));
} else if (x <= -4.5e-177) {
tmp = t_1;
} else if (x <= -2.2e-269) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 2.1e+113) {
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 = c * ((j * t) - (b * z))
t_2 = x * ((y * z) - (a * t))
if (x <= (-9.2d+58)) then
tmp = t_2
else if (x <= (-1.2d+28)) then
tmp = j * ((c * t) - (i * y))
else if (x <= (-3.5d-47)) then
tmp = a * ((b * i) - (t * x))
else if (x <= (-4.5d-177)) then
tmp = t_1
else if (x <= (-2.2d-269)) then
tmp = b * ((a * i) - (c * z))
else if (x <= 2.1d+113) 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 = c * ((j * t) - (b * z));
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (x <= -9.2e+58) {
tmp = t_2;
} else if (x <= -1.2e+28) {
tmp = j * ((c * t) - (i * y));
} else if (x <= -3.5e-47) {
tmp = a * ((b * i) - (t * x));
} else if (x <= -4.5e-177) {
tmp = t_1;
} else if (x <= -2.2e-269) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 2.1e+113) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((j * t) - (b * z)) t_2 = x * ((y * z) - (a * t)) tmp = 0 if x <= -9.2e+58: tmp = t_2 elif x <= -1.2e+28: tmp = j * ((c * t) - (i * y)) elif x <= -3.5e-47: tmp = a * ((b * i) - (t * x)) elif x <= -4.5e-177: tmp = t_1 elif x <= -2.2e-269: tmp = b * ((a * i) - (c * z)) elif x <= 2.1e+113: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) t_2 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -9.2e+58) tmp = t_2; elseif (x <= -1.2e+28) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); elseif (x <= -3.5e-47) tmp = Float64(a * Float64(Float64(b * i) - Float64(t * x))); elseif (x <= -4.5e-177) tmp = t_1; elseif (x <= -2.2e-269) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (x <= 2.1e+113) 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 = c * ((j * t) - (b * z)); t_2 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -9.2e+58) tmp = t_2; elseif (x <= -1.2e+28) tmp = j * ((c * t) - (i * y)); elseif (x <= -3.5e-47) tmp = a * ((b * i) - (t * x)); elseif (x <= -4.5e-177) tmp = t_1; elseif (x <= -2.2e-269) tmp = b * ((a * i) - (c * z)); elseif (x <= 2.1e+113) 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[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.2e+58], t$95$2, If[LessEqual[x, -1.2e+28], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e-47], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-177], t$95$1, If[LessEqual[x, -2.2e-269], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+113], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
t_2 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -9.2 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+28}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-47}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-269}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -9.2000000000000001e58 or 2.0999999999999999e113 < x Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in x around inf
Applied rewrites39.9%
if -9.2000000000000001e58 < x < -1.19999999999999991e28Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in j around inf
Applied rewrites38.8%
if -1.19999999999999991e28 < x < -3.4999999999999998e-47Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if -3.4999999999999998e-47 < x < -4.5000000000000003e-177 or -2.19999999999999984e-269 < x < 2.0999999999999999e113Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
if -4.5000000000000003e-177 < x < -2.19999999999999984e-269Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -5.5e+25)
t_1
(if (<= z 1.02e-275)
(* a (- (* b i) (* t x)))
(if (<= z 3.65e-28) (* j (- (* c t) (* 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 = z * ((x * y) - (b * c));
double tmp;
if (z <= -5.5e+25) {
tmp = t_1;
} else if (z <= 1.02e-275) {
tmp = a * ((b * i) - (t * x));
} else if (z <= 3.65e-28) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = z * ((x * y) - (b * c))
if (z <= (-5.5d+25)) then
tmp = t_1
else if (z <= 1.02d-275) then
tmp = a * ((b * i) - (t * x))
else if (z <= 3.65d-28) then
tmp = j * ((c * t) - (i * y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -5.5e+25) {
tmp = t_1;
} else if (z <= 1.02e-275) {
tmp = a * ((b * i) - (t * x));
} else if (z <= 3.65e-28) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = z * ((x * y) - (b * c)) tmp = 0 if z <= -5.5e+25: tmp = t_1 elif z <= 1.02e-275: tmp = a * ((b * i) - (t * x)) elif z <= 3.65e-28: tmp = j * ((c * t) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(z * Float64(Float64(x * y) - Float64(b * c))) tmp = 0.0 if (z <= -5.5e+25) tmp = t_1; elseif (z <= 1.02e-275) tmp = Float64(a * Float64(Float64(b * i) - Float64(t * x))); elseif (z <= 3.65e-28) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = z * ((x * y) - (b * c)); tmp = 0.0; if (z <= -5.5e+25) tmp = t_1; elseif (z <= 1.02e-275) tmp = a * ((b * i) - (t * x)); elseif (z <= 3.65e-28) tmp = j * ((c * t) - (i * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+25], t$95$1, If[LessEqual[z, 1.02e-275], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.65e-28], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-275}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{elif}\;z \leq 3.65 \cdot 10^{-28}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.50000000000000018e25 or 3.6499999999999998e-28 < z Initial program 73.2%
Taylor expanded in z around inf
Applied rewrites39.6%
if -5.50000000000000018e25 < z < 1.01999999999999994e-275Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if 1.01999999999999994e-275 < z < 3.6499999999999998e-28Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in j around inf
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (- (* b i) (* t x)))))
(if (<= a -8.2e-17)
t_1
(if (<= a 9e+109)
(* c (- (* j t) (* b z)))
(if (<= a 6.3e+246) (* b (- (* a i) (* c 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 = a * ((b * i) - (t * x));
double tmp;
if (a <= -8.2e-17) {
tmp = t_1;
} else if (a <= 9e+109) {
tmp = c * ((j * t) - (b * z));
} else if (a <= 6.3e+246) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = a * ((b * i) - (t * x))
if (a <= (-8.2d-17)) then
tmp = t_1
else if (a <= 9d+109) then
tmp = c * ((j * t) - (b * z))
else if (a <= 6.3d+246) then
tmp = b * ((a * i) - (c * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * ((b * i) - (t * x));
double tmp;
if (a <= -8.2e-17) {
tmp = t_1;
} else if (a <= 9e+109) {
tmp = c * ((j * t) - (b * z));
} else if (a <= 6.3e+246) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * ((b * i) - (t * x)) tmp = 0 if a <= -8.2e-17: tmp = t_1 elif a <= 9e+109: tmp = c * ((j * t) - (b * z)) elif a <= 6.3e+246: tmp = b * ((a * i) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(Float64(b * i) - Float64(t * x))) tmp = 0.0 if (a <= -8.2e-17) tmp = t_1; elseif (a <= 9e+109) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (a <= 6.3e+246) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = a * ((b * i) - (t * x)); tmp = 0.0; if (a <= -8.2e-17) tmp = t_1; elseif (a <= 9e+109) tmp = c * ((j * t) - (b * z)); elseif (a <= 6.3e+246) tmp = b * ((a * i) - (c * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.2e-17], t$95$1, If[LessEqual[a, 9e+109], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.3e+246], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+109}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;a \leq 6.3 \cdot 10^{+246}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.2000000000000001e-17 or 6.3e246 < a Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if -8.2000000000000001e-17 < a < 8.9999999999999992e109Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
if 8.9999999999999992e109 < a < 6.3e246Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* b (- (* a i) (* c z))))) (if (<= b -1.9e-22) t_1 (if (<= b 8e+132) (* j (- (* c t) (* 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 * ((a * i) - (c * z));
double tmp;
if (b <= -1.9e-22) {
tmp = t_1;
} else if (b <= 8e+132) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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) - (c * z))
if (b <= (-1.9d-22)) then
tmp = t_1
else if (b <= 8d+132) then
tmp = j * ((c * t) - (i * y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.9e-22) {
tmp = t_1;
} else if (b <= 8e+132) {
tmp = j * ((c * t) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((a * i) - (c * z)) tmp = 0 if b <= -1.9e-22: tmp = t_1 elif b <= 8e+132: tmp = j * ((c * t) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z))) tmp = 0.0 if (b <= -1.9e-22) tmp = t_1; elseif (b <= 8e+132) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((a * i) - (c * z)); tmp = 0.0; if (b <= -1.9e-22) tmp = t_1; elseif (b <= 8e+132) tmp = j * ((c * t) - (i * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.9e-22], t$95$1, If[LessEqual[b, 8e+132], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+132}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.90000000000000012e-22 or 7.99999999999999993e132 < b Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
if -1.90000000000000012e-22 < b < 7.99999999999999993e132Initial program 73.2%
Taylor expanded in c around 0
Applied rewrites57.7%
Applied rewrites60.9%
Taylor expanded in j around inf
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (- (* b i) (* t x)))))
(if (<= x -6.2e+139)
(* x (* y z))
(if (<= x -1.4e-78)
t_1
(if (<= x 7.4e+43) (* b (- (* a i) (* c 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 = a * ((b * i) - (t * x));
double tmp;
if (x <= -6.2e+139) {
tmp = x * (y * z);
} else if (x <= -1.4e-78) {
tmp = t_1;
} else if (x <= 7.4e+43) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = a * ((b * i) - (t * x))
if (x <= (-6.2d+139)) then
tmp = x * (y * z)
else if (x <= (-1.4d-78)) then
tmp = t_1
else if (x <= 7.4d+43) then
tmp = b * ((a * i) - (c * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * ((b * i) - (t * x));
double tmp;
if (x <= -6.2e+139) {
tmp = x * (y * z);
} else if (x <= -1.4e-78) {
tmp = t_1;
} else if (x <= 7.4e+43) {
tmp = b * ((a * i) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * ((b * i) - (t * x)) tmp = 0 if x <= -6.2e+139: tmp = x * (y * z) elif x <= -1.4e-78: tmp = t_1 elif x <= 7.4e+43: tmp = b * ((a * i) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(Float64(b * i) - Float64(t * x))) tmp = 0.0 if (x <= -6.2e+139) tmp = Float64(x * Float64(y * z)); elseif (x <= -1.4e-78) tmp = t_1; elseif (x <= 7.4e+43) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = a * ((b * i) - (t * x)); tmp = 0.0; if (x <= -6.2e+139) tmp = x * (y * z); elseif (x <= -1.4e-78) tmp = t_1; elseif (x <= 7.4e+43) tmp = b * ((a * i) - (c * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e+139], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.4e-78], t$95$1, If[LessEqual[x, 7.4e+43], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+43}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.2e139Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around inf
Applied rewrites23.1%
if -6.2e139 < x < -1.40000000000000012e-78 or 7.4000000000000002e43 < x Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if -1.40000000000000012e-78 < x < 7.4000000000000002e43Initial program 73.2%
Taylor expanded in b around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= y -3.5e+100) (* -1.0 (* i (* j y))) (if (<= y 7e+162) (* a (- (* b i) (* t x))) (* y (* -1.0 (* i j))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -3.5e+100) {
tmp = -1.0 * (i * (j * y));
} else if (y <= 7e+162) {
tmp = a * ((b * i) - (t * x));
} else {
tmp = y * (-1.0 * (i * 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) :: tmp
if (y <= (-3.5d+100)) then
tmp = (-1.0d0) * (i * (j * y))
else if (y <= 7d+162) then
tmp = a * ((b * i) - (t * x))
else
tmp = y * ((-1.0d0) * (i * 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 tmp;
if (y <= -3.5e+100) {
tmp = -1.0 * (i * (j * y));
} else if (y <= 7e+162) {
tmp = a * ((b * i) - (t * x));
} else {
tmp = y * (-1.0 * (i * j));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -3.5e+100: tmp = -1.0 * (i * (j * y)) elif y <= 7e+162: tmp = a * ((b * i) - (t * x)) else: tmp = y * (-1.0 * (i * j)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -3.5e+100) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (y <= 7e+162) tmp = Float64(a * Float64(Float64(b * i) - Float64(t * x))); else tmp = Float64(y * Float64(-1.0 * Float64(i * j))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -3.5e+100) tmp = -1.0 * (i * (j * y)); elseif (y <= 7e+162) tmp = a * ((b * i) - (t * x)); else tmp = y * (-1.0 * (i * j)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -3.5e+100], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+162], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+100}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\
\end{array}
\end{array}
if y < -3.49999999999999976e100Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around 0
Applied rewrites21.9%
if -3.49999999999999976e100 < y < 7.00000000000000036e162Initial program 73.2%
Applied rewrites73.7%
Taylor expanded in a around inf
Applied rewrites38.9%
if 7.00000000000000036e162 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around 0
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -1.95e+15)
(* x (* y z))
(if (<= y -5.2e-248)
(* c (* j t))
(if (<= y 230000000000.0)
(* (* b a) i)
(if (<= y 1.45e+61) (* c (* (- z) b)) (* y (* -1.0 (* i j))))))))
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.95e+15) {
tmp = x * (y * z);
} else if (y <= -5.2e-248) {
tmp = c * (j * t);
} else if (y <= 230000000000.0) {
tmp = (b * a) * i;
} else if (y <= 1.45e+61) {
tmp = c * (-z * b);
} else {
tmp = y * (-1.0 * (i * 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) :: tmp
if (y <= (-1.95d+15)) then
tmp = x * (y * z)
else if (y <= (-5.2d-248)) then
tmp = c * (j * t)
else if (y <= 230000000000.0d0) then
tmp = (b * a) * i
else if (y <= 1.45d+61) then
tmp = c * (-z * b)
else
tmp = y * ((-1.0d0) * (i * 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 tmp;
if (y <= -1.95e+15) {
tmp = x * (y * z);
} else if (y <= -5.2e-248) {
tmp = c * (j * t);
} else if (y <= 230000000000.0) {
tmp = (b * a) * i;
} else if (y <= 1.45e+61) {
tmp = c * (-z * b);
} else {
tmp = y * (-1.0 * (i * j));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -1.95e+15: tmp = x * (y * z) elif y <= -5.2e-248: tmp = c * (j * t) elif y <= 230000000000.0: tmp = (b * a) * i elif y <= 1.45e+61: tmp = c * (-z * b) else: tmp = y * (-1.0 * (i * j)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -1.95e+15) tmp = Float64(x * Float64(y * z)); elseif (y <= -5.2e-248) tmp = Float64(c * Float64(j * t)); elseif (y <= 230000000000.0) tmp = Float64(Float64(b * a) * i); elseif (y <= 1.45e+61) tmp = Float64(c * Float64(Float64(-z) * b)); else tmp = Float64(y * Float64(-1.0 * Float64(i * j))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -1.95e+15) tmp = x * (y * z); elseif (y <= -5.2e-248) tmp = c * (j * t); elseif (y <= 230000000000.0) tmp = (b * a) * i; elseif (y <= 1.45e+61) tmp = c * (-z * b); else tmp = y * (-1.0 * (i * j)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -1.95e+15], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-248], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 230000000000.0], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[y, 1.45e+61], N[(c * N[((-z) * b), $MachinePrecision]), $MachinePrecision], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-248}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;y \leq 230000000000:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+61}:\\
\;\;\;\;c \cdot \left(\left(-z\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\
\end{array}
\end{array}
if y < -1.95e15Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around inf
Applied rewrites23.1%
if -1.95e15 < y < -5.20000000000000013e-248Initial program 73.2%
Taylor expanded in t around inf
Applied rewrites39.2%
Taylor expanded in x around 0
Applied rewrites21.9%
if -5.20000000000000013e-248 < y < 2.3e11Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Taylor expanded in y around 0
Applied rewrites22.1%
Applied rewrites22.3%
if 2.3e11 < y < 1.45e61Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
Taylor expanded in z around inf
Applied rewrites21.7%
Applied rewrites21.7%
if 1.45e61 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around 0
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -1.95e+15)
(* x (* y z))
(if (<= y -5.2e-248)
(* c (* j t))
(if (<= y 230000000000.0)
(* (* b a) i)
(if (<= y 6.8e+61) (* c (* (- z) b)) (* -1.0 (* i (* j y))))))))
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.95e+15) {
tmp = x * (y * z);
} else if (y <= -5.2e-248) {
tmp = c * (j * t);
} else if (y <= 230000000000.0) {
tmp = (b * a) * i;
} else if (y <= 6.8e+61) {
tmp = c * (-z * b);
} else {
tmp = -1.0 * (i * (j * y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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.95d+15)) then
tmp = x * (y * z)
else if (y <= (-5.2d-248)) then
tmp = c * (j * t)
else if (y <= 230000000000.0d0) then
tmp = (b * a) * i
else if (y <= 6.8d+61) then
tmp = c * (-z * b)
else
tmp = (-1.0d0) * (i * (j * y))
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.95e+15) {
tmp = x * (y * z);
} else if (y <= -5.2e-248) {
tmp = c * (j * t);
} else if (y <= 230000000000.0) {
tmp = (b * a) * i;
} else if (y <= 6.8e+61) {
tmp = c * (-z * b);
} else {
tmp = -1.0 * (i * (j * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -1.95e+15: tmp = x * (y * z) elif y <= -5.2e-248: tmp = c * (j * t) elif y <= 230000000000.0: tmp = (b * a) * i elif y <= 6.8e+61: tmp = c * (-z * b) else: tmp = -1.0 * (i * (j * y)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -1.95e+15) tmp = Float64(x * Float64(y * z)); elseif (y <= -5.2e-248) tmp = Float64(c * Float64(j * t)); elseif (y <= 230000000000.0) tmp = Float64(Float64(b * a) * i); elseif (y <= 6.8e+61) tmp = Float64(c * Float64(Float64(-z) * b)); else tmp = Float64(-1.0 * Float64(i * Float64(j * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -1.95e+15) tmp = x * (y * z); elseif (y <= -5.2e-248) tmp = c * (j * t); elseif (y <= 230000000000.0) tmp = (b * a) * i; elseif (y <= 6.8e+61) tmp = c * (-z * b); else tmp = -1.0 * (i * (j * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -1.95e+15], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-248], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 230000000000.0], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[y, 6.8e+61], N[(c * N[((-z) * b), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-248}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;y \leq 230000000000:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+61}:\\
\;\;\;\;c \cdot \left(\left(-z\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -1.95e15Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around inf
Applied rewrites23.1%
if -1.95e15 < y < -5.20000000000000013e-248Initial program 73.2%
Taylor expanded in t around inf
Applied rewrites39.2%
Taylor expanded in x around 0
Applied rewrites21.9%
if -5.20000000000000013e-248 < y < 2.3e11Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Taylor expanded in y around 0
Applied rewrites22.1%
Applied rewrites22.3%
if 2.3e11 < y < 6.80000000000000051e61Initial program 73.2%
Taylor expanded in c around inf
Applied rewrites37.9%
Taylor expanded in z around inf
Applied rewrites21.7%
Applied rewrites21.7%
if 6.80000000000000051e61 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around 0
Applied rewrites21.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= y -1.95e+15)
t_1
(if (<= y -5.2e-248)
(* c (* j t))
(if (<= y 2.7e+126) (* (* 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 = x * (y * z);
double tmp;
if (y <= -1.95e+15) {
tmp = t_1;
} else if (y <= -5.2e-248) {
tmp = c * (j * t);
} else if (y <= 2.7e+126) {
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 = x * (y * z)
if (y <= (-1.95d+15)) then
tmp = t_1
else if (y <= (-5.2d-248)) then
tmp = c * (j * t)
else if (y <= 2.7d+126) 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 = x * (y * z);
double tmp;
if (y <= -1.95e+15) {
tmp = t_1;
} else if (y <= -5.2e-248) {
tmp = c * (j * t);
} else if (y <= 2.7e+126) {
tmp = (b * a) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if y <= -1.95e+15: tmp = t_1 elif y <= -5.2e-248: tmp = c * (j * t) elif y <= 2.7e+126: tmp = (b * a) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (y <= -1.95e+15) tmp = t_1; elseif (y <= -5.2e-248) tmp = Float64(c * Float64(j * t)); elseif (y <= 2.7e+126) 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 = x * (y * z); tmp = 0.0; if (y <= -1.95e+15) tmp = t_1; elseif (y <= -5.2e-248) tmp = c * (j * t); elseif (y <= 2.7e+126) 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+15], t$95$1, If[LessEqual[y, -5.2e-248], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+126], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-248}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+126}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.95e15 or 2.70000000000000002e126 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites39.8%
Taylor expanded in x around inf
Applied rewrites23.1%
if -1.95e15 < y < -5.20000000000000013e-248Initial program 73.2%
Taylor expanded in t around inf
Applied rewrites39.2%
Taylor expanded in x around 0
Applied rewrites21.9%
if -5.20000000000000013e-248 < y < 2.70000000000000002e126Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Taylor expanded in y around 0
Applied rewrites22.1%
Applied rewrites22.3%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* b a) i))) (if (<= b -2.05e-10) t_1 (if (<= b 1.9e+133) (* c (* j t)) 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 * a) * i;
double tmp;
if (b <= -2.05e-10) {
tmp = t_1;
} else if (b <= 1.9e+133) {
tmp = c * (j * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 (b <= (-2.05d-10)) then
tmp = t_1
else if (b <= 1.9d+133) then
tmp = c * (j * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (b * a) * i;
double tmp;
if (b <= -2.05e-10) {
tmp = t_1;
} else if (b <= 1.9e+133) {
tmp = c * (j * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * a) * i tmp = 0 if b <= -2.05e-10: tmp = t_1 elif b <= 1.9e+133: tmp = c * (j * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * a) * i) tmp = 0.0 if (b <= -2.05e-10) tmp = t_1; elseif (b <= 1.9e+133) tmp = Float64(c * Float64(j * t)); else tmp = t_1; 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 (b <= -2.05e-10) tmp = t_1; elseif (b <= 1.9e+133) tmp = c * (j * t); 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[(b * a), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[b, -2.05e-10], t$95$1, If[LessEqual[b, 1.9e+133], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i\\
\mathbf{if}\;b \leq -2.05 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+133}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.0499999999999999e-10 or 1.9000000000000001e133 < b Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Taylor expanded in y around 0
Applied rewrites22.1%
Applied rewrites22.3%
if -2.0499999999999999e-10 < b < 1.9000000000000001e133Initial program 73.2%
Taylor expanded in t around inf
Applied rewrites39.2%
Taylor expanded in x around 0
Applied rewrites21.9%
(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.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Taylor expanded in y around 0
Applied rewrites22.1%
Applied rewrites22.3%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* b i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (b * 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 = a * (b * 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 a * (b * i);
}
def code(x, y, z, t, a, b, c, i, j): return a * (b * i)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(b * i)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (b * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(b \cdot i\right)
\end{array}
Initial program 73.2%
Taylor expanded in i around -inf
Applied rewrites38.8%
Taylor expanded in y around 0
Applied rewrites22.1%
herbie shell --seed 2025153
(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)))))