
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* (fma (- i) j (* z x)) y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-i, j, (z * x)) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 91.7%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6444.7
Applied rewrites44.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* i t) (* c z))) (t_2 (- (* z y) (* a t))))
(if (<= b -1.32e+161)
(* t_1 b)
(if (<= b -1.28e-180)
(fma
(* j c)
a
(fma (- a) (* t x) (fma (- (* y x) (* c b)) z (* (* b t) i))))
(if (<= b 1.15e-33)
(fma (- i) (* j y) (fma t_2 x (* (* j c) a)))
(fma t_1 b (* t_2 x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) - (c * z);
double t_2 = (z * y) - (a * t);
double tmp;
if (b <= -1.32e+161) {
tmp = t_1 * b;
} else if (b <= -1.28e-180) {
tmp = fma((j * c), a, fma(-a, (t * x), fma(((y * x) - (c * b)), z, ((b * t) * i))));
} else if (b <= 1.15e-33) {
tmp = fma(-i, (j * y), fma(t_2, x, ((j * c) * a)));
} else {
tmp = fma(t_1, b, (t_2 * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) - Float64(c * z)) t_2 = Float64(Float64(z * y) - Float64(a * t)) tmp = 0.0 if (b <= -1.32e+161) tmp = Float64(t_1 * b); elseif (b <= -1.28e-180) tmp = fma(Float64(j * c), a, fma(Float64(-a), Float64(t * x), fma(Float64(Float64(y * x) - Float64(c * b)), z, Float64(Float64(b * t) * i)))); elseif (b <= 1.15e-33) tmp = fma(Float64(-i), Float64(j * y), fma(t_2, x, Float64(Float64(j * c) * a))); else tmp = fma(t_1, b, Float64(t_2 * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.32e+161], N[(t$95$1 * b), $MachinePrecision], If[LessEqual[b, -1.28e-180], N[(N[(j * c), $MachinePrecision] * a + N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z + N[(N[(b * t), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-33], N[((-i) * N[(j * y), $MachinePrecision] + N[(t$95$2 * x + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[(t$95$2 * x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot t - c \cdot z\\
t_2 := z \cdot y - a \cdot t\\
\mathbf{if}\;b \leq -1.32 \cdot 10^{+161}:\\
\;\;\;\;t\_1 \cdot b\\
\mathbf{elif}\;b \leq -1.28 \cdot 10^{-180}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(-a, t \cdot x, \mathsf{fma}\left(y \cdot x - c \cdot b, z, \left(b \cdot t\right) \cdot i\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, \mathsf{fma}\left(t\_2, x, \left(j \cdot c\right) \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, t\_2 \cdot x\right)\\
\end{array}
\end{array}
if b < -1.3199999999999999e161Initial program 70.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6470.0
Applied rewrites70.0%
if -1.3199999999999999e161 < b < -1.2800000000000001e-180Initial program 75.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites78.6%
Taylor expanded in z around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites80.4%
Taylor expanded in y around 0
lift-*.f6472.8
Applied rewrites72.8%
if -1.2800000000000001e-180 < b < 1.14999999999999993e-33Initial program 72.7%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites83.1%
Taylor expanded in b around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6474.0
Applied rewrites74.0%
if 1.14999999999999993e-33 < b Initial program 73.3%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites68.5%
Taylor expanded in j around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites68.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* i t) (* c z))) (t_2 (- (* z y) (* a t))))
(if (<= b -1.72e+106)
(fma (* j c) a (* t_1 b))
(if (<= b -6.4e-71)
(fma t_2 x (* (- (* b t) (* j y)) i))
(if (<= b 1.15e-33)
(fma (- i) (* j y) (fma t_2 x (* (* j c) a)))
(fma t_1 b (* t_2 x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) - (c * z);
double t_2 = (z * y) - (a * t);
double tmp;
if (b <= -1.72e+106) {
tmp = fma((j * c), a, (t_1 * b));
} else if (b <= -6.4e-71) {
tmp = fma(t_2, x, (((b * t) - (j * y)) * i));
} else if (b <= 1.15e-33) {
tmp = fma(-i, (j * y), fma(t_2, x, ((j * c) * a)));
} else {
tmp = fma(t_1, b, (t_2 * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) - Float64(c * z)) t_2 = Float64(Float64(z * y) - Float64(a * t)) tmp = 0.0 if (b <= -1.72e+106) tmp = fma(Float64(j * c), a, Float64(t_1 * b)); elseif (b <= -6.4e-71) tmp = fma(t_2, x, Float64(Float64(Float64(b * t) - Float64(j * y)) * i)); elseif (b <= 1.15e-33) tmp = fma(Float64(-i), Float64(j * y), fma(t_2, x, Float64(Float64(j * c) * a))); else tmp = fma(t_1, b, Float64(t_2 * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.72e+106], N[(N[(j * c), $MachinePrecision] * a + N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.4e-71], N[(t$95$2 * x + N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-33], N[((-i) * N[(j * y), $MachinePrecision] + N[(t$95$2 * x + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[(t$95$2 * x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot t - c \cdot z\\
t_2 := z \cdot y - a \cdot t\\
\mathbf{if}\;b \leq -1.72 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, t\_1 \cdot b\right)\\
\mathbf{elif}\;b \leq -6.4 \cdot 10^{-71}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x, \left(b \cdot t - j \cdot y\right) \cdot i\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, \mathsf{fma}\left(t\_2, x, \left(j \cdot c\right) \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, t\_2 \cdot x\right)\\
\end{array}
\end{array}
if b < -1.7200000000000001e106Initial program 72.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites63.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6469.9
Applied rewrites69.9%
if -1.7200000000000001e106 < b < -6.3999999999999998e-71Initial program 76.2%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites78.7%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites64.4%
if -6.3999999999999998e-71 < b < 1.14999999999999993e-33Initial program 72.7%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites83.2%
Taylor expanded in b around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6473.0
Applied rewrites73.0%
if 1.14999999999999993e-33 < b Initial program 73.3%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites68.5%
Taylor expanded in j around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites68.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j a) (* b z)) c)) (t_2 (- (* z y) (* a t))))
(if (<= c -6.2e+230)
t_1
(if (<= c -3.3e-241)
(fma (- (* i t) (* c z)) b (* t_2 x))
(if (<= c 4e+70) (fma t_2 x (* (- (* b t) (* j y)) i)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * a) - (b * z)) * c;
double t_2 = (z * y) - (a * t);
double tmp;
if (c <= -6.2e+230) {
tmp = t_1;
} else if (c <= -3.3e-241) {
tmp = fma(((i * t) - (c * z)), b, (t_2 * x));
} else if (c <= 4e+70) {
tmp = fma(t_2, x, (((b * t) - (j * y)) * i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * a) - Float64(b * z)) * c) t_2 = Float64(Float64(z * y) - Float64(a * t)) tmp = 0.0 if (c <= -6.2e+230) tmp = t_1; elseif (c <= -3.3e-241) tmp = fma(Float64(Float64(i * t) - Float64(c * z)), b, Float64(t_2 * x)); elseif (c <= 4e+70) tmp = fma(t_2, x, Float64(Float64(Float64(b * t) - Float64(j * y)) * i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.2e+230], t$95$1, If[LessEqual[c, -3.3e-241], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(t$95$2 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4e+70], N[(t$95$2 * x + N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot a - b \cdot z\right) \cdot c\\
t_2 := z \cdot y - a \cdot t\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.3 \cdot 10^{-241}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot t - c \cdot z, b, t\_2 \cdot x\right)\\
\mathbf{elif}\;c \leq 4 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, x, \left(b \cdot t - j \cdot y\right) \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -6.19999999999999963e230 or 4.00000000000000029e70 < c Initial program 61.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.9
Applied rewrites68.9%
if -6.19999999999999963e230 < c < -3.2999999999999999e-241Initial program 74.9%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites76.4%
Taylor expanded in j around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites61.5%
if -3.2999999999999999e-241 < c < 4.00000000000000029e70Initial program 79.7%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites82.4%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites72.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j a) (* b z)) c)) (t_2 (* (- (* z y) (* a t)) x)))
(if (<= c -6.2e+230)
t_1
(if (<= c -3.3e-241)
(fma (- (* i t) (* c z)) b t_2)
(if (<= c 4e+70) (fma (- (* b t) (* j y)) i 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 = ((j * a) - (b * z)) * c;
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (c <= -6.2e+230) {
tmp = t_1;
} else if (c <= -3.3e-241) {
tmp = fma(((i * t) - (c * z)), b, t_2);
} else if (c <= 4e+70) {
tmp = fma(((b * t) - (j * y)), i, t_2);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * a) - Float64(b * z)) * c) t_2 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (c <= -6.2e+230) tmp = t_1; elseif (c <= -3.3e-241) tmp = fma(Float64(Float64(i * t) - Float64(c * z)), b, t_2); elseif (c <= 4e+70) tmp = fma(Float64(Float64(b * t) - Float64(j * y)), i, t_2); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[c, -6.2e+230], t$95$1, If[LessEqual[c, -3.3e-241], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + t$95$2), $MachinePrecision], If[LessEqual[c, 4e+70], N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i + t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot a - b \cdot z\right) \cdot c\\
t_2 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.3 \cdot 10^{-241}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot t - c \cdot z, b, t\_2\right)\\
\mathbf{elif}\;c \leq 4 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot t - j \cdot y, i, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -6.19999999999999963e230 or 4.00000000000000029e70 < c Initial program 61.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.9
Applied rewrites68.9%
if -6.19999999999999963e230 < c < -3.2999999999999999e-241Initial program 74.9%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites76.4%
Taylor expanded in j around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites61.5%
if -3.2999999999999999e-241 < c < 4.00000000000000029e70Initial program 79.7%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites82.4%
Taylor expanded in z around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites83.8%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6472.5
Applied rewrites72.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j a) (* b z)) c)))
(if (<= c -4e+205)
t_1
(if (<= c 4e+70)
(fma (- (* b t) (* j y)) i (* (- (* z y) (* a t)) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * a) - (b * z)) * c;
double tmp;
if (c <= -4e+205) {
tmp = t_1;
} else if (c <= 4e+70) {
tmp = fma(((b * t) - (j * y)), i, (((z * y) - (a * t)) * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * a) - Float64(b * z)) * c) tmp = 0.0 if (c <= -4e+205) tmp = t_1; elseif (c <= 4e+70) tmp = fma(Float64(Float64(b * t) - Float64(j * y)), i, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -4e+205], t$95$1, If[LessEqual[c, 4e+70], N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -4 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 4 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot t - j \cdot y, i, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -4.00000000000000007e205 or 4.00000000000000029e70 < c Initial program 60.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.5
Applied rewrites68.5%
if -4.00000000000000007e205 < c < 4.00000000000000029e70Initial program 77.8%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites79.9%
Taylor expanded in z around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites80.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6467.9
Applied rewrites67.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -2.3e+18)
t_1
(if (<= y 7.2e-134)
(fma (* j c) a (- (* (* i t) b) (* (* c b) z)))
(if (<= y 1.6e-60)
(* (fma (- t) x (* j c)) a)
(if (<= y 8e+109) (fma (* j c) a (* (- (* i t) (* c z)) b)) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -2.3e+18) {
tmp = t_1;
} else if (y <= 7.2e-134) {
tmp = fma((j * c), a, (((i * t) * b) - ((c * b) * z)));
} else if (y <= 1.6e-60) {
tmp = fma(-t, x, (j * c)) * a;
} else if (y <= 8e+109) {
tmp = fma((j * c), a, (((i * t) - (c * z)) * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -2.3e+18) tmp = t_1; elseif (y <= 7.2e-134) tmp = fma(Float64(j * c), a, Float64(Float64(Float64(i * t) * b) - Float64(Float64(c * b) * z))); elseif (y <= 1.6e-60) tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); elseif (y <= 8e+109) tmp = fma(Float64(j * c), a, Float64(Float64(Float64(i * t) - Float64(c * z)) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.3e+18], t$95$1, If[LessEqual[y, 7.2e-134], N[(N[(j * c), $MachinePrecision] * a + N[(N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-60], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 8e+109], N[(N[(j * c), $MachinePrecision] * a + N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-134}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(i \cdot t\right) \cdot b - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-60}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(i \cdot t - c \cdot z\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3e18 or 7.99999999999999985e109 < y Initial program 64.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.8
Applied rewrites64.8%
if -2.3e18 < y < 7.1999999999999998e-134Initial program 80.5%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites82.4%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f64N/A
lift-*.f6458.1
Applied rewrites58.1%
if 7.1999999999999998e-134 < y < 1.6000000000000001e-60Initial program 78.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6448.0
Applied rewrites48.0%
if 1.6000000000000001e-60 < y < 7.99999999999999985e109Initial program 74.8%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites76.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6449.5
Applied rewrites49.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* (* i t) b) (* j (- (* c a) (* y i)))))
(t_2 (* (- (* z y) (* a t)) x)))
(if (<= x -0.235)
t_2
(if (<= x -3.2e-37)
t_1
(if (<= x -6e-124)
(* (- (* y x) (* c b)) z)
(if (<= x 1.9e+145) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) * b) + (j * ((c * a) - (y * i)));
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -0.235) {
tmp = t_2;
} else if (x <= -3.2e-37) {
tmp = t_1;
} else if (x <= -6e-124) {
tmp = ((y * x) - (c * b)) * z;
} else if (x <= 1.9e+145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((i * t) * b) + (j * ((c * a) - (y * i)))
t_2 = ((z * y) - (a * t)) * x
if (x <= (-0.235d0)) then
tmp = t_2
else if (x <= (-3.2d-37)) then
tmp = t_1
else if (x <= (-6d-124)) then
tmp = ((y * x) - (c * b)) * z
else if (x <= 1.9d+145) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) * b) + (j * ((c * a) - (y * i)));
double t_2 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -0.235) {
tmp = t_2;
} else if (x <= -3.2e-37) {
tmp = t_1;
} else if (x <= -6e-124) {
tmp = ((y * x) - (c * b)) * z;
} else if (x <= 1.9e+145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) * b) + (j * ((c * a) - (y * i))) t_2 = ((z * y) - (a * t)) * x tmp = 0 if x <= -0.235: tmp = t_2 elif x <= -3.2e-37: tmp = t_1 elif x <= -6e-124: tmp = ((y * x) - (c * b)) * z elif x <= 1.9e+145: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) * b) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) t_2 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -0.235) tmp = t_2; elseif (x <= -3.2e-37) tmp = t_1; elseif (x <= -6e-124) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (x <= 1.9e+145) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * t) * b) + (j * ((c * a) - (y * i))); t_2 = ((z * y) - (a * t)) * x; tmp = 0.0; if (x <= -0.235) tmp = t_2; elseif (x <= -3.2e-37) tmp = t_1; elseif (x <= -6e-124) tmp = ((y * x) - (c * b)) * z; elseif (x <= 1.9e+145) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -0.235], t$95$2, If[LessEqual[x, -3.2e-37], t$95$1, If[LessEqual[x, -6e-124], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 1.9e+145], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -0.235:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-124}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -0.23499999999999999 or 1.90000000000000006e145 < x Initial program 73.5%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.2
Applied rewrites62.2%
if -0.23499999999999999 < x < -3.1999999999999999e-37 or -6e-124 < x < 1.90000000000000006e145Initial program 72.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6456.0
Applied rewrites56.0%
if -3.1999999999999999e-37 < x < -6e-124Initial program 75.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6434.3
Applied rewrites34.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z y) (* a t)) x)))
(if (<= x -8.5e+66)
t_1
(if (<= x -8e-125)
(fma (* j c) a (- (* (- i) (* j y)) (* (* c b) z)))
(if (<= x 1.9e+145) (+ (* (* i t) b) (* j (- (* c a) (* y 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 * y) - (a * t)) * x;
double tmp;
if (x <= -8.5e+66) {
tmp = t_1;
} else if (x <= -8e-125) {
tmp = fma((j * c), a, ((-i * (j * y)) - ((c * b) * z)));
} else if (x <= 1.9e+145) {
tmp = ((i * t) * b) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -8.5e+66) tmp = t_1; elseif (x <= -8e-125) tmp = fma(Float64(j * c), a, Float64(Float64(Float64(-i) * Float64(j * y)) - Float64(Float64(c * b) * z))); elseif (x <= 1.9e+145) tmp = Float64(Float64(Float64(i * t) * b) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -8.5e+66], t$95$1, If[LessEqual[x, -8e-125], N[(N[(j * c), $MachinePrecision] * a + N[(N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e+145], N[(N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(-i\right) \cdot \left(j \cdot y\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+145}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.5000000000000004e66 or 1.90000000000000006e145 < x Initial program 72.5%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.8
Applied rewrites65.8%
if -8.5000000000000004e66 < x < -8.0000000000000001e-125Initial program 77.4%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites78.4%
Taylor expanded in j around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f6449.3
Applied rewrites49.3%
if -8.0000000000000001e-125 < x < 1.90000000000000006e145Initial program 72.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6456.6
Applied rewrites56.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -6.4e+16)
t_1
(if (<= y 8e+109) (fma (* j c) a (* (- (* i t) (* c z)) b)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -6.4e+16) {
tmp = t_1;
} else if (y <= 8e+109) {
tmp = fma((j * c), a, (((i * t) - (c * z)) * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -6.4e+16) tmp = t_1; elseif (y <= 8e+109) tmp = fma(Float64(j * c), a, Float64(Float64(Float64(i * t) - Float64(c * z)) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -6.4e+16], t$95$1, If[LessEqual[y, 8e+109], N[(N[(j * c), $MachinePrecision] * a + N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(i \cdot t - c \cdot z\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.4e16 or 7.99999999999999985e109 < y Initial program 64.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.6
Applied rewrites64.6%
if -6.4e16 < y < 7.99999999999999985e109Initial program 79.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites80.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6457.7
Applied rewrites57.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -3.6e+47)
t_1
(if (<= y 2.25e-144)
(* (- (* j a) (* b z)) c)
(if (<= y 1.25e+34) (* (fma (- t) x (* j c)) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -3.6e+47) {
tmp = t_1;
} else if (y <= 2.25e-144) {
tmp = ((j * a) - (b * z)) * c;
} else if (y <= 1.25e+34) {
tmp = fma(-t, x, (j * c)) * a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -3.6e+47) tmp = t_1; elseif (y <= 2.25e-144) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); elseif (y <= 1.25e+34) tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.6e+47], t$95$1, If[LessEqual[y, 2.25e-144], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 1.25e+34], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-144}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.60000000000000008e47 or 1.25e34 < y Initial program 64.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6463.0
Applied rewrites63.0%
if -3.60000000000000008e47 < y < 2.2499999999999999e-144Initial program 80.3%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6445.8
Applied rewrites45.8%
if 2.2499999999999999e-144 < y < 1.25e34Initial program 78.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.1
Applied rewrites43.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (fma (- i) j (* z x)) y))) (if (<= y -3.6e+47) t_1 (if (<= y 2.5e+37) (* (- (* j a) (* b z)) c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -3.6e+47) {
tmp = t_1;
} else if (y <= 2.5e+37) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -3.6e+47) tmp = t_1; elseif (y <= 2.5e+37) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.6e+47], t$95$1, If[LessEqual[y, 2.5e+37], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+37}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.60000000000000008e47 or 2.49999999999999994e37 < y Initial program 64.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6463.2
Applied rewrites63.2%
if -3.60000000000000008e47 < y < 2.49999999999999994e37Initial program 79.8%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.6
Applied rewrites44.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* y x) (* c b)) z)))
(if (<= z -1.3e-85)
t_1
(if (<= z 2e-216)
(* (- (* c a) (* i y)) j)
(if (<= z 1.32e-82) (* (fma (- a) x (* i b)) 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 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -1.3e-85) {
tmp = t_1;
} else if (z <= 2e-216) {
tmp = ((c * a) - (i * y)) * j;
} else if (z <= 1.32e-82) {
tmp = fma(-a, x, (i * b)) * t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(y * x) - Float64(c * b)) * z) tmp = 0.0 if (z <= -1.3e-85) tmp = t_1; elseif (z <= 2e-216) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); elseif (z <= 1.32e-82) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.3e-85], t$95$1, If[LessEqual[z, 2e-216], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[z, 1.32e-82], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-216}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-82}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.30000000000000006e-85 or 1.32e-82 < z Initial program 68.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6452.1
Applied rewrites52.1%
if -1.30000000000000006e-85 < z < 2.0000000000000001e-216Initial program 81.9%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6447.0
Applied rewrites47.0%
if 2.0000000000000001e-216 < z < 1.32e-82Initial program 82.2%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites78.8%
Taylor expanded in t around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6446.8
Applied rewrites46.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j a) (* b z)) c)))
(if (<= c -4e+205)
t_1
(if (<= c -3e-168)
(* (- (* y x) (* c b)) z)
(if (<= c 1.95e+71) (* (- (* b t) (* j y)) i) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * a) - (b * z)) * c;
double tmp;
if (c <= -4e+205) {
tmp = t_1;
} else if (c <= -3e-168) {
tmp = ((y * x) - (c * b)) * z;
} else if (c <= 1.95e+71) {
tmp = ((b * t) - (j * y)) * 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 = ((j * a) - (b * z)) * c
if (c <= (-4d+205)) then
tmp = t_1
else if (c <= (-3d-168)) then
tmp = ((y * x) - (c * b)) * z
else if (c <= 1.95d+71) then
tmp = ((b * t) - (j * y)) * 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 = ((j * a) - (b * z)) * c;
double tmp;
if (c <= -4e+205) {
tmp = t_1;
} else if (c <= -3e-168) {
tmp = ((y * x) - (c * b)) * z;
} else if (c <= 1.95e+71) {
tmp = ((b * t) - (j * y)) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((j * a) - (b * z)) * c tmp = 0 if c <= -4e+205: tmp = t_1 elif c <= -3e-168: tmp = ((y * x) - (c * b)) * z elif c <= 1.95e+71: tmp = ((b * t) - (j * y)) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * a) - Float64(b * z)) * c) tmp = 0.0 if (c <= -4e+205) tmp = t_1; elseif (c <= -3e-168) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (c <= 1.95e+71) tmp = Float64(Float64(Float64(b * t) - Float64(j * y)) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((j * a) - (b * z)) * c; tmp = 0.0; if (c <= -4e+205) tmp = t_1; elseif (c <= -3e-168) tmp = ((y * x) - (c * b)) * z; elseif (c <= 1.95e+71) tmp = ((b * t) - (j * y)) * 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[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -4e+205], t$95$1, If[LessEqual[c, -3e-168], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[c, 1.95e+71], N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -4 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3 \cdot 10^{-168}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{+71}:\\
\;\;\;\;\left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -4.00000000000000007e205 or 1.9500000000000001e71 < c Initial program 60.8%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if -4.00000000000000007e205 < c < -2.99999999999999991e-168Initial program 75.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
if -2.99999999999999991e-168 < c < 1.9500000000000001e71Initial program 79.4%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites82.1%
Taylor expanded in i around inf
*-commutativeN/A
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6446.0
Applied rewrites46.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j a) (* b z)) c)))
(if (<= c -5.2e-82)
t_1
(if (<= c 1.95e+71) (* (- (* b t) (* j y)) i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * a) - (b * z)) * c;
double tmp;
if (c <= -5.2e-82) {
tmp = t_1;
} else if (c <= 1.95e+71) {
tmp = ((b * t) - (j * y)) * 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 = ((j * a) - (b * z)) * c
if (c <= (-5.2d-82)) then
tmp = t_1
else if (c <= 1.95d+71) then
tmp = ((b * t) - (j * y)) * 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 = ((j * a) - (b * z)) * c;
double tmp;
if (c <= -5.2e-82) {
tmp = t_1;
} else if (c <= 1.95e+71) {
tmp = ((b * t) - (j * y)) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((j * a) - (b * z)) * c tmp = 0 if c <= -5.2e-82: tmp = t_1 elif c <= 1.95e+71: tmp = ((b * t) - (j * y)) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * a) - Float64(b * z)) * c) tmp = 0.0 if (c <= -5.2e-82) tmp = t_1; elseif (c <= 1.95e+71) tmp = Float64(Float64(Float64(b * t) - Float64(j * y)) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((j * a) - (b * z)) * c; tmp = 0.0; if (c <= -5.2e-82) tmp = t_1; elseif (c <= 1.95e+71) tmp = ((b * t) - (j * y)) * 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[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -5.2e-82], t$95$1, If[LessEqual[c, 1.95e+71], N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -5.2 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{+71}:\\
\;\;\;\;\left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -5.2e-82 or 1.9500000000000001e71 < c Initial program 66.4%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6457.8
Applied rewrites57.8%
if -5.2e-82 < c < 1.9500000000000001e71Initial program 80.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites82.4%
Taylor expanded in i around inf
*-commutativeN/A
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6445.5
Applied rewrites45.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* i t) (* c z)) b))) (if (<= b -1.5e+36) t_1 (if (<= b 3.1e-27) (* (- (* c a) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -1.5e+36) {
tmp = t_1;
} else if (b <= 3.1e-27) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((i * t) - (c * z)) * b
if (b <= (-1.5d+36)) then
tmp = t_1
else if (b <= 3.1d-27) then
tmp = ((c * a) - (i * y)) * j
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -1.5e+36) {
tmp = t_1;
} else if (b <= 3.1e-27) {
tmp = ((c * a) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) - (c * z)) * b tmp = 0 if b <= -1.5e+36: tmp = t_1 elif b <= 3.1e-27: tmp = ((c * a) - (i * y)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) tmp = 0.0 if (b <= -1.5e+36) tmp = t_1; elseif (b <= 3.1e-27) tmp = Float64(Float64(Float64(c * a) - Float64(i * y)) * j); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * t) - (c * z)) * b; tmp = 0.0; if (b <= -1.5e+36) tmp = t_1; elseif (b <= 3.1e-27) tmp = ((c * a) - (i * y)) * j; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.5e+36], t$95$1, If[LessEqual[b, 3.1e-27], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -1.5 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{-27}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.5e36 or 3.0999999999999998e-27 < b Initial program 73.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6458.8
Applied rewrites58.8%
if -1.5e36 < b < 3.0999999999999998e-27Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6445.7
Applied rewrites45.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b t) (* j y)) i)) (t_2 (* (- (* c a) (* i y)) j)))
(if (<= j -1.4e+41)
t_2
(if (<= j -2.8e-231)
t_1
(if (<= j 1e-271) (* (* z y) x) (if (<= j 1.65e+212) 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 = ((b * t) - (j * y)) * i;
double t_2 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -1.4e+41) {
tmp = t_2;
} else if (j <= -2.8e-231) {
tmp = t_1;
} else if (j <= 1e-271) {
tmp = (z * y) * x;
} else if (j <= 1.65e+212) {
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 = ((b * t) - (j * y)) * i
t_2 = ((c * a) - (i * y)) * j
if (j <= (-1.4d+41)) then
tmp = t_2
else if (j <= (-2.8d-231)) then
tmp = t_1
else if (j <= 1d-271) then
tmp = (z * y) * x
else if (j <= 1.65d+212) 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 = ((b * t) - (j * y)) * i;
double t_2 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -1.4e+41) {
tmp = t_2;
} else if (j <= -2.8e-231) {
tmp = t_1;
} else if (j <= 1e-271) {
tmp = (z * y) * x;
} else if (j <= 1.65e+212) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((b * t) - (j * y)) * i t_2 = ((c * a) - (i * y)) * j tmp = 0 if j <= -1.4e+41: tmp = t_2 elif j <= -2.8e-231: tmp = t_1 elif j <= 1e-271: tmp = (z * y) * x elif j <= 1.65e+212: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * t) - Float64(j * y)) * i) t_2 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -1.4e+41) tmp = t_2; elseif (j <= -2.8e-231) tmp = t_1; elseif (j <= 1e-271) tmp = Float64(Float64(z * y) * x); elseif (j <= 1.65e+212) 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 = ((b * t) - (j * y)) * i; t_2 = ((c * a) - (i * y)) * j; tmp = 0.0; if (j <= -1.4e+41) tmp = t_2; elseif (j <= -2.8e-231) tmp = t_1; elseif (j <= 1e-271) tmp = (z * y) * x; elseif (j <= 1.65e+212) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -1.4e+41], t$95$2, If[LessEqual[j, -2.8e-231], t$95$1, If[LessEqual[j, 1e-271], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 1.65e+212], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot t - j \cdot y\right) \cdot i\\
t_2 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -1.4 \cdot 10^{+41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq -2.8 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 10^{-271}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 1.65 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if j < -1.4e41 or 1.65e212 < j Initial program 70.9%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.0
Applied rewrites65.0%
if -1.4e41 < j < -2.7999999999999999e-231 or 9.99999999999999963e-272 < j < 1.65e212Initial program 75.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites79.5%
Taylor expanded in i around inf
*-commutativeN/A
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6438.1
Applied rewrites38.1%
if -2.7999999999999999e-231 < j < 9.99999999999999963e-272Initial program 69.2%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.8
Applied rewrites49.8%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6429.5
Applied rewrites29.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)))
(if (<= x -4e+257)
t_1
(if (<= x -3.6e+61)
(* (* (- a) t) x)
(if (<= x 4.1e+144) (* (- (* b t) (* j y)) 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 * y) * x;
double tmp;
if (x <= -4e+257) {
tmp = t_1;
} else if (x <= -3.6e+61) {
tmp = (-a * t) * x;
} else if (x <= 4.1e+144) {
tmp = ((b * t) - (j * y)) * 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 * y) * x
if (x <= (-4d+257)) then
tmp = t_1
else if (x <= (-3.6d+61)) then
tmp = (-a * t) * x
else if (x <= 4.1d+144) then
tmp = ((b * t) - (j * y)) * 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 * y) * x;
double tmp;
if (x <= -4e+257) {
tmp = t_1;
} else if (x <= -3.6e+61) {
tmp = (-a * t) * x;
} else if (x <= 4.1e+144) {
tmp = ((b * t) - (j * y)) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if x <= -4e+257: tmp = t_1 elif x <= -3.6e+61: tmp = (-a * t) * x elif x <= 4.1e+144: tmp = ((b * t) - (j * y)) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (x <= -4e+257) tmp = t_1; elseif (x <= -3.6e+61) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (x <= 4.1e+144) tmp = Float64(Float64(Float64(b * t) - Float64(j * y)) * 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 * y) * x; tmp = 0.0; if (x <= -4e+257) tmp = t_1; elseif (x <= -3.6e+61) tmp = (-a * t) * x; elseif (x <= 4.1e+144) tmp = ((b * t) - (j * y)) * 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[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4e+257], t$95$1, If[LessEqual[x, -3.6e+61], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 4.1e+144], N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -4 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{+61}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+144}:\\
\;\;\;\;\left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.00000000000000012e257 or 4.10000000000000001e144 < x Initial program 70.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6471.2
Applied rewrites71.2%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6440.3
Applied rewrites40.3%
if -4.00000000000000012e257 < x < -3.6000000000000001e61Initial program 75.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.7
Applied rewrites59.7%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6434.5
Applied rewrites34.5%
if -3.6000000000000001e61 < x < 4.10000000000000001e144Initial program 73.6%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.7%
Taylor expanded in i around inf
*-commutativeN/A
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
cancel-sign-sub-invN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6444.3
Applied rewrites44.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)))
(if (<= x -4e+257)
t_1
(if (<= x -6.2e-15)
(* (* (- a) t) x)
(if (<= x -1.32e-241)
(* (* (- i) j) y)
(if (<= x 4.8e+89) (* (* i b) 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 * y) * x;
double tmp;
if (x <= -4e+257) {
tmp = t_1;
} else if (x <= -6.2e-15) {
tmp = (-a * t) * x;
} else if (x <= -1.32e-241) {
tmp = (-i * j) * y;
} else if (x <= 4.8e+89) {
tmp = (i * b) * 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 * y) * x
if (x <= (-4d+257)) then
tmp = t_1
else if (x <= (-6.2d-15)) then
tmp = (-a * t) * x
else if (x <= (-1.32d-241)) then
tmp = (-i * j) * y
else if (x <= 4.8d+89) then
tmp = (i * b) * 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 * y) * x;
double tmp;
if (x <= -4e+257) {
tmp = t_1;
} else if (x <= -6.2e-15) {
tmp = (-a * t) * x;
} else if (x <= -1.32e-241) {
tmp = (-i * j) * y;
} else if (x <= 4.8e+89) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if x <= -4e+257: tmp = t_1 elif x <= -6.2e-15: tmp = (-a * t) * x elif x <= -1.32e-241: tmp = (-i * j) * y elif x <= 4.8e+89: tmp = (i * b) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (x <= -4e+257) tmp = t_1; elseif (x <= -6.2e-15) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (x <= -1.32e-241) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (x <= 4.8e+89) tmp = Float64(Float64(i * b) * 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 * y) * x; tmp = 0.0; if (x <= -4e+257) tmp = t_1; elseif (x <= -6.2e-15) tmp = (-a * t) * x; elseif (x <= -1.32e-241) tmp = (-i * j) * y; elseif (x <= 4.8e+89) tmp = (i * b) * 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4e+257], t$95$1, If[LessEqual[x, -6.2e-15], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.32e-241], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 4.8e+89], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -4 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-15}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;x \leq -1.32 \cdot 10^{-241}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+89}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.00000000000000012e257 or 4.80000000000000009e89 < x Initial program 70.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6437.8
Applied rewrites37.8%
if -4.00000000000000012e257 < x < -6.1999999999999998e-15Initial program 76.6%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6430.8
Applied rewrites30.8%
if -6.1999999999999998e-15 < x < -1.31999999999999993e-241Initial program 72.8%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6447.8
Applied rewrites47.8%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f6442.6
Applied rewrites42.6%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6427.3
Applied rewrites27.3%
if -1.31999999999999993e-241 < x < 4.80000000000000009e89Initial program 73.4%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.4%
Taylor expanded in t around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6434.9
Applied rewrites34.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)))
(if (<= x -4.5e-16)
t_1
(if (<= x -1.32e-241)
(* (* (- i) j) y)
(if (<= x 4.8e+89) (* (* i b) 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 * y) * x;
double tmp;
if (x <= -4.5e-16) {
tmp = t_1;
} else if (x <= -1.32e-241) {
tmp = (-i * j) * y;
} else if (x <= 4.8e+89) {
tmp = (i * b) * 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 * y) * x
if (x <= (-4.5d-16)) then
tmp = t_1
else if (x <= (-1.32d-241)) then
tmp = (-i * j) * y
else if (x <= 4.8d+89) then
tmp = (i * b) * 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 * y) * x;
double tmp;
if (x <= -4.5e-16) {
tmp = t_1;
} else if (x <= -1.32e-241) {
tmp = (-i * j) * y;
} else if (x <= 4.8e+89) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if x <= -4.5e-16: tmp = t_1 elif x <= -1.32e-241: tmp = (-i * j) * y elif x <= 4.8e+89: tmp = (i * b) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (x <= -4.5e-16) tmp = t_1; elseif (x <= -1.32e-241) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (x <= 4.8e+89) tmp = Float64(Float64(i * b) * 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 * y) * x; tmp = 0.0; if (x <= -4.5e-16) tmp = t_1; elseif (x <= -1.32e-241) tmp = (-i * j) * y; elseif (x <= 4.8e+89) tmp = (i * b) * 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -4.5e-16], t$95$1, If[LessEqual[x, -1.32e-241], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 4.8e+89], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.32 \cdot 10^{-241}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+89}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.5000000000000002e-16 or 4.80000000000000009e89 < x Initial program 73.3%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.7
Applied rewrites60.7%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6433.9
Applied rewrites33.9%
if -4.5000000000000002e-16 < x < -1.31999999999999993e-241Initial program 72.8%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6447.7
Applied rewrites47.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f6442.5
Applied rewrites42.5%
Taylor expanded in y around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
lift-neg.f64N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6427.2
Applied rewrites27.2%
if -1.31999999999999993e-241 < x < 4.80000000000000009e89Initial program 73.4%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.4%
Taylor expanded in t around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6434.9
Applied rewrites34.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* z y) x)))
(if (<= x -1.2e-5)
t_1
(if (<= x -1.05e-199)
(* (* c a) j)
(if (<= x 4.8e+89) (* (* i b) 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 * y) * x;
double tmp;
if (x <= -1.2e-5) {
tmp = t_1;
} else if (x <= -1.05e-199) {
tmp = (c * a) * j;
} else if (x <= 4.8e+89) {
tmp = (i * b) * 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 * y) * x
if (x <= (-1.2d-5)) then
tmp = t_1
else if (x <= (-1.05d-199)) then
tmp = (c * a) * j
else if (x <= 4.8d+89) then
tmp = (i * b) * 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 * y) * x;
double tmp;
if (x <= -1.2e-5) {
tmp = t_1;
} else if (x <= -1.05e-199) {
tmp = (c * a) * j;
} else if (x <= 4.8e+89) {
tmp = (i * b) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * y) * x tmp = 0 if x <= -1.2e-5: tmp = t_1 elif x <= -1.05e-199: tmp = (c * a) * j elif x <= 4.8e+89: tmp = (i * b) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * y) * x) tmp = 0.0 if (x <= -1.2e-5) tmp = t_1; elseif (x <= -1.05e-199) tmp = Float64(Float64(c * a) * j); elseif (x <= 4.8e+89) tmp = Float64(Float64(i * b) * 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 * y) * x; tmp = 0.0; if (x <= -1.2e-5) tmp = t_1; elseif (x <= -1.05e-199) tmp = (c * a) * j; elseif (x <= 4.8e+89) tmp = (i * b) * 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.2e-5], t$95$1, If[LessEqual[x, -1.05e-199], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 4.8e+89], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-199}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+89}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.2e-5 or 4.80000000000000009e89 < x Initial program 73.2%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6434.0
Applied rewrites34.0%
if -1.2e-5 < x < -1.05000000000000001e-199Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6447.2
Applied rewrites47.2%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6427.2
Applied rewrites27.2%
if -1.05000000000000001e-199 < x < 4.80000000000000009e89Initial program 73.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.0%
Taylor expanded in t around inf
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6435.2
Applied rewrites35.2%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6427.2
Applied rewrites27.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* c a) j))) (if (<= c -1.45e-64) t_1 (if (<= c 1.16e+86) (* (* i t) 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 = (c * a) * j;
double tmp;
if (c <= -1.45e-64) {
tmp = t_1;
} else if (c <= 1.16e+86) {
tmp = (i * t) * 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 = (c * a) * j
if (c <= (-1.45d-64)) then
tmp = t_1
else if (c <= 1.16d+86) then
tmp = (i * t) * 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 = (c * a) * j;
double tmp;
if (c <= -1.45e-64) {
tmp = t_1;
} else if (c <= 1.16e+86) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * a) * j tmp = 0 if c <= -1.45e-64: tmp = t_1 elif c <= 1.16e+86: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * a) * j) tmp = 0.0 if (c <= -1.45e-64) tmp = t_1; elseif (c <= 1.16e+86) tmp = Float64(Float64(i * t) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * a) * j; tmp = 0.0; if (c <= -1.45e-64) tmp = t_1; elseif (c <= 1.16e+86) tmp = (i * t) * 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[(c * a), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[c, -1.45e-64], t$95$1, If[LessEqual[c, 1.16e+86], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a\right) \cdot j\\
\mathbf{if}\;c \leq -1.45 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.16 \cdot 10^{+86}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.4499999999999999e-64 or 1.15999999999999999e86 < c Initial program 65.7%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6444.8
Applied rewrites44.8%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6433.9
Applied rewrites33.9%
if -1.4499999999999999e-64 < c < 1.15999999999999999e86Initial program 80.0%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.8
Applied rewrites45.8%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f64N/A
lift-*.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j c) a))) (if (<= c -1.45e-64) t_1 (if (<= c 1.16e+86) (* (* i t) 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 = (j * c) * a;
double tmp;
if (c <= -1.45e-64) {
tmp = t_1;
} else if (c <= 1.16e+86) {
tmp = (i * t) * 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 = (j * c) * a
if (c <= (-1.45d-64)) then
tmp = t_1
else if (c <= 1.16d+86) then
tmp = (i * t) * 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 = (j * c) * a;
double tmp;
if (c <= -1.45e-64) {
tmp = t_1;
} else if (c <= 1.16e+86) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * a tmp = 0 if c <= -1.45e-64: tmp = t_1 elif c <= 1.16e+86: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * a) tmp = 0.0 if (c <= -1.45e-64) tmp = t_1; elseif (c <= 1.16e+86) tmp = Float64(Float64(i * t) * b); 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) * a; tmp = 0.0; if (c <= -1.45e-64) tmp = t_1; elseif (c <= 1.16e+86) tmp = (i * t) * 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[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[c, -1.45e-64], t$95$1, If[LessEqual[c, 1.16e+86], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;c \leq -1.45 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.16 \cdot 10^{+86}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.4499999999999999e-64 or 1.15999999999999999e86 < c Initial program 65.7%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6444.8
Applied rewrites44.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6433.7
Applied rewrites33.7%
if -1.4499999999999999e-64 < c < 1.15999999999999999e86Initial program 80.0%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6445.8
Applied rewrites45.8%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f64N/A
lift-*.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i t) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * t) * b;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (i * t) * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * t) * b;
}
def code(x, y, z, t, a, b, c, i, j): return (i * t) * b
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * t) * b) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * t) * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot t\right) \cdot b
\end{array}
Initial program 73.3%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6440.3
Applied rewrites40.3%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f64N/A
lift-*.f6423.6
Applied rewrites23.6%
(FPCore (x y z t a b c i j) :precision binary64 (* i (* b t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return i * (b * 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 = i * (b * 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 i * (b * t);
}
def code(x, y, z, t, a, b, c, i, j): return i * (b * t)
function code(x, y, z, t, a, b, c, i, j) return Float64(i * Float64(b * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = i * (b * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(i * N[(b * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot \left(b \cdot t\right)
\end{array}
Initial program 73.3%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6440.3
Applied rewrites40.3%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f64N/A
lift-*.f6423.6
Applied rewrites23.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6423.5
Applied rewrites23.5%
herbie shell --seed 2025115
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))