
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* (fma (- i) y (* c a)) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-i, y, (c * a)) * j;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 89.6%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in j around inf
Applied rewrites54.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))))
(if (<= (+ t_1 (* j (- (* c a) (* y i)))) INFINITY)
(+ t_1 (* (* j c) a))
(* (fma (- i) y (* c a)) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)));
double tmp;
if ((t_1 + (j * ((c * a) - (y * i)))) <= ((double) INFINITY)) {
tmp = t_1 + ((j * c) * a);
} else {
tmp = fma(-i, y, (c * a)) * j;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) tmp = 0.0 if (Float64(t_1 + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) <= Inf) tmp = Float64(t_1 + Float64(Float64(j * c) * a)); else tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\
\mathbf{if}\;t\_1 + j \cdot \left(c \cdot a - y \cdot i\right) \leq \infty:\\
\;\;\;\;t\_1 + \left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites81.8%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in j around inf
Applied rewrites54.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= i -6e+70) (not (<= i 4e+197))) (* (fma (- y) j (* b t)) i) (fma (fma (- t) a (* z y)) x (* (fma (- z) b (* j a)) c))))
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+70) || !(i <= 4e+197)) {
tmp = fma(-y, j, (b * t)) * i;
} else {
tmp = fma(fma(-t, a, (z * y)), x, (fma(-z, b, (j * a)) * c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((i <= -6e+70) || !(i <= 4e+197)) tmp = Float64(fma(Float64(-y), j, Float64(b * t)) * i); else tmp = fma(fma(Float64(-t), a, Float64(z * y)), x, Float64(fma(Float64(-z), b, Float64(j * a)) * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[i, -6e+70], N[Not[LessEqual[i, 4e+197]], $MachinePrecision]], N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6 \cdot 10^{+70} \lor \neg \left(i \leq 4 \cdot 10^{+197}\right):\\
\;\;\;\;\mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-t, a, z \cdot y\right), x, \mathsf{fma}\left(-z, b, j \cdot a\right) \cdot c\right)\\
\end{array}
\end{array}
if i < -5.99999999999999952e70 or 3.9999999999999998e197 < i Initial program 61.4%
Taylor expanded in i around inf
Applied rewrites74.6%
if -5.99999999999999952e70 < i < 3.9999999999999998e197Initial program 81.4%
Taylor expanded in i around 0
Applied rewrites76.8%
Final simplification76.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) a (* z y)) x)))
(if (<= x -1.55e+83)
t_1
(if (<= x -6e-55)
(* (fma (- a) x (* i b)) t)
(if (<= x -2.5e-226)
(* (fma (- z) b (* j a)) c)
(if (<= x 6.2e-253)
(* (fma (- y) j (* b t)) i)
(if (<= x 2.05e-17) (* (fma (- i) y (* c a)) j) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-t, a, (z * y)) * x;
double tmp;
if (x <= -1.55e+83) {
tmp = t_1;
} else if (x <= -6e-55) {
tmp = fma(-a, x, (i * b)) * t;
} else if (x <= -2.5e-226) {
tmp = fma(-z, b, (j * a)) * c;
} else if (x <= 6.2e-253) {
tmp = fma(-y, j, (b * t)) * i;
} else if (x <= 2.05e-17) {
tmp = fma(-i, y, (c * a)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), a, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.55e+83) tmp = t_1; elseif (x <= -6e-55) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); elseif (x <= -2.5e-226) tmp = Float64(fma(Float64(-z), b, Float64(j * a)) * c); elseif (x <= 6.2e-253) tmp = Float64(fma(Float64(-y), j, Float64(b * t)) * i); elseif (x <= 2.05e-17) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.55e+83], t$95$1, If[LessEqual[x, -6e-55], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, -2.5e-226], N[(N[((-z) * b + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 6.2e-253], N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, 2.05e-17], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-226}:\\
\;\;\;\;\mathsf{fma}\left(-z, b, j \cdot a\right) \cdot c\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-253}:\\
\;\;\;\;\mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.54999999999999996e83 or 2.05e-17 < x Initial program 78.5%
Taylor expanded in x around inf
Applied rewrites72.5%
if -1.54999999999999996e83 < x < -6.00000000000000033e-55Initial program 66.3%
Taylor expanded in t around inf
Applied rewrites53.2%
if -6.00000000000000033e-55 < x < -2.4999999999999999e-226Initial program 80.4%
Taylor expanded in c around inf
Applied rewrites61.5%
if -2.4999999999999999e-226 < x < 6.19999999999999991e-253Initial program 64.5%
Taylor expanded in i around inf
Applied rewrites68.8%
if 6.19999999999999991e-253 < x < 2.05e-17Initial program 79.2%
Taylor expanded in j around inf
Applied rewrites60.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) a (* z y)) x)))
(if (<= x -1.55e+83)
t_1
(if (<= x -6e-55)
(* (fma (- a) x (* i b)) t)
(if (<= x -2.5e-226)
(* (fma j a (* (- z) b)) c)
(if (<= x 6.2e-253)
(* (fma (- y) j (* b t)) i)
(if (<= x 2.05e-17) (* (fma (- i) y (* c a)) j) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-t, a, (z * y)) * x;
double tmp;
if (x <= -1.55e+83) {
tmp = t_1;
} else if (x <= -6e-55) {
tmp = fma(-a, x, (i * b)) * t;
} else if (x <= -2.5e-226) {
tmp = fma(j, a, (-z * b)) * c;
} else if (x <= 6.2e-253) {
tmp = fma(-y, j, (b * t)) * i;
} else if (x <= 2.05e-17) {
tmp = fma(-i, y, (c * a)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), a, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.55e+83) tmp = t_1; elseif (x <= -6e-55) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); elseif (x <= -2.5e-226) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); elseif (x <= 6.2e-253) tmp = Float64(fma(Float64(-y), j, Float64(b * t)) * i); elseif (x <= 2.05e-17) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.55e+83], t$95$1, If[LessEqual[x, -6e-55], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, -2.5e-226], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 6.2e-253], N[(N[((-y) * j + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[x, 2.05e-17], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-226}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-253}:\\
\;\;\;\;\mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.54999999999999996e83 or 2.05e-17 < x Initial program 78.5%
Taylor expanded in x around inf
Applied rewrites72.5%
if -1.54999999999999996e83 < x < -6.00000000000000033e-55Initial program 66.3%
Taylor expanded in t around inf
Applied rewrites53.2%
if -6.00000000000000033e-55 < x < -2.4999999999999999e-226Initial program 80.4%
Taylor expanded in z around inf
Applied rewrites74.0%
Taylor expanded in c around inf
Applied rewrites61.5%
if -2.4999999999999999e-226 < x < 6.19999999999999991e-253Initial program 64.5%
Taylor expanded in i around inf
Applied rewrites68.8%
if 6.19999999999999991e-253 < x < 2.05e-17Initial program 79.2%
Taylor expanded in j around inf
Applied rewrites60.8%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -3.3e+72)
(* (* (fma b (/ i a) (- x)) a) t)
(if (<= t 7.2e+78)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(* (fma (- a) x (* i b)) 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 <= -3.3e+72) {
tmp = (fma(b, (i / a), -x) * a) * t;
} else if (t <= 7.2e+78) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else {
tmp = fma(-a, x, (i * b)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -3.3e+72) tmp = Float64(Float64(fma(b, Float64(i / a), Float64(-x)) * a) * t); elseif (t <= 7.2e+78) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -3.3e+72], N[(N[(N[(b * N[(i / a), $MachinePrecision] + (-x)), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 7.2e+78], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+72}:\\
\;\;\;\;\left(\mathsf{fma}\left(b, \frac{i}{a}, -x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+78}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\end{array}
\end{array}
if t < -3.3e72Initial program 73.0%
Taylor expanded in t around inf
Applied rewrites66.9%
Taylor expanded in a around inf
Applied rewrites68.7%
if -3.3e72 < t < 7.20000000000000039e78Initial program 80.3%
Taylor expanded in z around inf
Applied rewrites79.0%
Taylor expanded in y around inf
Applied rewrites68.0%
if 7.20000000000000039e78 < t Initial program 64.0%
Taylor expanded in t around inf
Applied rewrites65.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -3.5e+72)
(* (* (fma b (/ i a) (- x)) a) t)
(if (<= t 7.2e+78)
(+ (* (* z x) y) (* j (- (* c a) (* y i))))
(* (fma (- a) x (* i b)) 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 <= -3.5e+72) {
tmp = (fma(b, (i / a), -x) * a) * t;
} else if (t <= 7.2e+78) {
tmp = ((z * x) * y) + (j * ((c * a) - (y * i)));
} else {
tmp = fma(-a, x, (i * b)) * t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -3.5e+72) tmp = Float64(Float64(fma(b, Float64(i / a), Float64(-x)) * a) * t); elseif (t <= 7.2e+78) tmp = Float64(Float64(Float64(z * x) * y) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -3.5e+72], N[(N[(N[(b * N[(i / a), $MachinePrecision] + (-x)), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 7.2e+78], N[(N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+72}:\\
\;\;\;\;\left(\mathsf{fma}\left(b, \frac{i}{a}, -x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+78}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\end{array}
\end{array}
if t < -3.5000000000000001e72Initial program 73.0%
Taylor expanded in t around inf
Applied rewrites66.9%
Taylor expanded in a around inf
Applied rewrites68.7%
if -3.5000000000000001e72 < t < 7.20000000000000039e78Initial program 80.3%
Taylor expanded in y around inf
Applied rewrites67.4%
if 7.20000000000000039e78 < t Initial program 64.0%
Taylor expanded in t around inf
Applied rewrites65.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) x (* j c)) a)) (t_2 (* (fma (- j) i (* z x)) y)))
(if (<= y -1.95e+84)
t_2
(if (<= y -1.02e-205)
t_1
(if (<= y 3.5e-200)
(* (fma j a (* (- z) b)) c)
(if (<= y 1.85e-29) 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 = fma(-t, x, (j * c)) * a;
double t_2 = fma(-j, i, (z * x)) * y;
double tmp;
if (y <= -1.95e+84) {
tmp = t_2;
} else if (y <= -1.02e-205) {
tmp = t_1;
} else if (y <= 3.5e-200) {
tmp = fma(j, a, (-z * b)) * c;
} else if (y <= 1.85e-29) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), x, Float64(j * c)) * a) t_2 = Float64(fma(Float64(-j), i, Float64(z * x)) * y) tmp = 0.0 if (y <= -1.95e+84) tmp = t_2; elseif (y <= -1.02e-205) tmp = t_1; elseif (y <= 3.5e-200) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); elseif (y <= 1.85e-29) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.95e+84], t$95$2, If[LessEqual[y, -1.02e-205], t$95$1, If[LessEqual[y, 3.5e-200], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 1.85e-29], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
t_2 := \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-200}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.95000000000000008e84 or 1.8499999999999999e-29 < y Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites67.8%
if -1.95000000000000008e84 < y < -1.02000000000000001e-205 or 3.50000000000000023e-200 < y < 1.8499999999999999e-29Initial program 74.6%
Taylor expanded in a around inf
Applied rewrites57.5%
if -1.02000000000000001e-205 < y < 3.50000000000000023e-200Initial program 84.7%
Taylor expanded in z around inf
Applied rewrites84.7%
Taylor expanded in c around inf
Applied rewrites63.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- t) a (* z y)) x)))
(if (<= x -1.55e+83)
t_1
(if (<= x -6e-55)
(* (fma (- a) x (* i b)) t)
(if (<= x -3.5e-229)
(* (fma j a (* (- z) b)) c)
(if (<= x 2.05e-17) (* (fma (- i) y (* c a)) j) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-t, a, (z * y)) * x;
double tmp;
if (x <= -1.55e+83) {
tmp = t_1;
} else if (x <= -6e-55) {
tmp = fma(-a, x, (i * b)) * t;
} else if (x <= -3.5e-229) {
tmp = fma(j, a, (-z * b)) * c;
} else if (x <= 2.05e-17) {
tmp = fma(-i, y, (c * a)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-t), a, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.55e+83) tmp = t_1; elseif (x <= -6e-55) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); elseif (x <= -3.5e-229) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); elseif (x <= 2.05e-17) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.55e+83], t$95$1, If[LessEqual[x, -6e-55], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, -3.5e-229], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[x, 2.05e-17], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-229}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.54999999999999996e83 or 2.05e-17 < x Initial program 78.5%
Taylor expanded in x around inf
Applied rewrites72.5%
if -1.54999999999999996e83 < x < -6.00000000000000033e-55Initial program 66.3%
Taylor expanded in t around inf
Applied rewrites53.2%
if -6.00000000000000033e-55 < x < -3.5000000000000003e-229Initial program 81.1%
Taylor expanded in z around inf
Applied rewrites71.6%
Taylor expanded in c around inf
Applied rewrites59.5%
if -3.5000000000000003e-229 < x < 2.05e-17Initial program 74.4%
Taylor expanded in j around inf
Applied rewrites55.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- j) i (* z x)) y)))
(if (<= y -1e+74)
t_1
(if (<= y -1e+18)
(* (fma (- a) x (* i b)) t)
(if (<= y 7.5e-37) (* (fma j a (* (- z) b)) c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-j, i, (z * x)) * y;
double tmp;
if (y <= -1e+74) {
tmp = t_1;
} else if (y <= -1e+18) {
tmp = fma(-a, x, (i * b)) * t;
} else if (y <= 7.5e-37) {
tmp = fma(j, a, (-z * b)) * c;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-j), i, Float64(z * x)) * y) tmp = 0.0 if (y <= -1e+74) tmp = t_1; elseif (y <= -1e+18) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); elseif (y <= 7.5e-37) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1e+74], t$95$1, If[LessEqual[y, -1e+18], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 7.5e-37], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.99999999999999952e73 or 7.5000000000000004e-37 < y Initial program 72.3%
Taylor expanded in y around inf
Applied rewrites65.7%
if -9.99999999999999952e73 < y < -1e18Initial program 78.7%
Taylor expanded in t around inf
Applied rewrites78.9%
if -1e18 < y < 7.5000000000000004e-37Initial program 79.6%
Taylor expanded in z around inf
Applied rewrites78.7%
Taylor expanded in c around inf
Applied rewrites55.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- c) b (* y x)) z)))
(if (<= z -7.5e+135)
t_1
(if (<= z -8.5e-86)
(* (fma (- a) x (* i b)) t)
(if (<= z 3.4e+58) (* (fma (- i) y (* c a)) j) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-c, b, (y * x)) * z;
double tmp;
if (z <= -7.5e+135) {
tmp = t_1;
} else if (z <= -8.5e-86) {
tmp = fma(-a, x, (i * b)) * t;
} else if (z <= 3.4e+58) {
tmp = fma(-i, y, (c * a)) * j;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-c), b, Float64(y * x)) * z) tmp = 0.0 if (z <= -7.5e+135) tmp = t_1; elseif (z <= -8.5e-86) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); elseif (z <= 3.4e+58) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-c) * b + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -7.5e+135], t$95$1, If[LessEqual[z, -8.5e-86], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 3.4e+58], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-c, b, y \cdot x\right) \cdot z\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-86}:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.49999999999999947e135 or 3.4000000000000001e58 < z Initial program 69.3%
Taylor expanded in z around inf
Applied rewrites73.3%
if -7.49999999999999947e135 < z < -8.499999999999999e-86Initial program 73.6%
Taylor expanded in t around inf
Applied rewrites51.2%
if -8.499999999999999e-86 < z < 3.4000000000000001e58Initial program 81.8%
Taylor expanded in j around inf
Applied rewrites54.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* i b)) t)))
(if (<= t -4.8e+28)
t_1
(if (<= t 8e-301)
(* (fma j a (* (- z) b)) c)
(if (<= t 1.1e+18) (* (fma (- c) b (* y x)) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, x, (i * b)) * t;
double tmp;
if (t <= -4.8e+28) {
tmp = t_1;
} else if (t <= 8e-301) {
tmp = fma(j, a, (-z * b)) * c;
} else if (t <= 1.1e+18) {
tmp = fma(-c, b, (y * x)) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(i * b)) * t) tmp = 0.0 if (t <= -4.8e+28) tmp = t_1; elseif (t <= 8e-301) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); elseif (t <= 1.1e+18) tmp = Float64(fma(Float64(-c), b, Float64(y * x)) * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.8e+28], t$95$1, If[LessEqual[t, 8e-301], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, 1.1e+18], N[(N[((-c) * b + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-301}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(-c, b, y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999962e28 or 1.1e18 < t Initial program 70.8%
Taylor expanded in t around inf
Applied rewrites63.0%
if -4.79999999999999962e28 < t < 8.00000000000000053e-301Initial program 79.3%
Taylor expanded in z around inf
Applied rewrites77.8%
Taylor expanded in c around inf
Applied rewrites53.7%
if 8.00000000000000053e-301 < t < 1.1e18Initial program 81.6%
Taylor expanded in z around inf
Applied rewrites51.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* i b)) t)))
(if (<= t -4.8e+28)
t_1
(if (<= t 2.6e-79)
(* (fma j a (* (- z) b)) c)
(if (<= t 9.2e+17) (* (* z y) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, x, (i * b)) * t;
double tmp;
if (t <= -4.8e+28) {
tmp = t_1;
} else if (t <= 2.6e-79) {
tmp = fma(j, a, (-z * b)) * c;
} else if (t <= 9.2e+17) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(i * b)) * t) tmp = 0.0 if (t <= -4.8e+28) tmp = t_1; elseif (t <= 2.6e-79) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); elseif (t <= 9.2e+17) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.8e+28], t$95$1, If[LessEqual[t, 2.6e-79], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, 9.2e+17], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+17}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.79999999999999962e28 or 9.2e17 < t Initial program 70.8%
Taylor expanded in t around inf
Applied rewrites63.0%
if -4.79999999999999962e28 < t < 2.59999999999999994e-79Initial program 83.2%
Taylor expanded in z around inf
Applied rewrites82.3%
Taylor expanded in c around inf
Applied rewrites49.0%
if 2.59999999999999994e-79 < t < 9.2e17Initial program 65.1%
Taylor expanded in y around inf
Applied rewrites61.1%
Taylor expanded in x around inf
Applied rewrites60.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= c -3600000000000.0) (not (<= c 2.45e-55))) (* (fma j a (* (- z) b)) c) (* (* z y) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((c <= -3600000000000.0) || !(c <= 2.45e-55)) {
tmp = fma(j, a, (-z * b)) * c;
} else {
tmp = (z * y) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((c <= -3600000000000.0) || !(c <= 2.45e-55)) tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c); else tmp = Float64(Float64(z * y) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[c, -3600000000000.0], N[Not[LessEqual[c, 2.45e-55]], $MachinePrecision]], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3600000000000 \lor \neg \left(c \leq 2.45 \cdot 10^{-55}\right):\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if c < -3.6e12 or 2.45000000000000018e-55 < c Initial program 70.4%
Taylor expanded in z around inf
Applied rewrites67.5%
Taylor expanded in c around inf
Applied rewrites59.4%
if -3.6e12 < c < 2.45000000000000018e-55Initial program 82.5%
Taylor expanded in y around inf
Applied rewrites55.7%
Taylor expanded in x around inf
Applied rewrites36.1%
Final simplification48.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -7.1e+143)
(* (* z y) x)
(if (<= z -4.1e-74)
(* (* (- x) a) t)
(if (<= z 1.85e+59) (* (* j a) c) (* (* z x) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -7.1e+143) {
tmp = (z * y) * x;
} else if (z <= -4.1e-74) {
tmp = (-x * a) * t;
} else if (z <= 1.85e+59) {
tmp = (j * a) * c;
} else {
tmp = (z * x) * y;
}
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 (z <= (-7.1d+143)) then
tmp = (z * y) * x
else if (z <= (-4.1d-74)) then
tmp = (-x * a) * t
else if (z <= 1.85d+59) then
tmp = (j * a) * c
else
tmp = (z * x) * y
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 (z <= -7.1e+143) {
tmp = (z * y) * x;
} else if (z <= -4.1e-74) {
tmp = (-x * a) * t;
} else if (z <= 1.85e+59) {
tmp = (j * a) * c;
} else {
tmp = (z * x) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -7.1e+143: tmp = (z * y) * x elif z <= -4.1e-74: tmp = (-x * a) * t elif z <= 1.85e+59: tmp = (j * a) * c else: tmp = (z * x) * y return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -7.1e+143) tmp = Float64(Float64(z * y) * x); elseif (z <= -4.1e-74) tmp = Float64(Float64(Float64(-x) * a) * t); elseif (z <= 1.85e+59) tmp = Float64(Float64(j * a) * c); else tmp = Float64(Float64(z * x) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -7.1e+143) tmp = (z * y) * x; elseif (z <= -4.1e-74) tmp = (-x * a) * t; elseif (z <= 1.85e+59) tmp = (j * a) * c; else tmp = (z * x) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -7.1e+143], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -4.1e-74], N[(N[((-x) * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 1.85e+59], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.1 \cdot 10^{+143}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-74}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+59}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if z < -7.10000000000000043e143Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites60.8%
Taylor expanded in x around inf
Applied rewrites60.6%
if -7.10000000000000043e143 < z < -4.10000000000000032e-74Initial program 72.5%
Taylor expanded in t around inf
Applied rewrites51.2%
Taylor expanded in x around inf
Applied rewrites34.6%
if -4.10000000000000032e-74 < z < 1.84999999999999999e59Initial program 81.5%
Taylor expanded in z around inf
Applied rewrites75.2%
Taylor expanded in c around inf
Applied rewrites42.6%
Taylor expanded in z around 0
Applied rewrites37.1%
if 1.84999999999999999e59 < z Initial program 67.8%
Taylor expanded in y around inf
Applied rewrites56.7%
Taylor expanded in x around inf
Applied rewrites49.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= z -6.6e-60) (not (<= z 2e-33))) (* (* z y) x) (* (* j a) c)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((z <= -6.6e-60) || !(z <= 2e-33)) {
tmp = (z * y) * x;
} else {
tmp = (j * a) * 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 ((z <= (-6.6d-60)) .or. (.not. (z <= 2d-33))) then
tmp = (z * y) * x
else
tmp = (j * a) * 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 ((z <= -6.6e-60) || !(z <= 2e-33)) {
tmp = (z * y) * x;
} else {
tmp = (j * a) * c;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (z <= -6.6e-60) or not (z <= 2e-33): tmp = (z * y) * x else: tmp = (j * a) * c return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((z <= -6.6e-60) || !(z <= 2e-33)) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(j * a) * c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((z <= -6.6e-60) || ~((z <= 2e-33))) tmp = (z * y) * x; else tmp = (j * a) * c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[z, -6.6e-60], N[Not[LessEqual[z, 2e-33]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-60} \lor \neg \left(z \leq 2 \cdot 10^{-33}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\
\end{array}
\end{array}
if z < -6.5999999999999996e-60 or 2.0000000000000001e-33 < z Initial program 69.7%
Taylor expanded in y around inf
Applied rewrites50.8%
Taylor expanded in x around inf
Applied rewrites36.8%
if -6.5999999999999996e-60 < z < 2.0000000000000001e-33Initial program 85.9%
Taylor expanded in z around inf
Applied rewrites78.0%
Taylor expanded in c around inf
Applied rewrites44.5%
Taylor expanded in z around 0
Applied rewrites40.6%
Final simplification38.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= x -2.06e+83) (not (<= x 1.25e-83))) (* (* z y) x) (* (* i t) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((x <= -2.06e+83) || !(x <= 1.25e-83)) {
tmp = (z * y) * x;
} else {
tmp = (i * t) * 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 ((x <= (-2.06d+83)) .or. (.not. (x <= 1.25d-83))) then
tmp = (z * y) * x
else
tmp = (i * t) * 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 ((x <= -2.06e+83) || !(x <= 1.25e-83)) {
tmp = (z * y) * x;
} else {
tmp = (i * t) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (x <= -2.06e+83) or not (x <= 1.25e-83): tmp = (z * y) * x else: tmp = (i * t) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((x <= -2.06e+83) || !(x <= 1.25e-83)) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(i * t) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((x <= -2.06e+83) || ~((x <= 1.25e-83))) tmp = (z * y) * x; else tmp = (i * t) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[x, -2.06e+83], N[Not[LessEqual[x, 1.25e-83]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.06 \cdot 10^{+83} \lor \neg \left(x \leq 1.25 \cdot 10^{-83}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\end{array}
\end{array}
if x < -2.06e83 or 1.25e-83 < x Initial program 77.4%
Taylor expanded in y around inf
Applied rewrites52.3%
Taylor expanded in x around inf
Applied rewrites40.8%
if -2.06e83 < x < 1.25e-83Initial program 74.5%
Taylor expanded in t around inf
Applied rewrites38.9%
Taylor expanded in x around 0
Applied rewrites29.7%
Final simplification35.5%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= z -6.6e-60) (* (* z y) x) (if (<= z 1.85e+59) (* (* j a) c) (* (* z x) y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -6.6e-60) {
tmp = (z * y) * x;
} else if (z <= 1.85e+59) {
tmp = (j * a) * c;
} else {
tmp = (z * x) * y;
}
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 (z <= (-6.6d-60)) then
tmp = (z * y) * x
else if (z <= 1.85d+59) then
tmp = (j * a) * c
else
tmp = (z * x) * y
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 (z <= -6.6e-60) {
tmp = (z * y) * x;
} else if (z <= 1.85e+59) {
tmp = (j * a) * c;
} else {
tmp = (z * x) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -6.6e-60: tmp = (z * y) * x elif z <= 1.85e+59: tmp = (j * a) * c else: tmp = (z * x) * y return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -6.6e-60) tmp = Float64(Float64(z * y) * x); elseif (z <= 1.85e+59) tmp = Float64(Float64(j * a) * c); else tmp = Float64(Float64(z * x) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -6.6e-60) tmp = (z * y) * x; elseif (z <= 1.85e+59) tmp = (j * a) * c; else tmp = (z * x) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -6.6e-60], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.85e+59], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+59}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if z < -6.5999999999999996e-60Initial program 72.1%
Taylor expanded in y around inf
Applied rewrites48.1%
Taylor expanded in x around inf
Applied rewrites36.2%
if -6.5999999999999996e-60 < z < 1.84999999999999999e59Initial program 81.8%
Taylor expanded in z around inf
Applied rewrites75.6%
Taylor expanded in c around inf
Applied rewrites42.8%
Taylor expanded in z around 0
Applied rewrites37.4%
if 1.84999999999999999e59 < z Initial program 67.8%
Taylor expanded in y around inf
Applied rewrites56.7%
Taylor expanded in x around inf
Applied rewrites49.1%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i t) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * t) * b;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (i * t) * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * t) * b;
}
def code(x, y, z, t, a, b, c, i, j): return (i * t) * b
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * t) * b) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * t) * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot t\right) \cdot b
\end{array}
Initial program 76.0%
Taylor expanded in t around inf
Applied rewrites38.5%
Taylor expanded in x around 0
Applied rewrites20.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i))))
(t_2
(+
(-
(* x (- (* y z) (* t a)))
(/
(* b (- (pow (* c z) 2.0) (pow (* t i) 2.0)))
(+ (* c z) (* t i))))
t_1)))
(if (< x -1.469694296777705e-64)
t_2
(if (< x 3.2113527362226803e-147)
(- (* (- (* b i) (* x a)) t) (- (* z (* c b)) t_1))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (pow((c * z), 2.0) - pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * ((c * a) - (y * i))
t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
if (x < (-1.469694296777705d-64)) then
tmp = t_2
else if (x < 3.2113527362226803d-147) then
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * a) - (y * i)) t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1 tmp = 0 if x < -1.469694296777705e-64: tmp = t_2 elif x < 3.2113527362226803e-147: tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1) tmp = 0.0 if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * a) - (y * i)); t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1; tmp = 0.0; if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025026
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< x -293938859355541/2000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 32113527362226803/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))