
(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]
\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)
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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)
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* z (- (* x y) (* b c))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * ((x * y) - (b * c)) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * ((x * y) - (b * c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 72.4%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9%
Applied rewrites37.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y)))))
(if (<= j -5.1e+32)
(+ (* -1.0 (* a (- (* t x) (* b i)))) t_1)
(if (<= j 3.2e-44)
(+ (- (* x (- (* y z) (* a t))) (* (* c z) b)) (* (* i a) b))
(if (<= j 4.1e+182)
(+ (* z (- (* x y) (* b c))) t_1)
(+ (* a (* b i)) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * t) - (i * y));
double tmp;
if (j <= -5.1e+32) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1;
} else if (j <= 3.2e-44) {
tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b);
} else if (j <= 4.1e+182) {
tmp = (z * ((x * y) - (b * c))) + t_1;
} else {
tmp = (a * (b * i)) + 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) - (i * y))
if (j <= (-5.1d+32)) then
tmp = ((-1.0d0) * (a * ((t * x) - (b * i)))) + t_1
else if (j <= 3.2d-44) then
tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b)
else if (j <= 4.1d+182) then
tmp = (z * ((x * y) - (b * c))) + t_1
else
tmp = (a * (b * i)) + 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) - (i * y));
double tmp;
if (j <= -5.1e+32) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1;
} else if (j <= 3.2e-44) {
tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b);
} else if (j <= 4.1e+182) {
tmp = (z * ((x * y) - (b * c))) + t_1;
} else {
tmp = (a * (b * i)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * t) - (i * y)) tmp = 0 if j <= -5.1e+32: tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1 elif j <= 3.2e-44: tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b) elif j <= 4.1e+182: tmp = (z * ((x * y) - (b * c))) + t_1 else: tmp = (a * (b * i)) + t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * t) - Float64(i * y))) tmp = 0.0 if (j <= -5.1e+32) tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + t_1); elseif (j <= 3.2e-44) tmp = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(a * t))) - Float64(Float64(c * z) * b)) + Float64(Float64(i * a) * b)); elseif (j <= 4.1e+182) tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + t_1); else tmp = Float64(Float64(a * Float64(b * i)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * t) - (i * y)); tmp = 0.0; if (j <= -5.1e+32) tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1; elseif (j <= 3.2e-44) tmp = ((x * ((y * z) - (a * t))) - ((c * z) * b)) + ((i * a) * b); elseif (j <= 4.1e+182) tmp = (z * ((x * y) - (b * c))) + t_1; else tmp = (a * (b * i)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -5.1e+32], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[j, 3.2e-44], N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4.1e+182], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;j \leq -5.1 \cdot 10^{+32}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + t\_1\\
\mathbf{elif}\;j \leq 3.2 \cdot 10^{-44}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - a \cdot t\right) - \left(c \cdot z\right) \cdot b\right) + \left(i \cdot a\right) \cdot b\\
\mathbf{elif}\;j \leq 4.1 \cdot 10^{+182}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + t\_1\\
\end{array}
if j < -5.1e32Initial program 72.4%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.6%
Applied rewrites59.6%
if -5.1e32 < j < 3.1999999999999999e-44Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.4%
Applied rewrites57.4%
if 3.1999999999999999e-44 < j < 4.1e182Initial program 72.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.2%
Applied rewrites58.2%
if 4.1e182 < j Initial program 72.4%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.5%
Applied rewrites49.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y)))))
(if (<= z -1.6e+29)
(* z (- (* x y) (* b c)))
(if (<= z 3.7e-35)
(+ (* -1.0 (* a (- (* t x) (* b i)))) t_1)
(if (<= z 8.8e+72)
(+ (* b (- (* a i) (* c z))) t_1)
(+ (* z (+ (* -1.0 (* b c)) (* x y))) (* (* i a) b)))))))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) - (i * y));
double tmp;
if (z <= -1.6e+29) {
tmp = z * ((x * y) - (b * c));
} else if (z <= 3.7e-35) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1;
} else if (z <= 8.8e+72) {
tmp = (b * ((a * i) - (c * z))) + t_1;
} else {
tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b);
}
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) - (i * y))
if (z <= (-1.6d+29)) then
tmp = z * ((x * y) - (b * c))
else if (z <= 3.7d-35) then
tmp = ((-1.0d0) * (a * ((t * x) - (b * i)))) + t_1
else if (z <= 8.8d+72) then
tmp = (b * ((a * i) - (c * z))) + t_1
else
tmp = (z * (((-1.0d0) * (b * c)) + (x * y))) + ((i * a) * b)
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) - (i * y));
double tmp;
if (z <= -1.6e+29) {
tmp = z * ((x * y) - (b * c));
} else if (z <= 3.7e-35) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1;
} else if (z <= 8.8e+72) {
tmp = (b * ((a * i) - (c * z))) + t_1;
} else {
tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * t) - (i * y)) tmp = 0 if z <= -1.6e+29: tmp = z * ((x * y) - (b * c)) elif z <= 3.7e-35: tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1 elif z <= 8.8e+72: tmp = (b * ((a * i) - (c * z))) + t_1 else: tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * t) - Float64(i * y))) tmp = 0.0 if (z <= -1.6e+29) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (z <= 3.7e-35) tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + t_1); elseif (z <= 8.8e+72) tmp = Float64(Float64(b * Float64(Float64(a * i) - Float64(c * z))) + t_1); else tmp = Float64(Float64(z * Float64(Float64(-1.0 * Float64(b * c)) + Float64(x * y))) + Float64(Float64(i * a) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * t) - (i * y)); tmp = 0.0; if (z <= -1.6e+29) tmp = z * ((x * y) - (b * c)); elseif (z <= 3.7e-35) tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_1; elseif (z <= 8.8e+72) tmp = (b * ((a * i) - (c * z))) + t_1; else tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+29], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-35], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 8.8e+72], N[(N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(z * N[(N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+29}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-35}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+72}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) + \left(i \cdot a\right) \cdot b\\
\end{array}
if z < -1.5999999999999999e29Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9%
Applied rewrites37.9%
if -1.5999999999999999e29 < z < 3.6999999999999999e-35Initial program 72.4%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.6%
Applied rewrites59.6%
if 3.6999999999999999e-35 < z < 8.8e72Initial program 72.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.6%
Applied rewrites58.6%
if 8.8e72 < z Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6468.1%
Applied rewrites68.1%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -1.75e+28)
(* z (- (* x y) (* b c)))
(if (<= z -7e-270)
(- (- (* (* i b) a) (* (* (- c) j) t)) (* (* j i) y))
(if (<= z 2.9e+28)
(+ (* j (- (* c t) (* i y))) (* x (- (* y z) (* a t))))
(+ (* z (+ (* -1.0 (* b c)) (* x y))) (* (* i a) b))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -1.75e+28) {
tmp = z * ((x * y) - (b * c));
} else if (z <= -7e-270) {
tmp = (((i * b) * a) - ((-c * j) * t)) - ((j * i) * y);
} else if (z <= 2.9e+28) {
tmp = (j * ((c * t) - (i * y))) + (x * ((y * z) - (a * t)));
} else {
tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b);
}
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 (z <= (-1.75d+28)) then
tmp = z * ((x * y) - (b * c))
else if (z <= (-7d-270)) then
tmp = (((i * b) * a) - ((-c * j) * t)) - ((j * i) * y)
else if (z <= 2.9d+28) then
tmp = (j * ((c * t) - (i * y))) + (x * ((y * z) - (a * t)))
else
tmp = (z * (((-1.0d0) * (b * c)) + (x * y))) + ((i * a) * b)
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 (z <= -1.75e+28) {
tmp = z * ((x * y) - (b * c));
} else if (z <= -7e-270) {
tmp = (((i * b) * a) - ((-c * j) * t)) - ((j * i) * y);
} else if (z <= 2.9e+28) {
tmp = (j * ((c * t) - (i * y))) + (x * ((y * z) - (a * t)));
} else {
tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -1.75e+28: tmp = z * ((x * y) - (b * c)) elif z <= -7e-270: tmp = (((i * b) * a) - ((-c * j) * t)) - ((j * i) * y) elif z <= 2.9e+28: tmp = (j * ((c * t) - (i * y))) + (x * ((y * z) - (a * t))) else: tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -1.75e+28) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (z <= -7e-270) tmp = Float64(Float64(Float64(Float64(i * b) * a) - Float64(Float64(Float64(-c) * j) * t)) - Float64(Float64(j * i) * y)); elseif (z <= 2.9e+28) tmp = Float64(Float64(j * Float64(Float64(c * t) - Float64(i * y))) + Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = Float64(Float64(z * Float64(Float64(-1.0 * Float64(b * c)) + Float64(x * y))) + Float64(Float64(i * a) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -1.75e+28) tmp = z * ((x * y) - (b * c)); elseif (z <= -7e-270) tmp = (((i * b) * a) - ((-c * j) * t)) - ((j * i) * y); elseif (z <= 2.9e+28) tmp = (j * ((c * t) - (i * y))) + (x * ((y * z) - (a * t))); else tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.75e+28], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-270], N[(N[(N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision] - N[(N[((-c) * j), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * i), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+28], N[(N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+28}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-270}:\\
\;\;\;\;\left(\left(i \cdot b\right) \cdot a - \left(\left(-c\right) \cdot j\right) \cdot t\right) - \left(j \cdot i\right) \cdot y\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+28}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) + \left(i \cdot a\right) \cdot b\\
\end{array}
if z < -1.75e28Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9%
Applied rewrites37.9%
if -1.75e28 < z < -6.9999999999999999e-270Initial program 72.4%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.5%
Applied rewrites49.5%
Applied rewrites46.4%
if -6.9999999999999999e-270 < z < 2.9000000000000001e28Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
if 2.9000000000000001e28 < z Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6468.1%
Applied rewrites68.1%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y))))
(t_2 (+ t_1 (* x (- (* y z) (* a t))))))
(if (<= x -1.3e+41)
t_2
(if (<= x 3.75e+90) (+ (* b (- (* a i) (* c z))) t_1) t_2))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * t) - (i * y));
double t_2 = t_1 + (x * ((y * z) - (a * t)));
double tmp;
if (x <= -1.3e+41) {
tmp = t_2;
} else if (x <= 3.75e+90) {
tmp = (b * ((a * i) - (c * z))) + 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 * ((c * t) - (i * y))
t_2 = t_1 + (x * ((y * z) - (a * t)))
if (x <= (-1.3d+41)) then
tmp = t_2
else if (x <= 3.75d+90) then
tmp = (b * ((a * i) - (c * z))) + 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 * ((c * t) - (i * y));
double t_2 = t_1 + (x * ((y * z) - (a * t)));
double tmp;
if (x <= -1.3e+41) {
tmp = t_2;
} else if (x <= 3.75e+90) {
tmp = (b * ((a * i) - (c * z))) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * t) - (i * y)) t_2 = t_1 + (x * ((y * z) - (a * t))) tmp = 0 if x <= -1.3e+41: tmp = t_2 elif x <= 3.75e+90: tmp = (b * ((a * i) - (c * z))) + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * t) - Float64(i * y))) t_2 = Float64(t_1 + Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (x <= -1.3e+41) tmp = t_2; elseif (x <= 3.75e+90) tmp = Float64(Float64(b * Float64(Float64(a * i) - Float64(c * z))) + 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 * ((c * t) - (i * y)); t_2 = t_1 + (x * ((y * z) - (a * t))); tmp = 0.0; if (x <= -1.3e+41) tmp = t_2; elseif (x <= 3.75e+90) tmp = (b * ((a * i) - (c * z))) + 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[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+41], t$95$2, If[LessEqual[x, 3.75e+90], N[(N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
t_2 := t\_1 + x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.75 \cdot 10^{+90}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if x < -1.3e41 or 3.7500000000000001e90 < x Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
if -1.3e41 < x < 3.7500000000000001e90Initial program 72.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.6%
Applied rewrites58.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -1.75e+28)
(* z (- (* x y) (* b c)))
(if (<= z 1e+73)
(+ (* a (* b i)) (* j (- (* c t) (* i y))))
(+ (* z (+ (* -1.0 (* b c)) (* x y))) (* (* i a) b)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -1.75e+28) {
tmp = z * ((x * y) - (b * c));
} else if (z <= 1e+73) {
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)));
} else {
tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b);
}
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 (z <= (-1.75d+28)) then
tmp = z * ((x * y) - (b * c))
else if (z <= 1d+73) then
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)))
else
tmp = (z * (((-1.0d0) * (b * c)) + (x * y))) + ((i * a) * b)
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 (z <= -1.75e+28) {
tmp = z * ((x * y) - (b * c));
} else if (z <= 1e+73) {
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)));
} else {
tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -1.75e+28: tmp = z * ((x * y) - (b * c)) elif z <= 1e+73: tmp = (a * (b * i)) + (j * ((c * t) - (i * y))) else: tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -1.75e+28) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (z <= 1e+73) tmp = Float64(Float64(a * Float64(b * i)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = Float64(Float64(z * Float64(Float64(-1.0 * Float64(b * c)) + Float64(x * y))) + Float64(Float64(i * a) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -1.75e+28) tmp = z * ((x * y) - (b * c)); elseif (z <= 1e+73) tmp = (a * (b * i)) + (j * ((c * t) - (i * y))); else tmp = (z * ((-1.0 * (b * c)) + (x * y))) + ((i * a) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.75e+28], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+73], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+28}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;z \leq 10^{+73}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) + \left(i \cdot a\right) \cdot b\\
\end{array}
if z < -1.75e28Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9%
Applied rewrites37.9%
if -1.75e28 < z < 9.9999999999999998e72Initial program 72.4%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.5%
Applied rewrites49.5%
if 9.9999999999999998e72 < z Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6468.1%
Applied rewrites68.1%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -1.75e+28)
t_1
(if (<= z 5.5e+96)
(+ (* a (* b i)) (* j (- (* c t) (* i y))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -1.75e+28) {
tmp = t_1;
} else if (z <= 5.5e+96) {
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((x * y) - (b * c))
if (z <= (-1.75d+28)) then
tmp = t_1
else if (z <= 5.5d+96) then
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -1.75e+28) {
tmp = t_1;
} else if (z <= 5.5e+96) {
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = z * ((x * y) - (b * c)) tmp = 0 if z <= -1.75e+28: tmp = t_1 elif z <= 5.5e+96: tmp = (a * (b * i)) + (j * ((c * t) - (i * y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(z * Float64(Float64(x * y) - Float64(b * c))) tmp = 0.0 if (z <= -1.75e+28) tmp = t_1; elseif (z <= 5.5e+96) tmp = Float64(Float64(a * Float64(b * i)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = z * ((x * y) - (b * c)); tmp = 0.0; if (z <= -1.75e+28) tmp = t_1; elseif (z <= 5.5e+96) tmp = (a * (b * i)) + (j * ((c * t) - (i * y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+28], t$95$1, If[LessEqual[z, 5.5e+96], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+96}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.75e28 or 5.5000000000000002e96 < z Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9%
Applied rewrites37.9%
if -1.75e28 < z < 5.5000000000000002e96Initial program 72.4%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.5%
Applied rewrites49.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* a i) (* c z)))))
(if (<= b -3.9e+114)
t_1
(if (<= b 33000.0)
(* (- (* x z) (* j i)) y)
(if (<= b 1.2e+63) (* t (- (* c j) (* a 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 = b * ((a * i) - (c * z));
double tmp;
if (b <= -3.9e+114) {
tmp = t_1;
} else if (b <= 33000.0) {
tmp = ((x * z) - (j * i)) * y;
} else if (b <= 1.2e+63) {
tmp = t * ((c * j) - (a * 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 = b * ((a * i) - (c * z))
if (b <= (-3.9d+114)) then
tmp = t_1
else if (b <= 33000.0d0) then
tmp = ((x * z) - (j * i)) * y
else if (b <= 1.2d+63) then
tmp = t * ((c * j) - (a * 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 = b * ((a * i) - (c * z));
double tmp;
if (b <= -3.9e+114) {
tmp = t_1;
} else if (b <= 33000.0) {
tmp = ((x * z) - (j * i)) * y;
} else if (b <= 1.2e+63) {
tmp = t * ((c * j) - (a * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((a * i) - (c * z)) tmp = 0 if b <= -3.9e+114: tmp = t_1 elif b <= 33000.0: tmp = ((x * z) - (j * i)) * y elif b <= 1.2e+63: tmp = t * ((c * j) - (a * x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z))) tmp = 0.0 if (b <= -3.9e+114) tmp = t_1; elseif (b <= 33000.0) tmp = Float64(Float64(Float64(x * z) - Float64(j * i)) * y); elseif (b <= 1.2e+63) tmp = Float64(t * Float64(Float64(c * j) - Float64(a * x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((a * i) - (c * z)); tmp = 0.0; if (b <= -3.9e+114) tmp = t_1; elseif (b <= 33000.0) tmp = ((x * z) - (j * i)) * y; elseif (b <= 1.2e+63) tmp = t * ((c * j) - (a * 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[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.9e+114], t$95$1, If[LessEqual[b, 33000.0], N[(N[(N[(x * z), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[b, 1.2e+63], N[(t * N[(N[(c * j), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.9 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 33000:\\
\;\;\;\;\left(x \cdot z - j \cdot i\right) \cdot y\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+63}:\\
\;\;\;\;t \cdot \left(c \cdot j - a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -3.9000000000000001e114 or 1.2e63 < b Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
if -3.9000000000000001e114 < b < 33000Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6439.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5%
Applied rewrites39.5%
if 33000 < b < 1.2e63Initial program 72.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z)))))
(if (<= c -1.6e+31)
t_1
(if (<= c 2.5e-59)
(* (- (* x z) (* j i)) y)
(if (<= c 3.75e+37) (* a (- (* b i) (* 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 = c * ((j * t) - (b * z));
double tmp;
if (c <= -1.6e+31) {
tmp = t_1;
} else if (c <= 2.5e-59) {
tmp = ((x * z) - (j * i)) * y;
} else if (c <= 3.75e+37) {
tmp = a * ((b * i) - (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 = c * ((j * t) - (b * z))
if (c <= (-1.6d+31)) then
tmp = t_1
else if (c <= 2.5d-59) then
tmp = ((x * z) - (j * i)) * y
else if (c <= 3.75d+37) then
tmp = a * ((b * i) - (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 = c * ((j * t) - (b * z));
double tmp;
if (c <= -1.6e+31) {
tmp = t_1;
} else if (c <= 2.5e-59) {
tmp = ((x * z) - (j * i)) * y;
} else if (c <= 3.75e+37) {
tmp = a * ((b * i) - (t * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((j * t) - (b * z)) tmp = 0 if c <= -1.6e+31: tmp = t_1 elif c <= 2.5e-59: tmp = ((x * z) - (j * i)) * y elif c <= 3.75e+37: tmp = a * ((b * i) - (t * x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) tmp = 0.0 if (c <= -1.6e+31) tmp = t_1; elseif (c <= 2.5e-59) tmp = Float64(Float64(Float64(x * z) - Float64(j * i)) * y); elseif (c <= 3.75e+37) tmp = Float64(a * Float64(Float64(b * i) - 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 = c * ((j * t) - (b * z)); tmp = 0.0; if (c <= -1.6e+31) tmp = t_1; elseif (c <= 2.5e-59) tmp = ((x * z) - (j * i)) * y; elseif (c <= 3.75e+37) tmp = a * ((b * i) - (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[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.6e+31], t$95$1, If[LessEqual[c, 2.5e-59], N[(N[(N[(x * z), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[c, 3.75e+37], N[(a * N[(N[(b * i), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{if}\;c \leq -1.6 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.5 \cdot 10^{-59}:\\
\;\;\;\;\left(x \cdot z - j \cdot i\right) \cdot y\\
\mathbf{elif}\;c \leq 3.75 \cdot 10^{+37}:\\
\;\;\;\;a \cdot \left(b \cdot i - t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if c < -1.6e31 or 3.7500000000000002e37 < c Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -1.6e31 < c < 2.5000000000000001e-59Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6439.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5%
Applied rewrites39.5%
if 2.5000000000000001e-59 < c < 3.7500000000000002e37Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.8%
Applied rewrites39.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z)))))
(if (<= c -1.6e+31)
t_1
(if (<= c 2e+38) (* (- (* x z) (* j 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 = c * ((j * t) - (b * z));
double tmp;
if (c <= -1.6e+31) {
tmp = t_1;
} else if (c <= 2e+38) {
tmp = ((x * z) - (j * 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 = c * ((j * t) - (b * z))
if (c <= (-1.6d+31)) then
tmp = t_1
else if (c <= 2d+38) then
tmp = ((x * z) - (j * 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 = c * ((j * t) - (b * z));
double tmp;
if (c <= -1.6e+31) {
tmp = t_1;
} else if (c <= 2e+38) {
tmp = ((x * z) - (j * i)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((j * t) - (b * z)) tmp = 0 if c <= -1.6e+31: tmp = t_1 elif c <= 2e+38: tmp = ((x * z) - (j * i)) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) tmp = 0.0 if (c <= -1.6e+31) tmp = t_1; elseif (c <= 2e+38) tmp = Float64(Float64(Float64(x * z) - Float64(j * 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 = c * ((j * t) - (b * z)); tmp = 0.0; if (c <= -1.6e+31) tmp = t_1; elseif (c <= 2e+38) tmp = ((x * z) - (j * 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[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.6e+31], t$95$1, If[LessEqual[c, 2e+38], N[(N[(N[(x * z), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{if}\;c \leq -1.6 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\left(x \cdot z - j \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if c < -1.6e31 or 2e38 < c Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -1.6e31 < c < 2e38Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6439.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5%
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -3.2e+112)
(* y (* -1.0 (* i j)))
(if (<= i 9e-167)
(* c (- (* j t) (* b z)))
(if (<= i 4.9e+234) (* z (- (* x y) (* b c))) (* b (* a i))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -3.2e+112) {
tmp = y * (-1.0 * (i * j));
} else if (i <= 9e-167) {
tmp = c * ((j * t) - (b * z));
} else if (i <= 4.9e+234) {
tmp = z * ((x * y) - (b * c));
} else {
tmp = b * (a * i);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-3.2d+112)) then
tmp = y * ((-1.0d0) * (i * j))
else if (i <= 9d-167) then
tmp = c * ((j * t) - (b * z))
else if (i <= 4.9d+234) then
tmp = z * ((x * y) - (b * c))
else
tmp = b * (a * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -3.2e+112) {
tmp = y * (-1.0 * (i * j));
} else if (i <= 9e-167) {
tmp = c * ((j * t) - (b * z));
} else if (i <= 4.9e+234) {
tmp = z * ((x * y) - (b * c));
} else {
tmp = b * (a * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -3.2e+112: tmp = y * (-1.0 * (i * j)) elif i <= 9e-167: tmp = c * ((j * t) - (b * z)) elif i <= 4.9e+234: tmp = z * ((x * y) - (b * c)) else: tmp = b * (a * i) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -3.2e+112) tmp = Float64(y * Float64(-1.0 * Float64(i * j))); elseif (i <= 9e-167) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (i <= 4.9e+234) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); else tmp = Float64(b * Float64(a * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -3.2e+112) tmp = y * (-1.0 * (i * j)); elseif (i <= 9e-167) tmp = c * ((j * t) - (b * z)); elseif (i <= 4.9e+234) tmp = z * ((x * y) - (b * c)); else tmp = b * (a * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -3.2e+112], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 9e-167], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4.9e+234], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;i \leq -3.2 \cdot 10^{+112}:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\
\mathbf{elif}\;i \leq 9 \cdot 10^{-167}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;i \leq 4.9 \cdot 10^{+234}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\
\end{array}
if i < -3.1999999999999999e112Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if -3.1999999999999999e112 < i < 9.0000000000000002e-167Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 9.0000000000000002e-167 < i < 4.8999999999999999e234Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9%
Applied rewrites37.9%
if 4.8999999999999999e234 < i Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f6422.8%
Applied rewrites22.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= i -3.2e+112) (* y (* -1.0 (* i j))) (if (<= i 1.58e+91) (* c (- (* j t) (* b z))) (* b (* a i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -3.2e+112) {
tmp = y * (-1.0 * (i * j));
} else if (i <= 1.58e+91) {
tmp = c * ((j * t) - (b * z));
} else {
tmp = b * (a * i);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-3.2d+112)) then
tmp = y * ((-1.0d0) * (i * j))
else if (i <= 1.58d+91) then
tmp = c * ((j * t) - (b * z))
else
tmp = b * (a * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -3.2e+112) {
tmp = y * (-1.0 * (i * j));
} else if (i <= 1.58e+91) {
tmp = c * ((j * t) - (b * z));
} else {
tmp = b * (a * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -3.2e+112: tmp = y * (-1.0 * (i * j)) elif i <= 1.58e+91: tmp = c * ((j * t) - (b * z)) else: tmp = b * (a * i) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -3.2e+112) tmp = Float64(y * Float64(-1.0 * Float64(i * j))); elseif (i <= 1.58e+91) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); else tmp = Float64(b * Float64(a * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -3.2e+112) tmp = y * (-1.0 * (i * j)); elseif (i <= 1.58e+91) tmp = c * ((j * t) - (b * z)); else tmp = b * (a * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -3.2e+112], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.58e+91], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;i \leq -3.2 \cdot 10^{+112}:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\
\mathbf{elif}\;i \leq 1.58 \cdot 10^{+91}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\
\end{array}
if i < -3.1999999999999999e112Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if -3.1999999999999999e112 < i < 1.5799999999999999e91Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if 1.5799999999999999e91 < i Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f6422.8%
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* x y) z)) (t_2 (* b (* a i))))
(if (<= a -6.4e+230)
t_2
(if (<= a -3.2e+29)
(* (* x t) (- a))
(if (<= a -1.56e-93)
t_1
(if (<= a 6e-204)
(* c (* j t))
(if (<= a 1.05e-99)
t_1
(if (<= a 3.9e+32)
(* -1.0 (* i (* j y)))
(if (<= a 4.4e+176) (* (* (- a) t) 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 = (x * y) * z;
double t_2 = b * (a * i);
double tmp;
if (a <= -6.4e+230) {
tmp = t_2;
} else if (a <= -3.2e+29) {
tmp = (x * t) * -a;
} else if (a <= -1.56e-93) {
tmp = t_1;
} else if (a <= 6e-204) {
tmp = c * (j * t);
} else if (a <= 1.05e-99) {
tmp = t_1;
} else if (a <= 3.9e+32) {
tmp = -1.0 * (i * (j * y));
} else if (a <= 4.4e+176) {
tmp = (-a * t) * x;
} 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 = (x * y) * z
t_2 = b * (a * i)
if (a <= (-6.4d+230)) then
tmp = t_2
else if (a <= (-3.2d+29)) then
tmp = (x * t) * -a
else if (a <= (-1.56d-93)) then
tmp = t_1
else if (a <= 6d-204) then
tmp = c * (j * t)
else if (a <= 1.05d-99) then
tmp = t_1
else if (a <= 3.9d+32) then
tmp = (-1.0d0) * (i * (j * y))
else if (a <= 4.4d+176) then
tmp = (-a * t) * x
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 = (x * y) * z;
double t_2 = b * (a * i);
double tmp;
if (a <= -6.4e+230) {
tmp = t_2;
} else if (a <= -3.2e+29) {
tmp = (x * t) * -a;
} else if (a <= -1.56e-93) {
tmp = t_1;
} else if (a <= 6e-204) {
tmp = c * (j * t);
} else if (a <= 1.05e-99) {
tmp = t_1;
} else if (a <= 3.9e+32) {
tmp = -1.0 * (i * (j * y));
} else if (a <= 4.4e+176) {
tmp = (-a * t) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (x * y) * z t_2 = b * (a * i) tmp = 0 if a <= -6.4e+230: tmp = t_2 elif a <= -3.2e+29: tmp = (x * t) * -a elif a <= -1.56e-93: tmp = t_1 elif a <= 6e-204: tmp = c * (j * t) elif a <= 1.05e-99: tmp = t_1 elif a <= 3.9e+32: tmp = -1.0 * (i * (j * y)) elif a <= 4.4e+176: tmp = (-a * t) * x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * y) * z) t_2 = Float64(b * Float64(a * i)) tmp = 0.0 if (a <= -6.4e+230) tmp = t_2; elseif (a <= -3.2e+29) tmp = Float64(Float64(x * t) * Float64(-a)); elseif (a <= -1.56e-93) tmp = t_1; elseif (a <= 6e-204) tmp = Float64(c * Float64(j * t)); elseif (a <= 1.05e-99) tmp = t_1; elseif (a <= 3.9e+32) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (a <= 4.4e+176) tmp = Float64(Float64(Float64(-a) * t) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (x * y) * z; t_2 = b * (a * i); tmp = 0.0; if (a <= -6.4e+230) tmp = t_2; elseif (a <= -3.2e+29) tmp = (x * t) * -a; elseif (a <= -1.56e-93) tmp = t_1; elseif (a <= 6e-204) tmp = c * (j * t); elseif (a <= 1.05e-99) tmp = t_1; elseif (a <= 3.9e+32) tmp = -1.0 * (i * (j * y)); elseif (a <= 4.4e+176) tmp = (-a * t) * x; 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[(x * y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.4e+230], t$95$2, If[LessEqual[a, -3.2e+29], N[(N[(x * t), $MachinePrecision] * (-a)), $MachinePrecision], If[LessEqual[a, -1.56e-93], t$95$1, If[LessEqual[a, 6e-204], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-99], t$95$1, If[LessEqual[a, 3.9e+32], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.4e+176], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot z\\
t_2 := b \cdot \left(a \cdot i\right)\\
\mathbf{if}\;a \leq -6.4 \cdot 10^{+230}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{+29}:\\
\;\;\;\;\left(x \cdot t\right) \cdot \left(-a\right)\\
\mathbf{elif}\;a \leq -1.56 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-204}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{+32}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{+176}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if a < -6.3999999999999999e230 or 4.4000000000000001e176 < a Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f6422.8%
Applied rewrites22.8%
if -6.3999999999999999e230 < a < -3.1999999999999999e29Initial program 72.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6422.4%
Applied rewrites22.4%
if -3.1999999999999999e29 < a < -1.5600000000000001e-93 or 5.9999999999999997e-204 < a < 1.0499999999999999e-99Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.8%
Applied rewrites21.8%
if -1.5600000000000001e-93 < a < 5.9999999999999997e-204Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
Taylor expanded in z around 0
lower-*.f6422.0%
Applied rewrites22.0%
if 1.0499999999999999e-99 < a < 3.8999999999999999e32Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.7%
Applied rewrites22.7%
if 3.8999999999999999e32 < a < 4.4000000000000001e176Initial program 72.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6422.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.4%
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -3.8e+34)
(* b (* -1.0 (* c z)))
(if (<= z 0.16)
(* y (* -1.0 (* i j)))
(if (<= z 3.8e+162) (* a (* b i)) (* x (* y z))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -3.8e+34) {
tmp = b * (-1.0 * (c * z));
} else if (z <= 0.16) {
tmp = y * (-1.0 * (i * j));
} else if (z <= 3.8e+162) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
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 (z <= (-3.8d+34)) then
tmp = b * ((-1.0d0) * (c * z))
else if (z <= 0.16d0) then
tmp = y * ((-1.0d0) * (i * j))
else if (z <= 3.8d+162) then
tmp = a * (b * i)
else
tmp = x * (y * z)
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 (z <= -3.8e+34) {
tmp = b * (-1.0 * (c * z));
} else if (z <= 0.16) {
tmp = y * (-1.0 * (i * j));
} else if (z <= 3.8e+162) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -3.8e+34: tmp = b * (-1.0 * (c * z)) elif z <= 0.16: tmp = y * (-1.0 * (i * j)) elif z <= 3.8e+162: tmp = a * (b * i) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -3.8e+34) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); elseif (z <= 0.16) tmp = Float64(y * Float64(-1.0 * Float64(i * j))); elseif (z <= 3.8e+162) tmp = Float64(a * Float64(b * i)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -3.8e+34) tmp = b * (-1.0 * (c * z)); elseif (z <= 0.16) tmp = y * (-1.0 * (i * j)); elseif (z <= 3.8e+162) tmp = a * (b * i); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -3.8e+34], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.16], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+162], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+34}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 0.16:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -3.8000000000000001e34Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6421.9%
Applied rewrites21.9%
if -3.8000000000000001e34 < z < 0.16Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if 0.16 < z < 3.8000000000000002e162Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.9%
Applied rewrites22.9%
if 3.8000000000000002e162 < z Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -3.8e+34)
(* c (* -1.0 (* b z)))
(if (<= z 0.16)
(* y (* -1.0 (* i j)))
(if (<= z 3.8e+162) (* a (* b i)) (* x (* y z))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -3.8e+34) {
tmp = c * (-1.0 * (b * z));
} else if (z <= 0.16) {
tmp = y * (-1.0 * (i * j));
} else if (z <= 3.8e+162) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
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 (z <= (-3.8d+34)) then
tmp = c * ((-1.0d0) * (b * z))
else if (z <= 0.16d0) then
tmp = y * ((-1.0d0) * (i * j))
else if (z <= 3.8d+162) then
tmp = a * (b * i)
else
tmp = x * (y * z)
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 (z <= -3.8e+34) {
tmp = c * (-1.0 * (b * z));
} else if (z <= 0.16) {
tmp = y * (-1.0 * (i * j));
} else if (z <= 3.8e+162) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -3.8e+34: tmp = c * (-1.0 * (b * z)) elif z <= 0.16: tmp = y * (-1.0 * (i * j)) elif z <= 3.8e+162: tmp = a * (b * i) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -3.8e+34) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (z <= 0.16) tmp = Float64(y * Float64(-1.0 * Float64(i * j))); elseif (z <= 3.8e+162) tmp = Float64(a * Float64(b * i)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -3.8e+34) tmp = c * (-1.0 * (b * z)); elseif (z <= 0.16) tmp = y * (-1.0 * (i * j)); elseif (z <= 3.8e+162) tmp = a * (b * i); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -3.8e+34], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.16], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+162], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+34}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 0.16:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(i \cdot j\right)\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -3.8000000000000001e34Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.1%
Applied rewrites22.1%
if -3.8000000000000001e34 < z < 0.16Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if 0.16 < z < 3.8000000000000002e162Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.9%
Applied rewrites22.9%
if 3.8000000000000002e162 < z Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -1.3e+41)
(* (* x y) z)
(if (<= x 7.6e-172)
(* c (* -1.0 (* b z)))
(if (<= x 2.8e+39) (* -1.0 (* i (* j y))) (* (* x t) (- a))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.3e+41) {
tmp = (x * y) * z;
} else if (x <= 7.6e-172) {
tmp = c * (-1.0 * (b * z));
} else if (x <= 2.8e+39) {
tmp = -1.0 * (i * (j * y));
} else {
tmp = (x * t) * -a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (x <= (-1.3d+41)) then
tmp = (x * y) * z
else if (x <= 7.6d-172) then
tmp = c * ((-1.0d0) * (b * z))
else if (x <= 2.8d+39) then
tmp = (-1.0d0) * (i * (j * y))
else
tmp = (x * t) * -a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.3e+41) {
tmp = (x * y) * z;
} else if (x <= 7.6e-172) {
tmp = c * (-1.0 * (b * z));
} else if (x <= 2.8e+39) {
tmp = -1.0 * (i * (j * y));
} else {
tmp = (x * t) * -a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -1.3e+41: tmp = (x * y) * z elif x <= 7.6e-172: tmp = c * (-1.0 * (b * z)) elif x <= 2.8e+39: tmp = -1.0 * (i * (j * y)) else: tmp = (x * t) * -a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -1.3e+41) tmp = Float64(Float64(x * y) * z); elseif (x <= 7.6e-172) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (x <= 2.8e+39) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); else tmp = Float64(Float64(x * t) * Float64(-a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -1.3e+41) tmp = (x * y) * z; elseif (x <= 7.6e-172) tmp = c * (-1.0 * (b * z)); elseif (x <= 2.8e+39) tmp = -1.0 * (i * (j * y)); else tmp = (x * t) * -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.3e+41], N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 7.6e-172], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+39], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t), $MachinePrecision] * (-a)), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+41}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-172}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+39}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot t\right) \cdot \left(-a\right)\\
\end{array}
if x < -1.3e41Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.8%
Applied rewrites21.8%
if -1.3e41 < x < 7.5999999999999997e-172Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.1%
Applied rewrites22.1%
if 7.5999999999999997e-172 < x < 2.8e39Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.7%
Applied rewrites22.7%
if 2.8e39 < x Initial program 72.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6422.4%
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (* a i))))
(if (<= a -2.3e+79)
t_1
(if (<= a -1.56e-93)
(* (* x y) z)
(if (<= a 6e-204)
(* c (* j t))
(if (<= a 8800.0) (* x (* y z)) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (a * i);
double tmp;
if (a <= -2.3e+79) {
tmp = t_1;
} else if (a <= -1.56e-93) {
tmp = (x * y) * z;
} else if (a <= 6e-204) {
tmp = c * (j * t);
} else if (a <= 8800.0) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * i)
if (a <= (-2.3d+79)) then
tmp = t_1
else if (a <= (-1.56d-93)) then
tmp = (x * y) * z
else if (a <= 6d-204) then
tmp = c * (j * t)
else if (a <= 8800.0d0) then
tmp = x * (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (a * i);
double tmp;
if (a <= -2.3e+79) {
tmp = t_1;
} else if (a <= -1.56e-93) {
tmp = (x * y) * z;
} else if (a <= 6e-204) {
tmp = c * (j * t);
} else if (a <= 8800.0) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (a * i) tmp = 0 if a <= -2.3e+79: tmp = t_1 elif a <= -1.56e-93: tmp = (x * y) * z elif a <= 6e-204: tmp = c * (j * t) elif a <= 8800.0: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(a * i)) tmp = 0.0 if (a <= -2.3e+79) tmp = t_1; elseif (a <= -1.56e-93) tmp = Float64(Float64(x * y) * z); elseif (a <= 6e-204) tmp = Float64(c * Float64(j * t)); elseif (a <= 8800.0) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * (a * i); tmp = 0.0; if (a <= -2.3e+79) tmp = t_1; elseif (a <= -1.56e-93) tmp = (x * y) * z; elseif (a <= 6e-204) tmp = c * (j * t); elseif (a <= 8800.0) tmp = x * (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.3e+79], t$95$1, If[LessEqual[a, -1.56e-93], N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 6e-204], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8800.0], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i\right)\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.56 \cdot 10^{-93}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-204}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;a \leq 8800:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -2.3e79 or 8800 < a Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f6422.8%
Applied rewrites22.8%
if -2.3e79 < a < -1.5600000000000001e-93Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.8%
Applied rewrites21.8%
if -1.5600000000000001e-93 < a < 5.9999999999999997e-204Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
Taylor expanded in z around 0
lower-*.f6422.0%
Applied rewrites22.0%
if 5.9999999999999997e-204 < a < 8800Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* x t) (- a))))
(if (<= t -1.3e+55)
t_1
(if (<= t 7e-178)
(* b (* a i))
(if (<= t 1.9e+122) (* (* x y) z) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * t) * -a;
double tmp;
if (t <= -1.3e+55) {
tmp = t_1;
} else if (t <= 7e-178) {
tmp = b * (a * i);
} else if (t <= 1.9e+122) {
tmp = (x * y) * z;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (x * t) * -a
if (t <= (-1.3d+55)) then
tmp = t_1
else if (t <= 7d-178) then
tmp = b * (a * i)
else if (t <= 1.9d+122) then
tmp = (x * y) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * t) * -a;
double tmp;
if (t <= -1.3e+55) {
tmp = t_1;
} else if (t <= 7e-178) {
tmp = b * (a * i);
} else if (t <= 1.9e+122) {
tmp = (x * y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (x * t) * -a tmp = 0 if t <= -1.3e+55: tmp = t_1 elif t <= 7e-178: tmp = b * (a * i) elif t <= 1.9e+122: tmp = (x * y) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * t) * Float64(-a)) tmp = 0.0 if (t <= -1.3e+55) tmp = t_1; elseif (t <= 7e-178) tmp = Float64(b * Float64(a * i)); elseif (t <= 1.9e+122) tmp = Float64(Float64(x * y) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (x * t) * -a; tmp = 0.0; if (t <= -1.3e+55) tmp = t_1; elseif (t <= 7e-178) tmp = b * (a * i); elseif (t <= 1.9e+122) tmp = (x * y) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * t), $MachinePrecision] * (-a)), $MachinePrecision]}, If[LessEqual[t, -1.3e+55], t$95$1, If[LessEqual[t, 7e-178], N[(b * N[(a * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+122], N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(x \cdot t\right) \cdot \left(-a\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-178}:\\
\;\;\;\;b \cdot \left(a \cdot i\right)\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+122}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.3e55 or 1.8999999999999999e122 < t Initial program 72.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4%
Applied rewrites71.4%
Taylor expanded in y around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6457.2%
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6422.4%
Applied rewrites22.4%
if -1.3e55 < t < 6.9999999999999997e-178Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f6422.8%
Applied rewrites22.8%
if 6.9999999999999997e-178 < t < 1.8999999999999999e122Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.8%
Applied rewrites21.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -8e-5)
(* (* x z) y)
(if (<= z -6.4e-270)
(* c (* j t))
(if (<= z 3.8e+162) (* a (* b i)) (* x (* y z))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -8e-5) {
tmp = (x * z) * y;
} else if (z <= -6.4e-270) {
tmp = c * (j * t);
} else if (z <= 3.8e+162) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
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 (z <= (-8d-5)) then
tmp = (x * z) * y
else if (z <= (-6.4d-270)) then
tmp = c * (j * t)
else if (z <= 3.8d+162) then
tmp = a * (b * i)
else
tmp = x * (y * z)
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 (z <= -8e-5) {
tmp = (x * z) * y;
} else if (z <= -6.4e-270) {
tmp = c * (j * t);
} else if (z <= 3.8e+162) {
tmp = a * (b * i);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -8e-5: tmp = (x * z) * y elif z <= -6.4e-270: tmp = c * (j * t) elif z <= 3.8e+162: tmp = a * (b * i) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -8e-5) tmp = Float64(Float64(x * z) * y); elseif (z <= -6.4e-270) tmp = Float64(c * Float64(j * t)); elseif (z <= 3.8e+162) tmp = Float64(a * Float64(b * i)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -8e-5) tmp = (x * z) * y; elseif (z <= -6.4e-270) tmp = c * (j * t); elseif (z <= 3.8e+162) tmp = a * (b * i); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -8e-5], N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -6.4e-270], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+162], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-5}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-270}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+162}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -8.0000000000000007e-5Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if -8.0000000000000007e-5 < z < -6.3999999999999998e-270Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
Taylor expanded in z around 0
lower-*.f6422.0%
Applied rewrites22.0%
if -6.3999999999999998e-270 < z < 3.8000000000000002e162Initial program 72.4%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
associate--r+N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
Applied rewrites71.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.2%
Applied rewrites39.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.9%
Applied rewrites22.9%
if 3.8000000000000002e162 < z Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= z -8e-5) (* (* x z) y) (if (<= z 1.46e+85) (* c (* j t)) (* x (* y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -8e-5) {
tmp = (x * z) * y;
} else if (z <= 1.46e+85) {
tmp = c * (j * t);
} else {
tmp = x * (y * z);
}
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 (z <= (-8d-5)) then
tmp = (x * z) * y
else if (z <= 1.46d+85) then
tmp = c * (j * t)
else
tmp = x * (y * z)
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 (z <= -8e-5) {
tmp = (x * z) * y;
} else if (z <= 1.46e+85) {
tmp = c * (j * t);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -8e-5: tmp = (x * z) * y elif z <= 1.46e+85: tmp = c * (j * t) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -8e-5) tmp = Float64(Float64(x * z) * y); elseif (z <= 1.46e+85) tmp = Float64(c * Float64(j * t)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -8e-5) tmp = (x * z) * y; elseif (z <= 1.46e+85) tmp = c * (j * t); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -8e-5], N[(N[(x * z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1.46e+85], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-5}:\\
\;\;\;\;\left(x \cdot z\right) \cdot y\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{+85}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -8.0000000000000007e-5Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if -8.0000000000000007e-5 < z < 1.46e85Initial program 72.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
Taylor expanded in z around 0
lower-*.f6422.0%
Applied rewrites22.0%
if 1.46e85 < z Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (* (* x y) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (x * y) * z;
}
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
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;
}
def code(x, y, z, t, a, b, c, i, j): return (x * y) * z
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(x * y) * z) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (x * y) * z; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]
\left(x \cdot y\right) \cdot z
Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.8%
Applied rewrites21.8%
(FPCore (x y z t a b c i j) :precision binary64 (* x (* y z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
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)
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);
}
def code(x, y, z, t, a, b, c, i, j): return x * (y * z)
function code(x, y, z, t, a, b, c, i, j) return Float64(x * Float64(y * z)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = x * (y * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]
x \cdot \left(y \cdot z\right)
Initial program 72.4%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.1%
Applied rewrites71.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
herbie shell --seed 2025258
(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)))))