
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma i a (* (- c) z))))
(if (<=
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))
INFINITY)
(fma t_1 b (fma (fma (- a) t (* z y)) x (* (fma (- i) y (* c t)) j)))
(* t_1 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(i, a, (-c * z));
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))) <= ((double) INFINITY)) {
tmp = fma(t_1, b, fma(fma(-a, t, (z * y)), x, (fma(-i, y, (c * t)) * j)));
} else {
tmp = t_1 * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(i, a, Float64(Float64(-c) * z)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) <= Inf) tmp = fma(t_1, b, fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(fma(Float64(-i), y, Float64(c * t)) * j))); else tmp = Float64(t_1 * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * b + N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right)\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot b\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 88.8%
Taylor expanded in b around 0
Applied rewrites88.8%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6453.4
Applied rewrites53.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= j -1.12e+94) (not (<= j 0.00023))) (fma (- i) (* j y) (* t (fma (- a) x (* c j)))) (fma (fma (- a) t (* z y)) x (* (- b) (fma (- a) i (* 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 <= -1.12e+94) || !(j <= 0.00023)) {
tmp = fma(-i, (j * y), (t * fma(-a, x, (c * j))));
} else {
tmp = fma(fma(-a, t, (z * y)), x, (-b * fma(-a, i, (c * z))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((j <= -1.12e+94) || !(j <= 0.00023)) tmp = fma(Float64(-i), Float64(j * y), Float64(t * fma(Float64(-a), x, Float64(c * j)))); else tmp = fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(-b) * fma(Float64(-a), i, Float64(c * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -1.12e+94], N[Not[LessEqual[j, 0.00023]], $MachinePrecision]], N[((-i) * N[(j * y), $MachinePrecision] + N[(t * N[((-a) * x + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[((-b) * N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.12 \cdot 10^{+94} \lor \neg \left(j \leq 0.00023\right):\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t \cdot \mathsf{fma}\left(-a, x, c \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right)\\
\end{array}
\end{array}
if j < -1.11999999999999996e94 or 2.3000000000000001e-4 < j Initial program 67.7%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites59.0%
Taylor expanded in t around inf
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6469.6
Applied rewrites69.6%
if -1.11999999999999996e94 < j < 2.3000000000000001e-4Initial program 70.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 rewrites77.4%
Final simplification74.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -2e+92)
t_1
(if (<= y 2.1e-179)
(fma c (fma (- b) z (* j t)) (* x (fma (- a) t (* y z))))
(if (<= y 1.15e+62)
(fma (fma i a (* (- c) z)) b (* (- a) (* t x)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -2e+92) {
tmp = t_1;
} else if (y <= 2.1e-179) {
tmp = fma(c, fma(-b, z, (j * t)), (x * fma(-a, t, (y * z))));
} else if (y <= 1.15e+62) {
tmp = fma(fma(i, a, (-c * z)), b, (-a * (t * x)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -2e+92) tmp = t_1; elseif (y <= 2.1e-179) tmp = fma(c, fma(Float64(-b), z, Float64(j * t)), Float64(x * fma(Float64(-a), t, Float64(y * z)))); elseif (y <= 1.15e+62) tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, Float64(Float64(-a) * Float64(t * x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2e+92], t$95$1, If[LessEqual[y, 2.1e-179], N[(c * N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision] + N[(x * N[((-a) * t + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+62], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -2 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-179}:\\
\;\;\;\;\mathsf{fma}\left(c, \mathsf{fma}\left(-b, z, j \cdot t\right), x \cdot \mathsf{fma}\left(-a, t, y \cdot z\right)\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, \left(-a\right) \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.0000000000000001e92 or 1.14999999999999992e62 < y Initial program 61.6%
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-*.f6475.1
Applied rewrites75.1%
if -2.0000000000000001e92 < y < 2.0999999999999999e-179Initial program 71.2%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites78.2%
Taylor expanded in i around 0
lower-fma.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6470.4
Applied rewrites70.4%
if 2.0999999999999999e-179 < y < 1.14999999999999992e62Initial program 79.7%
Taylor expanded in b around 0
Applied rewrites83.3%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Final simplification73.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -7.1e-16) (not (<= y 1.15e+62))) (* (fma (- i) j (* z x)) y) (fma (fma i a (* (- c) z)) b (* (- a) (* t x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -7.1e-16) || !(y <= 1.15e+62)) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = fma(fma(i, a, (-c * z)), b, (-a * (t * x)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -7.1e-16) || !(y <= 1.15e+62)) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, Float64(Float64(-a) * Float64(t * x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -7.1e-16], N[Not[LessEqual[y, 1.15e+62]], $MachinePrecision]], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.1 \cdot 10^{-16} \lor \neg \left(y \leq 1.15 \cdot 10^{+62}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, \left(-a\right) \cdot \left(t \cdot x\right)\right)\\
\end{array}
\end{array}
if y < -7.1e-16 or 1.14999999999999992e62 < y Initial program 60.4%
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-*.f6472.0
Applied rewrites72.0%
if -7.1e-16 < y < 1.14999999999999992e62Initial program 76.0%
Taylor expanded in b around 0
Applied rewrites79.3%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-*.f6470.6
Applied rewrites70.6%
Final simplification71.2%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= t -2.1e+58) (not (<= t 8e+64))) (fma (- i) (* j y) (* t (fma (- a) x (* c j)))) (fma (fma i a (* (- c) z)) b (* x (* y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((t <= -2.1e+58) || !(t <= 8e+64)) {
tmp = fma(-i, (j * y), (t * fma(-a, x, (c * j))));
} else {
tmp = fma(fma(i, a, (-c * z)), b, (x * (y * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((t <= -2.1e+58) || !(t <= 8e+64)) tmp = fma(Float64(-i), Float64(j * y), Float64(t * fma(Float64(-a), x, Float64(c * j)))); else tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, Float64(x * Float64(y * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[t, -2.1e+58], N[Not[LessEqual[t, 8e+64]], $MachinePrecision]], N[((-i) * N[(j * y), $MachinePrecision] + N[(t * N[((-a) * x + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+58} \lor \neg \left(t \leq 8 \cdot 10^{+64}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, t \cdot \mathsf{fma}\left(-a, x, c \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, x \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -2.10000000000000012e58 or 8.00000000000000017e64 < t Initial program 58.3%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites63.3%
Taylor expanded in t around inf
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6474.2
Applied rewrites74.2%
if -2.10000000000000012e58 < t < 8.00000000000000017e64Initial program 76.9%
Taylor expanded in b around 0
Applied rewrites78.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6466.0
Applied rewrites66.0%
Final simplification69.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.85e+60)
(* (fma (- a) x (* j c)) t)
(if (<= t 8e+64)
(fma (fma i a (* (- c) z)) b (* x (* y z)))
(* (* (- c) (fma a (/ x c) (- j))) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -1.85e+60) {
tmp = fma(-a, x, (j * c)) * t;
} else if (t <= 8e+64) {
tmp = fma(fma(i, a, (-c * z)), b, (x * (y * z)));
} else {
tmp = (-c * fma(a, (x / c), -j)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.85e+60) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); elseif (t <= 8e+64) tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, Float64(x * Float64(y * z))); else tmp = Float64(Float64(Float64(-c) * fma(a, Float64(x / c), Float64(-j))) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.85e+60], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 8e+64], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-c) * N[(a * N[(x / c), $MachinePrecision] + (-j)), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, x \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-c\right) \cdot \mathsf{fma}\left(a, \frac{x}{c}, -j\right)\right) \cdot t\\
\end{array}
\end{array}
if t < -1.84999999999999994e60Initial program 54.8%
Taylor expanded in t 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-*.f6470.6
Applied rewrites70.6%
if -1.84999999999999994e60 < t < 8.00000000000000017e64Initial program 76.9%
Taylor expanded in b around 0
Applied rewrites78.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6466.0
Applied rewrites66.0%
if 8.00000000000000017e64 < t Initial program 61.1%
Taylor expanded in t 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-*.f6459.6
Applied rewrites59.6%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6440.3
Applied rewrites40.3%
Taylor expanded in c around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6459.7
Applied rewrites59.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= t -1.85e+60) (not (<= t 8e+64))) (* (fma (- a) x (* j c)) t) (fma (fma i a (* (- c) z)) b (* x (* y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((t <= -1.85e+60) || !(t <= 8e+64)) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = fma(fma(i, a, (-c * z)), b, (x * (y * z)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((t <= -1.85e+60) || !(t <= 8e+64)) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); else tmp = fma(fma(i, a, Float64(Float64(-c) * z)), b, Float64(x * Float64(y * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[t, -1.85e+60], N[Not[LessEqual[t, 8e+64]], $MachinePrecision]], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+60} \lor \neg \left(t \leq 8 \cdot 10^{+64}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, x \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -1.84999999999999994e60 or 8.00000000000000017e64 < t Initial program 58.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6464.4
Applied rewrites64.4%
if -1.84999999999999994e60 < t < 8.00000000000000017e64Initial program 76.9%
Taylor expanded in b around 0
Applied rewrites78.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6466.0
Applied rewrites66.0%
Final simplification65.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -5.5e+94)
(* (fma j t (* (- b) z)) c)
(if (<= c -2.3e-242)
(* (fma (- i) j (* z x)) y)
(if (<= c 2.7e-24)
(* (- a) (fma t x (* (- b) i)))
(* (fma (- b) z (* j t)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -5.5e+94) {
tmp = fma(j, t, (-b * z)) * c;
} else if (c <= -2.3e-242) {
tmp = fma(-i, j, (z * x)) * y;
} else if (c <= 2.7e-24) {
tmp = -a * fma(t, x, (-b * i));
} else {
tmp = fma(-b, z, (j * t)) * c;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -5.5e+94) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (c <= -2.3e-242) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (c <= 2.7e-24) tmp = Float64(Float64(-a) * fma(t, x, Float64(Float64(-b) * i))); else tmp = Float64(fma(Float64(-b), z, Float64(j * t)) * c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -5.5e+94], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, -2.3e-242], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[c, 2.7e-24], N[((-a) * N[(t * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.5 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;c \leq -2.3 \cdot 10^{-242}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-24}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-b, z, j \cdot t\right) \cdot c\\
\end{array}
\end{array}
if c < -5.4999999999999997e94Initial program 51.8%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6482.4
Applied rewrites82.4%
if -5.4999999999999997e94 < c < -2.29999999999999985e-242Initial program 76.4%
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-*.f6457.7
Applied rewrites57.7%
if -2.29999999999999985e-242 < c < 2.70000000000000007e-24Initial program 75.3%
Taylor expanded in a 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.f6459.0
Applied rewrites59.0%
if 2.70000000000000007e-24 < c Initial program 65.8%
Taylor expanded in y around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6461.7
Applied rewrites61.7%
Taylor expanded in c around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6464.2
Applied rewrites64.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -6e+93)
(* (* (- i) j) y)
(if (or (<= y -0.000155) (not (<= y 1.05e+49)))
(* (fma y x (* (- b) c)) z)
(* (fma i a (* (- c) z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -6e+93) {
tmp = (-i * j) * y;
} else if ((y <= -0.000155) || !(y <= 1.05e+49)) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = fma(i, a, (-c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -6e+93) tmp = Float64(Float64(Float64(-i) * j) * y); elseif ((y <= -0.000155) || !(y <= 1.05e+49)) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -6e+93], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[Or[LessEqual[y, -0.000155], N[Not[LessEqual[y, 1.05e+49]], $MachinePrecision]], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+93}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;y \leq -0.000155 \lor \neg \left(y \leq 1.05 \cdot 10^{+49}\right):\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if y < -5.99999999999999957e93Initial program 62.1%
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-*.f6474.4
Applied rewrites74.4%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6456.1
Applied rewrites56.1%
if -5.99999999999999957e93 < y < -1.55e-4 or 1.05000000000000005e49 < y Initial program 60.7%
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.f6461.5
Applied rewrites61.5%
if -1.55e-4 < y < 1.05000000000000005e49Initial program 75.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6455.2
Applied rewrites55.2%
Final simplification56.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -1.55e+95)
(* (* (- i) j) y)
(if (<= y 2.8e-299)
(* (fma j t (* (- b) z)) c)
(if (<= y 1.25e+74) (* (fma i a (* (- c) z)) b) (* (* 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 (y <= -1.55e+95) {
tmp = (-i * j) * y;
} else if (y <= 2.8e-299) {
tmp = fma(j, t, (-b * z)) * c;
} else if (y <= 1.25e+74) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = (z * y) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -1.55e+95) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (y <= 2.8e-299) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (y <= 1.25e+74) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = Float64(Float64(z * y) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -1.55e+95], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 2.8e-299], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 1.25e+74], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+95}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-299}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if y < -1.5500000000000001e95Initial program 62.1%
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-*.f6474.4
Applied rewrites74.4%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6456.1
Applied rewrites56.1%
if -1.5500000000000001e95 < y < 2.8000000000000001e-299Initial program 68.7%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6454.8
Applied rewrites54.8%
if 2.8000000000000001e-299 < y < 1.24999999999999991e74Initial program 79.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6455.7
Applied rewrites55.7%
if 1.24999999999999991e74 < y Initial program 58.4%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites58.7%
Taylor expanded in i around 0
lower-fma.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6448.1
Applied rewrites48.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6447.6
Applied rewrites47.6%
Final simplification54.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -5e+20)
(* (* z x) y)
(if (<= y -5.2e-49)
(* (* b a) i)
(if (<= y 1.8e-239)
(* (- a) (* t x))
(if (<= y 1.05e+74) (* (* a i) b) (* (* 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 (y <= -5e+20) {
tmp = (z * x) * y;
} else if (y <= -5.2e-49) {
tmp = (b * a) * i;
} else if (y <= 1.8e-239) {
tmp = -a * (t * x);
} else if (y <= 1.05e+74) {
tmp = (a * i) * b;
} 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 (y <= (-5d+20)) then
tmp = (z * x) * y
else if (y <= (-5.2d-49)) then
tmp = (b * a) * i
else if (y <= 1.8d-239) then
tmp = -a * (t * x)
else if (y <= 1.05d+74) then
tmp = (a * i) * b
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 (y <= -5e+20) {
tmp = (z * x) * y;
} else if (y <= -5.2e-49) {
tmp = (b * a) * i;
} else if (y <= 1.8e-239) {
tmp = -a * (t * x);
} else if (y <= 1.05e+74) {
tmp = (a * i) * b;
} else {
tmp = (z * y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -5e+20: tmp = (z * x) * y elif y <= -5.2e-49: tmp = (b * a) * i elif y <= 1.8e-239: tmp = -a * (t * x) elif y <= 1.05e+74: tmp = (a * i) * b else: tmp = (z * y) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -5e+20) tmp = Float64(Float64(z * x) * y); elseif (y <= -5.2e-49) tmp = Float64(Float64(b * a) * i); elseif (y <= 1.8e-239) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (y <= 1.05e+74) tmp = Float64(Float64(a * i) * b); 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 (y <= -5e+20) tmp = (z * x) * y; elseif (y <= -5.2e-49) tmp = (b * a) * i; elseif (y <= 1.8e-239) tmp = -a * (t * x); elseif (y <= 1.05e+74) tmp = (a * i) * b; else tmp = (z * y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -5e+20], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -5.2e-49], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[y, 1.8e-239], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+74], N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+20}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-49}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-239}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+74}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if y < -5e20Initial program 63.6%
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-*.f6473.7
Applied rewrites73.7%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6436.0
Applied rewrites36.0%
if -5e20 < y < -5.1999999999999999e-49Initial program 57.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.3
Applied rewrites58.3%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6451.9
Applied rewrites51.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.9
Applied rewrites51.9%
if -5.1999999999999999e-49 < y < 1.8000000000000001e-239Initial program 74.2%
Taylor expanded in t 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-*.f6453.1
Applied rewrites53.1%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
if 1.8000000000000001e-239 < y < 1.0499999999999999e74Initial program 78.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.9
Applied rewrites58.9%
Taylor expanded in z around 0
lower-*.f6431.4
Applied rewrites31.4%
if 1.0499999999999999e74 < y Initial program 58.4%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites58.7%
Taylor expanded in i around 0
lower-fma.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6448.1
Applied rewrites48.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6447.6
Applied rewrites47.6%
Final simplification38.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -4.8e+21) (not (<= y 9.8e+43))) (* (fma (- i) j (* z x)) y) (* (fma i a (* (- c) z)) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -4.8e+21) || !(y <= 9.8e+43)) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = fma(i, a, (-c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -4.8e+21) || !(y <= 9.8e+43)) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); else tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -4.8e+21], N[Not[LessEqual[y, 9.8e+43]], $MachinePrecision]], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+21} \lor \neg \left(y \leq 9.8 \cdot 10^{+43}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if y < -4.8e21 or 9.7999999999999999e43 < y Initial program 62.9%
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-*.f6472.2
Applied rewrites72.2%
if -4.8e21 < y < 9.7999999999999999e43Initial program 74.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6454.8
Applied rewrites54.8%
Final simplification61.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= t -6e+59) (not (<= t 75000000000000.0))) (* (fma (- a) x (* j c)) t) (* (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 tmp;
if ((t <= -6e+59) || !(t <= 75000000000000.0)) {
tmp = fma(-a, x, (j * c)) * t;
} else {
tmp = fma(y, x, (-b * c)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((t <= -6e+59) || !(t <= 75000000000000.0)) tmp = Float64(fma(Float64(-a), x, Float64(j * c)) * t); 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_] := If[Or[LessEqual[t, -6e+59], N[Not[LessEqual[t, 75000000000000.0]], $MachinePrecision]], N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+59} \lor \neg \left(t \leq 75000000000000\right):\\
\;\;\;\;\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\end{array}
\end{array}
if t < -6.0000000000000001e59 or 7.5e13 < t Initial program 59.0%
Taylor expanded in t 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-*.f6462.8
Applied rewrites62.8%
if -6.0000000000000001e59 < t < 7.5e13Initial program 77.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.f6456.3
Applied rewrites56.3%
Final simplification59.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- c) z) b)))
(if (<= c -5.8e+34)
t_1
(if (<= c -4.2e-246)
(* (* (- i) j) y)
(if (<= c 3e-24) (* (* a i) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-c * z) * b;
double tmp;
if (c <= -5.8e+34) {
tmp = t_1;
} else if (c <= -4.2e-246) {
tmp = (-i * j) * y;
} else if (c <= 3e-24) {
tmp = (a * i) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-c * z) * b
if (c <= (-5.8d+34)) then
tmp = t_1
else if (c <= (-4.2d-246)) then
tmp = (-i * j) * y
else if (c <= 3d-24) then
tmp = (a * i) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-c * z) * b;
double tmp;
if (c <= -5.8e+34) {
tmp = t_1;
} else if (c <= -4.2e-246) {
tmp = (-i * j) * y;
} else if (c <= 3e-24) {
tmp = (a * i) * b;
} 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 <= -5.8e+34: tmp = t_1 elif c <= -4.2e-246: tmp = (-i * j) * y elif c <= 3e-24: tmp = (a * i) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-c) * z) * b) tmp = 0.0 if (c <= -5.8e+34) tmp = t_1; elseif (c <= -4.2e-246) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (c <= 3e-24) tmp = Float64(Float64(a * i) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-c * z) * b; tmp = 0.0; if (c <= -5.8e+34) tmp = t_1; elseif (c <= -4.2e-246) tmp = (-i * j) * y; elseif (c <= 3e-24) tmp = (a * i) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[c, -5.8e+34], t$95$1, If[LessEqual[c, -4.2e-246], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[c, 3e-24], N[(N[(a * i), $MachinePrecision] * b), $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 -5.8 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -4.2 \cdot 10^{-246}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-24}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -5.8000000000000003e34 or 2.99999999999999995e-24 < c Initial program 60.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6460.7
Applied rewrites60.7%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6451.2
Applied rewrites51.2%
if -5.8000000000000003e34 < c < -4.19999999999999989e-246Initial program 77.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-*.f6456.8
Applied rewrites56.8%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6436.6
Applied rewrites36.6%
if -4.19999999999999989e-246 < c < 2.99999999999999995e-24Initial program 75.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6442.0
Applied rewrites42.0%
Taylor expanded in z around 0
lower-*.f6437.1
Applied rewrites37.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= c -2.05e+124) (* (fma j t (* (- b) z)) c) (if (<= c 8e-122) (* (fma (- a) t (* z y)) x) (* (fma i a (* (- c) z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -2.05e+124) {
tmp = fma(j, t, (-b * z)) * c;
} else if (c <= 8e-122) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = fma(i, a, (-c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -2.05e+124) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); elseif (c <= 8e-122) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -2.05e+124], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 8e-122], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.05 \cdot 10^{+124}:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;c \leq 8 \cdot 10^{-122}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if c < -2.05000000000000001e124Initial program 47.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6487.7
Applied rewrites87.7%
if -2.05000000000000001e124 < c < 8.00000000000000047e-122Initial program 77.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-*.f6444.9
Applied rewrites44.9%
if 8.00000000000000047e-122 < c Initial program 67.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.3
Applied rewrites58.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* c j) t)))
(if (<= c -6.8e+169)
t_1
(if (<= c -3.1e-242)
(* (* z x) y)
(if (<= c 8e+208) (* (* a i) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (c <= -6.8e+169) {
tmp = t_1;
} else if (c <= -3.1e-242) {
tmp = (z * x) * y;
} else if (c <= 8e+208) {
tmp = (a * i) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (c * j) * t
if (c <= (-6.8d+169)) then
tmp = t_1
else if (c <= (-3.1d-242)) then
tmp = (z * x) * y
else if (c <= 8d+208) then
tmp = (a * i) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (c <= -6.8e+169) {
tmp = t_1;
} else if (c <= -3.1e-242) {
tmp = (z * x) * y;
} else if (c <= 8e+208) {
tmp = (a * i) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * t tmp = 0 if c <= -6.8e+169: tmp = t_1 elif c <= -3.1e-242: tmp = (z * x) * y elif c <= 8e+208: tmp = (a * i) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * t) tmp = 0.0 if (c <= -6.8e+169) tmp = t_1; elseif (c <= -3.1e-242) tmp = Float64(Float64(z * x) * y); elseif (c <= 8e+208) tmp = Float64(Float64(a * i) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * t; tmp = 0.0; if (c <= -6.8e+169) tmp = t_1; elseif (c <= -3.1e-242) tmp = (z * x) * y; elseif (c <= 8e+208) tmp = (a * i) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[c, -6.8e+169], t$95$1, If[LessEqual[c, -3.1e-242], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[c, 8e+208], N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot t\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.1 \cdot 10^{-242}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;c \leq 8 \cdot 10^{+208}:\\
\;\;\;\;\left(a \cdot i\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -6.80000000000000056e169 or 7.9999999999999999e208 < c Initial program 45.4%
Taylor expanded in t 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-*.f6456.6
Applied rewrites56.6%
Taylor expanded in x around 0
lower-*.f6448.2
Applied rewrites48.2%
if -6.80000000000000056e169 < c < -3.10000000000000015e-242Initial program 77.1%
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-*.f6452.3
Applied rewrites52.3%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6429.6
Applied rewrites29.6%
if -3.10000000000000015e-242 < c < 7.9999999999999999e208Initial program 73.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6447.9
Applied rewrites47.9%
Taylor expanded in z around 0
lower-*.f6432.3
Applied rewrites32.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= t -2.1e+100) (not (<= t 4e+32))) (* (- a) (* t x)) (* (* (- b) z) c)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((t <= -2.1e+100) || !(t <= 4e+32)) {
tmp = -a * (t * x);
} else {
tmp = (-b * z) * c;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((t <= (-2.1d+100)) .or. (.not. (t <= 4d+32))) then
tmp = -a * (t * x)
else
tmp = (-b * z) * c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((t <= -2.1e+100) || !(t <= 4e+32)) {
tmp = -a * (t * x);
} else {
tmp = (-b * z) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (t <= -2.1e+100) or not (t <= 4e+32): tmp = -a * (t * x) else: tmp = (-b * z) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((t <= -2.1e+100) || !(t <= 4e+32)) tmp = Float64(Float64(-a) * Float64(t * x)); else tmp = Float64(Float64(Float64(-b) * z) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((t <= -2.1e+100) || ~((t <= 4e+32))) tmp = -a * (t * x); else tmp = (-b * z) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[t, -2.1e+100], N[Not[LessEqual[t, 4e+32]], $MachinePrecision]], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(N[((-b) * z), $MachinePrecision] * c), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+100} \lor \neg \left(t \leq 4 \cdot 10^{+32}\right):\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-b\right) \cdot z\right) \cdot c\\
\end{array}
\end{array}
if t < -2.0999999999999999e100 or 4.00000000000000021e32 < t Initial program 59.6%
Taylor expanded in t 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-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-*.f6447.2
Applied rewrites47.2%
if -2.0999999999999999e100 < t < 4.00000000000000021e32Initial program 76.2%
Taylor expanded in y around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6473.1
Applied rewrites73.1%
Taylor expanded in c around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-outN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f6441.5
Applied rewrites41.5%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6435.8
Applied rewrites35.8%
Final simplification40.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= t -1.8e+100) (not (<= t 4e+32))) (* (- a) (* t x)) (* (* (- c) z) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((t <= -1.8e+100) || !(t <= 4e+32)) {
tmp = -a * (t * x);
} else {
tmp = (-c * z) * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((t <= (-1.8d+100)) .or. (.not. (t <= 4d+32))) then
tmp = -a * (t * x)
else
tmp = (-c * z) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((t <= -1.8e+100) || !(t <= 4e+32)) {
tmp = -a * (t * x);
} else {
tmp = (-c * z) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (t <= -1.8e+100) or not (t <= 4e+32): tmp = -a * (t * x) else: tmp = (-c * z) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((t <= -1.8e+100) || !(t <= 4e+32)) tmp = Float64(Float64(-a) * Float64(t * x)); else tmp = Float64(Float64(Float64(-c) * z) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((t <= -1.8e+100) || ~((t <= 4e+32))) tmp = -a * (t * x); else tmp = (-c * z) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[t, -1.8e+100], N[Not[LessEqual[t, 4e+32]], $MachinePrecision]], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+100} \lor \neg \left(t \leq 4 \cdot 10^{+32}\right):\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if t < -1.8e100 or 4.00000000000000021e32 < t Initial program 59.6%
Taylor expanded in t 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-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-*.f6447.2
Applied rewrites47.2%
if -1.8e100 < t < 4.00000000000000021e32Initial program 76.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6452.7
Applied rewrites52.7%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6435.3
Applied rewrites35.3%
Final simplification40.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= j 2.7e+137) (* (fma i a (* (- c) z)) b) (* (* (- i) j) y)))
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.7e+137) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = (-i * j) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= 2.7e+137) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = Float64(Float64(Float64(-i) * j) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, 2.7e+137], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq 2.7 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if j < 2.70000000000000017e137Initial program 69.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.7
Applied rewrites49.7%
if 2.70000000000000017e137 < j Initial program 71.4%
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-*.f6462.6
Applied rewrites62.6%
Taylor expanded in x around 0
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lift-neg.f6455.8
Applied rewrites55.8%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -5e+20) (not (<= y 1.05e+74))) (* (* z y) x) (* (* b a) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -5e+20) || !(y <= 1.05e+74)) {
tmp = (z * y) * x;
} else {
tmp = (b * a) * i;
}
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 <= (-5d+20)) .or. (.not. (y <= 1.05d+74))) then
tmp = (z * y) * x
else
tmp = (b * a) * i
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 <= -5e+20) || !(y <= 1.05e+74)) {
tmp = (z * y) * x;
} else {
tmp = (b * a) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (y <= -5e+20) or not (y <= 1.05e+74): tmp = (z * y) * x else: tmp = (b * a) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -5e+20) || !(y <= 1.05e+74)) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(b * a) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((y <= -5e+20) || ~((y <= 1.05e+74))) tmp = (z * y) * x; else tmp = (b * a) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -5e+20], N[Not[LessEqual[y, 1.05e+74]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+20} \lor \neg \left(y \leq 1.05 \cdot 10^{+74}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\end{array}
\end{array}
if y < -5e20 or 1.0499999999999999e74 < y Initial program 61.2%
Taylor expanded in c around 0
associate--l+N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites64.7%
Taylor expanded in i around 0
lower-fma.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-*.f6451.8
Applied rewrites51.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6441.2
Applied rewrites41.2%
if -5e20 < y < 1.0499999999999999e74Initial program 74.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6453.7
Applied rewrites53.7%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6425.3
Applied rewrites25.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6426.9
Applied rewrites26.9%
Final simplification32.2%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= i -6e-23) (not (<= i 1.32e+115))) (* (* b a) i) (* c (* j t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -6e-23) || !(i <= 1.32e+115)) {
tmp = (b * a) * i;
} else {
tmp = c * (j * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((i <= (-6d-23)) .or. (.not. (i <= 1.32d+115))) then
tmp = (b * a) * i
else
tmp = c * (j * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((i <= -6e-23) || !(i <= 1.32e+115)) {
tmp = (b * a) * i;
} else {
tmp = c * (j * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (i <= -6e-23) or not (i <= 1.32e+115): tmp = (b * a) * i else: tmp = c * (j * t) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((i <= -6e-23) || !(i <= 1.32e+115)) tmp = Float64(Float64(b * a) * i); else tmp = Float64(c * Float64(j * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((i <= -6e-23) || ~((i <= 1.32e+115))) tmp = (b * a) * i; else tmp = c * (j * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -6e-23], N[Not[LessEqual[i, 1.32e+115]], $MachinePrecision]], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6 \cdot 10^{-23} \lor \neg \left(i \leq 1.32 \cdot 10^{+115}\right):\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\end{array}
\end{array}
if i < -6.00000000000000006e-23 or 1.32e115 < i Initial program 56.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6454.2
Applied rewrites54.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.4
Applied rewrites43.4%
if -6.00000000000000006e-23 < i < 1.32e115Initial program 77.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6444.5
Applied rewrites44.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.8
Applied rewrites22.8%
Final simplification30.0%
(FPCore (x y z t a b c i j) :precision binary64 (* (* b a) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * a) * 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 = (b * a) * 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 (b * a) * i;
}
def code(x, y, z, t, a, b, c, i, j): return (b * a) * i
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(b * a) * i) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (b * a) * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot a\right) \cdot i
\end{array}
Initial program 69.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6444.5
Applied rewrites44.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6421.2
Applied rewrites21.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* b i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (b * 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 = a * (b * 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 a * (b * i);
}
def code(x, y, z, t, a, b, c, i, j): return a * (b * i)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(b * i)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (b * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(b \cdot i\right)
\end{array}
Initial program 69.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6444.5
Applied rewrites44.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6421.2
Applied rewrites21.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(/
(* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
(+ (* c t) (* i y)))))
(t_2
(-
(* x (- (* z y) (* a t)))
(- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
(if (< t -8.120978919195912e-33)
t_2
(if (< t -4.712553818218485e-169)
t_1
(if (< t -7.633533346031584e-308)
t_2
(if (< t 1.0535888557455487e-139) 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
if (t < (-8.120978919195912d-33)) then
tmp = t_2
else if (t < (-4.712553818218485d-169)) then
tmp = t_1
else if (t < (-7.633533346031584d-308)) then
tmp = t_2
else if (t < 1.0535888557455487d-139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y))) t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)) tmp = 0 if t < -8.120978919195912e-33: tmp = t_2 elif t < -4.712553818218485e-169: tmp = t_1 elif t < -7.633533346031584e-308: tmp = t_2 elif t < 1.0535888557455487e-139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y)))) t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j))) tmp = 0.0 if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y))); t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)); tmp = 0.0; if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\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 - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025051
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))