
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))))
(if (<=
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j t_1))
INFINITY)
(fma t_1 j (fma (- (* i a) (* c z)) b (* (fma z y (* (- t) a)) x)))
(* 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 = (c * t) - (i * y);
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * t_1)) <= ((double) INFINITY)) {
tmp = fma(t_1, j, fma(((i * a) - (c * z)), b, (fma(z, y, (-t * a)) * x)));
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * t_1)) <= Inf) tmp = fma(t_1, j, fma(Float64(Float64(i * a) - Float64(c * z)), b, Float64(fma(z, y, Float64(Float64(-t) * a)) * x))); else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$1), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * j + N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(z * y + N[((-t) * a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_1, j, \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(z, y, \left(-t\right) \cdot a\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))))
(if (<=
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j t_1))
INFINITY)
(fma t_1 j (fma (- (* i a) (* c z)) b (* (- (* z y) (* a t)) x)))
(* 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 = (c * t) - (i * y);
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * t_1)) <= ((double) INFINITY)) {
tmp = fma(t_1, j, fma(((i * a) - (c * z)), b, (((z * y) - (a * t)) * x)));
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * t_1)) <= Inf) tmp = fma(t_1, j, fma(Float64(Float64(i * a) - Float64(c * z)), b, Float64(Float64(Float64(z * y) - Float64(a * t)) * x))); else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$1), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * j + N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_1, j, \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -1.72e+146)
t_1
(if (<= z 1.4e+128)
(fma (- (* c t) (* i y)) j (fma (* a i) b (* (fma z y (* (- t) 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 = z * ((x * y) - (b * c));
double tmp;
if (z <= -1.72e+146) {
tmp = t_1;
} else if (z <= 1.4e+128) {
tmp = fma(((c * t) - (i * y)), j, fma((a * i), b, (fma(z, y, (-t * a)) * x)));
} 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.72e+146) tmp = t_1; elseif (z <= 1.4e+128) tmp = fma(Float64(Float64(c * t) - Float64(i * y)), j, fma(Float64(a * i), b, Float64(fma(z, y, Float64(Float64(-t) * a)) * x))); else tmp = t_1; end return 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.72e+146], t$95$1, If[LessEqual[z, 1.4e+128], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(a * i), $MachinePrecision] * b + N[(N[(z * y + N[((-t) * a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -1.72 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+128}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \mathsf{fma}\left(a \cdot i, b, \mathsf{fma}\left(z, y, \left(-t\right) \cdot a\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.71999999999999999e146 or 1.39999999999999991e128 < z Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
if -1.71999999999999999e146 < z < 1.39999999999999991e128Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in z around 0
lower-*.f6469.3
Applied rewrites69.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (* c t) j (fma (* a i) b (* (fma z y (* (- t) a)) x)))))
(if (<= x -3.6e-106)
t_1
(if (<= x 14000000.0)
(fma (- (* c t) (* i y)) j (* b (- (* a i) (* c z))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma((c * t), j, fma((a * i), b, (fma(z, y, (-t * a)) * x)));
double tmp;
if (x <= -3.6e-106) {
tmp = t_1;
} else if (x <= 14000000.0) {
tmp = fma(((c * t) - (i * y)), j, (b * ((a * i) - (c * z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(c * t), j, fma(Float64(a * i), b, Float64(fma(z, y, Float64(Float64(-t) * a)) * x))) tmp = 0.0 if (x <= -3.6e-106) tmp = t_1; elseif (x <= 14000000.0) tmp = fma(Float64(Float64(c * t) - Float64(i * y)), j, Float64(b * Float64(Float64(a * i) - Float64(c * z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] * j + N[(N[(a * i), $MachinePrecision] * b + N[(N[(z * y + N[((-t) * a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e-106], t$95$1, If[LessEqual[x, 14000000.0], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c \cdot t, j, \mathsf{fma}\left(a \cdot i, b, \mathsf{fma}\left(z, y, \left(-t\right) \cdot a\right) \cdot x\right)\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 14000000:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, b \cdot \left(a \cdot i - c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.60000000000000013e-106 or 1.4e7 < x Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in z around 0
lower-*.f6469.3
Applied rewrites69.3%
Taylor expanded in y around 0
lower-*.f6462.1
Applied rewrites62.1%
if -3.60000000000000013e-106 < x < 1.4e7Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))) (t_2 (fma j t_1 (* x (- (* y z) (* a t))))))
(if (<= x -3.5e-106)
t_2
(if (<= x 0.0035) (fma t_1 j (* b (- (* a i) (* c z)))) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double t_2 = fma(j, t_1, (x * ((y * z) - (a * t))));
double tmp;
if (x <= -3.5e-106) {
tmp = t_2;
} else if (x <= 0.0035) {
tmp = fma(t_1, j, (b * ((a * i) - (c * z))));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) t_2 = fma(j, t_1, Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (x <= -3.5e-106) tmp = t_2; elseif (x <= 0.0035) tmp = fma(t_1, j, Float64(b * Float64(Float64(a * i) - Float64(c * z)))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * t$95$1 + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e-106], t$95$2, If[LessEqual[x, 0.0035], N[(t$95$1 * j + N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
t_2 := \mathsf{fma}\left(j, t\_1, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{-106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 0.0035:\\
\;\;\;\;\mathsf{fma}\left(t\_1, j, b \cdot \left(a \cdot i - c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -3.5e-106 or 0.00350000000000000007 < x Initial program 73.7%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.5
Applied rewrites60.5%
if -3.5e-106 < x < 0.00350000000000000007Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -5.2e+145)
t_1
(if (<= z 6e+38)
(fma j (- (* c t) (* i y)) (* x (- (* y z) (* a t))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -5.2e+145) {
tmp = t_1;
} else if (z <= 6e+38) {
tmp = fma(j, ((c * t) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(z * Float64(Float64(x * y) - Float64(b * c))) tmp = 0.0 if (z <= -5.2e+145) tmp = t_1; elseif (z <= 6e+38) tmp = fma(j, Float64(Float64(c * t) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+145], t$95$1, If[LessEqual[z, 6e+38], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.20000000000000005e145 or 6.0000000000000002e38 < z Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
if -5.20000000000000005e145 < z < 6.0000000000000002e38Initial program 73.7%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.5
Applied rewrites60.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -2.4e+145)
t_1
(if (<= z -1.25e-91)
(fma (- (* c t) (* i y)) j (* x (* y z)))
(if (<= z -4.2e-163)
(* (- (* b a) (* j y)) i)
(if (<= z 9e-149)
(* (- (* j c) (* x a)) t)
(if (<= z 5.2e+38) (* -1.0 (* a (- (* t x) (* 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 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e+145) {
tmp = t_1;
} else if (z <= -1.25e-91) {
tmp = fma(((c * t) - (i * y)), j, (x * (y * z)));
} else if (z <= -4.2e-163) {
tmp = ((b * a) - (j * y)) * i;
} else if (z <= 9e-149) {
tmp = ((j * c) - (x * a)) * t;
} else if (z <= 5.2e+38) {
tmp = -1.0 * (a * ((t * x) - (b * i)));
} 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 <= -2.4e+145) tmp = t_1; elseif (z <= -1.25e-91) tmp = fma(Float64(Float64(c * t) - Float64(i * y)), j, Float64(x * Float64(y * z))); elseif (z <= -4.2e-163) tmp = Float64(Float64(Float64(b * a) - Float64(j * y)) * i); elseif (z <= 9e-149) tmp = Float64(Float64(Float64(j * c) - Float64(x * a)) * t); elseif (z <= 5.2e+38) tmp = Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))); else tmp = t_1; end return 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, -2.4e+145], t$95$1, If[LessEqual[z, -1.25e-91], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-163], N[(N[(N[(b * a), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[z, 9e-149], N[(N[(N[(j * c), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 5.2e+38], N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-91}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-163}:\\
\;\;\;\;\left(b \cdot a - j \cdot y\right) \cdot i\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-149}:\\
\;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+38}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.39999999999999992e145 or 5.1999999999999998e38 < z Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
if -2.39999999999999992e145 < z < -1.24999999999999999e-91Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6450.1
Applied rewrites50.1%
if -1.24999999999999999e-91 < z < -4.19999999999999996e-163Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6438.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
if -4.19999999999999996e-163 < z < 8.9999999999999996e-149Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
lift-fma.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity38.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
if 8.9999999999999996e-149 < z < 5.1999999999999998e38Initial program 73.7%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -2.4e+145)
t_1
(if (<= z -1.3e-91)
(* j (- (* c t) (* i y)))
(if (<= z -4.2e-163)
(* (- (* b a) (* j y)) i)
(if (<= z 9e-149)
(* (- (* j c) (* x a)) t)
(if (<= z 5.2e+38) (* -1.0 (* a (- (* t x) (* 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 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e+145) {
tmp = t_1;
} else if (z <= -1.3e-91) {
tmp = j * ((c * t) - (i * y));
} else if (z <= -4.2e-163) {
tmp = ((b * a) - (j * y)) * i;
} else if (z <= 9e-149) {
tmp = ((j * c) - (x * a)) * t;
} else if (z <= 5.2e+38) {
tmp = -1.0 * (a * ((t * x) - (b * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((x * y) - (b * c))
if (z <= (-2.4d+145)) then
tmp = t_1
else if (z <= (-1.3d-91)) then
tmp = j * ((c * t) - (i * y))
else if (z <= (-4.2d-163)) then
tmp = ((b * a) - (j * y)) * i
else if (z <= 9d-149) then
tmp = ((j * c) - (x * a)) * t
else if (z <= 5.2d+38) then
tmp = (-1.0d0) * (a * ((t * x) - (b * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e+145) {
tmp = t_1;
} else if (z <= -1.3e-91) {
tmp = j * ((c * t) - (i * y));
} else if (z <= -4.2e-163) {
tmp = ((b * a) - (j * y)) * i;
} else if (z <= 9e-149) {
tmp = ((j * c) - (x * a)) * t;
} else if (z <= 5.2e+38) {
tmp = -1.0 * (a * ((t * x) - (b * i)));
} 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 <= -2.4e+145: tmp = t_1 elif z <= -1.3e-91: tmp = j * ((c * t) - (i * y)) elif z <= -4.2e-163: tmp = ((b * a) - (j * y)) * i elif z <= 9e-149: tmp = ((j * c) - (x * a)) * t elif z <= 5.2e+38: tmp = -1.0 * (a * ((t * x) - (b * i))) 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 <= -2.4e+145) tmp = t_1; elseif (z <= -1.3e-91) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); elseif (z <= -4.2e-163) tmp = Float64(Float64(Float64(b * a) - Float64(j * y)) * i); elseif (z <= 9e-149) tmp = Float64(Float64(Float64(j * c) - Float64(x * a)) * t); elseif (z <= 5.2e+38) tmp = Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = z * ((x * y) - (b * c)); tmp = 0.0; if (z <= -2.4e+145) tmp = t_1; elseif (z <= -1.3e-91) tmp = j * ((c * t) - (i * y)); elseif (z <= -4.2e-163) tmp = ((b * a) - (j * y)) * i; elseif (z <= 9e-149) tmp = ((j * c) - (x * a)) * t; elseif (z <= 5.2e+38) tmp = -1.0 * (a * ((t * x) - (b * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+145], t$95$1, If[LessEqual[z, -1.3e-91], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-163], N[(N[(N[(b * a), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[z, 9e-149], N[(N[(N[(j * c), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 5.2e+38], N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-91}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-163}:\\
\;\;\;\;\left(b \cdot a - j \cdot y\right) \cdot i\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-149}:\\
\;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+38}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.39999999999999992e145 or 5.1999999999999998e38 < z Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
if -2.39999999999999992e145 < z < -1.30000000000000007e-91Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -1.30000000000000007e-91 < z < -4.19999999999999996e-163Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6438.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
if -4.19999999999999996e-163 < z < 8.9999999999999996e-149Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
lift-fma.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity38.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
if 8.9999999999999996e-149 < z < 5.1999999999999998e38Initial program 73.7%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -4.4e+100)
t_1
(if (<= x 13000.0)
(+ (* -1.0 (* b (* c z))) (* j (- (* c t) (* i y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -4.4e+100) {
tmp = t_1;
} else if (x <= 13000.0) {
tmp = (-1.0 * (b * (c * z))) + (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 = x * ((y * z) - (a * t))
if (x <= (-4.4d+100)) then
tmp = t_1
else if (x <= 13000.0d0) then
tmp = ((-1.0d0) * (b * (c * z))) + (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 = x * ((y * z) - (a * t));
double tmp;
if (x <= -4.4e+100) {
tmp = t_1;
} else if (x <= 13000.0) {
tmp = (-1.0 * (b * (c * z))) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -4.4e+100: tmp = t_1 elif x <= 13000.0: tmp = (-1.0 * (b * (c * z))) + (j * ((c * t) - (i * y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -4.4e+100) tmp = t_1; elseif (x <= 13000.0) tmp = Float64(Float64(-1.0 * Float64(b * Float64(c * z))) + 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 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -4.4e+100) tmp = t_1; elseif (x <= 13000.0) tmp = (-1.0 * (b * (c * z))) + (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[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+100], t$95$1, If[LessEqual[x, 13000.0], N[(N[(-1.0 * N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 13000:\\
\;\;\;\;-1 \cdot \left(b \cdot \left(c \cdot z\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.4000000000000001e100 or 13000 < x Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
if -4.4000000000000001e100 < x < 13000Initial program 73.7%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -9.6e+145)
t_1
(if (<= z 1.1e-290)
(+ (* a (* b i)) (* j (- (* c t) (* i y))))
(if (<= z 5.2e+38) (* -1.0 (* a (- (* t x) (* 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 = z * ((x * y) - (b * c));
double tmp;
if (z <= -9.6e+145) {
tmp = t_1;
} else if (z <= 1.1e-290) {
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)));
} else if (z <= 5.2e+38) {
tmp = -1.0 * (a * ((t * x) - (b * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((x * y) - (b * c))
if (z <= (-9.6d+145)) then
tmp = t_1
else if (z <= 1.1d-290) then
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)))
else if (z <= 5.2d+38) then
tmp = (-1.0d0) * (a * ((t * x) - (b * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -9.6e+145) {
tmp = t_1;
} else if (z <= 1.1e-290) {
tmp = (a * (b * i)) + (j * ((c * t) - (i * y)));
} else if (z <= 5.2e+38) {
tmp = -1.0 * (a * ((t * x) - (b * i)));
} 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 <= -9.6e+145: tmp = t_1 elif z <= 1.1e-290: tmp = (a * (b * i)) + (j * ((c * t) - (i * y))) elif z <= 5.2e+38: tmp = -1.0 * (a * ((t * x) - (b * i))) 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 <= -9.6e+145) tmp = t_1; elseif (z <= 1.1e-290) tmp = Float64(Float64(a * Float64(b * i)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); elseif (z <= 5.2e+38) tmp = Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = z * ((x * y) - (b * c)); tmp = 0.0; if (z <= -9.6e+145) tmp = t_1; elseif (z <= 1.1e-290) tmp = (a * (b * i)) + (j * ((c * t) - (i * y))); elseif (z <= 5.2e+38) tmp = -1.0 * (a * ((t * x) - (b * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+145], t$95$1, If[LessEqual[z, 1.1e-290], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+38], N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-290}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+38}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.59999999999999967e145 or 5.1999999999999998e38 < z Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
if -9.59999999999999967e145 < z < 1.1e-290Initial program 73.7%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6448.9
Applied rewrites48.9%
if 1.1e-290 < z < 5.1999999999999998e38Initial program 73.7%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* z (- (* x y) (* b c)))))
(if (<= z -2.4e+145)
t_1
(if (<= z -1.3e-91)
(* j (- (* c t) (* i y)))
(if (<= z -4.2e-163)
(* (- (* b a) (* j y)) i)
(if (<= z 4.6e+31) (* (- (* j c) (* x a)) t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e+145) {
tmp = t_1;
} else if (z <= -1.3e-91) {
tmp = j * ((c * t) - (i * y));
} else if (z <= -4.2e-163) {
tmp = ((b * a) - (j * y)) * i;
} else if (z <= 4.6e+31) {
tmp = ((j * c) - (x * a)) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((x * y) - (b * c))
if (z <= (-2.4d+145)) then
tmp = t_1
else if (z <= (-1.3d-91)) then
tmp = j * ((c * t) - (i * y))
else if (z <= (-4.2d-163)) then
tmp = ((b * a) - (j * y)) * i
else if (z <= 4.6d+31) then
tmp = ((j * c) - (x * a)) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = z * ((x * y) - (b * c));
double tmp;
if (z <= -2.4e+145) {
tmp = t_1;
} else if (z <= -1.3e-91) {
tmp = j * ((c * t) - (i * y));
} else if (z <= -4.2e-163) {
tmp = ((b * a) - (j * y)) * i;
} else if (z <= 4.6e+31) {
tmp = ((j * c) - (x * a)) * t;
} 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 <= -2.4e+145: tmp = t_1 elif z <= -1.3e-91: tmp = j * ((c * t) - (i * y)) elif z <= -4.2e-163: tmp = ((b * a) - (j * y)) * i elif z <= 4.6e+31: tmp = ((j * c) - (x * a)) * t 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 <= -2.4e+145) tmp = t_1; elseif (z <= -1.3e-91) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); elseif (z <= -4.2e-163) tmp = Float64(Float64(Float64(b * a) - Float64(j * y)) * i); elseif (z <= 4.6e+31) tmp = Float64(Float64(Float64(j * c) - Float64(x * a)) * t); 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 <= -2.4e+145) tmp = t_1; elseif (z <= -1.3e-91) tmp = j * ((c * t) - (i * y)); elseif (z <= -4.2e-163) tmp = ((b * a) - (j * y)) * i; elseif (z <= 4.6e+31) tmp = ((j * c) - (x * a)) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+145], t$95$1, If[LessEqual[z, -1.3e-91], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-163], N[(N[(N[(b * a), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[z, 4.6e+31], N[(N[(N[(j * c), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-91}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-163}:\\
\;\;\;\;\left(b \cdot a - j \cdot y\right) \cdot i\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+31}:\\
\;\;\;\;\left(j \cdot c - x \cdot a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.39999999999999992e145 or 4.5999999999999999e31 < z Initial program 73.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.2
Applied rewrites40.2%
if -2.39999999999999992e145 < z < -1.30000000000000007e-91Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -1.30000000000000007e-91 < z < -4.19999999999999996e-163Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6438.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
if -4.19999999999999996e-163 < z < 4.5999999999999999e31Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
lift-fma.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity38.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* a i) (* c z)))))
(if (<= b -1.15e+129)
t_1
(if (<= b -2.05e-242)
(* j (- (* c t) (* i y)))
(if (<= b 2.05e-130) (* x (- (* y z) (* a t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.15e+129) {
tmp = t_1;
} else if (b <= -2.05e-242) {
tmp = j * ((c * t) - (i * y));
} else if (b <= 2.05e-130) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = b * ((a * i) - (c * z))
if (b <= (-1.15d+129)) then
tmp = t_1
else if (b <= (-2.05d-242)) then
tmp = j * ((c * t) - (i * y))
else if (b <= 2.05d-130) then
tmp = x * ((y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.15e+129) {
tmp = t_1;
} else if (b <= -2.05e-242) {
tmp = j * ((c * t) - (i * y));
} else if (b <= 2.05e-130) {
tmp = x * ((y * z) - (a * t));
} 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 <= -1.15e+129: tmp = t_1 elif b <= -2.05e-242: tmp = j * ((c * t) - (i * y)) elif b <= 2.05e-130: tmp = x * ((y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(a * i) - Float64(c * z))) tmp = 0.0 if (b <= -1.15e+129) tmp = t_1; elseif (b <= -2.05e-242) tmp = Float64(j * Float64(Float64(c * t) - Float64(i * y))); elseif (b <= 2.05e-130) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); 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 <= -1.15e+129) tmp = t_1; elseif (b <= -2.05e-242) tmp = j * ((c * t) - (i * y)); elseif (b <= 2.05e-130) tmp = x * ((y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.15e+129], t$95$1, If[LessEqual[b, -2.05e-242], N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.05e-130], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.05 \cdot 10^{-242}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{elif}\;b \leq 2.05 \cdot 10^{-130}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.14999999999999995e129 or 2.0499999999999999e-130 < b Initial program 73.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.8
Applied rewrites39.8%
if -1.14999999999999995e129 < b < -2.04999999999999985e-242Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -2.04999999999999985e-242 < b < 2.0499999999999999e-130Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y)))) (t_2 (* b (- (* a i) (* c z)))))
(if (<= b -1.15e+129)
t_2
(if (<= b -2e-242)
t_1
(if (<= b 3.8e-158) (* (* (- x) a) t) (if (<= b 4.3e-58) 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 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.15e+129) {
tmp = t_2;
} else if (b <= -2e-242) {
tmp = t_1;
} else if (b <= 3.8e-158) {
tmp = (-x * a) * t;
} else if (b <= 4.3e-58) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * ((c * t) - (i * y))
t_2 = b * ((a * i) - (c * z))
if (b <= (-1.15d+129)) then
tmp = t_2
else if (b <= (-2d-242)) then
tmp = t_1
else if (b <= 3.8d-158) then
tmp = (-x * a) * t
else if (b <= 4.3d-58) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * t) - (i * y));
double t_2 = b * ((a * i) - (c * z));
double tmp;
if (b <= -1.15e+129) {
tmp = t_2;
} else if (b <= -2e-242) {
tmp = t_1;
} else if (b <= 3.8e-158) {
tmp = (-x * a) * t;
} else if (b <= 4.3e-58) {
tmp = 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 = b * ((a * i) - (c * z)) tmp = 0 if b <= -1.15e+129: tmp = t_2 elif b <= -2e-242: tmp = t_1 elif b <= 3.8e-158: tmp = (-x * a) * t elif b <= 4.3e-58: tmp = 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(b * Float64(Float64(a * i) - Float64(c * z))) tmp = 0.0 if (b <= -1.15e+129) tmp = t_2; elseif (b <= -2e-242) tmp = t_1; elseif (b <= 3.8e-158) tmp = Float64(Float64(Float64(-x) * a) * t); elseif (b <= 4.3e-58) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * t) - (i * y)); t_2 = b * ((a * i) - (c * z)); tmp = 0.0; if (b <= -1.15e+129) tmp = t_2; elseif (b <= -2e-242) tmp = t_1; elseif (b <= 3.8e-158) tmp = (-x * a) * t; elseif (b <= 4.3e-58) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.15e+129], t$95$2, If[LessEqual[b, -2e-242], t$95$1, If[LessEqual[b, 3.8e-158], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 4.3e-58], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
t_2 := b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-242}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-158}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.14999999999999995e129 or 4.2999999999999999e-58 < b Initial program 73.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.8
Applied rewrites39.8%
if -1.14999999999999995e129 < b < -2e-242 or 3.7999999999999999e-158 < b < 4.2999999999999999e-58Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -2e-242 < b < 3.7999999999999999e-158Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
associate-*l*22.5
associate-*r*22.5
lift-*.f64N/A
lift-*.f64N/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift-*.f6422.5
*-commutative22.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* j (- (* c t) (* i y))))) (if (<= j -1300000000000.0) t_1 (if (<= j 9.6e-46) (* (* (- x) a) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * t) - (i * y));
double tmp;
if (j <= -1300000000000.0) {
tmp = t_1;
} else if (j <= 9.6e-46) {
tmp = (-x * a) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((c * t) - (i * y))
if (j <= (-1300000000000.0d0)) then
tmp = t_1
else if (j <= 9.6d-46) then
tmp = (-x * a) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * t) - (i * y));
double tmp;
if (j <= -1300000000000.0) {
tmp = t_1;
} else if (j <= 9.6e-46) {
tmp = (-x * a) * t;
} else {
tmp = 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 <= -1300000000000.0: tmp = t_1 elif j <= 9.6e-46: tmp = (-x * a) * t else: tmp = 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 <= -1300000000000.0) tmp = t_1; elseif (j <= 9.6e-46) tmp = Float64(Float64(Float64(-x) * a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * t) - (i * y)); tmp = 0.0; if (j <= -1300000000000.0) tmp = t_1; elseif (j <= 9.6e-46) tmp = (-x * a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1300000000000.0], t$95$1, If[LessEqual[j, 9.6e-46], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;j \leq -1300000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 9.6 \cdot 10^{-46}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.3e12 or 9.60000000000000053e-46 < j Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -1.3e12 < j < 9.60000000000000053e-46Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
associate-*l*22.5
associate-*r*22.5
lift-*.f64N/A
lift-*.f64N/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift-*.f6422.5
*-commutative22.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- x) a) t)) (t_2 (* (* a i) b)))
(if (<= a -9.2e+197)
t_2
(if (<= a -1.15e+50)
t_1
(if (<= a -6.8e-91)
(* j (* -1.0 (* i y)))
(if (<= a 8.2e-228)
(* t (* c j))
(if (<= a 4.5e-67)
(* -1.0 (* i (* j y)))
(if (<= a 3.75e+59) t_2 t_1))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-x * a) * t;
double t_2 = (a * i) * b;
double tmp;
if (a <= -9.2e+197) {
tmp = t_2;
} else if (a <= -1.15e+50) {
tmp = t_1;
} else if (a <= -6.8e-91) {
tmp = j * (-1.0 * (i * y));
} else if (a <= 8.2e-228) {
tmp = t * (c * j);
} else if (a <= 4.5e-67) {
tmp = -1.0 * (i * (j * y));
} else if (a <= 3.75e+59) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (-x * a) * t
t_2 = (a * i) * b
if (a <= (-9.2d+197)) then
tmp = t_2
else if (a <= (-1.15d+50)) then
tmp = t_1
else if (a <= (-6.8d-91)) then
tmp = j * ((-1.0d0) * (i * y))
else if (a <= 8.2d-228) then
tmp = t * (c * j)
else if (a <= 4.5d-67) then
tmp = (-1.0d0) * (i * (j * y))
else if (a <= 3.75d+59) then
tmp = t_2
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 * a) * t;
double t_2 = (a * i) * b;
double tmp;
if (a <= -9.2e+197) {
tmp = t_2;
} else if (a <= -1.15e+50) {
tmp = t_1;
} else if (a <= -6.8e-91) {
tmp = j * (-1.0 * (i * y));
} else if (a <= 8.2e-228) {
tmp = t * (c * j);
} else if (a <= 4.5e-67) {
tmp = -1.0 * (i * (j * y));
} else if (a <= 3.75e+59) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-x * a) * t t_2 = (a * i) * b tmp = 0 if a <= -9.2e+197: tmp = t_2 elif a <= -1.15e+50: tmp = t_1 elif a <= -6.8e-91: tmp = j * (-1.0 * (i * y)) elif a <= 8.2e-228: tmp = t * (c * j) elif a <= 4.5e-67: tmp = -1.0 * (i * (j * y)) elif a <= 3.75e+59: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-x) * a) * t) t_2 = Float64(Float64(a * i) * b) tmp = 0.0 if (a <= -9.2e+197) tmp = t_2; elseif (a <= -1.15e+50) tmp = t_1; elseif (a <= -6.8e-91) tmp = Float64(j * Float64(-1.0 * Float64(i * y))); elseif (a <= 8.2e-228) tmp = Float64(t * Float64(c * j)); elseif (a <= 4.5e-67) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (a <= 3.75e+59) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-x * a) * t; t_2 = (a * i) * b; tmp = 0.0; if (a <= -9.2e+197) tmp = t_2; elseif (a <= -1.15e+50) tmp = t_1; elseif (a <= -6.8e-91) tmp = j * (-1.0 * (i * y)); elseif (a <= 8.2e-228) tmp = t * (c * j); elseif (a <= 4.5e-67) tmp = -1.0 * (i * (j * y)); elseif (a <= 3.75e+59) tmp = t_2; 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) * a), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[a, -9.2e+197], t$95$2, If[LessEqual[a, -1.15e+50], t$95$1, If[LessEqual[a, -6.8e-91], N[(j * N[(-1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e-228], N[(t * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e-67], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.75e+59], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-x\right) \cdot a\right) \cdot t\\
t_2 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{+197}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.15 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-91}:\\
\;\;\;\;j \cdot \left(-1 \cdot \left(i \cdot y\right)\right)\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-228}:\\
\;\;\;\;t \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{-67}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;a \leq 3.75 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.2000000000000002e197 or 4.50000000000000015e-67 < a < 3.7499999999999998e59Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if -9.2000000000000002e197 < a < -1.14999999999999998e50 or 3.7499999999999998e59 < a Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
associate-*l*22.5
associate-*r*22.5
lift-*.f64N/A
lift-*.f64N/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift-*.f6422.5
*-commutative22.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if -1.14999999999999998e50 < a < -6.80000000000000053e-91Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
if -6.80000000000000053e-91 < a < 8.19999999999999995e-228Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around 0
lower-*.f6421.8
Applied rewrites21.8%
if 8.19999999999999995e-228 < a < 4.50000000000000015e-67Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6421.5
Applied rewrites21.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- x) a) t)) (t_2 (* j (* -1.0 (* i y)))))
(if (<= a -9.2e+197)
(* (* a i) b)
(if (<= a -1.15e+50)
t_1
(if (<= a -6.8e-91)
t_2
(if (<= a 8.2e-228) (* t (* c j)) (if (<= a 4.9e+58) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-x * a) * t;
double t_2 = j * (-1.0 * (i * y));
double tmp;
if (a <= -9.2e+197) {
tmp = (a * i) * b;
} else if (a <= -1.15e+50) {
tmp = t_1;
} else if (a <= -6.8e-91) {
tmp = t_2;
} else if (a <= 8.2e-228) {
tmp = t * (c * j);
} else if (a <= 4.9e+58) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (-x * a) * t
t_2 = j * ((-1.0d0) * (i * y))
if (a <= (-9.2d+197)) then
tmp = (a * i) * b
else if (a <= (-1.15d+50)) then
tmp = t_1
else if (a <= (-6.8d-91)) then
tmp = t_2
else if (a <= 8.2d-228) then
tmp = t * (c * j)
else if (a <= 4.9d+58) then
tmp = t_2
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 * a) * t;
double t_2 = j * (-1.0 * (i * y));
double tmp;
if (a <= -9.2e+197) {
tmp = (a * i) * b;
} else if (a <= -1.15e+50) {
tmp = t_1;
} else if (a <= -6.8e-91) {
tmp = t_2;
} else if (a <= 8.2e-228) {
tmp = t * (c * j);
} else if (a <= 4.9e+58) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-x * a) * t t_2 = j * (-1.0 * (i * y)) tmp = 0 if a <= -9.2e+197: tmp = (a * i) * b elif a <= -1.15e+50: tmp = t_1 elif a <= -6.8e-91: tmp = t_2 elif a <= 8.2e-228: tmp = t * (c * j) elif a <= 4.9e+58: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-x) * a) * t) t_2 = Float64(j * Float64(-1.0 * Float64(i * y))) tmp = 0.0 if (a <= -9.2e+197) tmp = Float64(Float64(a * i) * b); elseif (a <= -1.15e+50) tmp = t_1; elseif (a <= -6.8e-91) tmp = t_2; elseif (a <= 8.2e-228) tmp = Float64(t * Float64(c * j)); elseif (a <= 4.9e+58) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-x * a) * t; t_2 = j * (-1.0 * (i * y)); tmp = 0.0; if (a <= -9.2e+197) tmp = (a * i) * b; elseif (a <= -1.15e+50) tmp = t_1; elseif (a <= -6.8e-91) tmp = t_2; elseif (a <= 8.2e-228) tmp = t * (c * j); elseif (a <= 4.9e+58) tmp = t_2; 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) * a), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(-1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.2e+197], N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, -1.15e+50], t$95$1, If[LessEqual[a, -6.8e-91], t$95$2, If[LessEqual[a, 8.2e-228], N[(t * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.9e+58], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-x\right) \cdot a\right) \cdot t\\
t_2 := j \cdot \left(-1 \cdot \left(i \cdot y\right)\right)\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{+197}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{elif}\;a \leq -1.15 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-91}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-228}:\\
\;\;\;\;t \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.2000000000000002e197Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if -9.2000000000000002e197 < a < -1.14999999999999998e50 or 4.90000000000000018e58 < a Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
associate-*l*22.5
associate-*r*22.5
lift-*.f64N/A
lift-*.f64N/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift-*.f6422.5
*-commutative22.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if -1.14999999999999998e50 < a < -6.80000000000000053e-91 or 8.19999999999999995e-228 < a < 4.90000000000000018e58Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
if -6.80000000000000053e-91 < a < 8.19999999999999995e-228Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around 0
lower-*.f6421.8
Applied rewrites21.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.3e+126)
(* -1.0 (* a (* t x)))
(if (<= t -1.2e-215)
(* a (* b i))
(if (<= t 6.1e-136) (* j (* -1.0 (* i y))) (* (* (- x) a) t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.3e+126) {
tmp = -1.0 * (a * (t * x));
} else if (t <= -1.2e-215) {
tmp = a * (b * i);
} else if (t <= 6.1e-136) {
tmp = j * (-1.0 * (i * y));
} else {
tmp = (-x * a) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.3d+126)) then
tmp = (-1.0d0) * (a * (t * x))
else if (t <= (-1.2d-215)) then
tmp = a * (b * i)
else if (t <= 6.1d-136) then
tmp = j * ((-1.0d0) * (i * y))
else
tmp = (-x * a) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.3e+126) {
tmp = -1.0 * (a * (t * x));
} else if (t <= -1.2e-215) {
tmp = a * (b * i);
} else if (t <= 6.1e-136) {
tmp = j * (-1.0 * (i * y));
} else {
tmp = (-x * a) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.3e+126: tmp = -1.0 * (a * (t * x)) elif t <= -1.2e-215: tmp = a * (b * i) elif t <= 6.1e-136: tmp = j * (-1.0 * (i * y)) else: tmp = (-x * a) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.3e+126) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); elseif (t <= -1.2e-215) tmp = Float64(a * Float64(b * i)); elseif (t <= 6.1e-136) tmp = Float64(j * Float64(-1.0 * Float64(i * y))); else tmp = Float64(Float64(Float64(-x) * a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.3e+126) tmp = -1.0 * (a * (t * x)); elseif (t <= -1.2e-215) tmp = a * (b * i); elseif (t <= 6.1e-136) tmp = j * (-1.0 * (i * y)); else tmp = (-x * a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.3e+126], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.2e-215], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.1e-136], N[(j * N[(-1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+126}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-215}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{-136}:\\
\;\;\;\;j \cdot \left(-1 \cdot \left(i \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\end{array}
\end{array}
if t < -1.3e126Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
if -1.3e126 < t < -1.20000000000000005e-215Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
if -1.20000000000000005e-215 < t < 6.0999999999999999e-136Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6421.7
Applied rewrites21.7%
if 6.0999999999999999e-136 < t Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
associate-*l*22.5
associate-*r*22.5
lift-*.f64N/A
lift-*.f64N/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift-*.f6422.5
*-commutative22.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* (- x) a) t))) (if (<= t -8e+63) t_1 (if (<= t 1.02e-84) (* (* a i) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-x * a) * t;
double tmp;
if (t <= -8e+63) {
tmp = t_1;
} else if (t <= 1.02e-84) {
tmp = (a * i) * b;
} 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 * a) * t
if (t <= (-8d+63)) then
tmp = t_1
else if (t <= 1.02d-84) then
tmp = (a * i) * b
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 * a) * t;
double tmp;
if (t <= -8e+63) {
tmp = t_1;
} else if (t <= 1.02e-84) {
tmp = (a * i) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-x * a) * t tmp = 0 if t <= -8e+63: tmp = t_1 elif t <= 1.02e-84: tmp = (a * i) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-x) * a) * t) tmp = 0.0 if (t <= -8e+63) tmp = t_1; elseif (t <= 1.02e-84) tmp = Float64(Float64(a * i) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-x * a) * t; tmp = 0.0; if (t <= -8e+63) tmp = t_1; elseif (t <= 1.02e-84) tmp = (a * i) * b; 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) * a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -8e+63], t$95$1, If[LessEqual[t, 1.02e-84], N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-84}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.00000000000000046e63 or 1.02000000000000004e-84 < t Initial program 73.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
associate-*l*22.5
associate-*r*22.5
lift-*.f64N/A
lift-*.f64N/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
lift-*.f6422.5
*-commutative22.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if -8.00000000000000046e63 < t < 1.02000000000000004e-84Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* a i) b))) (if (<= a -1.85e-32) t_1 (if (<= a 4.6e-66) (* j (* c t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (a * i) * b;
double tmp;
if (a <= -1.85e-32) {
tmp = t_1;
} else if (a <= 4.6e-66) {
tmp = j * (c * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (a * i) * b
if (a <= (-1.85d-32)) then
tmp = t_1
else if (a <= 4.6d-66) then
tmp = j * (c * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (a * i) * b;
double tmp;
if (a <= -1.85e-32) {
tmp = t_1;
} else if (a <= 4.6e-66) {
tmp = j * (c * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (a * i) * b tmp = 0 if a <= -1.85e-32: tmp = t_1 elif a <= 4.6e-66: tmp = j * (c * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(a * i) * b) tmp = 0.0 if (a <= -1.85e-32) tmp = t_1; elseif (a <= 4.6e-66) tmp = Float64(j * Float64(c * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (a * i) * b; tmp = 0.0; if (a <= -1.85e-32) tmp = t_1; elseif (a <= 4.6e-66) tmp = j * (c * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[a, -1.85e-32], t$95$1, If[LessEqual[a, 4.6e-66], N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot i\right) \cdot b\\
\mathbf{if}\;a \leq -1.85 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-66}:\\
\;\;\;\;j \cdot \left(c \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.85e-32 or 4.59999999999999984e-66 < a Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if -1.85e-32 < a < 4.59999999999999984e-66Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* a (* b i)))) (if (<= b -2.05e+80) t_1 (if (<= b 3.3e+67) (* j (* c t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (b * i);
double tmp;
if (b <= -2.05e+80) {
tmp = t_1;
} else if (b <= 3.3e+67) {
tmp = j * (c * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = a * (b * i)
if (b <= (-2.05d+80)) then
tmp = t_1
else if (b <= 3.3d+67) then
tmp = j * (c * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (b * i);
double tmp;
if (b <= -2.05e+80) {
tmp = t_1;
} else if (b <= 3.3e+67) {
tmp = j * (c * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (b * i) tmp = 0 if b <= -2.05e+80: tmp = t_1 elif b <= 3.3e+67: tmp = j * (c * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(b * i)) tmp = 0.0 if (b <= -2.05e+80) tmp = t_1; elseif (b <= 3.3e+67) tmp = Float64(j * Float64(c * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = a * (b * i); tmp = 0.0; if (b <= -2.05e+80) tmp = t_1; elseif (b <= 3.3e+67) tmp = j * (c * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.05e+80], t$95$1, If[LessEqual[b, 3.3e+67], N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot i\right)\\
\mathbf{if}\;b \leq -2.05 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{+67}:\\
\;\;\;\;j \cdot \left(c \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.05000000000000001e80 or 3.3000000000000003e67 < b Initial program 73.7%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
if -2.05000000000000001e80 < b < 3.3000000000000003e67Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (* j (* c t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return j * (c * t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = j * (c * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return j * (c * t);
}
def code(x, y, z, t, a, b, c, i, j): return j * (c * t)
function code(x, y, z, t, a, b, c, i, j) return Float64(j * Float64(c * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = j * (c * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
j \cdot \left(c \cdot t\right)
\end{array}
Initial program 73.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.7
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites77.0%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6477.3
Applied rewrites77.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
lower-*.f6422.0
Applied rewrites22.0%
herbie shell --seed 2025149
(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)))))