
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * 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 ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * 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 ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* b (- (* i t) (* c z))))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = b * ((i * t) - (c * z));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = b * ((i * t) - (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = b * ((i * t) - (c * z)) 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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = b * ((i * t) - (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.7%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))) (t_2 (- (* a c) (* i y))))
(if (<= j -4.4e+73)
(- (fma j t_2 (fma t (* b i) (* x (* y z)))) (* b (* c z)))
(if (<= j 3.5e-170)
(- t_1 (* b (- (* c z) (* i t))))
(if (<= j 5.5e+178) (fma c (- (* a j) (* b z)) t_1) (fma j t_2 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) - (a * t));
double t_2 = (a * c) - (i * y);
double tmp;
if (j <= -4.4e+73) {
tmp = fma(j, t_2, fma(t, (b * i), (x * (y * z)))) - (b * (c * z));
} else if (j <= 3.5e-170) {
tmp = t_1 - (b * ((c * z) - (i * t)));
} else if (j <= 5.5e+178) {
tmp = fma(c, ((a * j) - (b * z)), t_1);
} else {
tmp = fma(j, t_2, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) t_2 = Float64(Float64(a * c) - Float64(i * y)) tmp = 0.0 if (j <= -4.4e+73) tmp = Float64(fma(j, t_2, fma(t, Float64(b * i), Float64(x * Float64(y * z)))) - Float64(b * Float64(c * z))); elseif (j <= 3.5e-170) tmp = Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(i * t)))); elseif (j <= 5.5e+178) tmp = fma(c, Float64(Float64(a * j) - Float64(b * z)), t_1); else tmp = fma(j, t_2, t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -4.4e+73], N[(N[(j * t$95$2 + N[(t * N[(b * i), $MachinePrecision] + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.5e-170], N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.5e+178], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(j * t$95$2 + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
t_2 := a \cdot c - i \cdot y\\
\mathbf{if}\;j \leq -4.4 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_2, \mathsf{fma}\left(t, b \cdot i, x \cdot \left(y \cdot z\right)\right)\right) - b \cdot \left(c \cdot z\right)\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-170}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z - i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{+178}:\\
\;\;\;\;\mathsf{fma}\left(c, a \cdot j - b \cdot z, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_2, t\_1\right)\\
\end{array}
\end{array}
if j < -4.4e73Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites65.8%
if -4.4e73 < j < 3.49999999999999985e-170Initial program 73.7%
Taylor expanded in x around inf
Applied rewrites68.9%
Taylor expanded in j around 0
Applied rewrites59.1%
if 3.49999999999999985e-170 < j < 5.5000000000000001e178Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in c around 0
Applied rewrites61.0%
if 5.5000000000000001e178 < j Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))) (t_2 (- (* a c) (* i y))))
(if (<= j -5.4e+48)
(fma j t_2 (* t (- (* -1.0 (* a x)) (* -1.0 (* b i)))))
(if (<= j 3.5e-170)
(- t_1 (* b (- (* c z) (* i t))))
(if (<= j 5.5e+178) (fma c (- (* a j) (* b z)) t_1) (fma j t_2 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) - (a * t));
double t_2 = (a * c) - (i * y);
double tmp;
if (j <= -5.4e+48) {
tmp = fma(j, t_2, (t * ((-1.0 * (a * x)) - (-1.0 * (b * i)))));
} else if (j <= 3.5e-170) {
tmp = t_1 - (b * ((c * z) - (i * t)));
} else if (j <= 5.5e+178) {
tmp = fma(c, ((a * j) - (b * z)), t_1);
} else {
tmp = fma(j, t_2, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) t_2 = Float64(Float64(a * c) - Float64(i * y)) tmp = 0.0 if (j <= -5.4e+48) tmp = fma(j, t_2, Float64(t * Float64(Float64(-1.0 * Float64(a * x)) - Float64(-1.0 * Float64(b * i))))); elseif (j <= 3.5e-170) tmp = Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(i * t)))); elseif (j <= 5.5e+178) tmp = fma(c, Float64(Float64(a * j) - Float64(b * z)), t_1); else tmp = fma(j, t_2, t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -5.4e+48], N[(j * t$95$2 + N[(t * N[(N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.5e-170], N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.5e+178], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(j * t$95$2 + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
t_2 := a \cdot c - i \cdot y\\
\mathbf{if}\;j \leq -5.4 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_2, t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-170}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z - i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{+178}:\\
\;\;\;\;\mathsf{fma}\left(c, a \cdot j - b \cdot z, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_2, t\_1\right)\\
\end{array}
\end{array}
if j < -5.40000000000000007e48Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in z around 0
Applied rewrites60.4%
if -5.40000000000000007e48 < j < 3.49999999999999985e-170Initial program 73.7%
Taylor expanded in x around inf
Applied rewrites68.9%
Taylor expanded in j around 0
Applied rewrites59.1%
if 3.49999999999999985e-170 < j < 5.5000000000000001e178Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in c around 0
Applied rewrites61.0%
if 5.5000000000000001e178 < j Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))) (t_2 (- (* a c) (* i y))))
(if (<= j -4.4e+64)
(fma j t_2 (* x (* a (- (/ (* y z) a) t))))
(if (<= j 3.5e-170)
(- t_1 (* b (- (* c z) (* i t))))
(if (<= j 5.5e+178) (fma c (- (* a j) (* b z)) t_1) (fma j t_2 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) - (a * t));
double t_2 = (a * c) - (i * y);
double tmp;
if (j <= -4.4e+64) {
tmp = fma(j, t_2, (x * (a * (((y * z) / a) - t))));
} else if (j <= 3.5e-170) {
tmp = t_1 - (b * ((c * z) - (i * t)));
} else if (j <= 5.5e+178) {
tmp = fma(c, ((a * j) - (b * z)), t_1);
} else {
tmp = fma(j, t_2, t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) t_2 = Float64(Float64(a * c) - Float64(i * y)) tmp = 0.0 if (j <= -4.4e+64) tmp = fma(j, t_2, Float64(x * Float64(a * Float64(Float64(Float64(y * z) / a) - t)))); elseif (j <= 3.5e-170) tmp = Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(i * t)))); elseif (j <= 5.5e+178) tmp = fma(c, Float64(Float64(a * j) - Float64(b * z)), t_1); else tmp = fma(j, t_2, t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -4.4e+64], N[(j * t$95$2 + N[(x * N[(a * N[(N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.5e-170], N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.5e+178], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(j * t$95$2 + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
t_2 := a \cdot c - i \cdot y\\
\mathbf{if}\;j \leq -4.4 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_2, x \cdot \left(a \cdot \left(\frac{y \cdot z}{a} - t\right)\right)\right)\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-170}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z - i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{+178}:\\
\;\;\;\;\mathsf{fma}\left(c, a \cdot j - b \cdot z, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_2, t\_1\right)\\
\end{array}
\end{array}
if j < -4.40000000000000004e64Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in a around inf
Applied rewrites59.8%
if -4.40000000000000004e64 < j < 3.49999999999999985e-170Initial program 73.7%
Taylor expanded in x around inf
Applied rewrites68.9%
Taylor expanded in j around 0
Applied rewrites59.1%
if 3.49999999999999985e-170 < j < 5.5000000000000001e178Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in c around 0
Applied rewrites61.0%
if 5.5000000000000001e178 < j Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))) (t_2 (fma j (- (* a c) (* i y)) t_1)))
(if (<= j -4.3e+64)
t_2
(if (<= j 3.5e-170)
(- t_1 (* b (- (* c z) (* i t))))
(if (<= j 5.5e+178) (fma c (- (* a j) (* b z)) 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 = x * ((y * z) - (a * t));
double t_2 = fma(j, ((a * c) - (i * y)), t_1);
double tmp;
if (j <= -4.3e+64) {
tmp = t_2;
} else if (j <= 3.5e-170) {
tmp = t_1 - (b * ((c * z) - (i * t)));
} else if (j <= 5.5e+178) {
tmp = fma(c, ((a * j) - (b * z)), t_1);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) t_2 = fma(j, Float64(Float64(a * c) - Float64(i * y)), t_1) tmp = 0.0 if (j <= -4.3e+64) tmp = t_2; elseif (j <= 3.5e-170) tmp = Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(i * t)))); elseif (j <= 5.5e+178) tmp = fma(c, Float64(Float64(a * j) - Float64(b * z)), 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[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[j, -4.3e+64], t$95$2, If[LessEqual[j, 3.5e-170], N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.5e+178], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
t_2 := \mathsf{fma}\left(j, a \cdot c - i \cdot y, t\_1\right)\\
\mathbf{if}\;j \leq -4.3 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-170}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z - i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{+178}:\\
\;\;\;\;\mathsf{fma}\left(c, a \cdot j - b \cdot z, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if j < -4.2999999999999998e64 or 5.5000000000000001e178 < j Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
if -4.2999999999999998e64 < j < 3.49999999999999985e-170Initial program 73.7%
Taylor expanded in x around inf
Applied rewrites68.9%
Taylor expanded in j around 0
Applied rewrites59.1%
if 3.49999999999999985e-170 < j < 5.5000000000000001e178Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in c around 0
Applied rewrites61.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* i (fma -1.0 (* j y) (* b t)))))
(if (<= i -8.2e+132)
t_1
(if (<= i 5.6e+134)
(fma c (- (* a j) (* b z)) (* x (- (* y z) (* a 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 = i * fma(-1.0, (j * y), (b * t));
double tmp;
if (i <= -8.2e+132) {
tmp = t_1;
} else if (i <= 5.6e+134) {
tmp = fma(c, ((a * j) - (b * z)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))) tmp = 0.0 if (i <= -8.2e+132) tmp = t_1; elseif (i <= 5.6e+134) tmp = fma(c, Float64(Float64(a * j) - Float64(b * z)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -8.2e+132], t$95$1, If[LessEqual[i, 5.6e+134], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{if}\;i \leq -8.2 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 5.6 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(c, a \cdot j - b \cdot z, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -8.19999999999999983e132 or 5.5999999999999997e134 < i Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in i around inf
Applied rewrites38.4%
if -8.19999999999999983e132 < i < 5.5999999999999997e134Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in c around 0
Applied rewrites61.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* i (fma -1.0 (* j y) (* b t)))))
(if (<= i -9.5e+146)
t_1
(if (<= i 4.4e+101) (- (* x (- (* y z) (* a t))) (* b (* 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 = i * fma(-1.0, (j * y), (b * t));
double tmp;
if (i <= -9.5e+146) {
tmp = t_1;
} else if (i <= 4.4e+101) {
tmp = (x * ((y * z) - (a * t))) - (b * (c * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))) tmp = 0.0 if (i <= -9.5e+146) tmp = t_1; elseif (i <= 4.4e+101) tmp = Float64(Float64(x * Float64(Float64(y * z) - Float64(a * t))) - Float64(b * Float64(c * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -9.5e+146], t$95$1, If[LessEqual[i, 4.4e+101], N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{if}\;i \leq -9.5 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 4.4 \cdot 10^{+101}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \left(c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -9.49999999999999926e146 or 4.4000000000000001e101 < i Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in i around inf
Applied rewrites38.4%
if -9.49999999999999926e146 < i < 4.4000000000000001e101Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in j around 0
Applied rewrites49.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -3e-153)
t_1
(if (<= b 1.2e+77) (fma j (* a c) (* x (- (* y z) (* a 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 * ((i * t) - (c * z));
double tmp;
if (b <= -3e-153) {
tmp = t_1;
} else if (b <= 1.2e+77) {
tmp = fma(j, (a * c), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -3e-153) tmp = t_1; elseif (b <= 1.2e+77) tmp = fma(j, Float64(a * c), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e-153], t$95$1, If[LessEqual[b, 1.2e+77], N[(j * N[(a * c), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -3 \cdot 10^{-153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3e-153 or 1.1999999999999999e77 < b Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
if -3e-153 < b < 1.1999999999999999e77Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in y around 0
Applied rewrites51.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -2e+52)
(* x (* a (fma -1.0 t (/ (* y z) a))))
(if (<= x 3.5e-241)
(* c (- (* a j) (* b z)))
(if (<= x 1.5e-93)
(* b (- (* i t) (* c z)))
(if (<= x 3.5e+102)
(* i (fma -1.0 (* j y) (* b t)))
(* x (- (* y z) (* a t))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -2e+52) {
tmp = x * (a * fma(-1.0, t, ((y * z) / a)));
} else if (x <= 3.5e-241) {
tmp = c * ((a * j) - (b * z));
} else if (x <= 1.5e-93) {
tmp = b * ((i * t) - (c * z));
} else if (x <= 3.5e+102) {
tmp = i * fma(-1.0, (j * y), (b * t));
} else {
tmp = x * ((y * z) - (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -2e+52) tmp = Float64(x * Float64(a * fma(-1.0, t, Float64(Float64(y * z) / a)))); elseif (x <= 3.5e-241) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (x <= 1.5e-93) tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); elseif (x <= 3.5e+102) tmp = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))); else tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -2e+52], N[(x * N[(a * N[(-1.0 * t + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e-241], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-93], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+102], N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \left(a \cdot \mathsf{fma}\left(-1, t, \frac{y \cdot z}{a}\right)\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-241}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-93}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+102}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\end{array}
\end{array}
if x < -2e52Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around inf
Applied rewrites39.4%
Taylor expanded in a around inf
Applied rewrites39.7%
if -2e52 < x < 3.4999999999999999e-241Initial program 73.7%
Taylor expanded in c around inf
Applied rewrites39.9%
if 3.4999999999999999e-241 < x < 1.5000000000000001e-93Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
if 1.5000000000000001e-93 < x < 3.50000000000000011e102Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in i around inf
Applied rewrites38.4%
if 3.50000000000000011e102 < x Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around inf
Applied rewrites39.4%
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -2e+52)
t_1
(if (<= x 3.5e-241)
(* c (- (* a j) (* b z)))
(if (<= x 1.5e-93)
(* b (- (* i t) (* c z)))
(if (<= x 3.5e+102) (* i (fma -1.0 (* j y) (* b 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 = x * ((y * z) - (a * t));
double tmp;
if (x <= -2e+52) {
tmp = t_1;
} else if (x <= 3.5e-241) {
tmp = c * ((a * j) - (b * z));
} else if (x <= 1.5e-93) {
tmp = b * ((i * t) - (c * z));
} else if (x <= 3.5e+102) {
tmp = i * fma(-1.0, (j * y), (b * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -2e+52) tmp = t_1; elseif (x <= 3.5e-241) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (x <= 1.5e-93) tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); elseif (x <= 3.5e+102) tmp = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+52], t$95$1, If[LessEqual[x, 3.5e-241], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-93], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+102], N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-241}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-93}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+102}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2e52 or 3.50000000000000011e102 < x Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around inf
Applied rewrites39.4%
Applied rewrites39.4%
if -2e52 < x < 3.4999999999999999e-241Initial program 73.7%
Taylor expanded in c around inf
Applied rewrites39.9%
if 3.4999999999999999e-241 < x < 1.5000000000000001e-93Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
if 1.5000000000000001e-93 < x < 3.50000000000000011e102Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in i around inf
Applied rewrites38.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -2e+52)
t_1
(if (<= x 3.5e-241)
(* c (- (* a j) (* b z)))
(if (<= x 3e+102) (* b (- (* i t) (* 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 * ((y * z) - (a * t));
double tmp;
if (x <= -2e+52) {
tmp = t_1;
} else if (x <= 3.5e-241) {
tmp = c * ((a * j) - (b * z));
} else if (x <= 3e+102) {
tmp = b * ((i * t) - (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 * ((y * z) - (a * t))
if (x <= (-2d+52)) then
tmp = t_1
else if (x <= 3.5d-241) then
tmp = c * ((a * j) - (b * z))
else if (x <= 3d+102) then
tmp = b * ((i * t) - (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 * ((y * z) - (a * t));
double tmp;
if (x <= -2e+52) {
tmp = t_1;
} else if (x <= 3.5e-241) {
tmp = c * ((a * j) - (b * z));
} else if (x <= 3e+102) {
tmp = b * ((i * t) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -2e+52: tmp = t_1 elif x <= 3.5e-241: tmp = c * ((a * j) - (b * z)) elif x <= 3e+102: tmp = b * ((i * t) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -2e+52) tmp = t_1; elseif (x <= 3.5e-241) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (x <= 3e+102) tmp = Float64(b * Float64(Float64(i * t) - 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 * ((y * z) - (a * t)); tmp = 0.0; if (x <= -2e+52) tmp = t_1; elseif (x <= 3.5e-241) tmp = c * ((a * j) - (b * z)); elseif (x <= 3e+102) tmp = b * ((i * t) - (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[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+52], t$95$1, If[LessEqual[x, 3.5e-241], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e+102], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-241}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+102}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2e52 or 2.9999999999999998e102 < x Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around inf
Applied rewrites39.4%
Applied rewrites39.4%
if -2e52 < x < 3.4999999999999999e-241Initial program 73.7%
Taylor expanded in c around inf
Applied rewrites39.9%
if 3.4999999999999999e-241 < x < 2.9999999999999998e102Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (- (* y z) (* a t))))) (if (<= x -1.6e-5) t_1 (if (<= x 3e+102) (* b (- (* i t) (* 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 * ((y * z) - (a * t));
double tmp;
if (x <= -1.6e-5) {
tmp = t_1;
} else if (x <= 3e+102) {
tmp = b * ((i * t) - (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 * ((y * z) - (a * t))
if (x <= (-1.6d-5)) then
tmp = t_1
else if (x <= 3d+102) then
tmp = b * ((i * t) - (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 * ((y * z) - (a * t));
double tmp;
if (x <= -1.6e-5) {
tmp = t_1;
} else if (x <= 3e+102) {
tmp = b * ((i * t) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -1.6e-5: tmp = t_1 elif x <= 3e+102: tmp = b * ((i * t) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -1.6e-5) tmp = t_1; elseif (x <= 3e+102) tmp = Float64(b * Float64(Float64(i * t) - 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 * ((y * z) - (a * t)); tmp = 0.0; if (x <= -1.6e-5) tmp = t_1; elseif (x <= 3e+102) tmp = b * ((i * t) - (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[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e-5], t$95$1, If[LessEqual[x, 3e+102], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+102}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.59999999999999993e-5 or 2.9999999999999998e102 < x Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around inf
Applied rewrites39.4%
Applied rewrites39.4%
if -1.59999999999999993e-5 < x < 2.9999999999999998e102Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (- (* y z) (* a t))))) (if (<= x -3.2e+22) t_1 (if (<= x 7e+23) (* j (- (* a c) (* 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 = x * ((y * z) - (a * t));
double tmp;
if (x <= -3.2e+22) {
tmp = t_1;
} else if (x <= 7e+23) {
tmp = j * ((a * c) - (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 = x * ((y * z) - (a * t))
if (x <= (-3.2d+22)) then
tmp = t_1
else if (x <= 7d+23) then
tmp = j * ((a * c) - (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 = x * ((y * z) - (a * t));
double tmp;
if (x <= -3.2e+22) {
tmp = t_1;
} else if (x <= 7e+23) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -3.2e+22: tmp = t_1 elif x <= 7e+23: tmp = j * ((a * c) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -3.2e+22) tmp = t_1; elseif (x <= 7e+23) tmp = Float64(j * Float64(Float64(a * c) - 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 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -3.2e+22) tmp = t_1; elseif (x <= 7e+23) tmp = j * ((a * c) - (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[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+22], t$95$1, If[LessEqual[x, 7e+23], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+23}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.2e22 or 7.0000000000000004e23 < x Initial program 73.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Taylor expanded in x around inf
Applied rewrites39.4%
Applied rewrites39.4%
if -3.2e22 < x < 7.0000000000000004e23Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (* -1.0 (* t x)))))
(if (<= x -6.3e+34)
t_1
(if (<= x 4.3e+111)
(* j (- (* a c) (* i y)))
(if (<= x 1.5e+234) (* x (* y 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 * (-1.0 * (t * x));
double tmp;
if (x <= -6.3e+34) {
tmp = t_1;
} else if (x <= 4.3e+111) {
tmp = j * ((a * c) - (i * y));
} else if (x <= 1.5e+234) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 * ((-1.0d0) * (t * x))
if (x <= (-6.3d+34)) then
tmp = t_1
else if (x <= 4.3d+111) then
tmp = j * ((a * c) - (i * y))
else if (x <= 1.5d+234) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (-1.0 * (t * x));
double tmp;
if (x <= -6.3e+34) {
tmp = t_1;
} else if (x <= 4.3e+111) {
tmp = j * ((a * c) - (i * y));
} else if (x <= 1.5e+234) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (-1.0 * (t * x)) tmp = 0 if x <= -6.3e+34: tmp = t_1 elif x <= 4.3e+111: tmp = j * ((a * c) - (i * y)) elif x <= 1.5e+234: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(-1.0 * Float64(t * x))) tmp = 0.0 if (x <= -6.3e+34) tmp = t_1; elseif (x <= 4.3e+111) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (x <= 1.5e+234) tmp = Float64(x * Float64(y * 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 * (-1.0 * (t * x)); tmp = 0.0; if (x <= -6.3e+34) tmp = t_1; elseif (x <= 4.3e+111) tmp = j * ((a * c) - (i * y)); elseif (x <= 1.5e+234) tmp = x * (y * 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[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.3e+34], t$95$1, If[LessEqual[x, 4.3e+111], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+234], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{if}\;x \leq -6.3 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+111}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+234}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.3000000000000001e34 or 1.4999999999999999e234 < x Initial program 73.7%
Taylor expanded in a around inf
Applied rewrites38.6%
Taylor expanded in x around inf
Applied rewrites21.6%
if -6.3000000000000001e34 < x < 4.29999999999999993e111Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
if 4.29999999999999993e111 < x < 1.4999999999999999e234Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (* -1.0 (* t x)))))
(if (<= x -1.7e+33)
t_1
(if (<= x 7.2e-245)
(* b (* -1.0 (* c z)))
(if (<= x 9.5e+43)
(* b (* i t))
(if (<= x 1.5e+234) (* x (* y 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 * (-1.0 * (t * x));
double tmp;
if (x <= -1.7e+33) {
tmp = t_1;
} else if (x <= 7.2e-245) {
tmp = b * (-1.0 * (c * z));
} else if (x <= 9.5e+43) {
tmp = b * (i * t);
} else if (x <= 1.5e+234) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 * ((-1.0d0) * (t * x))
if (x <= (-1.7d+33)) then
tmp = t_1
else if (x <= 7.2d-245) then
tmp = b * ((-1.0d0) * (c * z))
else if (x <= 9.5d+43) then
tmp = b * (i * t)
else if (x <= 1.5d+234) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (-1.0 * (t * x));
double tmp;
if (x <= -1.7e+33) {
tmp = t_1;
} else if (x <= 7.2e-245) {
tmp = b * (-1.0 * (c * z));
} else if (x <= 9.5e+43) {
tmp = b * (i * t);
} else if (x <= 1.5e+234) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (-1.0 * (t * x)) tmp = 0 if x <= -1.7e+33: tmp = t_1 elif x <= 7.2e-245: tmp = b * (-1.0 * (c * z)) elif x <= 9.5e+43: tmp = b * (i * t) elif x <= 1.5e+234: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(-1.0 * Float64(t * x))) tmp = 0.0 if (x <= -1.7e+33) tmp = t_1; elseif (x <= 7.2e-245) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); elseif (x <= 9.5e+43) tmp = Float64(b * Float64(i * t)); elseif (x <= 1.5e+234) tmp = Float64(x * Float64(y * 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 * (-1.0 * (t * x)); tmp = 0.0; if (x <= -1.7e+33) tmp = t_1; elseif (x <= 7.2e-245) tmp = b * (-1.0 * (c * z)); elseif (x <= 9.5e+43) tmp = b * (i * t); elseif (x <= 1.5e+234) tmp = x * (y * 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[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e+33], t$95$1, If[LessEqual[x, 7.2e-245], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e+43], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+234], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-245}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+43}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+234}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.7e33 or 1.4999999999999999e234 < x Initial program 73.7%
Taylor expanded in a around inf
Applied rewrites38.6%
Taylor expanded in x around inf
Applied rewrites21.6%
if -1.7e33 < x < 7.19999999999999999e-245Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
Taylor expanded in z around inf
Applied rewrites22.7%
if 7.19999999999999999e-245 < x < 9.5000000000000004e43Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
Taylor expanded in z around 0
Applied rewrites21.2%
if 9.5000000000000004e43 < x < 1.4999999999999999e234Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (* -1.0 (* t x)))))
(if (<= x -9.8e+31)
t_1
(if (<= x 7.5e-241)
(* c (* a j))
(if (<= x 9.5e+43)
(* b (* i t))
(if (<= x 1.5e+234) (* x (* y 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 * (-1.0 * (t * x));
double tmp;
if (x <= -9.8e+31) {
tmp = t_1;
} else if (x <= 7.5e-241) {
tmp = c * (a * j);
} else if (x <= 9.5e+43) {
tmp = b * (i * t);
} else if (x <= 1.5e+234) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 * ((-1.0d0) * (t * x))
if (x <= (-9.8d+31)) then
tmp = t_1
else if (x <= 7.5d-241) then
tmp = c * (a * j)
else if (x <= 9.5d+43) then
tmp = b * (i * t)
else if (x <= 1.5d+234) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (-1.0 * (t * x));
double tmp;
if (x <= -9.8e+31) {
tmp = t_1;
} else if (x <= 7.5e-241) {
tmp = c * (a * j);
} else if (x <= 9.5e+43) {
tmp = b * (i * t);
} else if (x <= 1.5e+234) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (-1.0 * (t * x)) tmp = 0 if x <= -9.8e+31: tmp = t_1 elif x <= 7.5e-241: tmp = c * (a * j) elif x <= 9.5e+43: tmp = b * (i * t) elif x <= 1.5e+234: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(-1.0 * Float64(t * x))) tmp = 0.0 if (x <= -9.8e+31) tmp = t_1; elseif (x <= 7.5e-241) tmp = Float64(c * Float64(a * j)); elseif (x <= 9.5e+43) tmp = Float64(b * Float64(i * t)); elseif (x <= 1.5e+234) tmp = Float64(x * Float64(y * 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 * (-1.0 * (t * x)); tmp = 0.0; if (x <= -9.8e+31) tmp = t_1; elseif (x <= 7.5e-241) tmp = c * (a * j); elseif (x <= 9.5e+43) tmp = b * (i * t); elseif (x <= 1.5e+234) tmp = x * (y * 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[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.8e+31], t$95$1, If[LessEqual[x, 7.5e-241], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e+43], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+234], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-241}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+43}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+234}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.79999999999999991e31 or 1.4999999999999999e234 < x Initial program 73.7%
Taylor expanded in a around inf
Applied rewrites38.6%
Taylor expanded in x around inf
Applied rewrites21.6%
if -9.79999999999999991e31 < x < 7.49999999999999977e-241Initial program 73.7%
Taylor expanded in c around inf
Applied rewrites39.9%
Taylor expanded in z around 0
Applied rewrites22.7%
if 7.49999999999999977e-241 < x < 9.5000000000000004e43Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
Taylor expanded in z around 0
Applied rewrites21.2%
if 9.5000000000000004e43 < x < 1.4999999999999999e234Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= y -1.4e+93)
t_1
(if (<= y -1.15e-121)
(* j (* a c))
(if (<= y 6.2e-202)
(* b (* i t))
(if (<= y 7.5e+128) (* j (* -1.0 (* 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 = x * (y * z);
double tmp;
if (y <= -1.4e+93) {
tmp = t_1;
} else if (y <= -1.15e-121) {
tmp = j * (a * c);
} else if (y <= 6.2e-202) {
tmp = b * (i * t);
} else if (y <= 7.5e+128) {
tmp = j * (-1.0 * (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 = x * (y * z)
if (y <= (-1.4d+93)) then
tmp = t_1
else if (y <= (-1.15d-121)) then
tmp = j * (a * c)
else if (y <= 6.2d-202) then
tmp = b * (i * t)
else if (y <= 7.5d+128) then
tmp = j * ((-1.0d0) * (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 = x * (y * z);
double tmp;
if (y <= -1.4e+93) {
tmp = t_1;
} else if (y <= -1.15e-121) {
tmp = j * (a * c);
} else if (y <= 6.2e-202) {
tmp = b * (i * t);
} else if (y <= 7.5e+128) {
tmp = j * (-1.0 * (i * y));
} 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.4e+93: tmp = t_1 elif y <= -1.15e-121: tmp = j * (a * c) elif y <= 6.2e-202: tmp = b * (i * t) elif y <= 7.5e+128: tmp = j * (-1.0 * (i * y)) 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.4e+93) tmp = t_1; elseif (y <= -1.15e-121) tmp = Float64(j * Float64(a * c)); elseif (y <= 6.2e-202) tmp = Float64(b * Float64(i * t)); elseif (y <= 7.5e+128) tmp = Float64(j * Float64(-1.0 * 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 = x * (y * z); tmp = 0.0; if (y <= -1.4e+93) tmp = t_1; elseif (y <= -1.15e-121) tmp = j * (a * c); elseif (y <= 6.2e-202) tmp = b * (i * t); elseif (y <= 7.5e+128) tmp = j * (-1.0 * (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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+93], t$95$1, If[LessEqual[y, -1.15e-121], N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-202], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+128], N[(j * N[(-1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-121}:\\
\;\;\;\;j \cdot \left(a \cdot c\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-202}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+128}:\\
\;\;\;\;j \cdot \left(-1 \cdot \left(i \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.39999999999999994e93 or 7.50000000000000076e128 < y Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites22.8%
if -1.39999999999999994e93 < y < -1.15000000000000006e-121Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
Taylor expanded in y around 0
Applied rewrites22.6%
if -1.15000000000000006e-121 < y < 6.2e-202Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
Taylor expanded in z around 0
Applied rewrites21.2%
if 6.2e-202 < y < 7.50000000000000076e128Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
Taylor expanded in y around inf
Applied rewrites22.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= y -1.4e+93)
t_1
(if (<= y -1.15e-121)
(* j (* a c))
(if (<= y 3.5e+54) (* b (* i 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 = x * (y * z);
double tmp;
if (y <= -1.4e+93) {
tmp = t_1;
} else if (y <= -1.15e-121) {
tmp = j * (a * c);
} else if (y <= 3.5e+54) {
tmp = b * (i * 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 = x * (y * z)
if (y <= (-1.4d+93)) then
tmp = t_1
else if (y <= (-1.15d-121)) then
tmp = j * (a * c)
else if (y <= 3.5d+54) then
tmp = b * (i * 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 = x * (y * z);
double tmp;
if (y <= -1.4e+93) {
tmp = t_1;
} else if (y <= -1.15e-121) {
tmp = j * (a * c);
} else if (y <= 3.5e+54) {
tmp = b * (i * t);
} 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.4e+93: tmp = t_1 elif y <= -1.15e-121: tmp = j * (a * c) elif y <= 3.5e+54: tmp = b * (i * t) 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.4e+93) tmp = t_1; elseif (y <= -1.15e-121) tmp = Float64(j * Float64(a * c)); elseif (y <= 3.5e+54) tmp = Float64(b * Float64(i * t)); 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.4e+93) tmp = t_1; elseif (y <= -1.15e-121) tmp = j * (a * c); elseif (y <= 3.5e+54) tmp = b * (i * 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+93], t$95$1, If[LessEqual[y, -1.15e-121], N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+54], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-121}:\\
\;\;\;\;j \cdot \left(a \cdot c\right)\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+54}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.39999999999999994e93 or 3.5000000000000001e54 < y Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites22.8%
if -1.39999999999999994e93 < y < -1.15000000000000006e-121Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
Taylor expanded in y around 0
Applied rewrites22.6%
if -1.15000000000000006e-121 < y < 3.5000000000000001e54Initial program 73.7%
Taylor expanded in b around inf
Applied rewrites38.4%
Taylor expanded in z around 0
Applied rewrites21.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* j (* a c)))) (if (<= c -1.25e+26) t_1 (if (<= c 1750.0) (* x (* y z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * (a * c);
double tmp;
if (c <= -1.25e+26) {
tmp = t_1;
} else if (c <= 1750.0) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * (a * c)
if (c <= (-1.25d+26)) then
tmp = t_1
else if (c <= 1750.0d0) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * (a * c);
double tmp;
if (c <= -1.25e+26) {
tmp = t_1;
} else if (c <= 1750.0) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * (a * c) tmp = 0 if c <= -1.25e+26: tmp = t_1 elif c <= 1750.0: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(a * c)) tmp = 0.0 if (c <= -1.25e+26) tmp = t_1; elseif (c <= 1750.0) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * (a * c); tmp = 0.0; if (c <= -1.25e+26) tmp = t_1; elseif (c <= 1750.0) tmp = x * (y * 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[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.25e+26], t$95$1, If[LessEqual[c, 1750.0], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;c \leq -1.25 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1750:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.25e26 or 1750 < c Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
Taylor expanded in y around 0
Applied rewrites22.6%
if -1.25e26 < c < 1750Initial program 73.7%
Taylor expanded in i around 0
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites22.8%
(FPCore (x y z t a b c i j) :precision binary64 (* j (* a c)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return j * (a * c);
}
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 = j * (a * c)
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 j * (a * c);
}
def code(x, y, z, t, a, b, c, i, j): return j * (a * c)
function code(x, y, z, t, a, b, c, i, j) return Float64(j * Float64(a * c)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = j * (a * c); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
j \cdot \left(a \cdot c\right)
\end{array}
Initial program 73.7%
Taylor expanded in b around 0
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites39.6%
Taylor expanded in y around 0
Applied rewrites22.6%
herbie shell --seed 2025161
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))