
(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}
Sampling outcomes in binary64 precision:
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
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (fma (fma (- t) x (* j c)) a (* (* z y) x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(fma(-t, x, (j * c)), a, ((z * y) * x));
}
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 = fma(fma(Float64(-t), x, Float64(j * c)), a, Float64(Float64(z * y) * x)); 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[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 91.4%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites28.3%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites52.7%
Taylor expanded in i around 0
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f6456.3
Applied rewrites56.3%
Final simplification83.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (fma (- t) x (* j c)) a (* (* z y) x))) (t_2 (* (* i t) b)))
(if (<= x -2.25e-33)
t_1
(if (<= x -5.7e-112)
(+ t_2 (* j (- (* c a) (* y i))))
(if (<= x 1.5e-231)
(* (fma i t (* (- c) z)) b)
(if (<= x 1.06e-17)
(fma (* (- i) j) y (fma (* y x) z (* (* j c) a)))
(if (<= x 1.6e+205) t_1 (fma (fma (- a) t (* z y)) x t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(fma(-t, x, (j * c)), a, ((z * y) * x));
double t_2 = (i * t) * b;
double tmp;
if (x <= -2.25e-33) {
tmp = t_1;
} else if (x <= -5.7e-112) {
tmp = t_2 + (j * ((c * a) - (y * i)));
} else if (x <= 1.5e-231) {
tmp = fma(i, t, (-c * z)) * b;
} else if (x <= 1.06e-17) {
tmp = fma((-i * j), y, fma((y * x), z, ((j * c) * a)));
} else if (x <= 1.6e+205) {
tmp = t_1;
} else {
tmp = fma(fma(-a, t, (z * y)), x, t_2);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(fma(Float64(-t), x, Float64(j * c)), a, Float64(Float64(z * y) * x)) t_2 = Float64(Float64(i * t) * b) tmp = 0.0 if (x <= -2.25e-33) tmp = t_1; elseif (x <= -5.7e-112) tmp = Float64(t_2 + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (x <= 1.5e-231) tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); elseif (x <= 1.06e-17) tmp = fma(Float64(Float64(-i) * j), y, fma(Float64(y * x), z, Float64(Float64(j * c) * a))); elseif (x <= 1.6e+205) tmp = t_1; else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, t_2); 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 + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x, -2.25e-33], t$95$1, If[LessEqual[x, -5.7e-112], N[(t$95$2 + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-231], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 1.06e-17], N[(N[((-i) * j), $MachinePrecision] * y + N[(N[(y * x), $MachinePrecision] * z + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+205], t$95$1, N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\\
t_2 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{-112}:\\
\;\;\;\;t\_2 + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-231}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\left(-i\right) \cdot j, y, \mathsf{fma}\left(y \cdot x, z, \left(j \cdot c\right) \cdot a\right)\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, t\_2\right)\\
\end{array}
\end{array}
if x < -2.24999999999999995e-33 or 1.06000000000000006e-17 < x < 1.59999999999999998e205Initial program 72.6%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites76.5%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites77.2%
Taylor expanded in i around 0
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f6474.2
Applied rewrites74.2%
if -2.24999999999999995e-33 < x < -5.70000000000000015e-112Initial program 69.4%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6469.7
Applied rewrites69.7%
if -5.70000000000000015e-112 < x < 1.5000000000000001e-231Initial program 73.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6463.7
Applied rewrites63.7%
if 1.5000000000000001e-231 < x < 1.06000000000000006e-17Initial program 72.6%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites82.7%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites72.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6468.3
Applied rewrites68.3%
if 1.59999999999999998e205 < x Initial program 54.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
Final simplification70.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (fma (- t) x (* j c)) a (* (* z y) x))))
(if (<= x -1.65e-33)
t_1
(if (<= x -1.02e-63)
(* (fma (- b) t (* j y)) (- i))
(if (<= x 2.9e-198)
(* (fma i t (* (- c) z)) b)
(if (<= x 8e-18)
(* (fma (- i) y (* c a)) j)
(if (<= x 1.6e+205)
t_1
(fma (fma (- a) t (* z y)) x (* (* i t) b)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(fma(-t, x, (j * c)), a, ((z * y) * x));
double tmp;
if (x <= -1.65e-33) {
tmp = t_1;
} else if (x <= -1.02e-63) {
tmp = fma(-b, t, (j * y)) * -i;
} else if (x <= 2.9e-198) {
tmp = fma(i, t, (-c * z)) * b;
} else if (x <= 8e-18) {
tmp = fma(-i, y, (c * a)) * j;
} else if (x <= 1.6e+205) {
tmp = t_1;
} else {
tmp = fma(fma(-a, t, (z * y)), x, ((i * t) * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(fma(Float64(-t), x, Float64(j * c)), a, Float64(Float64(z * y) * x)) tmp = 0.0 if (x <= -1.65e-33) tmp = t_1; elseif (x <= -1.02e-63) tmp = Float64(fma(Float64(-b), t, Float64(j * y)) * Float64(-i)); elseif (x <= 2.9e-198) tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); elseif (x <= 8e-18) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); elseif (x <= 1.6e+205) tmp = t_1; else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(i * t) * b)); 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 + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e-33], t$95$1, If[LessEqual[x, -1.02e-63], N[(N[((-b) * t + N[(j * y), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision], If[LessEqual[x, 2.9e-198], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 8e-18], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[x, 1.6e+205], t$95$1, N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.02 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(-b, t, j \cdot y\right) \cdot \left(-i\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-198}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(i \cdot t\right) \cdot b\right)\\
\end{array}
\end{array}
if x < -1.6500000000000001e-33 or 8.0000000000000006e-18 < x < 1.59999999999999998e205Initial program 72.6%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites76.5%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites77.2%
Taylor expanded in i around 0
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f6474.2
Applied rewrites74.2%
if -1.6500000000000001e-33 < x < -1.01999999999999997e-63Initial program 71.9%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6499.3
Applied rewrites99.3%
lift-neg.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-neg.f6499.6
Applied rewrites99.6%
if -1.01999999999999997e-63 < x < 2.90000000000000001e-198Initial program 70.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
if 2.90000000000000001e-198 < x < 8.0000000000000006e-18Initial program 76.3%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6464.7
Applied rewrites64.7%
if 1.59999999999999998e205 < x Initial program 54.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
Final simplification69.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -7e-243) (not (<= y 5e+36))) (fma (* (- i) j) y (fma (fma (- t) x (* j c)) a (* (* z y) x))) (fma (fma (- a) t (* z y)) x (* (- b) (fma (- i) t (* c z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -7e-243) || !(y <= 5e+36)) {
tmp = fma((-i * j), y, fma(fma(-t, x, (j * c)), a, ((z * y) * x)));
} else {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-i, t, (c * z))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -7e-243) || !(y <= 5e+36)) tmp = fma(Float64(Float64(-i) * j), y, fma(fma(Float64(-t), x, Float64(j * c)), a, Float64(Float64(z * y) * x))); else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-i), t, Float64(c * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -7e-243], N[Not[LessEqual[y, 5e+36]], $MachinePrecision]], N[(N[((-i) * j), $MachinePrecision] * y + N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-243} \lor \neg \left(y \leq 5 \cdot 10^{+36}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(-i\right) \cdot j, y, \mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -6.99999999999999958e-243 or 4.99999999999999977e36 < y Initial program 64.6%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites74.4%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites74.3%
if -6.99999999999999958e-243 < y < 4.99999999999999977e36Initial program 83.8%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.2%
Final simplification74.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= j -2.65e-17) (not (<= j 8.2e+21))) (+ (* (fma y x (* (- b) c)) z) (* j (- (* c a) (* y i)))) (fma (fma (- a) t (* z y)) x (* (- b) (fma (- i) t (* c z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((j <= -2.65e-17) || !(j <= 8.2e+21)) {
tmp = (fma(y, x, (-b * c)) * z) + (j * ((c * a) - (y * i)));
} else {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-i, t, (c * z))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((j <= -2.65e-17) || !(j <= 8.2e+21)) tmp = Float64(Float64(fma(y, x, Float64(Float64(-b) * c)) * z) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-i), t, Float64(c * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -2.65e-17], N[Not[LessEqual[j, 8.2e+21]], $MachinePrecision]], N[(N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.65 \cdot 10^{-17} \lor \neg \left(j \leq 8.2 \cdot 10^{+21}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\
\end{array}
\end{array}
if j < -2.6499999999999999e-17 or 8.2e21 < j Initial program 69.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6473.1
Applied rewrites73.1%
if -2.6499999999999999e-17 < j < 8.2e21Initial program 72.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.9%
Final simplification73.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i)))))
(if (<= j -6.5e-7)
(+ (* (* i t) b) t_1)
(if (<= j 1.55e+22)
(fma (fma (- a) t (* z y)) x (* (- b) (fma (- i) t (* c z))))
(+ (* (* z y) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double tmp;
if (j <= -6.5e-7) {
tmp = ((i * t) * b) + t_1;
} else if (j <= 1.55e+22) {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-i, t, (c * z))));
} else {
tmp = ((z * y) * x) + t_1;
}
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 (j <= -6.5e-7) tmp = Float64(Float64(Float64(i * t) * b) + t_1); elseif (j <= 1.55e+22) tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-i), t, Float64(c * z)))); else tmp = Float64(Float64(Float64(z * y) * x) + t_1); 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[j, -6.5e-7], N[(N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[j, 1.55e+22], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;j \leq -6.5 \cdot 10^{-7}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b + t\_1\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + t\_1\\
\end{array}
\end{array}
if j < -6.50000000000000024e-7Initial program 70.4%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.4
Applied rewrites66.4%
if -6.50000000000000024e-7 < j < 1.5500000000000001e22Initial program 72.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.9%
if 1.5500000000000001e22 < j Initial program 68.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.5
Applied rewrites72.5%
Final simplification71.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (fma (- t) x (* j c)) a (* (* z y) x))) (t_2 (* (* i t) b)))
(if (<= x -2.25e-33)
t_1
(if (<= x 3.9e-165)
(+ t_2 (* j (- (* c a) (* y i))))
(if (<= x 1.6e+205) t_1 (fma (fma (- a) t (* z y)) x t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(fma(-t, x, (j * c)), a, ((z * y) * x));
double t_2 = (i * t) * b;
double tmp;
if (x <= -2.25e-33) {
tmp = t_1;
} else if (x <= 3.9e-165) {
tmp = t_2 + (j * ((c * a) - (y * i)));
} else if (x <= 1.6e+205) {
tmp = t_1;
} else {
tmp = fma(fma(-a, t, (z * y)), x, t_2);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(fma(Float64(-t), x, Float64(j * c)), a, Float64(Float64(z * y) * x)) t_2 = Float64(Float64(i * t) * b) tmp = 0.0 if (x <= -2.25e-33) tmp = t_1; elseif (x <= 3.9e-165) tmp = Float64(t_2 + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (x <= 1.6e+205) tmp = t_1; else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, t_2); 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 + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x, -2.25e-33], t$95$1, If[LessEqual[x, 3.9e-165], N[(t$95$2 + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+205], t$95$1, N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\\
t_2 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-165}:\\
\;\;\;\;t\_2 + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, t\_2\right)\\
\end{array}
\end{array}
if x < -2.24999999999999995e-33 or 3.8999999999999999e-165 < x < 1.59999999999999998e205Initial program 72.6%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites78.9%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites78.1%
Taylor expanded in i around 0
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f6470.6
Applied rewrites70.6%
if -2.24999999999999995e-33 < x < 3.8999999999999999e-165Initial program 72.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.2
Applied rewrites59.2%
if 1.59999999999999998e205 < x Initial program 54.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
Final simplification67.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma y x (* (- b) c)) z)))
(if (<= z -9.5e+186)
t_1
(if (<= z -7.8e-131)
(* (fma (- i) j (* z x)) y)
(if (<= z 2.4e-32)
(* (- a) (fma (- c) j (* t x)))
(if (<= z 4.9e+79) (* (fma (- i) y (* c a)) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(y, x, (-b * c)) * z;
double tmp;
if (z <= -9.5e+186) {
tmp = t_1;
} else if (z <= -7.8e-131) {
tmp = fma(-i, j, (z * x)) * y;
} else if (z <= 2.4e-32) {
tmp = -a * fma(-c, j, (t * x));
} else if (z <= 4.9e+79) {
tmp = fma(-i, y, (c * a)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(y, x, Float64(Float64(-b) * c)) * z) tmp = 0.0 if (z <= -9.5e+186) tmp = t_1; elseif (z <= -7.8e-131) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (z <= 2.4e-32) tmp = Float64(Float64(-a) * fma(Float64(-c), j, Float64(t * x))); elseif (z <= 4.9e+79) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -9.5e+186], t$95$1, If[LessEqual[z, -7.8e-131], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.4e-32], N[((-a) * N[((-c) * j + N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e+79], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-32}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(-c, j, t \cdot x\right)\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.49999999999999999e186 or 4.8999999999999999e79 < z Initial program 57.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6476.1
Applied rewrites76.1%
if -9.49999999999999999e186 < z < -7.80000000000000039e-131Initial program 80.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.6
Applied rewrites50.6%
if -7.80000000000000039e-131 < z < 2.4000000000000001e-32Initial program 78.7%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
if 2.4000000000000001e-32 < z < 4.8999999999999999e79Initial program 68.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6465.0
Applied rewrites65.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma y x (* (- b) c)) z)))
(if (<= z -9.5e+186)
t_1
(if (<= z -7.8e-131)
(* (fma (- i) j (* z x)) y)
(if (<= z 2.4e-32)
(* (fma (- t) x (* j c)) a)
(if (<= z 4.9e+79) (* (fma (- i) y (* c a)) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(y, x, (-b * c)) * z;
double tmp;
if (z <= -9.5e+186) {
tmp = t_1;
} else if (z <= -7.8e-131) {
tmp = fma(-i, j, (z * x)) * y;
} else if (z <= 2.4e-32) {
tmp = fma(-t, x, (j * c)) * a;
} else if (z <= 4.9e+79) {
tmp = fma(-i, y, (c * a)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(y, x, Float64(Float64(-b) * c)) * z) tmp = 0.0 if (z <= -9.5e+186) tmp = t_1; elseif (z <= -7.8e-131) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (z <= 2.4e-32) tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); elseif (z <= 4.9e+79) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -9.5e+186], t$95$1, If[LessEqual[z, -7.8e-131], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.4e-32], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[z, 4.9e+79], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.49999999999999999e186 or 4.8999999999999999e79 < z Initial program 57.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6476.1
Applied rewrites76.1%
if -9.49999999999999999e186 < z < -7.80000000000000039e-131Initial program 80.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.6
Applied rewrites50.6%
if -7.80000000000000039e-131 < z < 2.4000000000000001e-32Initial program 78.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6460.3
Applied rewrites60.3%
if 2.4000000000000001e-32 < z < 4.8999999999999999e79Initial program 68.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6465.0
Applied rewrites65.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma j a (* (- b) z)) c)))
(if (<= y -5.4e+104)
(* (- i) (* j y))
(if (<= y -2e-267)
t_1
(if (<= y 2.8e-229)
(* (fma i t (* (- c) z)) b)
(if (<= y 4.4e-15) t_1 (* (fma y x (* (- b) c)) z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, a, (-b * z)) * c;
double tmp;
if (y <= -5.4e+104) {
tmp = -i * (j * y);
} else if (y <= -2e-267) {
tmp = t_1;
} else if (y <= 2.8e-229) {
tmp = fma(i, t, (-c * z)) * b;
} else if (y <= 4.4e-15) {
tmp = t_1;
} else {
tmp = fma(y, x, (-b * c)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(j, a, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (y <= -5.4e+104) tmp = Float64(Float64(-i) * Float64(j * y)); elseif (y <= -2e-267) tmp = t_1; elseif (y <= 2.8e-229) tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); elseif (y <= 4.4e-15) tmp = t_1; else tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[y, -5.4e+104], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-267], t$95$1, If[LessEqual[y, 2.8e-229], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[y, 4.4e-15], t$95$1, N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+104}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-229}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\end{array}
\end{array}
if y < -5.39999999999999969e104Initial program 64.7%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6449.6
Applied rewrites49.6%
Taylor expanded in y around inf
lift-*.f6444.8
Applied rewrites44.8%
if -5.39999999999999969e104 < y < -2e-267 or 2.7999999999999999e-229 < y < 4.39999999999999971e-15Initial program 72.1%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6452.9
Applied rewrites52.9%
if -2e-267 < y < 2.7999999999999999e-229Initial program 81.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6455.9
Applied rewrites55.9%
if 4.39999999999999971e-15 < y Initial program 68.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6458.1
Applied rewrites58.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma j a (* (- b) z)) c)))
(if (<= c -2.1e-64)
t_1
(if (<= c -1.9e-225)
(* (* (- a) x) t)
(if (<= c 2.6e-216)
(* (* z x) y)
(if (<= c 4.4e-10) (* (* (- i) y) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, a, (-b * z)) * c;
double tmp;
if (c <= -2.1e-64) {
tmp = t_1;
} else if (c <= -1.9e-225) {
tmp = (-a * x) * t;
} else if (c <= 2.6e-216) {
tmp = (z * x) * y;
} else if (c <= 4.4e-10) {
tmp = (-i * y) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(j, a, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (c <= -2.1e-64) tmp = t_1; elseif (c <= -1.9e-225) tmp = Float64(Float64(Float64(-a) * x) * t); elseif (c <= 2.6e-216) tmp = Float64(Float64(z * x) * y); elseif (c <= 4.4e-10) tmp = Float64(Float64(Float64(-i) * y) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -2.1e-64], t$95$1, If[LessEqual[c, -1.9e-225], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[c, 2.6e-216], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[c, 4.4e-10], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -2.1 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -1.9 \cdot 10^{-225}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{-216}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;c \leq 4.4 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -2.10000000000000011e-64 or 4.3999999999999998e-10 < c Initial program 62.6%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6460.0
Applied rewrites60.0%
if -2.10000000000000011e-64 < c < -1.9000000000000001e-225Initial program 92.9%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites93.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6462.9
Applied rewrites62.9%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6452.5
Applied rewrites52.5%
if -1.9000000000000001e-225 < c < 2.5999999999999999e-216Initial program 77.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6465.8
Applied rewrites65.8%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6446.0
Applied rewrites46.0%
if 2.5999999999999999e-216 < c < 4.3999999999999998e-10Initial program 78.9%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in y around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6434.9
Applied rewrites34.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= z -1.62e+174) (not (<= z 5.2e+83))) (* (fma y x (* (- b) c)) z) (fma (fma (- t) x (* j c)) a (* (* z y) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((z <= -1.62e+174) || !(z <= 5.2e+83)) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = fma(fma(-t, x, (j * c)), a, ((z * y) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((z <= -1.62e+174) || !(z <= 5.2e+83)) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = fma(fma(Float64(-t), x, Float64(j * c)), a, Float64(Float64(z * y) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -1.62e+174], N[Not[LessEqual[z, 5.2e+83]], $MachinePrecision]], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a + N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{+174} \lor \neg \left(z \leq 5.2 \cdot 10^{+83}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-t, x, j \cdot c\right), a, \left(z \cdot y\right) \cdot x\right)\\
\end{array}
\end{array}
if z < -1.62000000000000007e174 or 5.2000000000000002e83 < z Initial program 57.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6475.7
Applied rewrites75.7%
if -1.62000000000000007e174 < z < 5.2000000000000002e83Initial program 77.9%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites80.1%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites72.0%
Taylor expanded in i around 0
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f6458.5
Applied rewrites58.5%
Final simplification64.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (* t x))))
(if (<= t -6e+14)
t_1
(if (<= t -2.45e-57)
(* (* z y) x)
(if (<= t 1.85e-7)
(* (* j c) a)
(if (<= t 6.2e+181) (* (* i t) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -a * (t * x);
double tmp;
if (t <= -6e+14) {
tmp = t_1;
} else if (t <= -2.45e-57) {
tmp = (z * y) * x;
} else if (t <= 1.85e-7) {
tmp = (j * c) * a;
} else if (t <= 6.2e+181) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = -a * (t * x)
if (t <= (-6d+14)) then
tmp = t_1
else if (t <= (-2.45d-57)) then
tmp = (z * y) * x
else if (t <= 1.85d-7) then
tmp = (j * c) * a
else if (t <= 6.2d+181) then
tmp = (i * t) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -a * (t * x);
double tmp;
if (t <= -6e+14) {
tmp = t_1;
} else if (t <= -2.45e-57) {
tmp = (z * y) * x;
} else if (t <= 1.85e-7) {
tmp = (j * c) * a;
} else if (t <= 6.2e+181) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -a * (t * x) tmp = 0 if t <= -6e+14: tmp = t_1 elif t <= -2.45e-57: tmp = (z * y) * x elif t <= 1.85e-7: tmp = (j * c) * a elif t <= 6.2e+181: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-a) * Float64(t * x)) tmp = 0.0 if (t <= -6e+14) tmp = t_1; elseif (t <= -2.45e-57) tmp = Float64(Float64(z * y) * x); elseif (t <= 1.85e-7) tmp = Float64(Float64(j * c) * a); elseif (t <= 6.2e+181) tmp = Float64(Float64(i * t) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -a * (t * x); tmp = 0.0; if (t <= -6e+14) tmp = t_1; elseif (t <= -2.45e-57) tmp = (z * y) * x; elseif (t <= 1.85e-7) tmp = (j * c) * a; elseif (t <= 6.2e+181) tmp = (i * t) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e+14], t$95$1, If[LessEqual[t, -2.45e-57], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.85e-7], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 6.2e+181], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{if}\;t \leq -6 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.45 \cdot 10^{-57}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-7}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+181}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6e14 or 6.19999999999999978e181 < t Initial program 59.3%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.1%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f64N/A
lower-*.f6447.2
Applied rewrites47.2%
if -6e14 < t < -2.44999999999999994e-57Initial program 75.5%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.1%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6455.7
Applied rewrites55.7%
if -2.44999999999999994e-57 < t < 1.85000000000000002e-7Initial program 81.9%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites83.6%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites75.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6435.0
Applied rewrites35.0%
if 1.85000000000000002e-7 < t < 6.19999999999999978e181Initial program 61.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.2
Applied rewrites49.2%
Taylor expanded in z around 0
lower-*.f6432.1
Applied rewrites32.1%
Final simplification40.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma j a (* (- b) z)) c)))
(if (<= c -1.18e+24)
t_1
(if (<= c -3.7e-103)
(* (fma (- i) y (* c a)) j)
(if (<= c 1.2e-6) (* (fma (- a) t (* z y)) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, a, (-b * z)) * c;
double tmp;
if (c <= -1.18e+24) {
tmp = t_1;
} else if (c <= -3.7e-103) {
tmp = fma(-i, y, (c * a)) * j;
} else if (c <= 1.2e-6) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(j, a, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (c <= -1.18e+24) tmp = t_1; elseif (c <= -3.7e-103) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); elseif (c <= 1.2e-6) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -1.18e+24], t$95$1, If[LessEqual[c, -3.7e-103], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[c, 1.2e-6], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -1.18 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.7 \cdot 10^{-103}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.17999999999999997e24 or 1.1999999999999999e-6 < c Initial program 59.1%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6464.6
Applied rewrites64.6%
if -1.17999999999999997e24 < c < -3.6999999999999999e-103Initial program 84.5%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6460.3
Applied rewrites60.3%
if -3.6999999999999999e-103 < c < 1.1999999999999999e-6Initial program 81.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6456.9
Applied rewrites56.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i t (* (- c) z)) b)))
(if (<= b -4.6e-93)
t_1
(if (<= b 7.4e-274)
(* (* y x) z)
(if (<= b 9e-39) (* (* (- i) y) j) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(i, t, (-c * z)) * b;
double tmp;
if (b <= -4.6e-93) {
tmp = t_1;
} else if (b <= 7.4e-274) {
tmp = (y * x) * z;
} else if (b <= 9e-39) {
tmp = (-i * y) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -4.6e-93) tmp = t_1; elseif (b <= 7.4e-274) tmp = Float64(Float64(y * x) * z); elseif (b <= 9e-39) tmp = Float64(Float64(Float64(-i) * y) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -4.6e-93], t$95$1, If[LessEqual[b, 7.4e-274], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[b, 9e-39], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -4.6 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-274}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;b \leq 9 \cdot 10^{-39}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.5999999999999996e-93 or 9.0000000000000002e-39 < b Initial program 70.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6453.4
Applied rewrites53.4%
if -4.5999999999999996e-93 < b < 7.39999999999999967e-274Initial program 70.2%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.5%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.7
Applied rewrites38.7%
if 7.39999999999999967e-274 < b < 9.0000000000000002e-39Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lift-*.f6451.4
Applied rewrites51.4%
Taylor expanded in y around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6444.4
Applied rewrites44.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= c -1.5e-43) (not (<= c 1.2e-6))) (* (fma j a (* (- b) z)) c) (* (fma (- a) t (* z y)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((c <= -1.5e-43) || !(c <= 1.2e-6)) {
tmp = fma(j, a, (-b * z)) * c;
} else {
tmp = fma(-a, t, (z * y)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((c <= -1.5e-43) || !(c <= 1.2e-6)) tmp = Float64(fma(j, a, Float64(Float64(-b) * z)) * c); else tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[c, -1.5e-43], N[Not[LessEqual[c, 1.2e-6]], $MachinePrecision]], N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.5 \cdot 10^{-43} \lor \neg \left(c \leq 1.2 \cdot 10^{-6}\right):\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if c < -1.50000000000000002e-43 or 1.1999999999999999e-6 < c Initial program 61.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6461.6
Applied rewrites61.6%
if -1.50000000000000002e-43 < c < 1.1999999999999999e-6Initial program 83.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6453.6
Applied rewrites53.6%
Final simplification58.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- c) z) b)))
(if (<= c -3.6e+80)
t_1
(if (<= c -1.9e-225)
(* (* (- a) x) t)
(if (<= c 5.7e+88) (* (* 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 = (-c * z) * b;
double tmp;
if (c <= -3.6e+80) {
tmp = t_1;
} else if (c <= -1.9e-225) {
tmp = (-a * x) * t;
} else if (c <= 5.7e+88) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-c * z) * b
if (c <= (-3.6d+80)) then
tmp = t_1
else if (c <= (-1.9d-225)) then
tmp = (-a * x) * t
else if (c <= 5.7d+88) then
tmp = (z * x) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-c * z) * b;
double tmp;
if (c <= -3.6e+80) {
tmp = t_1;
} else if (c <= -1.9e-225) {
tmp = (-a * x) * t;
} else if (c <= 5.7e+88) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-c * z) * b tmp = 0 if c <= -3.6e+80: tmp = t_1 elif c <= -1.9e-225: tmp = (-a * x) * t elif c <= 5.7e+88: tmp = (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(-c) * z) * b) tmp = 0.0 if (c <= -3.6e+80) tmp = t_1; elseif (c <= -1.9e-225) tmp = Float64(Float64(Float64(-a) * x) * t); elseif (c <= 5.7e+88) tmp = Float64(Float64(z * x) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-c * z) * b; tmp = 0.0; if (c <= -3.6e+80) tmp = t_1; elseif (c <= -1.9e-225) tmp = (-a * x) * t; elseif (c <= 5.7e+88) tmp = (z * x) * 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[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[c, -3.6e+80], t$95$1, If[LessEqual[c, -1.9e-225], N[(N[((-a) * x), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[c, 5.7e+88], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;c \leq -3.6 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -1.9 \cdot 10^{-225}:\\
\;\;\;\;\left(\left(-a\right) \cdot x\right) \cdot t\\
\mathbf{elif}\;c \leq 5.7 \cdot 10^{+88}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.59999999999999995e80 or 5.70000000000000021e88 < c Initial program 54.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6451.8
Applied rewrites51.8%
if -3.59999999999999995e80 < c < -1.9000000000000001e-225Initial program 82.2%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites85.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lower-*.f6445.9
Applied rewrites45.9%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6439.0
Applied rewrites39.0%
if -1.9000000000000001e-225 < c < 5.70000000000000021e88Initial program 79.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.7
Applied rewrites49.7%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6433.5
Applied rewrites33.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- c) z) b)))
(if (<= c -3.7e+80)
t_1
(if (<= c -2e-225)
(* (- a) (* t x))
(if (<= c 5.7e+88) (* (* 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 = (-c * z) * b;
double tmp;
if (c <= -3.7e+80) {
tmp = t_1;
} else if (c <= -2e-225) {
tmp = -a * (t * x);
} else if (c <= 5.7e+88) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-c * z) * b
if (c <= (-3.7d+80)) then
tmp = t_1
else if (c <= (-2d-225)) then
tmp = -a * (t * x)
else if (c <= 5.7d+88) then
tmp = (z * x) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-c * z) * b;
double tmp;
if (c <= -3.7e+80) {
tmp = t_1;
} else if (c <= -2e-225) {
tmp = -a * (t * x);
} else if (c <= 5.7e+88) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-c * z) * b tmp = 0 if c <= -3.7e+80: tmp = t_1 elif c <= -2e-225: tmp = -a * (t * x) elif c <= 5.7e+88: tmp = (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(-c) * z) * b) tmp = 0.0 if (c <= -3.7e+80) tmp = t_1; elseif (c <= -2e-225) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (c <= 5.7e+88) tmp = Float64(Float64(z * x) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-c * z) * b; tmp = 0.0; if (c <= -3.7e+80) tmp = t_1; elseif (c <= -2e-225) tmp = -a * (t * x); elseif (c <= 5.7e+88) tmp = (z * x) * 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[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[c, -3.7e+80], t$95$1, If[LessEqual[c, -2e-225], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.7e+88], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;c \leq -3.7 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -2 \cdot 10^{-225}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;c \leq 5.7 \cdot 10^{+88}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.69999999999999996e80 or 5.70000000000000021e88 < c Initial program 54.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6451.8
Applied rewrites51.8%
if -3.69999999999999996e80 < c < -1.9999999999999999e-225Initial program 82.2%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
if -1.9999999999999999e-225 < c < 5.70000000000000021e88Initial program 79.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.7
Applied rewrites49.7%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6433.5
Applied rewrites33.5%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= y -2.65e+126) (* (* z y) x) (if (<= y 4.4e-15) (* (* j c) a) (* (* y x) z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -2.65e+126) {
tmp = (z * y) * x;
} else if (y <= 4.4e-15) {
tmp = (j * c) * a;
} else {
tmp = (y * x) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (y <= (-2.65d+126)) then
tmp = (z * y) * x
else if (y <= 4.4d-15) then
tmp = (j * c) * a
else
tmp = (y * x) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -2.65e+126) {
tmp = (z * y) * x;
} else if (y <= 4.4e-15) {
tmp = (j * c) * a;
} else {
tmp = (y * x) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -2.65e+126: tmp = (z * y) * x elif y <= 4.4e-15: tmp = (j * c) * a else: tmp = (y * x) * z return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -2.65e+126) tmp = Float64(Float64(z * y) * x); elseif (y <= 4.4e-15) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(y * x) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -2.65e+126) tmp = (z * y) * x; elseif (y <= 4.4e-15) tmp = (j * c) * a; else tmp = (y * x) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -2.65e+126], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 4.4e-15], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+126}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-15}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\end{array}
\end{array}
if y < -2.65000000000000014e126Initial program 64.9%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.0%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6434.8
Applied rewrites34.8%
if -2.65000000000000014e126 < y < 4.39999999999999971e-15Initial program 73.8%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites76.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
Applied rewrites62.6%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6430.2
Applied rewrites30.2%
if 4.39999999999999971e-15 < y Initial program 68.5%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.7%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6446.1
Applied rewrites46.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6447.3
Applied rewrites47.3%
Final simplification35.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x -2.15e-154) (* (* y x) z) (* (* z y) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -2.15e-154) {
tmp = (y * x) * z;
} else {
tmp = (z * y) * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (x <= (-2.15d-154)) then
tmp = (y * x) * z
else
tmp = (z * y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -2.15e-154) {
tmp = (y * x) * z;
} else {
tmp = (z * y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -2.15e-154: tmp = (y * x) * z else: tmp = (z * y) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -2.15e-154) tmp = Float64(Float64(y * x) * z); else tmp = Float64(Float64(z * y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -2.15e-154) tmp = (y * x) * z; else tmp = (z * y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -2.15e-154], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-154}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if x < -2.14999999999999996e-154Initial program 67.2%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.6%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6428.4
Applied rewrites28.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6432.9
Applied rewrites32.9%
if -2.14999999999999996e-154 < x Initial program 73.6%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.3%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6420.7
Applied rewrites20.7%
(FPCore (x y z t a b c i j) :precision binary64 (* (* y x) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (y * x) * z;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (y * x) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (y * x) * z;
}
def code(x, y, z, t, a, b, c, i, j): return (y * x) * z
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(y * x) * z) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (y * x) * z; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot x\right) \cdot z
\end{array}
Initial program 71.1%
Taylor expanded in j around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.4%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i))))
(t_2
(+
(-
(* x (- (* y z) (* t a)))
(/
(* b (- (pow (* c z) 2.0) (pow (* t i) 2.0)))
(+ (* c z) (* t i))))
t_1)))
(if (< x -1.469694296777705e-64)
t_2
(if (< x 3.2113527362226803e-147)
(- (* (- (* b i) (* x a)) t) (- (* z (* c b)) t_1))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (pow((c * z), 2.0) - pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * ((c * a) - (y * i))
t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
if (x < (-1.469694296777705d-64)) then
tmp = t_2
else if (x < 3.2113527362226803d-147) then
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * a) - (y * i)) t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1 tmp = 0 if x < -1.469694296777705e-64: tmp = t_2 elif x < 3.2113527362226803e-147: tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1) tmp = 0.0 if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * a) - (y * i)); t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1; tmp = 0.0; if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025037
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< x -293938859355541/2000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 32113527362226803/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))