
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* 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 (* j (- (* c a) (* y i)))))
(if (<=
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) t_1)
INFINITY)
(+ (- (fma (- (* z y) (* a t)) x (* (* i t) b)) (* (* c b) z)) t_1)
(* (* z (- (/ (* i t) z) c)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + t_1) <= ((double) INFINITY)) {
tmp = (fma(((z * y) - (a * t)), x, ((i * t) * b)) - ((c * b) * z)) + t_1;
} else {
tmp = (z * (((i * t) / z) - c)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + t_1) <= Inf) tmp = Float64(Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(i * t) * b)) - Float64(Float64(c * b) * z)) + t_1); else tmp = Float64(Float64(z * Float64(Float64(Float64(i * t) / z) - c)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(z * N[(N[(N[(i * t), $MachinePrecision] / z), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + t\_1 \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(i \cdot t\right) \cdot b\right) - \left(c \cdot b\right) \cdot z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(\frac{i \cdot t}{z} - c\right)\right) \cdot b\\
\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 73.9%
Taylor expanded in i around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.7
Applied rewrites72.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 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
(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 (* (* z (- (/ (* i t) z) c)) b))))
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 = (z * (((i * t) / z) - c)) * b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (z * (((i * t) / z) - c)) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (z * (((i * t) / z) - c)) * b 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(Float64(z * Float64(Float64(Float64(i * t) / z) - c)) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (z * (((i * t) / z) - c)) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(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[(z * N[(N[(N[(i * t), $MachinePrecision] / z), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] * b), $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}:\\
\;\;\;\;\left(z \cdot \left(\frac{i \cdot t}{z} - c\right)\right) \cdot b\\
\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 73.9%
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 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (* (- z) (fma i (/ t z) (- c)))))
(* j (* a c)))))
(if (<= b -6e-77)
t_1
(if (<= b 2.4e+131)
(fma
(* j c)
a
(- (fma t (* -1.0 (* a x)) (* y (- (* x z) (* i j)))) (* (* c b) z)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * (-z * fma(i, (t / z), -c)))) + (j * (a * c));
double tmp;
if (b <= -6e-77) {
tmp = t_1;
} else if (b <= 2.4e+131) {
tmp = fma((j * c), a, (fma(t, (-1.0 * (a * x)), (y * ((x * z) - (i * j)))) - ((c * b) * z)));
} else {
tmp = t_1;
}
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(-z) * fma(i, Float64(t / z), Float64(-c))))) + Float64(j * Float64(a * c))) tmp = 0.0 if (b <= -6e-77) tmp = t_1; elseif (b <= 2.4e+131) tmp = fma(Float64(j * c), a, Float64(fma(t, Float64(-1.0 * Float64(a * x)), Float64(y * Float64(Float64(x * z) - Float64(i * j)))) - Float64(Float64(c * b) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[((-z) * N[(i * N[(t / z), $MachinePrecision] + (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6e-77], t$95$1, If[LessEqual[b, 2.4e+131], N[(N[(j * c), $MachinePrecision] * a + N[(N[(t * N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\left(-z\right) \cdot \mathsf{fma}\left(i, \frac{t}{z}, -c\right)\right)\right) + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;b \leq -6 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(t, -1 \cdot \left(a \cdot x\right), y \cdot \left(x \cdot z - i \cdot j\right)\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.00000000000000033e-77 or 2.3999999999999999e131 < b Initial program 73.9%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6468.0
Applied rewrites68.0%
Taylor expanded in y around 0
lower-*.f6461.9
Applied rewrites61.9%
if -6.00000000000000033e-77 < b < 2.3999999999999999e131Initial program 73.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 rewrites74.5%
Taylor expanded in t around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lift-*.f64N/A
add-flipN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites73.0%
Taylor expanded in y around 0
lower-fma.f64N/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6468.0
Applied rewrites68.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -2e+178)
(* (* z (- (/ (* i t) z) c)) b)
(if (<= b 8.5e+161)
(fma
(* j c)
a
(- (fma t (* -1.0 (* a x)) (* y (- (* x z) (* i j)))) (* (* c b) z)))
(* (- (* i t) (* c z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -2e+178) {
tmp = (z * (((i * t) / z) - c)) * b;
} else if (b <= 8.5e+161) {
tmp = fma((j * c), a, (fma(t, (-1.0 * (a * x)), (y * ((x * z) - (i * j)))) - ((c * b) * z)));
} else {
tmp = ((i * t) - (c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -2e+178) tmp = Float64(Float64(z * Float64(Float64(Float64(i * t) / z) - c)) * b); elseif (b <= 8.5e+161) tmp = fma(Float64(j * c), a, Float64(fma(t, Float64(-1.0 * Float64(a * x)), Float64(y * Float64(Float64(x * z) - Float64(i * j)))) - Float64(Float64(c * b) * z))); else tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2e+178], N[(N[(z * N[(N[(N[(i * t), $MachinePrecision] / z), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 8.5e+161], N[(N[(j * c), $MachinePrecision] * a + N[(N[(t * N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+178}:\\
\;\;\;\;\left(z \cdot \left(\frac{i \cdot t}{z} - c\right)\right) \cdot b\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \mathsf{fma}\left(t, -1 \cdot \left(a \cdot x\right), y \cdot \left(x \cdot z - i \cdot j\right)\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\end{array}
\end{array}
if b < -2.0000000000000001e178Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
if -2.0000000000000001e178 < b < 8.50000000000000007e161Initial program 73.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 rewrites74.5%
Taylor expanded in t around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lift-*.f64N/A
add-flipN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites73.0%
Taylor expanded in y around 0
lower-fma.f64N/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6468.0
Applied rewrites68.0%
if 8.50000000000000007e161 < b Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* i (- (* b t) (* j y)))))
(if (<= i -5.4e+88)
t_1
(if (<= i 3.8e+30)
(- (fma (- (* z y) (* a t)) x (* (* j c) a)) (* (* c b) z))
(if (<= i 4.2e+142)
(fma (* j c) a (+ (- (* i (* j y))) (* x (- (* y z) (* a t)))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * ((b * t) - (j * y));
double tmp;
if (i <= -5.4e+88) {
tmp = t_1;
} else if (i <= 3.8e+30) {
tmp = fma(((z * y) - (a * t)), x, ((j * c) * a)) - ((c * b) * z);
} else if (i <= 4.2e+142) {
tmp = fma((j * c), a, (-(i * (j * y)) + (x * ((y * z) - (a * t)))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(i * Float64(Float64(b * t) - Float64(j * y))) tmp = 0.0 if (i <= -5.4e+88) tmp = t_1; elseif (i <= 3.8e+30) tmp = Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(j * c) * a)) - Float64(Float64(c * b) * z)); elseif (i <= 4.2e+142) tmp = fma(Float64(j * c), a, Float64(Float64(-Float64(i * Float64(j * y))) + Float64(x * Float64(Float64(y * z) - Float64(a * t))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -5.4e+88], t$95$1, If[LessEqual[i, 3.8e+30], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4.2e+142], N[(N[(j * c), $MachinePrecision] * a + N[((-N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]) + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{if}\;i \leq -5.4 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 3.8 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot c\right) \cdot a\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{elif}\;i \leq 4.2 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, \left(-i \cdot \left(j \cdot y\right)\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -5.40000000000000031e88 or 4.2e142 < i Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if -5.40000000000000031e88 < i < 3.8000000000000001e30Initial program 73.9%
Taylor expanded in i around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.4
Applied rewrites58.4%
if 3.8000000000000001e30 < i < 4.2e142Initial program 73.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 rewrites74.5%
Taylor expanded in b around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* i (- (* b t) (* j y)))))
(if (<= i -5.4e+88)
t_1
(if (<= i 1.8e+144)
(- (fma (- (* z y) (* a t)) x (* (* j c) a)) (* (* c b) z))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * ((b * t) - (j * y));
double tmp;
if (i <= -5.4e+88) {
tmp = t_1;
} else if (i <= 1.8e+144) {
tmp = fma(((z * y) - (a * t)), x, ((j * c) * a)) - ((c * b) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(i * Float64(Float64(b * t) - Float64(j * y))) tmp = 0.0 if (i <= -5.4e+88) tmp = t_1; elseif (i <= 1.8e+144) tmp = Float64(fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(j * c) * a)) - Float64(Float64(c * b) * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -5.4e+88], t$95$1, If[LessEqual[i, 1.8e+144], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{if}\;i \leq -5.4 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.8 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot c\right) \cdot a\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -5.40000000000000031e88 or 1.7999999999999999e144 < i Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if -5.40000000000000031e88 < i < 1.7999999999999999e144Initial program 73.9%
Taylor expanded in i around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.4
Applied rewrites58.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -3.7e+105)
(* (* z (- (/ (* i t) z) c)) b)
(if (<= b 3.2e-6)
(fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))
(* (- (* i t) (* c z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -3.7e+105) {
tmp = (z * (((i * t) / z) - c)) * b;
} else if (b <= 3.2e-6) {
tmp = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
} else {
tmp = ((i * t) - (c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -3.7e+105) tmp = Float64(Float64(z * Float64(Float64(Float64(i * t) / z) - c)) * b); elseif (b <= 3.2e-6) tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)); else tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -3.7e+105], N[(N[(z * N[(N[(N[(i * t), $MachinePrecision] / z), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 3.2e-6], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.7 \cdot 10^{+105}:\\
\;\;\;\;\left(z \cdot \left(\frac{i \cdot t}{z} - c\right)\right) \cdot b\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\end{array}
\end{array}
if b < -3.69999999999999985e105Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
if -3.69999999999999985e105 < b < 3.1999999999999999e-6Initial program 73.9%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.9
Applied rewrites60.9%
if 3.1999999999999999e-6 < b Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- t) (- (* a x) (* i b)))) (t_2 (* j (- (* c a) (* y i)))))
(if (<= t -2.2e-10)
t_1
(if (<= t 1.4e-297)
(+ (* (* z y) x) t_2)
(if (<= t 1.32e+36) (+ (- (* (* c b) z)) 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 = -t * ((a * x) - (i * b));
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (t <= -2.2e-10) {
tmp = t_1;
} else if (t <= 1.4e-297) {
tmp = ((z * y) * x) + t_2;
} else if (t <= 1.32e+36) {
tmp = -((c * b) * z) + t_2;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -t * ((a * x) - (i * b))
t_2 = j * ((c * a) - (y * i))
if (t <= (-2.2d-10)) then
tmp = t_1
else if (t <= 1.4d-297) then
tmp = ((z * y) * x) + t_2
else if (t <= 1.32d+36) then
tmp = -((c * b) * z) + t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (t <= -2.2e-10) {
tmp = t_1;
} else if (t <= 1.4e-297) {
tmp = ((z * y) * x) + t_2;
} else if (t <= 1.32e+36) {
tmp = -((c * b) * z) + t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -t * ((a * x) - (i * b)) t_2 = j * ((c * a) - (y * i)) tmp = 0 if t <= -2.2e-10: tmp = t_1 elif t <= 1.4e-297: tmp = ((z * y) * x) + t_2 elif t <= 1.32e+36: tmp = -((c * b) * z) + t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-t) * Float64(Float64(a * x) - Float64(i * b))) t_2 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (t <= -2.2e-10) tmp = t_1; elseif (t <= 1.4e-297) tmp = Float64(Float64(Float64(z * y) * x) + t_2); elseif (t <= 1.32e+36) tmp = Float64(Float64(-Float64(Float64(c * b) * z)) + t_2); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -t * ((a * x) - (i * b)); t_2 = j * ((c * a) - (y * i)); tmp = 0.0; if (t <= -2.2e-10) tmp = t_1; elseif (t <= 1.4e-297) tmp = ((z * y) * x) + t_2; elseif (t <= 1.32e+36) tmp = -((c * b) * z) + t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-t) * N[(N[(a * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e-10], t$95$1, If[LessEqual[t, 1.4e-297], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t, 1.32e+36], N[((-N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]) + t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \left(a \cdot x - i \cdot b\right)\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-297}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + t\_2\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+36}:\\
\;\;\;\;\left(-\left(c \cdot b\right) \cdot z\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1999999999999999e-10 or 1.3200000000000001e36 < t Initial program 73.9%
Taylor expanded in t around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.6
Applied rewrites38.6%
if -2.1999999999999999e-10 < t < 1.39999999999999992e-297Initial program 73.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.2
Applied rewrites50.2%
if 1.39999999999999992e-297 < t < 1.3200000000000001e36Initial program 73.9%
Taylor expanded in c around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.8
Applied rewrites51.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- t) (- (* a x) (* i b)))))
(if (<= t -2.2e-10)
t_1
(if (<= t 2.7e-171)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= t 2.75e+34) (* (- (* y x) (* c b)) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double tmp;
if (t <= -2.2e-10) {
tmp = t_1;
} else if (t <= 2.7e-171) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (t <= 2.75e+34) {
tmp = ((y * x) - (c * b)) * z;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = -t * ((a * x) - (i * b))
if (t <= (-2.2d-10)) then
tmp = t_1
else if (t <= 2.7d-171) then
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)))
else if (t <= 2.75d+34) then
tmp = ((y * x) - (c * b)) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double tmp;
if (t <= -2.2e-10) {
tmp = t_1;
} else if (t <= 2.7e-171) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (t <= 2.75e+34) {
tmp = ((y * x) - (c * b)) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -t * ((a * x) - (i * b)) tmp = 0 if t <= -2.2e-10: tmp = t_1 elif t <= 2.7e-171: tmp = ((z * y) * x) + (j * ((c * a) - (y * i))) elif t <= 2.75e+34: tmp = ((y * x) - (c * b)) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-t) * Float64(Float64(a * x) - Float64(i * b))) tmp = 0.0 if (t <= -2.2e-10) tmp = t_1; elseif (t <= 2.7e-171) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (t <= 2.75e+34) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -t * ((a * x) - (i * b)); tmp = 0.0; if (t <= -2.2e-10) tmp = t_1; elseif (t <= 2.7e-171) tmp = ((z * y) * x) + (j * ((c * a) - (y * i))); elseif (t <= 2.75e+34) tmp = ((y * x) - (c * b)) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-t) * N[(N[(a * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e-10], t$95$1, If[LessEqual[t, 2.7e-171], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.75e+34], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \left(a \cdot x - i \cdot b\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-171}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{+34}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1999999999999999e-10 or 2.7499999999999998e34 < t Initial program 73.9%
Taylor expanded in t around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.6
Applied rewrites38.6%
if -2.1999999999999999e-10 < t < 2.70000000000000014e-171Initial program 73.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.2
Applied rewrites50.2%
if 2.70000000000000014e-171 < t < 2.7499999999999998e34Initial program 73.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -0.0074)
(* x (* a (- (/ (* c j) x) t)))
(if (<= a -8e-301)
(* (- (* i t) (* c z)) b)
(if (<= a 1.62e-152)
(* (- (* y x) (* c b)) z)
(if (<= a 2.3e-108)
(* i (- (* b t) (* j y)))
(if (<= a 1.6e+97)
(* (- (* j a) (* b z)) c)
(* (fma (- t) x (* j c)) a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -0.0074) {
tmp = x * (a * (((c * j) / x) - t));
} else if (a <= -8e-301) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 1.62e-152) {
tmp = ((y * x) - (c * b)) * z;
} else if (a <= 2.3e-108) {
tmp = i * ((b * t) - (j * y));
} else if (a <= 1.6e+97) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = fma(-t, x, (j * c)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -0.0074) tmp = Float64(x * Float64(a * Float64(Float64(Float64(c * j) / x) - t))); elseif (a <= -8e-301) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (a <= 1.62e-152) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (a <= 2.3e-108) tmp = Float64(i * Float64(Float64(b * t) - Float64(j * y))); elseif (a <= 1.6e+97) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -0.0074], N[(x * N[(a * N[(N[(N[(c * j), $MachinePrecision] / x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -8e-301], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 1.62e-152], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 2.3e-108], N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+97], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0074:\\
\;\;\;\;x \cdot \left(a \cdot \left(\frac{c \cdot j}{x} - t\right)\right)\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-301}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;a \leq 1.62 \cdot 10^{-152}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-108}:\\
\;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+97}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\end{array}
\end{array}
if a < -0.0074000000000000003Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in a around 0
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6438.7
Applied rewrites38.7%
if -0.0074000000000000003 < a < -8.00000000000000053e-301Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
if -8.00000000000000053e-301 < a < 1.61999999999999995e-152Initial program 73.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
if 1.61999999999999995e-152 < a < 2.29999999999999996e-108Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if 2.29999999999999996e-108 < a < 1.60000000000000008e97Initial program 73.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if 1.60000000000000008e97 < a Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) x (* j c)) a)))
(if (<= a -0.0074)
t_1
(if (<= a -8e-301)
(* (- (* i t) (* c z)) b)
(if (<= a 1.62e-152)
(* (- (* y x) (* c b)) z)
(if (<= a 2.3e-108)
(* i (- (* b t) (* j y)))
(if (<= a 1.6e+97) (* (- (* 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(-t, x, (j * c)) * a;
double tmp;
if (a <= -0.0074) {
tmp = t_1;
} else if (a <= -8e-301) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 1.62e-152) {
tmp = ((y * x) - (c * b)) * z;
} else if (a <= 2.3e-108) {
tmp = i * ((b * t) - (j * y));
} else if (a <= 1.6e+97) {
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(-t), x, Float64(j * c)) * a) tmp = 0.0 if (a <= -0.0074) tmp = t_1; elseif (a <= -8e-301) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (a <= 1.62e-152) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); elseif (a <= 2.3e-108) tmp = Float64(i * Float64(Float64(b * t) - Float64(j * y))); elseif (a <= 1.6e+97) 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[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -0.0074], t$95$1, If[LessEqual[a, -8e-301], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 1.62e-152], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 2.3e-108], N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+97], 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(-t, x, j \cdot c\right) \cdot a\\
\mathbf{if}\;a \leq -0.0074:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-301}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;a \leq 1.62 \cdot 10^{-152}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-108}:\\
\;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+97}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0074000000000000003 or 1.60000000000000008e97 < a Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
if -0.0074000000000000003 < a < -8.00000000000000053e-301Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
if -8.00000000000000053e-301 < a < 1.61999999999999995e-152Initial program 73.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
if 1.61999999999999995e-152 < a < 2.29999999999999996e-108Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if 2.29999999999999996e-108 < a < 1.60000000000000008e97Initial program 73.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* j a) (* b z)) c)))
(if (<= c -3e-112)
t_1
(if (<= c -4e-308)
(* i (- (* b t) (* j y)))
(if (<= c 4.2e-70) (* (fma (- i) j (* z x)) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((j * a) - (b * z)) * c;
double tmp;
if (c <= -3e-112) {
tmp = t_1;
} else if (c <= -4e-308) {
tmp = i * ((b * t) - (j * y));
} else if (c <= 4.2e-70) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(j * a) - Float64(b * z)) * c) tmp = 0.0 if (c <= -3e-112) tmp = t_1; elseif (c <= -4e-308) tmp = Float64(i * Float64(Float64(b * t) - Float64(j * y))); elseif (c <= 4.2e-70) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -3e-112], t$95$1, If[LessEqual[c, -4e-308], N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e-70], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $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 -3 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -4 \cdot 10^{-308}:\\
\;\;\;\;i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{-70}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.0000000000000001e-112 or 4.2000000000000002e-70 < c Initial program 73.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -3.0000000000000001e-112 < c < -4.00000000000000013e-308Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if -4.00000000000000013e-308 < c < 4.2000000000000002e-70Initial program 73.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* i (- (* b t) (* j y))))) (if (<= i -2e+37) t_1 (if (<= i 2.7e+35) (* (- (* 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 = i * ((b * t) - (j * y));
double tmp;
if (i <= -2e+37) {
tmp = t_1;
} else if (i <= 2.7e+35) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = i * ((b * t) - (j * y))
if (i <= (-2d+37)) then
tmp = t_1
else if (i <= 2.7d+35) then
tmp = ((j * a) - (b * z)) * c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * ((b * t) - (j * y));
double tmp;
if (i <= -2e+37) {
tmp = t_1;
} else if (i <= 2.7e+35) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = i * ((b * t) - (j * y)) tmp = 0 if i <= -2e+37: tmp = t_1 elif i <= 2.7e+35: 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(i * Float64(Float64(b * t) - Float64(j * y))) tmp = 0.0 if (i <= -2e+37) tmp = t_1; elseif (i <= 2.7e+35) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = i * ((b * t) - (j * y)); tmp = 0.0; if (i <= -2e+37) tmp = t_1; elseif (i <= 2.7e+35) tmp = ((j * a) - (b * z)) * c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2e+37], t$95$1, If[LessEqual[i, 2.7e+35], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{if}\;i \leq -2 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 2.7 \cdot 10^{+35}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.99999999999999991e37 or 2.70000000000000003e35 < i Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if -1.99999999999999991e37 < i < 2.70000000000000003e35Initial program 73.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* i t) (* c z)) b))) (if (<= b -5.6e-143) t_1 (if (<= b 9.2e-7) (* x (* -1.0 (* a t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -5.6e-143) {
tmp = t_1;
} else if (b <= 9.2e-7) {
tmp = x * (-1.0 * (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((i * t) - (c * z)) * b
if (b <= (-5.6d-143)) then
tmp = t_1
else if (b <= 9.2d-7) then
tmp = x * ((-1.0d0) * (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -5.6e-143) {
tmp = t_1;
} else if (b <= 9.2e-7) {
tmp = x * (-1.0 * (a * t));
} 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 <= -5.6e-143: tmp = t_1 elif b <= 9.2e-7: tmp = x * (-1.0 * (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) tmp = 0.0 if (b <= -5.6e-143) tmp = t_1; elseif (b <= 9.2e-7) tmp = Float64(x * Float64(-1.0 * Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * t) - (c * z)) * b; tmp = 0.0; if (b <= -5.6e-143) tmp = t_1; elseif (b <= 9.2e-7) tmp = x * (-1.0 * (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -5.6e-143], t$95$1, If[LessEqual[b, 9.2e-7], N[(x * N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $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 -5.6 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(-1 \cdot \left(a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.5999999999999997e-143 or 9.1999999999999998e-7 < b Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
if -5.5999999999999997e-143 < b < 9.1999999999999998e-7Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* i (- (* b t) (* j y))))) (if (<= i -1.7e+22) t_1 (if (<= i 1.55e+36) (* (* c j) 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 = i * ((b * t) - (j * y));
double tmp;
if (i <= -1.7e+22) {
tmp = t_1;
} else if (i <= 1.55e+36) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = i * ((b * t) - (j * y))
if (i <= (-1.7d+22)) then
tmp = t_1
else if (i <= 1.55d+36) then
tmp = (c * j) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * ((b * t) - (j * y));
double tmp;
if (i <= -1.7e+22) {
tmp = t_1;
} else if (i <= 1.55e+36) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = i * ((b * t) - (j * y)) tmp = 0 if i <= -1.7e+22: tmp = t_1 elif i <= 1.55e+36: tmp = (c * j) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(i * Float64(Float64(b * t) - Float64(j * y))) tmp = 0.0 if (i <= -1.7e+22) tmp = t_1; elseif (i <= 1.55e+36) tmp = Float64(Float64(c * j) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = i * ((b * t) - (j * y)); tmp = 0.0; if (i <= -1.7e+22) tmp = t_1; elseif (i <= 1.55e+36) tmp = (c * j) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.7e+22], t$95$1, If[LessEqual[i, 1.55e+36], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(b \cdot t - j \cdot y\right)\\
\mathbf{if}\;i \leq -1.7 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.55 \cdot 10^{+36}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.7e22 or 1.55e36 < i Initial program 73.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 rewrites74.5%
Taylor expanded in i around inf
mul-1-negN/A
mul-1-negN/A
lower-*.f64N/A
add-negate-revN/A
sub-flipN/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6439.8
Applied rewrites39.8%
if -1.7e22 < i < 1.55e36Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.95e-109)
(* (* i t) b)
(if (<= t 5.8e-177)
(* (* c j) a)
(if (<= t 4.4e+42) (* (* -1.0 (* b c)) z) (* x (* -1.0 (* a t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 5.8e-177) {
tmp = (c * j) * a;
} else if (t <= 4.4e+42) {
tmp = (-1.0 * (b * c)) * z;
} else {
tmp = x * (-1.0 * (a * t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.95d-109)) then
tmp = (i * t) * b
else if (t <= 5.8d-177) then
tmp = (c * j) * a
else if (t <= 4.4d+42) then
tmp = ((-1.0d0) * (b * c)) * z
else
tmp = x * ((-1.0d0) * (a * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 5.8e-177) {
tmp = (c * j) * a;
} else if (t <= 4.4e+42) {
tmp = (-1.0 * (b * c)) * z;
} else {
tmp = x * (-1.0 * (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.95e-109: tmp = (i * t) * b elif t <= 5.8e-177: tmp = (c * j) * a elif t <= 4.4e+42: tmp = (-1.0 * (b * c)) * z else: tmp = x * (-1.0 * (a * t)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.95e-109) tmp = Float64(Float64(i * t) * b); elseif (t <= 5.8e-177) tmp = Float64(Float64(c * j) * a); elseif (t <= 4.4e+42) tmp = Float64(Float64(-1.0 * Float64(b * c)) * z); else tmp = Float64(x * Float64(-1.0 * Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.95e-109) tmp = (i * t) * b; elseif (t <= 5.8e-177) tmp = (c * j) * a; elseif (t <= 4.4e+42) tmp = (-1.0 * (b * c)) * z; else tmp = x * (-1.0 * (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.95e-109], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 5.8e-177], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 4.4e+42], N[(N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(x * N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-109}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-177}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+42}:\\
\;\;\;\;\left(-1 \cdot \left(b \cdot c\right)\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \left(a \cdot t\right)\right)\\
\end{array}
\end{array}
if t < -1.95000000000000011e-109Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lift-*.f6421.9
Applied rewrites21.9%
if -1.95000000000000011e-109 < t < 5.79999999999999994e-177Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
if 5.79999999999999994e-177 < t < 4.4000000000000003e42Initial program 73.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6423.0
Applied rewrites23.0%
if 4.4000000000000003e42 < t Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.95e-109)
(* (* i t) b)
(if (<= t 5.8e-177)
(* (* c j) a)
(if (<= t 2.7e+42) (* (- (* c z)) b) (* x (* -1.0 (* a t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 5.8e-177) {
tmp = (c * j) * a;
} else if (t <= 2.7e+42) {
tmp = -(c * z) * b;
} else {
tmp = x * (-1.0 * (a * t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.95d-109)) then
tmp = (i * t) * b
else if (t <= 5.8d-177) then
tmp = (c * j) * a
else if (t <= 2.7d+42) then
tmp = -(c * z) * b
else
tmp = x * ((-1.0d0) * (a * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 5.8e-177) {
tmp = (c * j) * a;
} else if (t <= 2.7e+42) {
tmp = -(c * z) * b;
} else {
tmp = x * (-1.0 * (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.95e-109: tmp = (i * t) * b elif t <= 5.8e-177: tmp = (c * j) * a elif t <= 2.7e+42: tmp = -(c * z) * b else: tmp = x * (-1.0 * (a * t)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.95e-109) tmp = Float64(Float64(i * t) * b); elseif (t <= 5.8e-177) tmp = Float64(Float64(c * j) * a); elseif (t <= 2.7e+42) tmp = Float64(Float64(-Float64(c * z)) * b); else tmp = Float64(x * Float64(-1.0 * Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.95e-109) tmp = (i * t) * b; elseif (t <= 5.8e-177) tmp = (c * j) * a; elseif (t <= 2.7e+42) tmp = -(c * z) * b; else tmp = x * (-1.0 * (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.95e-109], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 5.8e-177], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 2.7e+42], N[((-N[(c * z), $MachinePrecision]) * b), $MachinePrecision], N[(x * N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-109}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-177}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+42}:\\
\;\;\;\;\left(-c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \left(a \cdot t\right)\right)\\
\end{array}
\end{array}
if t < -1.95000000000000011e-109Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lift-*.f6421.9
Applied rewrites21.9%
if -1.95000000000000011e-109 < t < 5.79999999999999994e-177Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
if 5.79999999999999994e-177 < t < 2.7000000000000001e42Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
lift-*.f6422.8
Applied rewrites22.8%
if 2.7000000000000001e42 < t Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.95e-109)
(* (* i t) b)
(if (<= t 5.8e-177)
(* (* c j) a)
(if (<= t 2.7e+42) (* (- (* c z)) b) (* (* (- t) x) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 5.8e-177) {
tmp = (c * j) * a;
} else if (t <= 2.7e+42) {
tmp = -(c * z) * b;
} else {
tmp = (-t * x) * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.95d-109)) then
tmp = (i * t) * b
else if (t <= 5.8d-177) then
tmp = (c * j) * a
else if (t <= 2.7d+42) then
tmp = -(c * z) * b
else
tmp = (-t * x) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 5.8e-177) {
tmp = (c * j) * a;
} else if (t <= 2.7e+42) {
tmp = -(c * z) * b;
} else {
tmp = (-t * x) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.95e-109: tmp = (i * t) * b elif t <= 5.8e-177: tmp = (c * j) * a elif t <= 2.7e+42: tmp = -(c * z) * b else: tmp = (-t * x) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.95e-109) tmp = Float64(Float64(i * t) * b); elseif (t <= 5.8e-177) tmp = Float64(Float64(c * j) * a); elseif (t <= 2.7e+42) tmp = Float64(Float64(-Float64(c * z)) * b); else tmp = Float64(Float64(Float64(-t) * x) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.95e-109) tmp = (i * t) * b; elseif (t <= 5.8e-177) tmp = (c * j) * a; elseif (t <= 2.7e+42) tmp = -(c * z) * b; else tmp = (-t * x) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.95e-109], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 5.8e-177], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 2.7e+42], N[((-N[(c * z), $MachinePrecision]) * b), $MachinePrecision], N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-109}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-177}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+42}:\\
\;\;\;\;\left(-c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\
\end{array}
\end{array}
if t < -1.95000000000000011e-109Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lift-*.f6421.9
Applied rewrites21.9%
if -1.95000000000000011e-109 < t < 5.79999999999999994e-177Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
if 5.79999999999999994e-177 < t < 2.7000000000000001e42Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
lift-*.f6422.8
Applied rewrites22.8%
if 2.7000000000000001e42 < t Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= t -1.95e-109) (* (* i t) b) (if (<= t 4.8e+34) (* (* c j) a) (* (* (- t) x) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 4.8e+34) {
tmp = (c * j) * a;
} else {
tmp = (-t * x) * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-1.95d-109)) then
tmp = (i * t) * b
else if (t <= 4.8d+34) then
tmp = (c * j) * a
else
tmp = (-t * x) * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.95e-109) {
tmp = (i * t) * b;
} else if (t <= 4.8e+34) {
tmp = (c * j) * a;
} else {
tmp = (-t * x) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.95e-109: tmp = (i * t) * b elif t <= 4.8e+34: tmp = (c * j) * a else: tmp = (-t * x) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.95e-109) tmp = Float64(Float64(i * t) * b); elseif (t <= 4.8e+34) tmp = Float64(Float64(c * j) * a); else tmp = Float64(Float64(Float64(-t) * x) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.95e-109) tmp = (i * t) * b; elseif (t <= 4.8e+34) tmp = (c * j) * a; else tmp = (-t * x) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.95e-109], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 4.8e+34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-109}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\
\end{array}
\end{array}
if t < -1.95000000000000011e-109Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lift-*.f6421.9
Applied rewrites21.9%
if -1.95000000000000011e-109 < t < 4.79999999999999974e34Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
if 4.79999999999999974e34 < t Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* i t) b))) (if (<= i -5.1e+22) t_1 (if (<= i 9.3e+145) (* (* c j) 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 = (i * t) * b;
double tmp;
if (i <= -5.1e+22) {
tmp = t_1;
} else if (i <= 9.3e+145) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (i * t) * b
if (i <= (-5.1d+22)) then
tmp = t_1
else if (i <= 9.3d+145) then
tmp = (c * j) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) * b;
double tmp;
if (i <= -5.1e+22) {
tmp = t_1;
} else if (i <= 9.3e+145) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * t) * b tmp = 0 if i <= -5.1e+22: tmp = t_1 elif i <= 9.3e+145: tmp = (c * j) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) * b) tmp = 0.0 if (i <= -5.1e+22) tmp = t_1; elseif (i <= 9.3e+145) tmp = Float64(Float64(c * j) * a); 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) * b; tmp = 0.0; if (i <= -5.1e+22) tmp = t_1; elseif (i <= 9.3e+145) tmp = (c * j) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -5.1e+22], t$95$1, If[LessEqual[i, 9.3e+145], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;i \leq -5.1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 9.3 \cdot 10^{+145}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -5.1000000000000002e22 or 9.3000000000000002e145 < i Initial program 73.9%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lift-*.f6421.9
Applied rewrites21.9%
if -5.1000000000000002e22 < i < 9.3000000000000002e145Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
(FPCore (x y z t a b c i j) :precision binary64 (* (* c j) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (c * j) * a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (c * j) * a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (c * j) * a;
}
def code(x, y, z, t, a, b, c, i, j): return (c * j) * a
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(c * j) * a) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (c * j) * a; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(c \cdot j\right) \cdot a
\end{array}
Initial program 73.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x around 0
lower-*.f6423.1
Applied rewrites23.1%
herbie shell --seed 2025136
(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)))))