
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* 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 (- (* c z) (* i a))) (t_2 (- (* c t) (* i y))))
(if (<= (+ (- (* x (- (* y z) (* t a))) (* b t_1)) (* j t_2)) INFINITY)
(fma t_2 j (- (* (- (* z y) (* a t)) x) (* t_1 b)))
(*
(- c)
(fma
(- j)
t
(-
(-
(/
(-
(fma (- a) (* x t) (fma (* x y) z (* (* (- i) j) y)))
(* (- a) (* b i)))
c))
(- (* b z))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * z) - (i * a);
double t_2 = (c * t) - (i * y);
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * t_1)) + (j * t_2)) <= ((double) INFINITY)) {
tmp = fma(t_2, j, ((((z * y) - (a * t)) * x) - (t_1 * b)));
} else {
tmp = -c * fma(-j, t, (-((fma(-a, (x * t), fma((x * y), z, ((-i * j) * y))) - (-a * (b * i))) / c) - -(b * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * z) - Float64(i * a)) t_2 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * t_1)) + Float64(j * t_2)) <= Inf) tmp = fma(t_2, j, Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(t_1 * b))); else tmp = Float64(Float64(-c) * fma(Float64(-j), t, Float64(Float64(-Float64(Float64(fma(Float64(-a), Float64(x * t), fma(Float64(x * y), z, Float64(Float64(Float64(-i) * j) * y))) - Float64(Float64(-a) * Float64(b * i))) / c)) - Float64(-Float64(b * z))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$2), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * j + N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-c) * N[((-j) * t + N[((-N[(N[(N[((-a) * N[(x * t), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] * z + N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[((-a) * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]) - (-N[(b * z), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot z - i \cdot a\\
t_2 := c \cdot t - i \cdot y\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot t\_1\right) + j \cdot t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_2, j, \left(z \cdot y - a \cdot t\right) \cdot x - t\_1 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-c\right) \cdot \mathsf{fma}\left(-j, t, \left(-\frac{\mathsf{fma}\left(-a, x \cdot t, \mathsf{fma}\left(x \cdot y, z, \left(\left(-i\right) \cdot j\right) \cdot y\right)\right) - \left(-a\right) \cdot \left(b \cdot i\right)}{c}\right) - \left(-b \cdot z\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 72.8%
Applied rewrites74.5%
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 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c z) (* i a))) (t_2 (- (* c t) (* i y))))
(if (<= (+ (- (* x (- (* y z) (* t a))) (* b t_1)) (* j t_2)) INFINITY)
(fma t_2 j (- (* (- (* z y) (* a t)) x) (* t_1 b)))
(* (- a) (- (* t x) (* i b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * z) - (i * a);
double t_2 = (c * t) - (i * y);
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * t_1)) + (j * t_2)) <= ((double) INFINITY)) {
tmp = fma(t_2, j, ((((z * y) - (a * t)) * x) - (t_1 * b)));
} else {
tmp = -a * ((t * x) - (i * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * z) - Float64(i * a)) t_2 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * t_1)) + Float64(j * t_2)) <= Inf) tmp = fma(t_2, j, Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(t_1 * b))); else tmp = Float64(Float64(-a) * Float64(Float64(t * x) - Float64(i * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$2), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * j + N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(N[(t * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot z - i \cdot a\\
t_2 := c \cdot t - i \cdot y\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot t\_1\right) + j \cdot t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_2, j, \left(z \cdot y - a \cdot t\right) \cdot x - t\_1 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x - i \cdot b\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 72.8%
Applied rewrites74.5%
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 72.8%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (fma (- a) (* t x) (* (* j t) c)) (* (- (* c z) (* i a)) b))))
(if (<= b -6e-35)
t_1
(if (<= b 2.1e+131)
(fma j (- (* c t) (* i y)) (* x (- (* y z) (* a t))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, (t * x), ((j * t) * c)) - (((c * z) - (i * a)) * b);
double tmp;
if (b <= -6e-35) {
tmp = t_1;
} else if (b <= 2.1e+131) {
tmp = fma(j, ((c * t) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(j * t) * c)) - Float64(Float64(Float64(c * z) - Float64(i * a)) * b)) tmp = 0.0 if (b <= -6e-35) tmp = t_1; elseif (b <= 2.1e+131) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6e-35], t$95$1, If[LessEqual[b, 2.1e+131], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t \cdot x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot z - i \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -6 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.99999999999999978e-35 or 2.09999999999999985e131 < b Initial program 72.8%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6458.4
Applied rewrites58.4%
if -5.99999999999999978e-35 < b < 2.09999999999999985e131Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= b -1.55e-32)
(- t_1 (* b (- (* c z) (* a i))))
(if (<= b 9.2e+128)
(fma j (- (* c t) (* i y)) t_1)
(if (<= b 1.5e+167)
(* (- i) (- (* j y) (* b a)))
(+ (- (* (* c b) z)) (* (fma j t (/ (* (* (- i) j) y) c)) 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) - (a * t));
double tmp;
if (b <= -1.55e-32) {
tmp = t_1 - (b * ((c * z) - (a * i)));
} else if (b <= 9.2e+128) {
tmp = fma(j, ((c * t) - (i * y)), t_1);
} else if (b <= 1.5e+167) {
tmp = -i * ((j * y) - (b * a));
} else {
tmp = -((c * b) * z) + (fma(j, t, (((-i * j) * y) / c)) * c);
}
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 <= -1.55e-32) tmp = Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(a * i)))); elseif (b <= 9.2e+128) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), t_1); elseif (b <= 1.5e+167) tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * a))); else tmp = Float64(Float64(-Float64(Float64(c * b) * z)) + Float64(fma(j, t, Float64(Float64(Float64(Float64(-i) * j) * y) / c)) * c)); 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, -1.55e-32], N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.2e+128], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[b, 1.5e+167], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]) + N[(N[(j * t + N[(N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{+128}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+167}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\left(c \cdot b\right) \cdot z\right) + \mathsf{fma}\left(j, t, \frac{\left(\left(-i\right) \cdot j\right) \cdot y}{c}\right) \cdot c\\
\end{array}
\end{array}
if b < -1.55000000000000005e-32Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
Taylor expanded in j around 0
lower--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6458.8
Applied rewrites58.8%
if -1.55000000000000005e-32 < b < 9.19999999999999992e128Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
if 9.19999999999999992e128 < b < 1.50000000000000006e167Initial program 72.8%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
if 1.50000000000000006e167 < b Initial program 72.8%
Taylor expanded in c around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.0
Applied rewrites50.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6448.6
Applied rewrites48.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))) (t_2 (fma j (- (* c t) (* i y)) t_1)))
(if (<= t -0.96)
t_2
(if (<= t 2.5e-96) (- t_1 (* b (- (* c z) (* a i)))) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double t_2 = fma(j, ((c * t) - (i * y)), t_1);
double tmp;
if (t <= -0.96) {
tmp = t_2;
} else if (t <= 2.5e-96) {
tmp = t_1 - (b * ((c * z) - (a * i)));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) t_2 = fma(j, Float64(Float64(c * t) - Float64(i * y)), t_1) tmp = 0.0 if (t <= -0.96) tmp = t_2; elseif (t <= 2.5e-96) tmp = Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(a * i)))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, -0.96], t$95$2, If[LessEqual[t, 2.5e-96], N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
t_2 := \mathsf{fma}\left(j, c \cdot t - i \cdot y, t\_1\right)\\
\mathbf{if}\;t \leq -0.96:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-96}:\\
\;\;\;\;t\_1 - b \cdot \left(c \cdot z - a \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.95999999999999996 or 2.49999999999999997e-96 < t Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
if -0.95999999999999996 < t < 2.49999999999999997e-96Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
Taylor expanded in j around 0
lower--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6458.8
Applied rewrites58.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -1.55e-32) (* (- (* i a) (* c z)) b) (fma j (- (* c t) (* i y)) (* x (- (* y z) (* a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -1.55e-32) {
tmp = ((i * a) - (c * z)) * b;
} else {
tmp = fma(j, ((c * t) - (i * y)), (x * ((y * z) - (a * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -1.55e-32) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); else tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.55e-32], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
\end{array}
if b < -1.55000000000000005e-32Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
if -1.55000000000000005e-32 < b Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma j (* c t) (* x (- (* y z) (* a t))))))
(if (<= x -1.75e-13)
t_1
(if (<= x 3.8e+70) (+ (- (* (* c b) z)) (* j (- (* c t) (* i y)))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, (c * t), (x * ((y * z) - (a * t))));
double tmp;
if (x <= -1.75e-13) {
tmp = t_1;
} else if (x <= 3.8e+70) {
tmp = -((c * b) * z) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(j, Float64(c * t), Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (x <= -1.75e-13) tmp = t_1; elseif (x <= 3.8e+70) tmp = Float64(Float64(-Float64(Float64(c * b) * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(c * t), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e-13], t$95$1, If[LessEqual[x, 3.8e+70], N[((-N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]) + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, c \cdot t, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+70}:\\
\;\;\;\;\left(-\left(c \cdot b\right) \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.7500000000000001e-13 or 3.7999999999999998e70 < x Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
Taylor expanded in y around 0
lift-*.f6450.0
Applied rewrites50.0%
if -1.7500000000000001e-13 < x < 3.7999999999999998e70Initial program 72.8%
Taylor expanded in c around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.0
Applied rewrites50.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i a) (* c z)) b)))
(if (<= b -1.55e-32)
t_1
(if (<= b -2.15e-82)
(* (- (* t c) (* y i)) j)
(if (<= b 4.6e+131) (fma j (* c t) (* x (- (* y z) (* a t)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double tmp;
if (b <= -1.55e-32) {
tmp = t_1;
} else if (b <= -2.15e-82) {
tmp = ((t * c) - (y * i)) * j;
} else if (b <= 4.6e+131) {
tmp = fma(j, (c * t), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * a) - Float64(c * z)) * b) tmp = 0.0 if (b <= -1.55e-32) tmp = t_1; elseif (b <= -2.15e-82) tmp = Float64(Float64(Float64(t * c) - Float64(y * i)) * j); elseif (b <= 4.6e+131) tmp = fma(j, Float64(c * t), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.55e-32], t$95$1, If[LessEqual[b, -2.15e-82], N[(N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[b, 4.6e+131], N[(j * N[(c * t), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.15 \cdot 10^{-82}:\\
\;\;\;\;\left(t \cdot c - y \cdot i\right) \cdot j\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.55000000000000005e-32 or 4.59999999999999983e131 < b Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
if -1.55000000000000005e-32 < b < -2.15000000000000009e-82Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -2.15000000000000009e-82 < b < 4.59999999999999983e131Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
Taylor expanded in y around 0
lift-*.f6450.0
Applied rewrites50.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (- (* t x) (* i b)))))
(if (<= a -1e+22)
t_1
(if (<= a 2.3e-51) (+ (* (* z y) x) (* j (- (* c t) (* i y)))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -a * ((t * x) - (i * b));
double tmp;
if (a <= -1e+22) {
tmp = t_1;
} else if (a <= 2.3e-51) {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = -a * ((t * x) - (i * b))
if (a <= (-1d+22)) then
tmp = t_1
else if (a <= 2.3d-51) then
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -a * ((t * x) - (i * b));
double tmp;
if (a <= -1e+22) {
tmp = t_1;
} else if (a <= 2.3e-51) {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -a * ((t * x) - (i * b)) tmp = 0 if a <= -1e+22: tmp = t_1 elif a <= 2.3e-51: tmp = ((z * y) * x) + (j * ((c * t) - (i * y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-a) * Float64(Float64(t * x) - Float64(i * b))) tmp = 0.0 if (a <= -1e+22) tmp = t_1; elseif (a <= 2.3e-51) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -a * ((t * x) - (i * b)); tmp = 0.0; if (a <= -1e+22) tmp = t_1; elseif (a <= 2.3e-51) tmp = ((z * y) * x) + (j * ((c * t) - (i * y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-a) * N[(N[(t * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+22], t$95$1, If[LessEqual[a, 2.3e-51], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(t \cdot x - i \cdot b\right)\\
\mathbf{if}\;a \leq -1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-51}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1e22 or 2.30000000000000002e-51 < a Initial program 72.8%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -1e22 < a < 2.30000000000000002e-51Initial program 72.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z y) (* a t)) x)))
(if (<= x -2.3e-20)
t_1
(if (<= x -1.8e-237)
(* (- (* i a) (* c z)) b)
(if (<= x 1.45e-99)
(* (- (* t c) (* y i)) j)
(if (<= x 1.55e+29) (* (- (* j t) (* b z)) c) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -2.3e-20) {
tmp = t_1;
} else if (x <= -1.8e-237) {
tmp = ((i * a) - (c * z)) * b;
} else if (x <= 1.45e-99) {
tmp = ((t * c) - (y * i)) * j;
} else if (x <= 1.55e+29) {
tmp = ((j * t) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((z * y) - (a * t)) * x
if (x <= (-2.3d-20)) then
tmp = t_1
else if (x <= (-1.8d-237)) then
tmp = ((i * a) - (c * z)) * b
else if (x <= 1.45d-99) then
tmp = ((t * c) - (y * i)) * j
else if (x <= 1.55d+29) then
tmp = ((j * t) - (b * z)) * c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -2.3e-20) {
tmp = t_1;
} else if (x <= -1.8e-237) {
tmp = ((i * a) - (c * z)) * b;
} else if (x <= 1.45e-99) {
tmp = ((t * c) - (y * i)) * j;
} else if (x <= 1.55e+29) {
tmp = ((j * t) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * y) - (a * t)) * x tmp = 0 if x <= -2.3e-20: tmp = t_1 elif x <= -1.8e-237: tmp = ((i * a) - (c * z)) * b elif x <= 1.45e-99: tmp = ((t * c) - (y * i)) * j elif x <= 1.55e+29: tmp = ((j * t) - (b * z)) * c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -2.3e-20) tmp = t_1; elseif (x <= -1.8e-237) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); elseif (x <= 1.45e-99) tmp = Float64(Float64(Float64(t * c) - Float64(y * i)) * j); elseif (x <= 1.55e+29) tmp = Float64(Float64(Float64(j * t) - Float64(b * z)) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((z * y) - (a * t)) * x; tmp = 0.0; if (x <= -2.3e-20) tmp = t_1; elseif (x <= -1.8e-237) tmp = ((i * a) - (c * z)) * b; elseif (x <= 1.45e-99) tmp = ((t * c) - (y * i)) * j; elseif (x <= 1.55e+29) tmp = ((j * t) - (b * z)) * c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.3e-20], t$95$1, If[LessEqual[x, -1.8e-237], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 1.45e-99], N[(N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 1.55e+29], N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-237}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-99}:\\
\;\;\;\;\left(t \cdot c - y \cdot i\right) \cdot j\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+29}:\\
\;\;\;\;\left(j \cdot t - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.2999999999999999e-20 or 1.5499999999999999e29 < x Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
if -2.2999999999999999e-20 < x < -1.79999999999999998e-237Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
if -1.79999999999999998e-237 < x < 1.44999999999999993e-99Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if 1.44999999999999993e-99 < x < 1.5499999999999999e29Initial program 72.8%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i a) (* c z)) b)) (t_2 (* (- (* z y) (* a t)) x)))
(if (<= x -2.3e-20)
t_2
(if (<= x -1.8e-237)
t_1
(if (<= x 2.1e-102)
(* (- (* t c) (* y i)) j)
(if (<= x 1.4e+71) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -2.3e-20) {
tmp = t_2;
} else if (x <= -1.8e-237) {
tmp = t_1;
} else if (x <= 2.1e-102) {
tmp = ((t * c) - (y * i)) * j;
} else if (x <= 1.4e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((i * a) - (c * z)) * b
t_2 = ((z * y) - (a * t)) * x
if (x <= (-2.3d-20)) then
tmp = t_2
else if (x <= (-1.8d-237)) then
tmp = t_1
else if (x <= 2.1d-102) then
tmp = ((t * c) - (y * i)) * j
else if (x <= 1.4d+71) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * a) - (c * z)) * b;
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -2.3e-20) {
tmp = t_2;
} else if (x <= -1.8e-237) {
tmp = t_1;
} else if (x <= 2.1e-102) {
tmp = ((t * c) - (y * i)) * j;
} else if (x <= 1.4e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * a) - (c * z)) * b t_2 = ((z * y) - (a * t)) * x tmp = 0 if x <= -2.3e-20: tmp = t_2 elif x <= -1.8e-237: tmp = t_1 elif x <= 2.1e-102: tmp = ((t * c) - (y * i)) * j elif x <= 1.4e+71: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * a) - Float64(c * z)) * b) t_2 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -2.3e-20) tmp = t_2; elseif (x <= -1.8e-237) tmp = t_1; elseif (x <= 2.1e-102) tmp = Float64(Float64(Float64(t * c) - Float64(y * i)) * j); elseif (x <= 1.4e+71) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * a) - (c * z)) * b; t_2 = ((z * y) - (a * t)) * x; tmp = 0.0; if (x <= -2.3e-20) tmp = t_2; elseif (x <= -1.8e-237) tmp = t_1; elseif (x <= 2.1e-102) tmp = ((t * c) - (y * i)) * j; elseif (x <= 1.4e+71) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.3e-20], t$95$2, If[LessEqual[x, -1.8e-237], t$95$1, If[LessEqual[x, 2.1e-102], N[(N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 1.4e+71], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
t_2 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-102}:\\
\;\;\;\;\left(t \cdot c - y \cdot i\right) \cdot j\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.2999999999999999e-20 or 1.40000000000000001e71 < x Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
if -2.2999999999999999e-20 < x < -1.79999999999999998e-237 or 2.1e-102 < x < 1.40000000000000001e71Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
if -1.79999999999999998e-237 < x < 2.1e-102Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* z y) (* a t)) x))) (if (<= x -2.5e-19) t_1 (if (<= x 3.8e+70) (* (- (* t c) (* y 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 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -2.5e-19) {
tmp = t_1;
} else if (x <= 3.8e+70) {
tmp = ((t * c) - (y * 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 = ((z * y) - (a * t)) * x
if (x <= (-2.5d-19)) then
tmp = t_1
else if (x <= 3.8d+70) then
tmp = ((t * c) - (y * 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 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -2.5e-19) {
tmp = t_1;
} else if (x <= 3.8e+70) {
tmp = ((t * c) - (y * i)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * y) - (a * t)) * x tmp = 0 if x <= -2.5e-19: tmp = t_1 elif x <= 3.8e+70: tmp = ((t * c) - (y * i)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -2.5e-19) tmp = t_1; elseif (x <= 3.8e+70) tmp = Float64(Float64(Float64(t * c) - Float64(y * 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 = ((z * y) - (a * t)) * x; tmp = 0.0; if (x <= -2.5e-19) tmp = t_1; elseif (x <= 3.8e+70) tmp = ((t * c) - (y * 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[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.5e-19], t$95$1, If[LessEqual[x, 3.8e+70], N[(N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+70}:\\
\;\;\;\;\left(t \cdot c - y \cdot i\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.5000000000000002e-19 or 3.7999999999999998e70 < x Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
if -2.5000000000000002e-19 < x < 3.7999999999999998e70Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* -1.0 (* a t)) x)))
(if (<= a -1.82e+180)
t_1
(if (<= a -2e+22)
(* (- i) (* -1.0 (* a b)))
(if (<= a 5e-7) (* (- (* t c) (* y 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 = (-1.0 * (a * t)) * x;
double tmp;
if (a <= -1.82e+180) {
tmp = t_1;
} else if (a <= -2e+22) {
tmp = -i * (-1.0 * (a * b));
} else if (a <= 5e-7) {
tmp = ((t * c) - (y * 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 = ((-1.0d0) * (a * t)) * x
if (a <= (-1.82d+180)) then
tmp = t_1
else if (a <= (-2d+22)) then
tmp = -i * ((-1.0d0) * (a * b))
else if (a <= 5d-7) then
tmp = ((t * c) - (y * 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 = (-1.0 * (a * t)) * x;
double tmp;
if (a <= -1.82e+180) {
tmp = t_1;
} else if (a <= -2e+22) {
tmp = -i * (-1.0 * (a * b));
} else if (a <= 5e-7) {
tmp = ((t * c) - (y * i)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-1.0 * (a * t)) * x tmp = 0 if a <= -1.82e+180: tmp = t_1 elif a <= -2e+22: tmp = -i * (-1.0 * (a * b)) elif a <= 5e-7: tmp = ((t * c) - (y * i)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-1.0 * Float64(a * t)) * x) tmp = 0.0 if (a <= -1.82e+180) tmp = t_1; elseif (a <= -2e+22) tmp = Float64(Float64(-i) * Float64(-1.0 * Float64(a * b))); elseif (a <= 5e-7) tmp = Float64(Float64(Float64(t * c) - Float64(y * 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 = (-1.0 * (a * t)) * x; tmp = 0.0; if (a <= -1.82e+180) tmp = t_1; elseif (a <= -2e+22) tmp = -i * (-1.0 * (a * b)); elseif (a <= 5e-7) tmp = ((t * c) - (y * 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[(N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -1.82e+180], t$95$1, If[LessEqual[a, -2e+22], N[((-i) * N[(-1.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e-7], N[(N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x\\
\mathbf{if}\;a \leq -1.82 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2 \cdot 10^{+22}:\\
\;\;\;\;\left(-i\right) \cdot \left(-1 \cdot \left(a \cdot b\right)\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\left(t \cdot c - y \cdot i\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.8199999999999999e180 or 4.99999999999999977e-7 < a Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
lower-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
if -1.8199999999999999e180 < a < -2e22Initial program 72.8%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if -2e22 < a < 4.99999999999999977e-7Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -2.65e+68)
(* (* (- i) j) y)
(if (<= i -3.45e-105)
(* c (* j t))
(if (<= i 9.2e-143)
(* (* (- c) z) b)
(if (<= i 1.25e+242) (* (* b i) a) (* (- i) (* j y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.65e+68) {
tmp = (-i * j) * y;
} else if (i <= -3.45e-105) {
tmp = c * (j * t);
} else if (i <= 9.2e-143) {
tmp = (-c * z) * b;
} else if (i <= 1.25e+242) {
tmp = (b * i) * a;
} else {
tmp = -i * (j * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-2.65d+68)) then
tmp = (-i * j) * y
else if (i <= (-3.45d-105)) then
tmp = c * (j * t)
else if (i <= 9.2d-143) then
tmp = (-c * z) * b
else if (i <= 1.25d+242) then
tmp = (b * i) * a
else
tmp = -i * (j * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.65e+68) {
tmp = (-i * j) * y;
} else if (i <= -3.45e-105) {
tmp = c * (j * t);
} else if (i <= 9.2e-143) {
tmp = (-c * z) * b;
} else if (i <= 1.25e+242) {
tmp = (b * i) * a;
} else {
tmp = -i * (j * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -2.65e+68: tmp = (-i * j) * y elif i <= -3.45e-105: tmp = c * (j * t) elif i <= 9.2e-143: tmp = (-c * z) * b elif i <= 1.25e+242: tmp = (b * i) * a else: tmp = -i * (j * y) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -2.65e+68) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (i <= -3.45e-105) tmp = Float64(c * Float64(j * t)); elseif (i <= 9.2e-143) tmp = Float64(Float64(Float64(-c) * z) * b); elseif (i <= 1.25e+242) tmp = Float64(Float64(b * i) * a); else tmp = Float64(Float64(-i) * Float64(j * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -2.65e+68) tmp = (-i * j) * y; elseif (i <= -3.45e-105) tmp = c * (j * t); elseif (i <= 9.2e-143) tmp = (-c * z) * b; elseif (i <= 1.25e+242) tmp = (b * i) * a; else tmp = -i * (j * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -2.65e+68], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[i, -3.45e-105], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 9.2e-143], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[i, 1.25e+242], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.65 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;i \leq -3.45 \cdot 10^{-105}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;i \leq 9.2 \cdot 10^{-143}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;i \leq 1.25 \cdot 10^{+242}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\end{array}
\end{array}
if i < -2.6500000000000001e68Initial program 72.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if -2.6500000000000001e68 < i < -3.45000000000000014e-105Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -3.45000000000000014e-105 < i < 9.20000000000000045e-143Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6422.7
Applied rewrites22.7%
if 9.20000000000000045e-143 < i < 1.2500000000000001e242Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.2500000000000001e242 < i Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* -1.0 (* a t)) x)))
(if (<= a -1.82e+180)
t_1
(if (<= a -3.2e+16)
(* (- i) (* -1.0 (* a b)))
(if (<= a 7.2e-116) (* c (* j t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-1.0 * (a * t)) * x;
double tmp;
if (a <= -1.82e+180) {
tmp = t_1;
} else if (a <= -3.2e+16) {
tmp = -i * (-1.0 * (a * b));
} else if (a <= 7.2e-116) {
tmp = c * (j * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * (a * t)) * x
if (a <= (-1.82d+180)) then
tmp = t_1
else if (a <= (-3.2d+16)) then
tmp = -i * ((-1.0d0) * (a * b))
else if (a <= 7.2d-116) then
tmp = c * (j * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-1.0 * (a * t)) * x;
double tmp;
if (a <= -1.82e+180) {
tmp = t_1;
} else if (a <= -3.2e+16) {
tmp = -i * (-1.0 * (a * b));
} else if (a <= 7.2e-116) {
tmp = c * (j * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-1.0 * (a * t)) * x tmp = 0 if a <= -1.82e+180: tmp = t_1 elif a <= -3.2e+16: tmp = -i * (-1.0 * (a * b)) elif a <= 7.2e-116: tmp = c * (j * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-1.0 * Float64(a * t)) * x) tmp = 0.0 if (a <= -1.82e+180) tmp = t_1; elseif (a <= -3.2e+16) tmp = Float64(Float64(-i) * Float64(-1.0 * Float64(a * b))); elseif (a <= 7.2e-116) tmp = Float64(c * Float64(j * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-1.0 * (a * t)) * x; tmp = 0.0; if (a <= -1.82e+180) tmp = t_1; elseif (a <= -3.2e+16) tmp = -i * (-1.0 * (a * b)); elseif (a <= 7.2e-116) tmp = c * (j * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[a, -1.82e+180], t$95$1, If[LessEqual[a, -3.2e+16], N[((-i) * N[(-1.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-116], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 \cdot \left(a \cdot t\right)\right) \cdot x\\
\mathbf{if}\;a \leq -1.82 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{+16}:\\
\;\;\;\;\left(-i\right) \cdot \left(-1 \cdot \left(a \cdot b\right)\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-116}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.8199999999999999e180 or 7.19999999999999951e-116 < a Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
lower-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
if -1.8199999999999999e180 < a < -3.2e16Initial program 72.8%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if -3.2e16 < a < 7.19999999999999951e-116Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -2.65e+68)
(* (* (- i) j) y)
(if (<= i -3.45e-105)
(* c (* j t))
(if (<= i 9.2e-143)
(* (- c) (* z b))
(if (<= i 1.25e+242) (* (* b i) a) (* (- i) (* j y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.65e+68) {
tmp = (-i * j) * y;
} else if (i <= -3.45e-105) {
tmp = c * (j * t);
} else if (i <= 9.2e-143) {
tmp = -c * (z * b);
} else if (i <= 1.25e+242) {
tmp = (b * i) * a;
} else {
tmp = -i * (j * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-2.65d+68)) then
tmp = (-i * j) * y
else if (i <= (-3.45d-105)) then
tmp = c * (j * t)
else if (i <= 9.2d-143) then
tmp = -c * (z * b)
else if (i <= 1.25d+242) then
tmp = (b * i) * a
else
tmp = -i * (j * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -2.65e+68) {
tmp = (-i * j) * y;
} else if (i <= -3.45e-105) {
tmp = c * (j * t);
} else if (i <= 9.2e-143) {
tmp = -c * (z * b);
} else if (i <= 1.25e+242) {
tmp = (b * i) * a;
} else {
tmp = -i * (j * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -2.65e+68: tmp = (-i * j) * y elif i <= -3.45e-105: tmp = c * (j * t) elif i <= 9.2e-143: tmp = -c * (z * b) elif i <= 1.25e+242: tmp = (b * i) * a else: tmp = -i * (j * y) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -2.65e+68) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (i <= -3.45e-105) tmp = Float64(c * Float64(j * t)); elseif (i <= 9.2e-143) tmp = Float64(Float64(-c) * Float64(z * b)); elseif (i <= 1.25e+242) tmp = Float64(Float64(b * i) * a); else tmp = Float64(Float64(-i) * Float64(j * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -2.65e+68) tmp = (-i * j) * y; elseif (i <= -3.45e-105) tmp = c * (j * t); elseif (i <= 9.2e-143) tmp = -c * (z * b); elseif (i <= 1.25e+242) tmp = (b * i) * a; else tmp = -i * (j * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -2.65e+68], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[i, -3.45e-105], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 9.2e-143], N[((-c) * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.25e+242], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.65 \cdot 10^{+68}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;i \leq -3.45 \cdot 10^{-105}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;i \leq 9.2 \cdot 10^{-143}:\\
\;\;\;\;\left(-c\right) \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;i \leq 1.25 \cdot 10^{+242}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\end{array}
\end{array}
if i < -2.6500000000000001e68Initial program 72.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if -2.6500000000000001e68 < i < -3.45000000000000014e-105Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -3.45000000000000014e-105 < i < 9.20000000000000045e-143Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
Taylor expanded in x around 0
Applied rewrites22.6%
if 9.20000000000000045e-143 < i < 1.2500000000000001e242Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.2500000000000001e242 < i Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -1.6e-32)
(* (- c) (* z b))
(if (<= b -1.75e-181)
(* (- i) (* j y))
(if (<= b 1.95e+48) (* x (* y z)) (* (* b i) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -1.6e-32) {
tmp = -c * (z * b);
} else if (b <= -1.75e-181) {
tmp = -i * (j * y);
} else if (b <= 1.95e+48) {
tmp = x * (y * z);
} else {
tmp = (b * i) * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (b <= (-1.6d-32)) then
tmp = -c * (z * b)
else if (b <= (-1.75d-181)) then
tmp = -i * (j * y)
else if (b <= 1.95d+48) then
tmp = x * (y * z)
else
tmp = (b * i) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -1.6e-32) {
tmp = -c * (z * b);
} else if (b <= -1.75e-181) {
tmp = -i * (j * y);
} else if (b <= 1.95e+48) {
tmp = x * (y * z);
} else {
tmp = (b * i) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -1.6e-32: tmp = -c * (z * b) elif b <= -1.75e-181: tmp = -i * (j * y) elif b <= 1.95e+48: tmp = x * (y * z) else: tmp = (b * i) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -1.6e-32) tmp = Float64(Float64(-c) * Float64(z * b)); elseif (b <= -1.75e-181) tmp = Float64(Float64(-i) * Float64(j * y)); elseif (b <= 1.95e+48) tmp = Float64(x * Float64(y * z)); else tmp = Float64(Float64(b * i) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -1.6e-32) tmp = -c * (z * b); elseif (b <= -1.75e-181) tmp = -i * (j * y); elseif (b <= 1.95e+48) tmp = x * (y * z); else tmp = (b * i) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.6e-32], N[((-c) * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.75e-181], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e+48], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.6 \cdot 10^{-32}:\\
\;\;\;\;\left(-c\right) \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;b \leq -1.75 \cdot 10^{-181}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+48}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\end{array}
\end{array}
if b < -1.6000000000000001e-32Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
Taylor expanded in x around 0
Applied rewrites22.6%
if -1.6000000000000001e-32 < b < -1.74999999999999998e-181Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
if -1.74999999999999998e-181 < b < 1.95e48Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6421.7
Applied rewrites21.7%
if 1.95e48 < b Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (* j t))))
(if (<= t -7.8e+71)
t_1
(if (<= t -3.65e-261)
(* (* a i) b)
(if (<= t 2.9e+88) (* x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (t <= -7.8e+71) {
tmp = t_1;
} else if (t <= -3.65e-261) {
tmp = (a * i) * b;
} else if (t <= 2.9e+88) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (j * t)
if (t <= (-7.8d+71)) then
tmp = t_1
else if (t <= (-3.65d-261)) then
tmp = (a * i) * b
else if (t <= 2.9d+88) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (t <= -7.8e+71) {
tmp = t_1;
} else if (t <= -3.65e-261) {
tmp = (a * i) * b;
} else if (t <= 2.9e+88) {
tmp = x * (y * z);
} 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 <= -7.8e+71: tmp = t_1 elif t <= -3.65e-261: tmp = (a * i) * b elif t <= 2.9e+88: tmp = x * (y * z) 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 <= -7.8e+71) tmp = t_1; elseif (t <= -3.65e-261) tmp = Float64(Float64(a * i) * b); elseif (t <= 2.9e+88) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (j * t); tmp = 0.0; if (t <= -7.8e+71) tmp = t_1; elseif (t <= -3.65e-261) tmp = (a * i) * b; elseif (t <= 2.9e+88) tmp = x * (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e+71], t$95$1, If[LessEqual[t, -3.65e-261], N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 2.9e+88], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.65 \cdot 10^{-261}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.8000000000000002e71 or 2.9e88 < t Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in j around inf
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sub-sign-invN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -7.8000000000000002e71 < t < -3.64999999999999987e-261Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
lower-*.f6422.0
Applied rewrites22.0%
if -3.64999999999999987e-261 < t < 2.9e88Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (* y z)))) (if (<= z -2.7e+32) t_1 (if (<= z 7.5e+43) (* (* b i) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -2.7e+32) {
tmp = t_1;
} else if (z <= 7.5e+43) {
tmp = (b * i) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y * z)
if (z <= (-2.7d+32)) then
tmp = t_1
else if (z <= 7.5d+43) then
tmp = (b * i) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -2.7e+32) {
tmp = t_1;
} else if (z <= 7.5e+43) {
tmp = (b * i) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if z <= -2.7e+32: tmp = t_1 elif z <= 7.5e+43: tmp = (b * i) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (z <= -2.7e+32) tmp = t_1; elseif (z <= 7.5e+43) tmp = Float64(Float64(b * i) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (z <= -2.7e+32) tmp = t_1; elseif (z <= 7.5e+43) tmp = (b * i) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+32], t$95$1, If[LessEqual[z, 7.5e+43], N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+43}:\\
\;\;\;\;\left(b \cdot i\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.70000000000000013e32 or 7.49999999999999967e43 < z Initial program 72.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in c around -inf
Applied rewrites68.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6421.7
Applied rewrites21.7%
if -2.70000000000000013e32 < z < 7.49999999999999967e43Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
(FPCore (x y z t a b c i j) :precision binary64 (* (* b i) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * i) * a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (b * i) * a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * i) * a;
}
def code(x, y, z, t, a, b, c, i, j): return (b * i) * a
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(b * i) * a) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (b * i) * a; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * i), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot i\right) \cdot a
\end{array}
Initial program 72.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
herbie shell --seed 2025142
(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)))))