
(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 22 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))
(*
-1.0
(*
i
(-
(fma
-1.0
(/ (- (fma c (* j t) (* x (- (* y z) (* a t)))) (* b (* c z))) i)
(* j y))
(* a b))))
(if (<= t_1 INFINITY) t_1 (* z (- (* x y) (* b c)))))))
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 = -1.0 * (i * (fma(-1.0, ((fma(c, (j * t), (x * ((y * z) - (a * t)))) - (b * (c * z))) / i), (j * y)) - (a * b)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
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 <= Float64(-Inf)) tmp = Float64(-1.0 * Float64(i * Float64(fma(-1.0, Float64(Float64(fma(c, Float64(j * t), Float64(x * Float64(Float64(y * z) - Float64(a * t)))) - Float64(b * Float64(c * z))) / i), Float64(j * y)) - Float64(a * b)))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); 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)], N[(-1.0 * N[(i * N[(N[(-1.0 * N[(N[(N[(c * N[(j * t), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision] + N[(j * y), $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $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:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(c, j \cdot t, x \cdot \left(y \cdot z - a \cdot t\right)\right) - b \cdot \left(c \cdot z\right)}{i}, j \cdot y\right) - a \cdot b\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\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.8%
Taylor expanded in i around -inf
Applied rewrites67.8%
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)))) < +inf.0Initial program 73.8%
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.8%
Taylor expanded in z around inf
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))))
(t_2 (+ t_1 (* j (- (* c t) (* i y))))))
(if (<= t_2 (- INFINITY))
(+ t_1 (fma -1.0 (* i (* j y)) (* c (* j t))))
(if (<= t_2 INFINITY) t_2 (* z (- (* x y) (* b c)))))))
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)));
double t_2 = t_1 + (j * ((c * t) - (i * y)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 + fma(-1.0, (i * (j * y)), (c * (j * t)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) t_2 = Float64(t_1 + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 + fma(-1.0, Float64(i * Float64(j * y)), Float64(c * Float64(j * t)))); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(t$95$1 + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 + N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\\
t_2 := t\_1 + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1 + \mathsf{fma}\left(-1, i \cdot \left(j \cdot y\right), c \cdot \left(j \cdot t\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\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.8%
Taylor expanded in y around 0
Applied rewrites72.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)))) < +inf.0Initial program 73.8%
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.8%
Taylor expanded in z around inf
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 (- INFINITY))
(+
(- (* i (* j y)))
(-
(fma (- (* y z) (* a t)) x (* (- (* j t) (* b z)) c))
(- (* a (* b i)))))
(if (<= t_1 INFINITY) t_1 (* z (- (* x y) (* b c)))))))
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 = -(i * (j * y)) + (fma(((y * z) - (a * t)), x, (((j * t) - (b * z)) * c)) - -(a * (b * i)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
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 <= Float64(-Inf)) tmp = Float64(Float64(-Float64(i * Float64(j * y))) + Float64(fma(Float64(Float64(y * z) - Float64(a * t)), x, Float64(Float64(Float64(j * t) - Float64(b * z)) * c)) - Float64(-Float64(a * Float64(b * i))))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); 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)], N[((-N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]) + N[(N[(N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] - (-N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $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:\\
\;\;\;\;\left(-i \cdot \left(j \cdot y\right)\right) + \left(\mathsf{fma}\left(y \cdot z - a \cdot t, x, \left(j \cdot t - b \cdot z\right) \cdot c\right) - \left(-a \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\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.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
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)))) < +inf.0Initial program 73.8%
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.8%
Taylor expanded in z around inf
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* z (- (* x y) (* b c))))))
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 = z * ((x * y) - (b * c));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * ((x * y) - (b * c)) 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(z * Float64(Float64(x * y) - Float64(b * c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * ((x * y) - (b * c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $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}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\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.8%
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.8%
Taylor expanded in z around inf
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t))))
(t_2 (* x (* y z)))
(t_3 (* b (- (fma a i (/ t_1 b)) (* c z)))))
(if (<= b -3.7e-5)
t_3
(if (<= b -2.45e-172)
(- (fma c (- (* j t) (* b z)) t_2) (* i (* j y)))
(if (<= b 8e-79)
(fma j (- (* c t) (* i y)) t_1)
(if (<= b 1.9e+231)
t_3
(*
-1.0
(*
a
(- (fma -1.0 (/ (- t_2 (* b (* c z))) a) (* t x)) (* b 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) - (a * t));
double t_2 = x * (y * z);
double t_3 = b * (fma(a, i, (t_1 / b)) - (c * z));
double tmp;
if (b <= -3.7e-5) {
tmp = t_3;
} else if (b <= -2.45e-172) {
tmp = fma(c, ((j * t) - (b * z)), t_2) - (i * (j * y));
} else if (b <= 8e-79) {
tmp = fma(j, ((c * t) - (i * y)), t_1);
} else if (b <= 1.9e+231) {
tmp = t_3;
} else {
tmp = -1.0 * (a * (fma(-1.0, ((t_2 - (b * (c * z))) / a), (t * x)) - (b * i)));
}
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(x * Float64(y * z)) t_3 = Float64(b * Float64(fma(a, i, Float64(t_1 / b)) - Float64(c * z))) tmp = 0.0 if (b <= -3.7e-5) tmp = t_3; elseif (b <= -2.45e-172) tmp = Float64(fma(c, Float64(Float64(j * t) - Float64(b * z)), t_2) - Float64(i * Float64(j * y))); elseif (b <= 8e-79) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), t_1); elseif (b <= 1.9e+231) tmp = t_3; else tmp = Float64(-1.0 * Float64(a * Float64(fma(-1.0, Float64(Float64(t_2 - Float64(b * Float64(c * z))) / a), Float64(t * x)) - Float64(b * i)))); 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(N[(a * i + N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.7e-5], t$95$3, If[LessEqual[b, -2.45e-172], N[(N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e-79], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[b, 1.9e+231], t$95$3, N[(-1.0 * N[(a * N[(N[(-1.0 * N[(N[(t$95$2 - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] + N[(t * x), $MachinePrecision]), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
t_2 := x \cdot \left(y \cdot z\right)\\
t_3 := b \cdot \left(\mathsf{fma}\left(a, i, \frac{t\_1}{b}\right) - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq -2.45 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(c, j \cdot t - b \cdot z, t\_2\right) - i \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;b \leq 8 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+231}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(\mathsf{fma}\left(-1, \frac{t\_2 - b \cdot \left(c \cdot z\right)}{a}, t \cdot x\right) - b \cdot i\right)\right)\\
\end{array}
\end{array}
if b < -3.69999999999999981e-5 or 8e-79 < b < 1.9e231Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in b around inf
Applied rewrites59.5%
if -3.69999999999999981e-5 < b < -2.45e-172Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in a around 0
Applied rewrites58.2%
if -2.45e-172 < b < 8e-79Initial program 73.8%
Taylor expanded in b around 0
Applied rewrites61.3%
if 1.9e231 < b Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in a around -inf
Applied rewrites55.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t))))
(t_2 (* b (- (fma a i (/ t_1 b)) (* c z)))))
(if (<= b -3.7e-5)
t_2
(if (<= b -2.45e-172)
(- (fma c (- (* j t) (* b z)) (* x (* y z))) (* i (* j y)))
(if (<= b 8e-79) (fma j (- (* c t) (* i y)) 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 = b * (fma(a, i, (t_1 / b)) - (c * z));
double tmp;
if (b <= -3.7e-5) {
tmp = t_2;
} else if (b <= -2.45e-172) {
tmp = fma(c, ((j * t) - (b * z)), (x * (y * z))) - (i * (j * y));
} else if (b <= 8e-79) {
tmp = fma(j, ((c * t) - (i * y)), 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 = Float64(b * Float64(fma(a, i, Float64(t_1 / b)) - Float64(c * z))) tmp = 0.0 if (b <= -3.7e-5) tmp = t_2; elseif (b <= -2.45e-172) tmp = Float64(fma(c, Float64(Float64(j * t) - Float64(b * z)), Float64(x * Float64(y * z))) - Float64(i * Float64(j * y))); elseif (b <= 8e-79) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), 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[(b * N[(N[(a * i + N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.7e-5], t$95$2, If[LessEqual[b, -2.45e-172], N[(N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e-79], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $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 := b \cdot \left(\mathsf{fma}\left(a, i, \frac{t\_1}{b}\right) - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -2.45 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(c, j \cdot t - b \cdot z, x \cdot \left(y \cdot z\right)\right) - i \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;b \leq 8 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -3.69999999999999981e-5 or 8e-79 < b Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in b around inf
Applied rewrites59.5%
if -3.69999999999999981e-5 < b < -2.45e-172Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in a around 0
Applied rewrites58.2%
if -2.45e-172 < b < 8e-79Initial program 73.8%
Taylor expanded in b around 0
Applied rewrites61.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))) (t_2 (* x (- (* y z) (* a t)))))
(if (<= j -3.5e+49)
(+ (* x (* y z)) (* j t_1))
(if (<= j 5.5e+30) (- t_2 (* b (- (* c z) (* a i)))) (fma j 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 * t) - (i * y);
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (j <= -3.5e+49) {
tmp = (x * (y * z)) + (j * t_1);
} else if (j <= 5.5e+30) {
tmp = t_2 - (b * ((c * z) - (a * i)));
} else {
tmp = fma(j, t_1, t_2);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) t_2 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (j <= -3.5e+49) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * t_1)); elseif (j <= 5.5e+30) tmp = Float64(t_2 - Float64(b * Float64(Float64(c * z) - Float64(a * i)))); else tmp = fma(j, t_1, t_2); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.5e+49], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.5e+30], N[(t$95$2 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * t$95$1 + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
t_2 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;j \leq -3.5 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot t\_1\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{+30}:\\
\;\;\;\;t\_2 - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_1, t\_2\right)\\
\end{array}
\end{array}
if j < -3.49999999999999975e49Initial program 73.8%
Taylor expanded in y around inf
Applied rewrites50.3%
if -3.49999999999999975e49 < j < 5.50000000000000025e30Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
if 5.50000000000000025e30 < j Initial program 73.8%
Taylor expanded in b around 0
Applied rewrites61.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= b -5.5e+80)
(- (* x (* y z)) (* b (- (* c z) (* a i))))
(if (<= b -2.45e-172)
(- t_1 (* b (* c z)))
(if (<= b 1.85e+108)
(fma j (- (* c t) (* i y)) t_1)
(* b (- (* a i) (* 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) - (a * t));
double tmp;
if (b <= -5.5e+80) {
tmp = (x * (y * z)) - (b * ((c * z) - (a * i)));
} else if (b <= -2.45e-172) {
tmp = t_1 - (b * (c * z));
} else if (b <= 1.85e+108) {
tmp = fma(j, ((c * t) - (i * y)), t_1);
} else {
tmp = b * ((a * i) - (c * z));
}
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 (b <= -5.5e+80) tmp = Float64(Float64(x * Float64(y * z)) - Float64(b * Float64(Float64(c * z) - Float64(a * i)))); elseif (b <= -2.45e-172) tmp = Float64(t_1 - Float64(b * Float64(c * z))); elseif (b <= 1.85e+108) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), t_1); else tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); 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[b, -5.5e+80], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.45e-172], N[(t$95$1 - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e+108], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;b \leq -5.5 \cdot 10^{+80}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{elif}\;b \leq -2.45 \cdot 10^{-172}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z\right)\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{+108}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\end{array}
\end{array}
if b < -5.49999999999999967e80Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in t around 0
Applied rewrites49.7%
if -5.49999999999999967e80 < b < -2.45e-172Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in z around inf
Applied rewrites50.3%
if -2.45e-172 < b < 1.8499999999999999e108Initial program 73.8%
Taylor expanded in b around 0
Applied rewrites61.3%
if 1.8499999999999999e108 < b Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -4.5e-60)
(- t_1 (* b (* c z)))
(if (<= x 1.15e-284)
(* c (- (* j t) (* b z)))
(if (<= x 6e+111) (- (* x (* y z)) (* b (- (* c z) (* 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) - (a * t));
double tmp;
if (x <= -4.5e-60) {
tmp = t_1 - (b * (c * z));
} else if (x <= 1.15e-284) {
tmp = c * ((j * t) - (b * z));
} else if (x <= 6e+111) {
tmp = (x * (y * z)) - (b * ((c * z) - (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) - (a * t))
if (x <= (-4.5d-60)) then
tmp = t_1 - (b * (c * z))
else if (x <= 1.15d-284) then
tmp = c * ((j * t) - (b * z))
else if (x <= 6d+111) then
tmp = (x * (y * z)) - (b * ((c * z) - (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) - (a * t));
double tmp;
if (x <= -4.5e-60) {
tmp = t_1 - (b * (c * z));
} else if (x <= 1.15e-284) {
tmp = c * ((j * t) - (b * z));
} else if (x <= 6e+111) {
tmp = (x * (y * z)) - (b * ((c * z) - (a * i)));
} 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 <= -4.5e-60: tmp = t_1 - (b * (c * z)) elif x <= 1.15e-284: tmp = c * ((j * t) - (b * z)) elif x <= 6e+111: tmp = (x * (y * z)) - (b * ((c * z) - (a * i))) 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 <= -4.5e-60) tmp = Float64(t_1 - Float64(b * Float64(c * z))); elseif (x <= 1.15e-284) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (x <= 6e+111) tmp = Float64(Float64(x * Float64(y * z)) - Float64(b * Float64(Float64(c * z) - Float64(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) - (a * t)); tmp = 0.0; if (x <= -4.5e-60) tmp = t_1 - (b * (c * z)); elseif (x <= 1.15e-284) tmp = c * ((j * t) - (b * z)); elseif (x <= 6e+111) tmp = (x * (y * z)) - (b * ((c * z) - (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[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e-60], N[(t$95$1 - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-284], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+111], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $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 -4.5 \cdot 10^{-60}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-284}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.50000000000000001e-60Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in z around inf
Applied rewrites50.3%
if -4.50000000000000001e-60 < x < 1.15e-284Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
if 1.15e-284 < x < 6e111Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in t around 0
Applied rewrites49.7%
if 6e111 < x Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in x around inf
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -1.02e+50)
t_1
(if (<= x -2e-41)
(* b (- (* a i) (* c z)))
(if (<= x 1.15e-284)
(* c (- (* j t) (* b z)))
(if (<= x 6e+111)
(- (* x (* y z)) (* b (- (* c z) (* 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) - (a * t));
double tmp;
if (x <= -1.02e+50) {
tmp = t_1;
} else if (x <= -2e-41) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 1.15e-284) {
tmp = c * ((j * t) - (b * z));
} else if (x <= 6e+111) {
tmp = (x * (y * z)) - (b * ((c * z) - (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) - (a * t))
if (x <= (-1.02d+50)) then
tmp = t_1
else if (x <= (-2d-41)) then
tmp = b * ((a * i) - (c * z))
else if (x <= 1.15d-284) then
tmp = c * ((j * t) - (b * z))
else if (x <= 6d+111) then
tmp = (x * (y * z)) - (b * ((c * z) - (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) - (a * t));
double tmp;
if (x <= -1.02e+50) {
tmp = t_1;
} else if (x <= -2e-41) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 1.15e-284) {
tmp = c * ((j * t) - (b * z));
} else if (x <= 6e+111) {
tmp = (x * (y * z)) - (b * ((c * z) - (a * i)));
} 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.02e+50: tmp = t_1 elif x <= -2e-41: tmp = b * ((a * i) - (c * z)) elif x <= 1.15e-284: tmp = c * ((j * t) - (b * z)) elif x <= 6e+111: tmp = (x * (y * z)) - (b * ((c * z) - (a * i))) 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.02e+50) tmp = t_1; elseif (x <= -2e-41) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (x <= 1.15e-284) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (x <= 6e+111) tmp = Float64(Float64(x * Float64(y * z)) - Float64(b * Float64(Float64(c * z) - Float64(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) - (a * t)); tmp = 0.0; if (x <= -1.02e+50) tmp = t_1; elseif (x <= -2e-41) tmp = b * ((a * i) - (c * z)); elseif (x <= 1.15e-284) tmp = c * ((j * t) - (b * z)); elseif (x <= 6e+111) tmp = (x * (y * z)) - (b * ((c * z) - (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[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e+50], t$95$1, If[LessEqual[x, -2e-41], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-284], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+111], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $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.02 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-284}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.01999999999999991e50 or 6e111 < x Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in x around inf
Applied rewrites39.5%
if -1.01999999999999991e50 < x < -2.00000000000000001e-41Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
if -2.00000000000000001e-41 < x < 1.15e-284Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
if 1.15e-284 < x < 6e111Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in j around 0
Applied rewrites59.6%
Taylor expanded in t around 0
Applied rewrites49.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -1.02e+50)
t_1
(if (<= x -2e-41)
(* b (- (* a i) (* c z)))
(if (<= x 62000000.0) (* c (* j (+ t (* -1.0 (/ (* b z) j))))) 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.02e+50) {
tmp = t_1;
} else if (x <= -2e-41) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 62000000.0) {
tmp = c * (j * (t + (-1.0 * ((b * z) / j))));
} 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.02d+50)) then
tmp = t_1
else if (x <= (-2d-41)) then
tmp = b * ((a * i) - (c * z))
else if (x <= 62000000.0d0) then
tmp = c * (j * (t + ((-1.0d0) * ((b * z) / j))))
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.02e+50) {
tmp = t_1;
} else if (x <= -2e-41) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 62000000.0) {
tmp = c * (j * (t + (-1.0 * ((b * z) / j))));
} 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.02e+50: tmp = t_1 elif x <= -2e-41: tmp = b * ((a * i) - (c * z)) elif x <= 62000000.0: tmp = c * (j * (t + (-1.0 * ((b * z) / j)))) 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.02e+50) tmp = t_1; elseif (x <= -2e-41) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (x <= 62000000.0) tmp = Float64(c * Float64(j * Float64(t + Float64(-1.0 * Float64(Float64(b * z) / j))))); 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.02e+50) tmp = t_1; elseif (x <= -2e-41) tmp = b * ((a * i) - (c * z)); elseif (x <= 62000000.0) tmp = c * (j * (t + (-1.0 * ((b * z) / j)))); 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.02e+50], t$95$1, If[LessEqual[x, -2e-41], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 62000000.0], N[(c * N[(j * N[(t + N[(-1.0 * N[(N[(b * z), $MachinePrecision] / j), $MachinePrecision]), $MachinePrecision]), $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.02 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;x \leq 62000000:\\
\;\;\;\;c \cdot \left(j \cdot \left(t + -1 \cdot \frac{b \cdot z}{j}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.01999999999999991e50 or 6.2e7 < x Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in x around inf
Applied rewrites39.5%
if -1.01999999999999991e50 < x < -2.00000000000000001e-41Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
if -2.00000000000000001e-41 < x < 6.2e7Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
Taylor expanded in j around inf
Applied rewrites40.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -1.02e+50)
t_1
(if (<= x -2e-41)
(* b (- (* a i) (* c z)))
(if (<= x 62000000.0) (* c (- (* j t) (* b z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.02e+50) {
tmp = t_1;
} else if (x <= -2e-41) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 62000000.0) {
tmp = c * ((j * t) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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.02d+50)) then
tmp = t_1
else if (x <= (-2d-41)) then
tmp = b * ((a * i) - (c * z))
else if (x <= 62000000.0d0) then
tmp = c * ((j * t) - (b * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.02e+50) {
tmp = t_1;
} else if (x <= -2e-41) {
tmp = b * ((a * i) - (c * z));
} else if (x <= 62000000.0) {
tmp = c * ((j * t) - (b * 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.02e+50: tmp = t_1 elif x <= -2e-41: tmp = b * ((a * i) - (c * z)) elif x <= 62000000.0: tmp = c * ((j * t) - (b * 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.02e+50) tmp = t_1; elseif (x <= -2e-41) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (x <= 62000000.0) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * 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.02e+50) tmp = t_1; elseif (x <= -2e-41) tmp = b * ((a * i) - (c * z)); elseif (x <= 62000000.0) tmp = c * ((j * t) - (b * 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.02e+50], t$95$1, If[LessEqual[x, -2e-41], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 62000000.0], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * 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.02 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;x \leq 62000000:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.01999999999999991e50 or 6.2e7 < x Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in x around inf
Applied rewrites39.5%
if -1.01999999999999991e50 < x < -2.00000000000000001e-41Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
if -2.00000000000000001e-41 < x < 6.2e7Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* b (- (* a i) (* c z))))) (if (<= b -0.000172) t_1 (if (<= b 6e+52) (* y (- (* x z) (* i j))) 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 <= -0.000172) {
tmp = t_1;
} else if (b <= 6e+52) {
tmp = y * ((x * z) - (i * j));
} 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 <= (-0.000172d0)) then
tmp = t_1
else if (b <= 6d+52) then
tmp = y * ((x * z) - (i * j))
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 <= -0.000172) {
tmp = t_1;
} else if (b <= 6e+52) {
tmp = y * ((x * z) - (i * j));
} 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 <= -0.000172: tmp = t_1 elif b <= 6e+52: tmp = y * ((x * z) - (i * j)) 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 <= -0.000172) tmp = t_1; elseif (b <= 6e+52) tmp = Float64(y * Float64(Float64(x * z) - Float64(i * j))); 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 <= -0.000172) tmp = t_1; elseif (b <= 6e+52) tmp = y * ((x * z) - (i * j)); 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, -0.000172], t$95$1, If[LessEqual[b, 6e+52], N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * j), $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 -0.000172:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \left(x \cdot z - i \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.7200000000000001e-4 or 6e52 < b Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
if -1.7200000000000001e-4 < b < 6e52Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in y around inf
Applied rewrites39.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -6e+123)
(* c (* -1.0 (* b z)))
(if (<= b 6.5e+57)
(* y (- (* x z) (* i j)))
(if (<= b 1.08e+191) (* b (* -1.0 (* c z))) (* i (- (* a b) (* 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 (b <= -6e+123) {
tmp = c * (-1.0 * (b * z));
} else if (b <= 6.5e+57) {
tmp = y * ((x * z) - (i * j));
} else if (b <= 1.08e+191) {
tmp = b * (-1.0 * (c * z));
} else {
tmp = i * ((a * b) - (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 (b <= (-6d+123)) then
tmp = c * ((-1.0d0) * (b * z))
else if (b <= 6.5d+57) then
tmp = y * ((x * z) - (i * j))
else if (b <= 1.08d+191) then
tmp = b * ((-1.0d0) * (c * z))
else
tmp = i * ((a * b) - (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 (b <= -6e+123) {
tmp = c * (-1.0 * (b * z));
} else if (b <= 6.5e+57) {
tmp = y * ((x * z) - (i * j));
} else if (b <= 1.08e+191) {
tmp = b * (-1.0 * (c * z));
} else {
tmp = i * ((a * b) - (j * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -6e+123: tmp = c * (-1.0 * (b * z)) elif b <= 6.5e+57: tmp = y * ((x * z) - (i * j)) elif b <= 1.08e+191: tmp = b * (-1.0 * (c * z)) else: tmp = i * ((a * b) - (j * y)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -6e+123) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (b <= 6.5e+57) tmp = Float64(y * Float64(Float64(x * z) - Float64(i * j))); elseif (b <= 1.08e+191) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); else tmp = Float64(i * Float64(Float64(a * b) - Float64(j * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -6e+123) tmp = c * (-1.0 * (b * z)); elseif (b <= 6.5e+57) tmp = y * ((x * z) - (i * j)); elseif (b <= 1.08e+191) tmp = b * (-1.0 * (c * z)); else tmp = i * ((a * b) - (j * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -6e+123], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e+57], N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.08e+191], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(N[(a * b), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{+123}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+57}:\\
\;\;\;\;y \cdot \left(x \cdot z - i \cdot j\right)\\
\mathbf{elif}\;b \leq 1.08 \cdot 10^{+191}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(a \cdot b - j \cdot y\right)\\
\end{array}
\end{array}
if b < -6.00000000000000016e123Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
Taylor expanded in z around inf
Applied rewrites23.0%
if -6.00000000000000016e123 < b < 6.4999999999999997e57Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in y around inf
Applied rewrites39.7%
if 6.4999999999999997e57 < b < 1.08000000000000002e191Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
Taylor expanded in z around inf
Applied rewrites23.1%
if 1.08000000000000002e191 < b Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in i around inf
Applied rewrites37.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* t (* -1.0 (* a x)))))
(if (<= x -2.6e+72)
t_1
(if (<= x 5.5e+103) (* i (- (* a b) (* j 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 = t * (-1.0 * (a * x));
double tmp;
if (x <= -2.6e+72) {
tmp = t_1;
} else if (x <= 5.5e+103) {
tmp = i * ((a * b) - (j * 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 = t * ((-1.0d0) * (a * x))
if (x <= (-2.6d+72)) then
tmp = t_1
else if (x <= 5.5d+103) then
tmp = i * ((a * b) - (j * 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 = t * (-1.0 * (a * x));
double tmp;
if (x <= -2.6e+72) {
tmp = t_1;
} else if (x <= 5.5e+103) {
tmp = i * ((a * b) - (j * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = t * (-1.0 * (a * x)) tmp = 0 if x <= -2.6e+72: tmp = t_1 elif x <= 5.5e+103: tmp = i * ((a * b) - (j * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(t * Float64(-1.0 * Float64(a * x))) tmp = 0.0 if (x <= -2.6e+72) tmp = t_1; elseif (x <= 5.5e+103) tmp = Float64(i * Float64(Float64(a * b) - Float64(j * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = t * (-1.0 * (a * x)); tmp = 0.0; if (x <= -2.6e+72) tmp = t_1; elseif (x <= 5.5e+103) tmp = i * ((a * b) - (j * 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[(t * N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e+72], t$95$1, If[LessEqual[x, 5.5e+103], N[(i * N[(N[(a * b), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-1 \cdot \left(a \cdot x\right)\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+103}:\\
\;\;\;\;i \cdot \left(a \cdot b - j \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.59999999999999981e72 or 5.50000000000000001e103 < x Initial program 73.8%
Taylor expanded in t around inf
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites22.0%
if -2.59999999999999981e72 < x < 5.50000000000000001e103Initial program 73.8%
Taylor expanded in c around 0
Applied rewrites72.7%
Applied rewrites72.7%
Applied rewrites72.7%
Taylor expanded in i around inf
Applied rewrites37.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -2.4e-172)
(* c (* -1.0 (* b z)))
(if (<= b 1.12e+105)
(* t (* -1.0 (* a x)))
(if (<= b 1.4e+198) (* b (* -1.0 (* c z))) (* b (* 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 <= -2.4e-172) {
tmp = c * (-1.0 * (b * z));
} else if (b <= 1.12e+105) {
tmp = t * (-1.0 * (a * x));
} else if (b <= 1.4e+198) {
tmp = b * (-1.0 * (c * z));
} else {
tmp = b * (a * i);
}
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 (b <= (-2.4d-172)) then
tmp = c * ((-1.0d0) * (b * z))
else if (b <= 1.12d+105) then
tmp = t * ((-1.0d0) * (a * x))
else if (b <= 1.4d+198) then
tmp = b * ((-1.0d0) * (c * z))
else
tmp = b * (a * i)
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 (b <= -2.4e-172) {
tmp = c * (-1.0 * (b * z));
} else if (b <= 1.12e+105) {
tmp = t * (-1.0 * (a * x));
} else if (b <= 1.4e+198) {
tmp = b * (-1.0 * (c * z));
} else {
tmp = b * (a * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -2.4e-172: tmp = c * (-1.0 * (b * z)) elif b <= 1.12e+105: tmp = t * (-1.0 * (a * x)) elif b <= 1.4e+198: tmp = b * (-1.0 * (c * z)) else: tmp = b * (a * i) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -2.4e-172) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (b <= 1.12e+105) tmp = Float64(t * Float64(-1.0 * Float64(a * x))); elseif (b <= 1.4e+198) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); else tmp = Float64(b * Float64(a * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -2.4e-172) tmp = c * (-1.0 * (b * z)); elseif (b <= 1.12e+105) tmp = t * (-1.0 * (a * x)); elseif (b <= 1.4e+198) tmp = b * (-1.0 * (c * z)); else tmp = b * (a * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.4e-172], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.12e+105], N[(t * N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.4e+198], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-172}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 1.12 \cdot 10^{+105}:\\
\;\;\;\;t \cdot \left(-1 \cdot \left(a \cdot x\right)\right)\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+198}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\
\end{array}
\end{array}
if b < -2.4000000000000001e-172Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
Taylor expanded in z around inf
Applied rewrites23.0%
if -2.4000000000000001e-172 < b < 1.12e105Initial program 73.8%
Taylor expanded in t around inf
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites22.0%
if 1.12e105 < b < 1.4e198Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
Taylor expanded in z around inf
Applied rewrites23.1%
if 1.4e198 < b Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
Taylor expanded in z around 0
Applied rewrites21.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -6.5e-173) (* c (* -1.0 (* b z))) (if (<= b 7800.0) (* -1.0 (* a (* t x))) (* (* a b) 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 <= -6.5e-173) {
tmp = c * (-1.0 * (b * z));
} else if (b <= 7800.0) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = (a * b) * i;
}
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 (b <= (-6.5d-173)) then
tmp = c * ((-1.0d0) * (b * z))
else if (b <= 7800.0d0) then
tmp = (-1.0d0) * (a * (t * x))
else
tmp = (a * b) * i
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 (b <= -6.5e-173) {
tmp = c * (-1.0 * (b * z));
} else if (b <= 7800.0) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = (a * b) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -6.5e-173: tmp = c * (-1.0 * (b * z)) elif b <= 7800.0: tmp = -1.0 * (a * (t * x)) else: tmp = (a * b) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -6.5e-173) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (b <= 7800.0) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); else tmp = Float64(Float64(a * b) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -6.5e-173) tmp = c * (-1.0 * (b * z)); elseif (b <= 7800.0) tmp = -1.0 * (a * (t * x)); else tmp = (a * b) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -6.5e-173], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7800.0], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-173}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 7800:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\end{array}
\end{array}
if b < -6.4999999999999995e-173Initial program 73.8%
Taylor expanded in c around inf
Applied rewrites39.7%
Taylor expanded in z around inf
Applied rewrites23.0%
if -6.4999999999999995e-173 < b < 7800Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around inf
Applied rewrites22.0%
if 7800 < b Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
Applied rewrites21.2%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -6.5e-173) (* b (* -1.0 (* c z))) (if (<= b 7800.0) (* -1.0 (* a (* t x))) (* (* a b) 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 <= -6.5e-173) {
tmp = b * (-1.0 * (c * z));
} else if (b <= 7800.0) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = (a * b) * i;
}
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 (b <= (-6.5d-173)) then
tmp = b * ((-1.0d0) * (c * z))
else if (b <= 7800.0d0) then
tmp = (-1.0d0) * (a * (t * x))
else
tmp = (a * b) * i
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 (b <= -6.5e-173) {
tmp = b * (-1.0 * (c * z));
} else if (b <= 7800.0) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = (a * b) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -6.5e-173: tmp = b * (-1.0 * (c * z)) elif b <= 7800.0: tmp = -1.0 * (a * (t * x)) else: tmp = (a * b) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -6.5e-173) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); elseif (b <= 7800.0) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); else tmp = Float64(Float64(a * b) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -6.5e-173) tmp = b * (-1.0 * (c * z)); elseif (b <= 7800.0) tmp = -1.0 * (a * (t * x)); else tmp = (a * b) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -6.5e-173], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7800.0], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-173}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 7800:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\end{array}
\end{array}
if b < -6.4999999999999995e-173Initial program 73.8%
Taylor expanded in b around inf
Applied rewrites39.2%
Taylor expanded in z around inf
Applied rewrites23.1%
if -6.4999999999999995e-173 < b < 7800Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around inf
Applied rewrites22.0%
if 7800 < b Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
Applied rewrites21.2%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -4.8e+58) (* a (* b i)) (if (<= b 7800.0) (* -1.0 (* a (* t x))) (* (* a b) 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+58) {
tmp = a * (b * i);
} else if (b <= 7800.0) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = (a * b) * i;
}
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 (b <= (-4.8d+58)) then
tmp = a * (b * i)
else if (b <= 7800.0d0) then
tmp = (-1.0d0) * (a * (t * x))
else
tmp = (a * b) * i
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 (b <= -4.8e+58) {
tmp = a * (b * i);
} else if (b <= 7800.0) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = (a * b) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -4.8e+58: tmp = a * (b * i) elif b <= 7800.0: tmp = -1.0 * (a * (t * x)) else: tmp = (a * b) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -4.8e+58) tmp = Float64(a * Float64(b * i)); elseif (b <= 7800.0) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); else tmp = Float64(Float64(a * b) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -4.8e+58) tmp = a * (b * i); elseif (b <= 7800.0) tmp = -1.0 * (a * (t * x)); else tmp = (a * b) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -4.8e+58], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7800.0], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+58}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;b \leq 7800:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\end{array}
\end{array}
if b < -4.8e58Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
if -4.8e58 < b < 7800Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around inf
Applied rewrites22.0%
if 7800 < b Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
Applied rewrites21.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* c (* j t)))) (if (<= t -2.05e+30) t_1 (if (<= t 2.3e-15) (* (* a b) 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 = c * (j * t);
double tmp;
if (t <= -2.05e+30) {
tmp = t_1;
} else if (t <= 2.3e-15) {
tmp = (a * b) * 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 = c * (j * t)
if (t <= (-2.05d+30)) then
tmp = t_1
else if (t <= 2.3d-15) then
tmp = (a * b) * 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 = c * (j * t);
double tmp;
if (t <= -2.05e+30) {
tmp = t_1;
} else if (t <= 2.3e-15) {
tmp = (a * b) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (j * t) tmp = 0 if t <= -2.05e+30: tmp = t_1 elif t <= 2.3e-15: tmp = (a * b) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(j * t)) tmp = 0.0 if (t <= -2.05e+30) tmp = t_1; elseif (t <= 2.3e-15) tmp = Float64(Float64(a * b) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (j * t); tmp = 0.0; if (t <= -2.05e+30) tmp = t_1; elseif (t <= 2.3e-15) tmp = (a * b) * 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[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.05e+30], t$95$1, If[LessEqual[t, 2.3e-15], N[(N[(a * b), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
\mathbf{if}\;t \leq -2.05 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-15}:\\
\;\;\;\;\left(a \cdot b\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.05000000000000003e30 or 2.2999999999999999e-15 < t Initial program 73.8%
Taylor expanded in t around inf
Applied rewrites38.8%
Taylor expanded in x around 0
Applied rewrites22.3%
if -2.05000000000000003e30 < t < 2.2999999999999999e-15Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
Applied rewrites21.2%
(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(Float64(a * 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[(N[(a * b), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}
\\
\left(a \cdot b\right) \cdot i
\end{array}
Initial program 73.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
Applied rewrites21.2%
(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.8%
Taylor expanded in a around -inf
Applied rewrites37.9%
Taylor expanded in x around 0
Applied rewrites21.1%
herbie shell --seed 2025161
(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)))))