
(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 17 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 (fma -1.0 (/ c i) (/ t z)))) 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 * fma(-1.0, (c / i), (t / z)))) * 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(i * fma(-1.0, Float64(c / i), Float64(t / z)))) * 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[(i * N[(-1.0 * N[(c / i), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $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(i \cdot \mathsf{fma}\left(-1, \frac{c}{i}, \frac{t}{z}\right)\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
*-commutativeN/A
lower-*.f64N/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%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6439.3
Applied rewrites39.3%
(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 (fma -1.0 (/ c i) (/ t z)))) 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 * fma(-1.0, (c / i), (t / z)))) * 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(i * fma(-1.0, Float64(c / i), Float64(t / z)))) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(z * N[(i * N[(-1.0 * N[(c / i), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $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(i \cdot \mathsf{fma}\left(-1, \frac{c}{i}, \frac{t}{z}\right)\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%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -5.5e+178)
(* (* z (- (/ (* i t) z) c)) b)
(if (<= b 1.3e+163)
(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 <= -5.5e+178) {
tmp = (z * (((i * t) / z) - c)) * b;
} else if (b <= 1.3e+163) {
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 <= -5.5e+178) tmp = Float64(Float64(z * Float64(Float64(Float64(i * t) / z) - c)) * b); elseif (b <= 1.3e+163) 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, -5.5e+178], N[(N[(z * N[(N[(N[(i * t), $MachinePrecision] / z), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 1.3e+163], 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 -5.5 \cdot 10^{+178}:\\
\;\;\;\;\left(z \cdot \left(\frac{i \cdot t}{z} - c\right)\right) \cdot b\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{+163}:\\
\;\;\;\;\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 < -5.5000000000000001e178Initial 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 -5.5000000000000001e178 < b < 1.3000000000000001e163Initial 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 1.3000000000000001e163 < 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 -4.4e+88)
t_1
(if (<= i 3.8e+30)
(- (fma (- (* z y) (* a t)) x (* (* j c) a)) (* (* c b) z))
(if (<= i 1.9e+144)
(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 <= -4.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 <= 1.9e+144) {
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 <= -4.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 <= 1.9e+144) 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, -4.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, 1.9e+144], 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 -4.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 1.9 \cdot 10^{+144}:\\
\;\;\;\;\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 < -4.40000000000000017e88 or 1.90000000000000013e144 < 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 -4.40000000000000017e88 < 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites58.4%
if 3.8000000000000001e30 < i < 1.90000000000000013e144Initial 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 -4.4e+88)
t_1
(if (<= i 1.9e+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 <= -4.4e+88) {
tmp = t_1;
} else if (i <= 1.9e+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 <= -4.4e+88) tmp = t_1; elseif (i <= 1.9e+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, -4.4e+88], t$95$1, If[LessEqual[i, 1.9e+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 -4.4 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.9 \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 < -4.40000000000000017e88 or 1.90000000000000013e144 < 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 -4.40000000000000017e88 < i < 1.90000000000000013e144Initial 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
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites58.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= b -7.6e+105)
(* (* z (- (/ (* i t) z) c)) b)
(if (<= b 5.1e-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 <= -7.6e+105) {
tmp = (z * (((i * t) / z) - c)) * b;
} else if (b <= 5.1e-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 <= -7.6e+105) tmp = Float64(Float64(z * Float64(Float64(Float64(i * t) / z) - c)) * b); elseif (b <= 5.1e-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, -7.6e+105], N[(N[(z * N[(N[(N[(i * t), $MachinePrecision] / z), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 5.1e-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 -7.6 \cdot 10^{+105}:\\
\;\;\;\;\left(z \cdot \left(\frac{i \cdot t}{z} - c\right)\right) \cdot b\\
\mathbf{elif}\;b \leq 5.1 \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 < -7.6e105Initial 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 -7.6e105 < b < 5.1000000000000003e-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
*-commutativeN/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
if 5.1000000000000003e-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.9e-11)
t_1
(if (<= t 6.4e-296)
(+ (* (* z y) x) t_2)
(if (<= t 1.05e+35) (+ (- (* (* 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.9e-11) {
tmp = t_1;
} else if (t <= 6.4e-296) {
tmp = ((z * y) * x) + t_2;
} else if (t <= 1.05e+35) {
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.9d-11)) then
tmp = t_1
else if (t <= 6.4d-296) then
tmp = ((z * y) * x) + t_2
else if (t <= 1.05d+35) 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.9e-11) {
tmp = t_1;
} else if (t <= 6.4e-296) {
tmp = ((z * y) * x) + t_2;
} else if (t <= 1.05e+35) {
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.9e-11: tmp = t_1 elif t <= 6.4e-296: tmp = ((z * y) * x) + t_2 elif t <= 1.05e+35: 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.9e-11) tmp = t_1; elseif (t <= 6.4e-296) tmp = Float64(Float64(Float64(z * y) * x) + t_2); elseif (t <= 1.05e+35) 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.9e-11) tmp = t_1; elseif (t <= 6.4e-296) tmp = ((z * y) * x) + t_2; elseif (t <= 1.05e+35) 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.9e-11], t$95$1, If[LessEqual[t, 6.4e-296], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t, 1.05e+35], 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.9 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-296}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + t\_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+35}:\\
\;\;\;\;\left(-\left(c \cdot b\right) \cdot z\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9e-11 or 1.0499999999999999e35 < 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.9e-11 < t < 6.40000000000000025e-296Initial program 73.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.2
Applied rewrites50.2%
if 6.40000000000000025e-296 < t < 1.0499999999999999e35Initial 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.9e-11)
t_1
(if (<= t 2.4e-171)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= t 2.4e+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.9e-11) {
tmp = t_1;
} else if (t <= 2.4e-171) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (t <= 2.4e+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.9d-11)) then
tmp = t_1
else if (t <= 2.4d-171) then
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)))
else if (t <= 2.4d+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.9e-11) {
tmp = t_1;
} else if (t <= 2.4e-171) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (t <= 2.4e+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.9e-11: tmp = t_1 elif t <= 2.4e-171: tmp = ((z * y) * x) + (j * ((c * a) - (y * i))) elif t <= 2.4e+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.9e-11) tmp = t_1; elseif (t <= 2.4e-171) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (t <= 2.4e+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.9e-11) tmp = t_1; elseif (t <= 2.4e-171) tmp = ((z * y) * x) + (j * ((c * a) - (y * i))); elseif (t <= 2.4e+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.9e-11], t$95$1, If[LessEqual[t, 2.4e-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.4e+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.9 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.4 \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.4 \cdot 10^{+34}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9e-11 or 2.39999999999999987e34 < 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.9e-11 < t < 2.39999999999999987e-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.39999999999999987e-171 < t < 2.39999999999999987e34Initial 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
(let* ((t_1 (* (fma (- t) x (* j c)) a)))
(if (<= a -0.235)
t_1
(if (<= a -4.5e-301)
(* (- (* i t) (* c z)) b)
(if (<= a 2.95e-154)
(* (- (* y x) (* c b)) z)
(if (<= a 2.3e-108)
(* i (- (* b t) (* j y)))
(if (<= a 6.4e+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.235) {
tmp = t_1;
} else if (a <= -4.5e-301) {
tmp = ((i * t) - (c * z)) * b;
} else if (a <= 2.95e-154) {
tmp = ((y * x) - (c * b)) * z;
} else if (a <= 2.3e-108) {
tmp = i * ((b * t) - (j * y));
} else if (a <= 6.4e+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.235) tmp = t_1; elseif (a <= -4.5e-301) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (a <= 2.95e-154) 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 <= 6.4e+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.235], t$95$1, If[LessEqual[a, -4.5e-301], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 2.95e-154], 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, 6.4e+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.235:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.5 \cdot 10^{-301}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;a \leq 2.95 \cdot 10^{-154}:\\
\;\;\;\;\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 6.4 \cdot 10^{+97}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.23499999999999999 or 6.40000000000000032e97 < 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.23499999999999999 < a < -4.5000000000000002e-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 -4.5000000000000002e-301 < a < 2.9500000000000001e-154Initial 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 2.9500000000000001e-154 < 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 < 6.40000000000000032e97Initial 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 -2.6e-22) t_1 (if (<= b 1.35e-7) (* 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 * t) - (c * z)) * b;
double tmp;
if (b <= -2.6e-22) {
tmp = t_1;
} else if (b <= 1.35e-7) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((i * t) - (c * z)) * b
if (b <= (-2.6d-22)) then
tmp = t_1
else if (b <= 1.35d-7) then
tmp = x * ((y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -2.6e-22) {
tmp = t_1;
} else if (b <= 1.35e-7) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) - (c * z)) * b tmp = 0 if b <= -2.6e-22: tmp = t_1 elif b <= 1.35e-7: tmp = x * ((y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) tmp = 0.0 if (b <= -2.6e-22) tmp = t_1; elseif (b <= 1.35e-7) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * t) - (c * z)) * b; tmp = 0.0; if (b <= -2.6e-22) tmp = t_1; elseif (b <= 1.35e-7) tmp = x * ((y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.6e-22], t$95$1, If[LessEqual[b, 1.35e-7], N[(x * N[(N[(y * z), $MachinePrecision] - 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 -2.6 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.35 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.6e-22 or 1.35000000000000004e-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 -2.6e-22 < b < 1.35000000000000004e-7Initial 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 x around inf
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -2.8e+52)
t_1
(if (<= j 3.55e+115) (* 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -2.8e+52) {
tmp = t_1;
} else if (j <= 3.55e+115) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((a * c) - (i * y))
if (j <= (-2.8d+52)) then
tmp = t_1
else if (j <= 3.55d+115) then
tmp = x * ((y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -2.8e+52) {
tmp = t_1;
} else if (j <= 3.55e+115) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -2.8e+52: tmp = t_1 elif j <= 3.55e+115: tmp = x * ((y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -2.8e+52) tmp = t_1; elseif (j <= 3.55e+115) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -2.8e+52) tmp = t_1; elseif (j <= 3.55e+115) tmp = x * ((y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -2.8e+52], t$95$1, If[LessEqual[j, 3.55e+115], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -2.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.55 \cdot 10^{+115}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.8e52 or 3.5499999999999998e115 < j 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 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 j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6441.1
Applied rewrites41.1%
if -2.8e52 < j < 3.5499999999999998e115Initial 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 x around inf
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* i (- (* b t) (* j y))))) (if (<= i -1e+27) t_1 (if (<= i 7e+38) (* j (- (* a c) (* i y))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * ((b * t) - (j * y));
double tmp;
if (i <= -1e+27) {
tmp = t_1;
} else if (i <= 7e+38) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = i * ((b * t) - (j * y))
if (i <= (-1d+27)) then
tmp = t_1
else if (i <= 7d+38) then
tmp = j * ((a * c) - (i * y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * ((b * t) - (j * y));
double tmp;
if (i <= -1e+27) {
tmp = t_1;
} else if (i <= 7e+38) {
tmp = j * ((a * c) - (i * y));
} 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 <= -1e+27: tmp = t_1 elif i <= 7e+38: tmp = j * ((a * c) - (i * y)) 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 <= -1e+27) tmp = t_1; elseif (i <= 7e+38) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = i * ((b * t) - (j * y)); tmp = 0.0; if (i <= -1e+27) tmp = t_1; elseif (i <= 7e+38) tmp = j * ((a * c) - (i * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1e+27], t$95$1, If[LessEqual[i, 7e+38], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $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 -1 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 7 \cdot 10^{+38}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1e27 or 7.00000000000000003e38 < 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 -1e27 < i < 7.00000000000000003e38Initial 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 j around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6441.1
Applied rewrites41.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* i (- (* b t) (* j y))))) (if (<= i -3.7e+24) t_1 (if (<= i 3.8e+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 <= -3.7e+24) {
tmp = t_1;
} else if (i <= 3.8e+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 <= (-3.7d+24)) then
tmp = t_1
else if (i <= 3.8d+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 <= -3.7e+24) {
tmp = t_1;
} else if (i <= 3.8e+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 <= -3.7e+24: tmp = t_1 elif i <= 3.8e+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 <= -3.7e+24) tmp = t_1; elseif (i <= 3.8e+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 <= -3.7e+24) tmp = t_1; elseif (i <= 3.8e+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, -3.7e+24], t$95$1, If[LessEqual[i, 3.8e+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 -3.7 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 3.8 \cdot 10^{+36}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -3.69999999999999999e24 or 3.80000000000000025e36 < 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 -3.69999999999999999e24 < i < 3.80000000000000025e36Initial 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 -5.6e-109)
(* (* i t) b)
(if (<= t 8.5e-175)
(* (* c j) a)
(if (<= t 2.6e+43) (* (- (* 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 <= -5.6e-109) {
tmp = (i * t) * b;
} else if (t <= 8.5e-175) {
tmp = (c * j) * a;
} else if (t <= 2.6e+43) {
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 <= (-5.6d-109)) then
tmp = (i * t) * b
else if (t <= 8.5d-175) then
tmp = (c * j) * a
else if (t <= 2.6d+43) 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 <= -5.6e-109) {
tmp = (i * t) * b;
} else if (t <= 8.5e-175) {
tmp = (c * j) * a;
} else if (t <= 2.6e+43) {
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 <= -5.6e-109: tmp = (i * t) * b elif t <= 8.5e-175: tmp = (c * j) * a elif t <= 2.6e+43: 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 <= -5.6e-109) tmp = Float64(Float64(i * t) * b); elseif (t <= 8.5e-175) tmp = Float64(Float64(c * j) * a); elseif (t <= 2.6e+43) 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 <= -5.6e-109) tmp = (i * t) * b; elseif (t <= 8.5e-175) tmp = (c * j) * a; elseif (t <= 2.6e+43) 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, -5.6e-109], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 8.5e-175], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 2.6e+43], N[((-N[(c * z), $MachinePrecision]) * b), $MachinePrecision], N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-109}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-175}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+43}:\\
\;\;\;\;\left(-c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\
\end{array}
\end{array}
if t < -5.59999999999999958e-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 -5.59999999999999958e-109 < t < 8.5000000000000005e-175Initial 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 8.5000000000000005e-175 < t < 2.60000000000000021e43Initial 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.60000000000000021e43 < 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 -5.6e-109) (* (* i t) b) (if (<= t 2.05e+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 <= -5.6e-109) {
tmp = (i * t) * b;
} else if (t <= 2.05e+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 <= (-5.6d-109)) then
tmp = (i * t) * b
else if (t <= 2.05d+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 <= -5.6e-109) {
tmp = (i * t) * b;
} else if (t <= 2.05e+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 <= -5.6e-109: tmp = (i * t) * b elif t <= 2.05e+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 <= -5.6e-109) tmp = Float64(Float64(i * t) * b); elseif (t <= 2.05e+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 <= -5.6e-109) tmp = (i * t) * b; elseif (t <= 2.05e+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, -5.6e-109], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 2.05e+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 -5.6 \cdot 10^{-109}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;t \leq 2.05 \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 < -5.59999999999999958e-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 -5.59999999999999958e-109 < t < 2.0499999999999999e34Initial 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 2.0499999999999999e34 < 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 -8.6e+26) t_1 (if (<= i 1.42e+146) (* (* 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 <= -8.6e+26) {
tmp = t_1;
} else if (i <= 1.42e+146) {
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 <= (-8.6d+26)) then
tmp = t_1
else if (i <= 1.42d+146) 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 <= -8.6e+26) {
tmp = t_1;
} else if (i <= 1.42e+146) {
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 <= -8.6e+26: tmp = t_1 elif i <= 1.42e+146: 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 <= -8.6e+26) tmp = t_1; elseif (i <= 1.42e+146) 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 <= -8.6e+26) tmp = t_1; elseif (i <= 1.42e+146) 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, -8.6e+26], t$95$1, If[LessEqual[i, 1.42e+146], 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 -8.6 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.42 \cdot 10^{+146}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -8.5999999999999996e26 or 1.4200000000000001e146 < 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 -8.5999999999999996e26 < i < 1.4200000000000001e146Initial 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)))))