
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* (fma (- a) x (* j c)) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-a, x, (j * c)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 73.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 73.2%
Taylor expanded in t 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%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))) (t_2 (* j t_1)) (t_3 (- (* z y) (* a t))))
(if (<= j -8e+151)
(fma t_3 x (* t_1 j))
(if (<= j 4.5e-73)
(fma (- i) (* j y) (- (* t_3 x) (* (- a) (* i b))))
(if (<= j 1e+129)
(+ (* (* (+ (/ (* (- t) x) b) i) a) b) t_2)
(+ (* (* z y) x) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double t_2 = j * t_1;
double t_3 = (z * y) - (a * t);
double tmp;
if (j <= -8e+151) {
tmp = fma(t_3, x, (t_1 * j));
} else if (j <= 4.5e-73) {
tmp = fma(-i, (j * y), ((t_3 * x) - (-a * (i * b))));
} else if (j <= 1e+129) {
tmp = (((((-t * x) / b) + i) * a) * b) + t_2;
} else {
tmp = ((z * y) * x) + t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) t_2 = Float64(j * t_1) t_3 = Float64(Float64(z * y) - Float64(a * t)) tmp = 0.0 if (j <= -8e+151) tmp = fma(t_3, x, Float64(t_1 * j)); elseif (j <= 4.5e-73) tmp = fma(Float64(-i), Float64(j * y), Float64(Float64(t_3 * x) - Float64(Float64(-a) * Float64(i * b)))); elseif (j <= 1e+129) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(-t) * x) / b) + i) * a) * b) + t_2); else tmp = Float64(Float64(Float64(z * y) * x) + t_2); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+151], N[(t$95$3 * x + N[(t$95$1 * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4.5e-73], N[((-i) * N[(j * y), $MachinePrecision] + N[(N[(t$95$3 * x), $MachinePrecision] - N[((-a) * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1e+129], N[(N[(N[(N[(N[(N[((-t) * x), $MachinePrecision] / b), $MachinePrecision] + i), $MachinePrecision] * a), $MachinePrecision] * b), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
t_2 := j \cdot t\_1\\
t_3 := z \cdot y - a \cdot t\\
\mathbf{if}\;j \leq -8 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, x, t\_1 \cdot j\right)\\
\mathbf{elif}\;j \leq 4.5 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t\_3 \cdot x - \left(-a\right) \cdot \left(i \cdot b\right)\right)\\
\mathbf{elif}\;j \leq 10^{+129}:\\
\;\;\;\;\left(\left(\frac{\left(-t\right) \cdot x}{b} + i\right) \cdot a\right) \cdot b + t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + t\_2\\
\end{array}
\end{array}
if j < -8.00000000000000014e151Initial program 73.2%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6460.1
Applied rewrites60.1%
if -8.00000000000000014e151 < j < 4.5e-73Initial program 73.2%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites58.0%
if 4.5e-73 < j < 1e129Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6455.3
Applied rewrites55.3%
if 1e129 < j Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.1
Applied rewrites49.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- (* z y) (* a t)) x (* (- (* c t) (* i y)) j))))
(if (<= y -7.5e-149)
t_1
(if (<= y 2.5e-220)
(+
(- (* x (* (- (* z (/ y t)) a) t)) (* b (- (* c z) (* i a))))
(* j (* c 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(((z * y) - (a * t)), x, (((c * t) - (i * y)) * j));
double tmp;
if (y <= -7.5e-149) {
tmp = t_1;
} else if (y <= 2.5e-220) {
tmp = ((x * (((z * (y / t)) - a) * t)) - (b * ((c * z) - (i * a)))) + (j * (c * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(Float64(c * t) - Float64(i * y)) * j)) tmp = 0.0 if (y <= -7.5e-149) tmp = t_1; elseif (y <= 2.5e-220) tmp = Float64(Float64(Float64(x * Float64(Float64(Float64(z * Float64(y / t)) - a) * t)) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(c * 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[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e-149], t$95$1, If[LessEqual[y, 2.5e-220], N[(N[(N[(x * N[(N[(N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-220}:\\
\;\;\;\;\left(x \cdot \left(\left(z \cdot \frac{y}{t} - a\right) \cdot t\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.49999999999999995e-149 or 2.5000000000000001e-220 < y Initial program 73.2%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6460.1
Applied rewrites60.1%
if -7.49999999999999995e-149 < y < 2.5000000000000001e-220Initial program 73.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6470.1
Applied rewrites70.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
Taylor expanded in y around 0
lift-*.f6462.8
Applied rewrites62.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* z y) (* a t))) (t_2 (fma t_1 x (* (- (* c t) (* i y)) j))))
(if (<= j -8e+151)
t_2
(if (<= j 3.6e-31)
(fma (- i) (* j y) (- (* t_1 x) (* (- a) (* i b))))
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 = (z * y) - (a * t);
double t_2 = fma(t_1, x, (((c * t) - (i * y)) * j));
double tmp;
if (j <= -8e+151) {
tmp = t_2;
} else if (j <= 3.6e-31) {
tmp = fma(-i, (j * y), ((t_1 * x) - (-a * (i * b))));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) - Float64(a * t)) t_2 = fma(t_1, x, Float64(Float64(Float64(c * t) - Float64(i * y)) * j)) tmp = 0.0 if (j <= -8e+151) tmp = t_2; elseif (j <= 3.6e-31) tmp = fma(Float64(-i), Float64(j * y), Float64(Float64(t_1 * x) - Float64(Float64(-a) * Float64(i * b)))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * x + N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+151], t$95$2, If[LessEqual[j, 3.6e-31], N[((-i) * N[(j * y), $MachinePrecision] + N[(N[(t$95$1 * x), $MachinePrecision] - N[((-a) * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot y - a \cdot t\\
t_2 := \mathsf{fma}\left(t\_1, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\\
\mathbf{if}\;j \leq -8 \cdot 10^{+151}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq 3.6 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t\_1 \cdot x - \left(-a\right) \cdot \left(i \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if j < -8.00000000000000014e151 or 3.60000000000000004e-31 < j Initial program 73.2%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6460.1
Applied rewrites60.1%
if -8.00000000000000014e151 < j < 3.60000000000000004e-31Initial program 73.2%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites58.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -2.4e+157) (* (- (* i a) (* c z)) b) (fma (- (* z y) (* a t)) x (* (- (* c t) (* i y)) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -2.4e+157) {
tmp = ((i * a) - (c * z)) * b;
} else {
tmp = fma(((z * y) - (a * t)), x, (((c * t) - (i * y)) * j));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -2.4e+157) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); else tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(Float64(c * t) - Float64(i * y)) * j)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.4e+157], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+157}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\\
\end{array}
\end{array}
if b < -2.4e157Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
if -2.4e157 < b Initial program 73.2%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6460.1
Applied rewrites60.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (- (* t x) (* i b)))))
(if (<= a -8.8e+219)
t_1
(if (<= a 105000000000.0)
(+ (* (* 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 <= -8.8e+219) {
tmp = t_1;
} else if (a <= 105000000000.0) {
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 <= (-8.8d+219)) then
tmp = t_1
else if (a <= 105000000000.0d0) 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 <= -8.8e+219) {
tmp = t_1;
} else if (a <= 105000000000.0) {
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 <= -8.8e+219: tmp = t_1 elif a <= 105000000000.0: 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 <= -8.8e+219) tmp = t_1; elseif (a <= 105000000000.0) 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 <= -8.8e+219) tmp = t_1; elseif (a <= 105000000000.0) 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, -8.8e+219], t$95$1, If[LessEqual[a, 105000000000.0], 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 -8.8 \cdot 10^{+219}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 105000000000:\\
\;\;\;\;\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 < -8.8000000000000006e219 or 1.05e11 < a Initial program 73.2%
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-*.f6438.6
Applied rewrites38.6%
if -8.8000000000000006e219 < a < 1.05e11Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.1
Applied rewrites49.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -9.5e+127)
t_1
(if (<= t -1.95e-25)
(* (- a) (- (* t x) (* i b)))
(if (<= t 5e-291)
(* (fma (- i) j (* z x)) y)
(if (<= t 2.4e-20) (* (- i) (- (* j y) (* b 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 = fma(-a, x, (j * c)) * t;
double tmp;
if (t <= -9.5e+127) {
tmp = t_1;
} else if (t <= -1.95e-25) {
tmp = -a * ((t * x) - (i * b));
} else if (t <= 5e-291) {
tmp = fma(-i, j, (z * x)) * y;
} else if (t <= 2.4e-20) {
tmp = -i * ((j * y) - (b * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -9.5e+127) tmp = t_1; elseif (t <= -1.95e-25) tmp = Float64(Float64(-a) * Float64(Float64(t * x) - Float64(i * b))); elseif (t <= 5e-291) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (t <= 2.4e-20) tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * a))); 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) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.5e+127], t$95$1, If[LessEqual[t, -1.95e-25], N[((-a) * N[(N[(t * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-291], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.4e-20], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{-25}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x - i \cdot b\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-291}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-20}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.49999999999999975e127 or 2.39999999999999993e-20 < t Initial program 73.2%
Taylor expanded in t 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%
if -9.49999999999999975e127 < t < -1.95e-25Initial program 73.2%
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-*.f6438.6
Applied rewrites38.6%
if -1.95e-25 < t < 5.0000000000000003e-291Initial program 73.2%
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-*.f6438.9
Applied rewrites38.9%
if 5.0000000000000003e-291 < t < 2.39999999999999993e-20Initial program 73.2%
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.5
Applied rewrites38.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -9.5e+127)
t_1
(if (<= t -1.95e-25)
(* (- a) (- (* t x) (* i b)))
(if (<= t 2.4e-20) (* (fma (- i) j (* z x)) 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(-a, x, (j * c)) * t;
double tmp;
if (t <= -9.5e+127) {
tmp = t_1;
} else if (t <= -1.95e-25) {
tmp = -a * ((t * x) - (i * b));
} else if (t <= 2.4e-20) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -9.5e+127) tmp = t_1; elseif (t <= -1.95e-25) tmp = Float64(Float64(-a) * Float64(Float64(t * x) - Float64(i * b))); elseif (t <= 2.4e-20) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.5e+127], t$95$1, If[LessEqual[t, -1.95e-25], N[((-a) * N[(N[(t * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-20], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{-25}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x - i \cdot b\right)\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.49999999999999975e127 or 2.39999999999999993e-20 < t Initial program 73.2%
Taylor expanded in t 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%
if -9.49999999999999975e127 < t < -1.95e-25Initial program 73.2%
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-*.f6438.6
Applied rewrites38.6%
if -1.95e-25 < t < 2.39999999999999993e-20Initial program 73.2%
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-*.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -8e+128)
t_1
(if (<= t 2.4e-20) (* (fma (- i) j (* z x)) 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(-a, x, (j * c)) * t;
double tmp;
if (t <= -8e+128) {
tmp = t_1;
} else if (t <= 2.4e-20) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -8e+128) tmp = t_1; elseif (t <= 2.4e-20) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -8e+128], t$95$1, If[LessEqual[t, 2.4e-20], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -8 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.0000000000000006e128 or 2.39999999999999993e-20 < t Initial program 73.2%
Taylor expanded in t 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%
if -8.0000000000000006e128 < t < 2.39999999999999993e-20Initial program 73.2%
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-*.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -8e+118)
t_1
(if (<= t -7.5e+37)
(* (- (* z y) (* a t)) x)
(if (<= t 2.2e-98) (* (- (* i a) (* c z)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, x, (j * c)) * t;
double tmp;
if (t <= -8e+118) {
tmp = t_1;
} else if (t <= -7.5e+37) {
tmp = ((z * y) - (a * t)) * x;
} else if (t <= 2.2e-98) {
tmp = ((i * a) - (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -8e+118) tmp = t_1; elseif (t <= -7.5e+37) tmp = Float64(Float64(Float64(z * y) - Float64(a * t)) * x); elseif (t <= 2.2e-98) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); 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) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -8e+118], t$95$1, If[LessEqual[t, -7.5e+37], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 2.2e-98], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -8 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{+37}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-98}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.99999999999999973e118 or 2.19999999999999996e-98 < t Initial program 73.2%
Taylor expanded in t 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%
if -7.99999999999999973e118 < t < -7.5000000000000003e37Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
if -7.5000000000000003e37 < t < 2.19999999999999996e-98Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* j t) (* b z)) c))) (if (<= c -4.7e+114) t_1 (if (<= c 9e+41) (* (- (* z y) (* a t)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * t) - (b * z)) * c;
double tmp;
if (c <= -4.7e+114) {
tmp = t_1;
} else if (c <= 9e+41) {
tmp = ((z * y) - (a * t)) * x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((j * t) - (b * z)) * c
if (c <= (-4.7d+114)) then
tmp = t_1
else if (c <= 9d+41) then
tmp = ((z * y) - (a * t)) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * t) - (b * z)) * c;
double tmp;
if (c <= -4.7e+114) {
tmp = t_1;
} else if (c <= 9e+41) {
tmp = ((z * y) - (a * t)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((j * t) - (b * z)) * c tmp = 0 if c <= -4.7e+114: tmp = t_1 elif c <= 9e+41: tmp = ((z * y) - (a * t)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * t) - Float64(b * z)) * c) tmp = 0.0 if (c <= -4.7e+114) tmp = t_1; elseif (c <= 9e+41) tmp = Float64(Float64(Float64(z * y) - Float64(a * t)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((j * t) - (b * z)) * c; tmp = 0.0; if (c <= -4.7e+114) tmp = t_1; elseif (c <= 9e+41) tmp = ((z * y) - (a * t)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -4.7e+114], t$95$1, If[LessEqual[c, 9e+41], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t - b \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -4.7 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 9 \cdot 10^{+41}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -4.7000000000000001e114 or 9.0000000000000002e41 < c Initial program 73.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.4
Applied rewrites40.4%
if -4.7000000000000001e114 < c < 9.0000000000000002e41Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -2.5e+99)
(* (* (- a) t) x)
(if (<= t 9.2e-166)
(* (- (* i a) (* c z)) b)
(if (<= t 6e+234) (* (- (* j t) (* b z)) c) (* (- a) (* t x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -2.5e+99) {
tmp = (-a * t) * x;
} else if (t <= 9.2e-166) {
tmp = ((i * a) - (c * z)) * b;
} else if (t <= 6e+234) {
tmp = ((j * t) - (b * z)) * c;
} else {
tmp = -a * (t * x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-2.5d+99)) then
tmp = (-a * t) * x
else if (t <= 9.2d-166) then
tmp = ((i * a) - (c * z)) * b
else if (t <= 6d+234) then
tmp = ((j * t) - (b * z)) * c
else
tmp = -a * (t * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -2.5e+99) {
tmp = (-a * t) * x;
} else if (t <= 9.2e-166) {
tmp = ((i * a) - (c * z)) * b;
} else if (t <= 6e+234) {
tmp = ((j * t) - (b * z)) * c;
} else {
tmp = -a * (t * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -2.5e+99: tmp = (-a * t) * x elif t <= 9.2e-166: tmp = ((i * a) - (c * z)) * b elif t <= 6e+234: tmp = ((j * t) - (b * z)) * c else: tmp = -a * (t * x) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -2.5e+99) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (t <= 9.2e-166) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); elseif (t <= 6e+234) tmp = Float64(Float64(Float64(j * t) - Float64(b * z)) * c); else tmp = Float64(Float64(-a) * Float64(t * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -2.5e+99) tmp = (-a * t) * x; elseif (t <= 9.2e-166) tmp = ((i * a) - (c * z)) * b; elseif (t <= 6e+234) tmp = ((j * t) - (b * z)) * c; else tmp = -a * (t * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -2.5e+99], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 9.2e-166], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 6e+234], N[(N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-166}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+234}:\\
\;\;\;\;\left(j \cdot t - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\end{array}
\end{array}
if t < -2.50000000000000004e99Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if -2.50000000000000004e99 < t < 9.19999999999999995e-166Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
if 9.19999999999999995e-166 < t < 5.9999999999999998e234Initial program 73.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.4
Applied rewrites40.4%
if 5.9999999999999998e234 < t Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= t -2.5e+99) (* (* (- a) t) x) (if (<= t 9.5e+26) (* (- (* i a) (* c z)) b) (* (- a) (* t x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -2.5e+99) {
tmp = (-a * t) * x;
} else if (t <= 9.5e+26) {
tmp = ((i * a) - (c * z)) * b;
} else {
tmp = -a * (t * x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-2.5d+99)) then
tmp = (-a * t) * x
else if (t <= 9.5d+26) then
tmp = ((i * a) - (c * z)) * b
else
tmp = -a * (t * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -2.5e+99) {
tmp = (-a * t) * x;
} else if (t <= 9.5e+26) {
tmp = ((i * a) - (c * z)) * b;
} else {
tmp = -a * (t * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -2.5e+99: tmp = (-a * t) * x elif t <= 9.5e+26: tmp = ((i * a) - (c * z)) * b else: tmp = -a * (t * x) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -2.5e+99) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (t <= 9.5e+26) tmp = Float64(Float64(Float64(i * a) - Float64(c * z)) * b); else tmp = Float64(Float64(-a) * Float64(t * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -2.5e+99) tmp = (-a * t) * x; elseif (t <= 9.5e+26) tmp = ((i * a) - (c * z)) * b; else tmp = -a * (t * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -2.5e+99], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 9.5e+26], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+26}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\end{array}
\end{array}
if t < -2.50000000000000004e99Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if -2.50000000000000004e99 < t < 9.50000000000000054e26Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
if 9.50000000000000054e26 < t Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -7.6e+114)
(* (* (- c) z) b)
(if (<= c -4.2e-159)
(* (* (- a) t) x)
(if (<= c 8.2e-244)
(* (* i b) a)
(if (<= c 3.1e+34) (* (- a) (* t x)) (* (* j c) t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -7.6e+114) {
tmp = (-c * z) * b;
} else if (c <= -4.2e-159) {
tmp = (-a * t) * x;
} else if (c <= 8.2e-244) {
tmp = (i * b) * a;
} else if (c <= 3.1e+34) {
tmp = -a * (t * x);
} else {
tmp = (j * c) * t;
}
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 (c <= (-7.6d+114)) then
tmp = (-c * z) * b
else if (c <= (-4.2d-159)) then
tmp = (-a * t) * x
else if (c <= 8.2d-244) then
tmp = (i * b) * a
else if (c <= 3.1d+34) then
tmp = -a * (t * x)
else
tmp = (j * c) * t
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 (c <= -7.6e+114) {
tmp = (-c * z) * b;
} else if (c <= -4.2e-159) {
tmp = (-a * t) * x;
} else if (c <= 8.2e-244) {
tmp = (i * b) * a;
} else if (c <= 3.1e+34) {
tmp = -a * (t * x);
} else {
tmp = (j * c) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if c <= -7.6e+114: tmp = (-c * z) * b elif c <= -4.2e-159: tmp = (-a * t) * x elif c <= 8.2e-244: tmp = (i * b) * a elif c <= 3.1e+34: tmp = -a * (t * x) else: tmp = (j * c) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -7.6e+114) tmp = Float64(Float64(Float64(-c) * z) * b); elseif (c <= -4.2e-159) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (c <= 8.2e-244) tmp = Float64(Float64(i * b) * a); elseif (c <= 3.1e+34) tmp = Float64(Float64(-a) * Float64(t * x)); else tmp = Float64(Float64(j * c) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (c <= -7.6e+114) tmp = (-c * z) * b; elseif (c <= -4.2e-159) tmp = (-a * t) * x; elseif (c <= 8.2e-244) tmp = (i * b) * a; elseif (c <= 3.1e+34) tmp = -a * (t * x); else tmp = (j * c) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -7.6e+114], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, -4.2e-159], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[c, 8.2e-244], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[c, 3.1e+34], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.6 \cdot 10^{+114}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;c \leq -4.2 \cdot 10^{-159}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;c \leq 8.2 \cdot 10^{-244}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;c \leq 3.1 \cdot 10^{+34}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\end{array}
\end{array}
if c < -7.6000000000000001e114Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6423.0
Applied rewrites23.0%
if -7.6000000000000001e114 < c < -4.1999999999999998e-159Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if -4.1999999999999998e-159 < c < 8.2000000000000004e-244Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
if 8.2000000000000004e-244 < c < 3.09999999999999977e34Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
if 3.09999999999999977e34 < c Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lift-*.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j t) c)))
(if (<= b -1e+119)
(* (* i a) b)
(if (<= b -7.8e+29)
t_1
(if (<= b 1.4e-282)
(* (* z y) x)
(if (<= b 4.5e+239) t_1 (* (* i b) a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * t) * c;
double tmp;
if (b <= -1e+119) {
tmp = (i * a) * b;
} else if (b <= -7.8e+29) {
tmp = t_1;
} else if (b <= 1.4e-282) {
tmp = (z * y) * x;
} else if (b <= 4.5e+239) {
tmp = t_1;
} else {
tmp = (i * b) * 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) :: t_1
real(8) :: tmp
t_1 = (j * t) * c
if (b <= (-1d+119)) then
tmp = (i * a) * b
else if (b <= (-7.8d+29)) then
tmp = t_1
else if (b <= 1.4d-282) then
tmp = (z * y) * x
else if (b <= 4.5d+239) then
tmp = t_1
else
tmp = (i * b) * 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 t_1 = (j * t) * c;
double tmp;
if (b <= -1e+119) {
tmp = (i * a) * b;
} else if (b <= -7.8e+29) {
tmp = t_1;
} else if (b <= 1.4e-282) {
tmp = (z * y) * x;
} else if (b <= 4.5e+239) {
tmp = t_1;
} else {
tmp = (i * b) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c tmp = 0 if b <= -1e+119: tmp = (i * a) * b elif b <= -7.8e+29: tmp = t_1 elif b <= 1.4e-282: tmp = (z * y) * x elif b <= 4.5e+239: tmp = t_1 else: tmp = (i * b) * a return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) tmp = 0.0 if (b <= -1e+119) tmp = Float64(Float64(i * a) * b); elseif (b <= -7.8e+29) tmp = t_1; elseif (b <= 1.4e-282) tmp = Float64(Float64(z * y) * x); elseif (b <= 4.5e+239) tmp = t_1; else tmp = Float64(Float64(i * b) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * t) * c; tmp = 0.0; if (b <= -1e+119) tmp = (i * a) * b; elseif (b <= -7.8e+29) tmp = t_1; elseif (b <= 1.4e-282) tmp = (z * y) * x; elseif (b <= 4.5e+239) tmp = t_1; else tmp = (i * b) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[b, -1e+119], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, -7.8e+29], t$95$1, If[LessEqual[b, 1.4e-282], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 4.5e+239], t$95$1, N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;b \leq -1 \cdot 10^{+119}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{elif}\;b \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-282}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\end{array}
\end{array}
if b < -9.99999999999999944e118Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6422.2
Applied rewrites22.2%
if -9.99999999999999944e118 < b < -7.79999999999999937e29 or 1.3999999999999999e-282 < b < 4.4999999999999998e239Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -7.79999999999999937e29 < b < 1.3999999999999999e-282Initial program 73.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.2
Applied rewrites22.2%
if 4.4999999999999998e239 < b Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j t) c)) (t_2 (* (* i b) a)))
(if (<= b -1e+119)
t_2
(if (<= b -7.8e+29)
t_1
(if (<= b 1.4e-282) (* (* z y) x) (if (<= b 4.5e+239) 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 = (j * t) * c;
double t_2 = (i * b) * a;
double tmp;
if (b <= -1e+119) {
tmp = t_2;
} else if (b <= -7.8e+29) {
tmp = t_1;
} else if (b <= 1.4e-282) {
tmp = (z * y) * x;
} else if (b <= 4.5e+239) {
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 = (j * t) * c
t_2 = (i * b) * a
if (b <= (-1d+119)) then
tmp = t_2
else if (b <= (-7.8d+29)) then
tmp = t_1
else if (b <= 1.4d-282) then
tmp = (z * y) * x
else if (b <= 4.5d+239) 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 = (j * t) * c;
double t_2 = (i * b) * a;
double tmp;
if (b <= -1e+119) {
tmp = t_2;
} else if (b <= -7.8e+29) {
tmp = t_1;
} else if (b <= 1.4e-282) {
tmp = (z * y) * x;
} else if (b <= 4.5e+239) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c t_2 = (i * b) * a tmp = 0 if b <= -1e+119: tmp = t_2 elif b <= -7.8e+29: tmp = t_1 elif b <= 1.4e-282: tmp = (z * y) * x elif b <= 4.5e+239: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) t_2 = Float64(Float64(i * b) * a) tmp = 0.0 if (b <= -1e+119) tmp = t_2; elseif (b <= -7.8e+29) tmp = t_1; elseif (b <= 1.4e-282) tmp = Float64(Float64(z * y) * x); elseif (b <= 4.5e+239) 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 = (j * t) * c; t_2 = (i * b) * a; tmp = 0.0; if (b <= -1e+119) tmp = t_2; elseif (b <= -7.8e+29) tmp = t_1; elseif (b <= 1.4e-282) tmp = (z * y) * x; elseif (b <= 4.5e+239) 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[(j * t), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[b, -1e+119], t$95$2, If[LessEqual[b, -7.8e+29], t$95$1, If[LessEqual[b, 1.4e-282], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 4.5e+239], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
t_2 := \left(i \cdot b\right) \cdot a\\
\mathbf{if}\;b \leq -1 \cdot 10^{+119}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-282}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -9.99999999999999944e118 or 4.4999999999999998e239 < b Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
if -9.99999999999999944e118 < b < -7.79999999999999937e29 or 1.3999999999999999e-282 < b < 4.4999999999999998e239Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -7.79999999999999937e29 < b < 1.3999999999999999e-282Initial program 73.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -5.5e+98)
(* (* j c) t)
(if (<= j 1.18e-180)
(* (* (- a) t) x)
(if (<= j 1.78e+103) (* (* i a) b) (* (* j t) c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -5.5e+98) {
tmp = (j * c) * t;
} else if (j <= 1.18e-180) {
tmp = (-a * t) * x;
} else if (j <= 1.78e+103) {
tmp = (i * a) * b;
} else {
tmp = (j * t) * c;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-5.5d+98)) then
tmp = (j * c) * t
else if (j <= 1.18d-180) then
tmp = (-a * t) * x
else if (j <= 1.78d+103) then
tmp = (i * a) * b
else
tmp = (j * t) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -5.5e+98) {
tmp = (j * c) * t;
} else if (j <= 1.18e-180) {
tmp = (-a * t) * x;
} else if (j <= 1.78e+103) {
tmp = (i * a) * b;
} else {
tmp = (j * t) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -5.5e+98: tmp = (j * c) * t elif j <= 1.18e-180: tmp = (-a * t) * x elif j <= 1.78e+103: tmp = (i * a) * b else: tmp = (j * t) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -5.5e+98) tmp = Float64(Float64(j * c) * t); elseif (j <= 1.18e-180) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (j <= 1.78e+103) tmp = Float64(Float64(i * a) * b); else tmp = Float64(Float64(j * t) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -5.5e+98) tmp = (j * c) * t; elseif (j <= 1.18e-180) tmp = (-a * t) * x; elseif (j <= 1.78e+103) tmp = (i * a) * b; else tmp = (j * t) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -5.5e+98], N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, 1.18e-180], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.78e+103], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -5.5 \cdot 10^{+98}:\\
\;\;\;\;\left(j \cdot c\right) \cdot t\\
\mathbf{elif}\;j \leq 1.18 \cdot 10^{-180}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;j \leq 1.78 \cdot 10^{+103}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if j < -5.49999999999999946e98Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lift-*.f6422.4
Applied rewrites22.4%
if -5.49999999999999946e98 < j < 1.18000000000000002e-180Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6421.8
Applied rewrites21.8%
if 1.18000000000000002e-180 < j < 1.78e103Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6422.2
Applied rewrites22.2%
if 1.78e103 < j Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j c) t)))
(if (<= c -1e-39)
t_1
(if (<= c 8.2e-244)
(* (* i b) a)
(if (<= c 3.1e+34) (* (- a) (* t x)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * t;
double tmp;
if (c <= -1e-39) {
tmp = t_1;
} else if (c <= 8.2e-244) {
tmp = (i * b) * a;
} else if (c <= 3.1e+34) {
tmp = -a * (t * x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * c) * t
if (c <= (-1d-39)) then
tmp = t_1
else if (c <= 8.2d-244) then
tmp = (i * b) * a
else if (c <= 3.1d+34) then
tmp = -a * (t * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * t;
double tmp;
if (c <= -1e-39) {
tmp = t_1;
} else if (c <= 8.2e-244) {
tmp = (i * b) * a;
} else if (c <= 3.1e+34) {
tmp = -a * (t * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * t tmp = 0 if c <= -1e-39: tmp = t_1 elif c <= 8.2e-244: tmp = (i * b) * a elif c <= 3.1e+34: tmp = -a * (t * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * t) tmp = 0.0 if (c <= -1e-39) tmp = t_1; elseif (c <= 8.2e-244) tmp = Float64(Float64(i * b) * a); elseif (c <= 3.1e+34) tmp = Float64(Float64(-a) * Float64(t * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * c) * t; tmp = 0.0; if (c <= -1e-39) tmp = t_1; elseif (c <= 8.2e-244) tmp = (i * b) * a; elseif (c <= 3.1e+34) tmp = -a * (t * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[c, -1e-39], t$95$1, If[LessEqual[c, 8.2e-244], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[c, 3.1e+34], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot t\\
\mathbf{if}\;c \leq -1 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 8.2 \cdot 10^{-244}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{elif}\;c \leq 3.1 \cdot 10^{+34}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -9.99999999999999929e-40 or 3.09999999999999977e34 < c Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lift-*.f6422.4
Applied rewrites22.4%
if -9.99999999999999929e-40 < c < 8.2000000000000004e-244Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
if 8.2000000000000004e-244 < c < 3.09999999999999977e34Initial program 73.2%
Taylor expanded in t 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 inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j t) c))) (if (<= j -1.05e+73) t_1 (if (<= j 1.78e+103) (* (* i b) 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 = (j * t) * c;
double tmp;
if (j <= -1.05e+73) {
tmp = t_1;
} else if (j <= 1.78e+103) {
tmp = (i * b) * 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 = (j * t) * c
if (j <= (-1.05d+73)) then
tmp = t_1
else if (j <= 1.78d+103) then
tmp = (i * b) * 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 = (j * t) * c;
double tmp;
if (j <= -1.05e+73) {
tmp = t_1;
} else if (j <= 1.78e+103) {
tmp = (i * b) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * t) * c tmp = 0 if j <= -1.05e+73: tmp = t_1 elif j <= 1.78e+103: tmp = (i * b) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * t) * c) tmp = 0.0 if (j <= -1.05e+73) tmp = t_1; elseif (j <= 1.78e+103) tmp = Float64(Float64(i * b) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * t) * c; tmp = 0.0; if (j <= -1.05e+73) tmp = t_1; elseif (j <= 1.78e+103) tmp = (i * b) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[j, -1.05e+73], t$95$1, If[LessEqual[j, 1.78e+103], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;j \leq -1.05 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.78 \cdot 10^{+103}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.0500000000000001e73 or 1.78e103 < j Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -1.0500000000000001e73 < j < 1.78e103Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* j (* c t)))) (if (<= j -6.7e+72) t_1 (if (<= j 2e+103) (* (* i b) 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 = j * (c * t);
double tmp;
if (j <= -6.7e+72) {
tmp = t_1;
} else if (j <= 2e+103) {
tmp = (i * b) * 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 = j * (c * t)
if (j <= (-6.7d+72)) then
tmp = t_1
else if (j <= 2d+103) then
tmp = (i * b) * 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 = j * (c * t);
double tmp;
if (j <= -6.7e+72) {
tmp = t_1;
} else if (j <= 2e+103) {
tmp = (i * b) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * (c * t) tmp = 0 if j <= -6.7e+72: tmp = t_1 elif j <= 2e+103: tmp = (i * b) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(c * t)) tmp = 0.0 if (j <= -6.7e+72) tmp = t_1; elseif (j <= 2e+103) tmp = Float64(Float64(i * b) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * (c * t); tmp = 0.0; if (j <= -6.7e+72) tmp = t_1; elseif (j <= 2e+103) tmp = (i * b) * 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[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -6.7e+72], t$95$1, If[LessEqual[j, 2e+103], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t\right)\\
\mathbf{if}\;j \leq -6.7 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2 \cdot 10^{+103}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -6.6999999999999998e72 or 2e103 < j Initial program 73.2%
Taylor expanded in t 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6422.6
Applied rewrites22.6%
if -6.6999999999999998e72 < j < 2e103Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i b) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * b) * 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 = (i * b) * 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 (i * b) * a;
}
def code(x, y, z, t, a, b, c, i, j): return (i * b) * a
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * b) * a) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * b) * a; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot b\right) \cdot a
\end{array}
Initial program 73.2%
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.5
Applied rewrites38.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.5
Applied rewrites35.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
herbie shell --seed 2025139
(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)))))