
(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)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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 18 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)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
(-
(* (- (* c a) (* i y)) j)
(- (* (- (* a t) (* z y)) x) (* (- (* i t) (* c z)) b)))))
(if (<= t_1 INFINITY)
t_1
(*
(fma
(fma (- c) z (* i t))
(/ b y)
(fma (- j) i (fma z x (/ (* (fma (- x) t (* j c)) a) y))))
y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (((c * a) - (i * y)) * j) - ((((a * t) - (z * y)) * x) - (((i * t) - (c * z)) * b));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(fma(-c, z, (i * t)), (b / y), fma(-j, i, fma(z, x, ((fma(-x, t, (j * c)) * a) / y)))) * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(Float64(Float64(Float64(a * t) - Float64(z * y)) * x) - Float64(Float64(Float64(i * t) - Float64(c * z)) * b))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(fma(Float64(-c), z, Float64(i * t)), Float64(b / y), fma(Float64(-j), i, fma(z, x, Float64(Float64(fma(Float64(-x), t, Float64(j * c)) * a) / y)))) * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(N[(N[(N[(a * t), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * N[(b / y), $MachinePrecision] + N[((-j) * i + N[(z * x + N[(N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot t - c \cdot z\right) \cdot b\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-c, z, i \cdot t\right), \frac{b}{y}, \mathsf{fma}\left(-j, i, \mathsf{fma}\left(z, x, \frac{\mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a}{y}\right)\right)\right) \cdot y\\
\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 90.7%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in y around inf
Applied rewrites71.4%
Final simplification87.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(-
(* (- (* c a) (* i y)) j)
(- (* (- (* a t) (* z y)) x) (* (- (* i t) (* c z)) b)))))
(if (<= t_1 INFINITY) t_1 (* (fma (- x) t (* j c)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (((c * a) - (i * y)) * j) - ((((a * t) - (z * y)) * x) - (((i * t) - (c * z)) * b));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-x, t, (j * c)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(Float64(Float64(Float64(a * t) - Float64(z * y)) * x) - Float64(Float64(Float64(i * t) - Float64(c * z)) * b))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-x), t, Float64(j * c)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(N[(N[(N[(a * t), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot t - c \cdot z\right) \cdot b\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a\\
\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 90.7%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
Final simplification85.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (fma (- j) i (* z x)) y (* (* (- c) z) b))))
(if (<= y -5e+19)
t_1
(if (<= y -3.7e-57)
(- (* (* (- z) b) c) (* (- (* i y) (* c a)) j))
(if (<= y 4.8e-43)
(fma (fma (- c) z (* i t)) b (* (* (- t) x) a))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(fma(-j, i, (z * x)), y, ((-c * z) * b));
double tmp;
if (y <= -5e+19) {
tmp = t_1;
} else if (y <= -3.7e-57) {
tmp = ((-z * b) * c) - (((i * y) - (c * a)) * j);
} else if (y <= 4.8e-43) {
tmp = fma(fma(-c, z, (i * t)), b, ((-t * x) * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(fma(Float64(-j), i, Float64(z * x)), y, Float64(Float64(Float64(-c) * z) * b)) tmp = 0.0 if (y <= -5e+19) tmp = t_1; elseif (y <= -3.7e-57) tmp = Float64(Float64(Float64(Float64(-z) * b) * c) - Float64(Float64(Float64(i * y) - Float64(c * a)) * j)); elseif (y <= 4.8e-43) tmp = fma(fma(Float64(-c), z, Float64(i * t)), b, Float64(Float64(Float64(-t) * x) * a)); 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 + N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e+19], t$95$1, If[LessEqual[y, -3.7e-57], N[(N[(N[((-z) * b), $MachinePrecision] * c), $MachinePrecision] - N[(N[(N[(i * y), $MachinePrecision] - N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-43], N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * b + N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-j, i, z \cdot x\right), y, \left(\left(-c\right) \cdot z\right) \cdot b\right)\\
\mathbf{if}\;y \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-57}:\\
\;\;\;\;\left(\left(-z\right) \cdot b\right) \cdot c - \left(i \cdot y - c \cdot a\right) \cdot j\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-43}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-c, z, i \cdot t\right), b, \left(\left(-t\right) \cdot x\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5e19 or 4.8000000000000004e-43 < y Initial program 70.3%
Taylor expanded in a around 0
sub-negN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
Applied rewrites74.3%
Taylor expanded in c around inf
Applied rewrites71.8%
if -5e19 < y < -3.7e-57Initial program 66.5%
Taylor expanded in c around inf
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
if -3.7e-57 < y < 4.8000000000000004e-43Initial program 85.4%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.8%
Taylor expanded in c around 0
Applied rewrites69.7%
Final simplification71.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (fma (- j) i (* z x)) y (* (* (- c) z) b)))
(t_2 (fma (- c) z (* i t))))
(if (<= y -5.5e-20)
t_1
(if (<= y -4.5e-182)
(fma t_2 b (* (* j c) a))
(if (<= y 4.8e-43) (fma t_2 b (* (* (- t) x) a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(fma(-j, i, (z * x)), y, ((-c * z) * b));
double t_2 = fma(-c, z, (i * t));
double tmp;
if (y <= -5.5e-20) {
tmp = t_1;
} else if (y <= -4.5e-182) {
tmp = fma(t_2, b, ((j * c) * a));
} else if (y <= 4.8e-43) {
tmp = fma(t_2, b, ((-t * x) * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(fma(Float64(-j), i, Float64(z * x)), y, Float64(Float64(Float64(-c) * z) * b)) t_2 = fma(Float64(-c), z, Float64(i * t)) tmp = 0.0 if (y <= -5.5e-20) tmp = t_1; elseif (y <= -4.5e-182) tmp = fma(t_2, b, Float64(Float64(j * c) * a)); elseif (y <= 4.8e-43) tmp = fma(t_2, b, Float64(Float64(Float64(-t) * x) * a)); 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 + N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e-20], t$95$1, If[LessEqual[y, -4.5e-182], N[(t$95$2 * b + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-43], N[(t$95$2 * b + N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-j, i, z \cdot x\right), y, \left(\left(-c\right) \cdot z\right) \cdot b\right)\\
t_2 := \mathsf{fma}\left(-c, z, i \cdot t\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-182}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, b, \left(j \cdot c\right) \cdot a\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-43}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, b, \left(\left(-t\right) \cdot x\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.4999999999999996e-20 or 4.8000000000000004e-43 < y Initial program 70.1%
Taylor expanded in a around 0
sub-negN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
Applied rewrites73.2%
Taylor expanded in c around inf
Applied rewrites71.5%
if -5.4999999999999996e-20 < y < -4.4999999999999999e-182Initial program 80.2%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.9%
Taylor expanded in c around inf
Applied rewrites66.8%
if -4.4999999999999999e-182 < y < 4.8000000000000004e-43Initial program 85.6%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.6%
Taylor expanded in c around 0
Applied rewrites73.6%
Final simplification71.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- c) z (* i t)))
(t_2 (fma t_1 b (* (fma (- x) t (* j c)) a))))
(if (<= a -5.2e+118)
t_2
(if (<= a 7e+42) (fma (fma (- j) i (* z x)) y (* t_1 b)) 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(-c, z, (i * t));
double t_2 = fma(t_1, b, (fma(-x, t, (j * c)) * a));
double tmp;
if (a <= -5.2e+118) {
tmp = t_2;
} else if (a <= 7e+42) {
tmp = fma(fma(-j, i, (z * x)), y, (t_1 * b));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(-c), z, Float64(i * t)) t_2 = fma(t_1, b, Float64(fma(Float64(-x), t, Float64(j * c)) * a)) tmp = 0.0 if (a <= -5.2e+118) tmp = t_2; elseif (a <= 7e+42) tmp = fma(fma(Float64(-j), i, Float64(z * x)), y, Float64(t_1 * b)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * b + N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.2e+118], t$95$2, If[LessEqual[a, 7e+42], N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y + N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-c, z, i \cdot t\right)\\
t_2 := \mathsf{fma}\left(t\_1, b, \mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a\right)\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{+118}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-j, i, z \cdot x\right), y, t\_1 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -5.20000000000000032e118 or 7.00000000000000047e42 < a Initial program 62.3%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.3%
if -5.20000000000000032e118 < a < 7.00000000000000047e42Initial program 83.0%
Taylor expanded in a around 0
sub-negN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
Applied rewrites74.7%
Final simplification77.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (fma (- j) i (* z x)) y (* (* (- c) z) b))))
(if (<= y -1.1e-19)
t_1
(if (<= y 1.28e-42)
(fma (fma (- c) z (* i t)) b (* (fma (- x) t (* j c)) a))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(fma(-j, i, (z * x)), y, ((-c * z) * b));
double tmp;
if (y <= -1.1e-19) {
tmp = t_1;
} else if (y <= 1.28e-42) {
tmp = fma(fma(-c, z, (i * t)), b, (fma(-x, t, (j * c)) * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(fma(Float64(-j), i, Float64(z * x)), y, Float64(Float64(Float64(-c) * z) * b)) tmp = 0.0 if (y <= -1.1e-19) tmp = t_1; elseif (y <= 1.28e-42) tmp = fma(fma(Float64(-c), z, Float64(i * t)), b, Float64(fma(Float64(-x), t, Float64(j * c)) * a)); 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 + N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e-19], t$95$1, If[LessEqual[y, 1.28e-42], N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * b + N[(N[((-x) * t + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-j, i, z \cdot x\right), y, \left(\left(-c\right) \cdot z\right) \cdot b\right)\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-c, z, i \cdot t\right), b, \mathsf{fma}\left(-x, t, j \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.0999999999999999e-19 or 1.27999999999999994e-42 < y Initial program 70.1%
Taylor expanded in a around 0
sub-negN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
Applied rewrites73.2%
Taylor expanded in c around inf
Applied rewrites71.5%
if -1.0999999999999999e-19 < y < 1.27999999999999994e-42Initial program 83.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.7%
Final simplification74.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c a)) j)))
(if (<= j -2.5e+100)
t_1
(if (<= j 1.3e+87) (fma (* z x) y (* (fma (- c) z (* i t)) b)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * a)) * j;
double tmp;
if (j <= -2.5e+100) {
tmp = t_1;
} else if (j <= 1.3e+87) {
tmp = fma((z * x), y, (fma(-c, z, (i * t)) * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * a)) * j) tmp = 0.0 if (j <= -2.5e+100) tmp = t_1; elseif (j <= 1.3e+87) tmp = fma(Float64(z * x), y, Float64(fma(Float64(-c), z, Float64(i * t)) * b)); 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) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -2.5e+100], t$95$1, If[LessEqual[j, 1.3e+87], N[(N[(z * x), $MachinePrecision] * y + N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{if}\;j \leq -2.5 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.3 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot x, y, \mathsf{fma}\left(-c, z, i \cdot t\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.4999999999999999e100 or 1.29999999999999999e87 < j Initial program 79.9%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
+-commutativeN/A
neg-mul-1N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6471.6
Applied rewrites71.6%
if -2.4999999999999999e100 < j < 1.29999999999999999e87Initial program 73.7%
Taylor expanded in a around 0
sub-negN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
Applied rewrites70.5%
Taylor expanded in x around inf
Applied rewrites64.0%
Final simplification66.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c a)) j)))
(if (<= j -750000000000.0)
t_1
(if (<= j 3.3e-154)
(* (* (- y (/ (* a t) z)) z) x)
(if (<= j 4e+85) (* (fma (- c) z (* i t)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * a)) * j;
double tmp;
if (j <= -750000000000.0) {
tmp = t_1;
} else if (j <= 3.3e-154) {
tmp = ((y - ((a * t) / z)) * z) * x;
} else if (j <= 4e+85) {
tmp = fma(-c, z, (i * t)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * a)) * j) tmp = 0.0 if (j <= -750000000000.0) tmp = t_1; elseif (j <= 3.3e-154) tmp = Float64(Float64(Float64(y - Float64(Float64(a * t) / z)) * z) * x); elseif (j <= 4e+85) tmp = Float64(fma(Float64(-c), z, Float64(i * t)) * b); 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) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -750000000000.0], t$95$1, If[LessEqual[j, 3.3e-154], N[(N[(N[(y - N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 4e+85], N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{if}\;j \leq -750000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.3 \cdot 10^{-154}:\\
\;\;\;\;\left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) \cdot x\\
\mathbf{elif}\;j \leq 4 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(-c, z, i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -7.5e11 or 4.0000000000000001e85 < j Initial program 80.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
+-commutativeN/A
neg-mul-1N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6470.0
Applied rewrites70.0%
if -7.5e11 < j < 3.30000000000000027e-154Initial program 73.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6460.4
Applied rewrites60.4%
Taylor expanded in z around inf
Applied rewrites60.4%
if 3.30000000000000027e-154 < j < 4.0000000000000001e85Initial program 72.2%
Taylor expanded in b around inf
*-commutativeN/A
sub-negN/A
+-commutativeN/A
remove-double-negN/A
distribute-neg-inN/A
sub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.4
Applied rewrites50.4%
Final simplification62.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) y (* c a)) j)))
(if (<= j -750000000000.0)
t_1
(if (<= j 3.3e-154)
(* (fma (- a) t (* z y)) x)
(if (<= j 4e+85) (* (fma (- c) z (* i t)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, y, (c * a)) * j;
double tmp;
if (j <= -750000000000.0) {
tmp = t_1;
} else if (j <= 3.3e-154) {
tmp = fma(-a, t, (z * y)) * x;
} else if (j <= 4e+85) {
tmp = fma(-c, z, (i * t)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), y, Float64(c * a)) * j) tmp = 0.0 if (j <= -750000000000.0) tmp = t_1; elseif (j <= 3.3e-154) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); elseif (j <= 4e+85) tmp = Float64(fma(Float64(-c), z, Float64(i * t)) * b); 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) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -750000000000.0], t$95$1, If[LessEqual[j, 3.3e-154], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 4e+85], N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{if}\;j \leq -750000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.3 \cdot 10^{-154}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 4 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(-c, z, i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -7.5e11 or 4.0000000000000001e85 < j Initial program 80.5%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
+-commutativeN/A
neg-mul-1N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6470.0
Applied rewrites70.0%
if -7.5e11 < j < 3.30000000000000027e-154Initial program 73.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6460.4
Applied rewrites60.4%
if 3.30000000000000027e-154 < j < 4.0000000000000001e85Initial program 72.2%
Taylor expanded in b around inf
*-commutativeN/A
sub-negN/A
+-commutativeN/A
remove-double-negN/A
distribute-neg-inN/A
sub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.4
Applied rewrites50.4%
Final simplification62.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -1.3e+89)
(* (* (- t) x) a)
(if (<= t 6.1e-12)
(* (* z x) y)
(if (<= t 9.5e+143) (* (* j c) a) (* (* (- t) a) x)))))
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.3e+89) {
tmp = (-t * x) * a;
} else if (t <= 6.1e-12) {
tmp = (z * x) * y;
} else if (t <= 9.5e+143) {
tmp = (j * c) * a;
} else {
tmp = (-t * a) * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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.3d+89)) then
tmp = (-t * x) * a
else if (t <= 6.1d-12) then
tmp = (z * x) * y
else if (t <= 9.5d+143) then
tmp = (j * c) * a
else
tmp = (-t * a) * 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 (t <= -1.3e+89) {
tmp = (-t * x) * a;
} else if (t <= 6.1e-12) {
tmp = (z * x) * y;
} else if (t <= 9.5e+143) {
tmp = (j * c) * a;
} else {
tmp = (-t * a) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -1.3e+89: tmp = (-t * x) * a elif t <= 6.1e-12: tmp = (z * x) * y elif t <= 9.5e+143: tmp = (j * c) * a else: tmp = (-t * a) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -1.3e+89) tmp = Float64(Float64(Float64(-t) * x) * a); elseif (t <= 6.1e-12) tmp = Float64(Float64(z * x) * y); elseif (t <= 9.5e+143) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(Float64(-t) * a) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -1.3e+89) tmp = (-t * x) * a; elseif (t <= 6.1e-12) tmp = (z * x) * y; elseif (t <= 9.5e+143) tmp = (j * c) * a; else tmp = (-t * a) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.3e+89], N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 6.1e-12], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 9.5e+143], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[((-t) * a), $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+89}:\\
\;\;\;\;\left(\left(-t\right) \cdot x\right) \cdot a\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+143}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-t\right) \cdot a\right) \cdot x\\
\end{array}
\end{array}
if t < -1.3e89Initial program 75.7%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.7%
Taylor expanded in x around inf
Applied rewrites54.3%
if -1.3e89 < t < 6.1000000000000003e-12Initial program 80.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6451.7
Applied rewrites51.7%
Taylor expanded in x around inf
Applied rewrites32.9%
if 6.1000000000000003e-12 < t < 9.50000000000000066e143Initial program 67.2%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.7%
Taylor expanded in j around inf
Applied rewrites44.7%
if 9.50000000000000066e143 < t Initial program 62.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
Taylor expanded in a around inf
Applied rewrites63.0%
Final simplification40.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- t) x) a)))
(if (<= t -1.3e+89)
t_1
(if (<= t 6.1e-12)
(* (* z x) y)
(if (<= t 2.9e+143) (* (* j c) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-t * x) * a;
double tmp;
if (t <= -1.3e+89) {
tmp = t_1;
} else if (t <= 6.1e-12) {
tmp = (z * x) * y;
} else if (t <= 2.9e+143) {
tmp = (j * c) * a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-t * x) * a
if (t <= (-1.3d+89)) then
tmp = t_1
else if (t <= 6.1d-12) then
tmp = (z * x) * y
else if (t <= 2.9d+143) then
tmp = (j * c) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-t * x) * a;
double tmp;
if (t <= -1.3e+89) {
tmp = t_1;
} else if (t <= 6.1e-12) {
tmp = (z * x) * y;
} else if (t <= 2.9e+143) {
tmp = (j * c) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-t * x) * a tmp = 0 if t <= -1.3e+89: tmp = t_1 elif t <= 6.1e-12: tmp = (z * x) * y elif t <= 2.9e+143: tmp = (j * c) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-t) * x) * a) tmp = 0.0 if (t <= -1.3e+89) tmp = t_1; elseif (t <= 6.1e-12) tmp = Float64(Float64(z * x) * y); elseif (t <= 2.9e+143) tmp = Float64(Float64(j * c) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-t * x) * a; tmp = 0.0; if (t <= -1.3e+89) tmp = t_1; elseif (t <= 6.1e-12) tmp = (z * x) * y; elseif (t <= 2.9e+143) tmp = (j * c) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * x), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -1.3e+89], t$95$1, If[LessEqual[t, 6.1e-12], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.9e+143], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-t\right) \cdot x\right) \cdot a\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+143}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.3e89 or 2.8999999999999998e143 < t Initial program 71.3%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.8%
Taylor expanded in x around inf
Applied rewrites57.1%
if -1.3e89 < t < 6.1000000000000003e-12Initial program 80.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6451.7
Applied rewrites51.7%
Taylor expanded in x around inf
Applied rewrites32.9%
if 6.1000000000000003e-12 < t < 2.8999999999999998e143Initial program 67.2%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.7%
Taylor expanded in j around inf
Applied rewrites44.7%
Final simplification40.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) t (* z y)) x)))
(if (<= x -1.5e-44)
t_1
(if (<= x 1.05e-22) (* (fma (- c) z (* i t)) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, t, (z * y)) * x;
double tmp;
if (x <= -1.5e-44) {
tmp = t_1;
} else if (x <= 1.05e-22) {
tmp = fma(-c, z, (i * t)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), t, Float64(z * y)) * x) tmp = 0.0 if (x <= -1.5e-44) tmp = t_1; elseif (x <= 1.05e-22) tmp = Float64(fma(Float64(-c), z, Float64(i * t)) * b); 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) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.5e-44], t$95$1, If[LessEqual[x, 1.05e-22], N[(N[((-c) * z + N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(-c, z, i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.5000000000000001e-44 or 1.05000000000000004e-22 < x Initial program 74.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6462.8
Applied rewrites62.8%
if -1.5000000000000001e-44 < x < 1.05000000000000004e-22Initial program 76.9%
Taylor expanded in b around inf
*-commutativeN/A
sub-negN/A
+-commutativeN/A
remove-double-negN/A
distribute-neg-inN/A
sub-negN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Final simplification55.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- b) z (* j a)) c)))
(if (<= c -3.6e+75)
t_1
(if (<= c 2.05e-35) (* (fma (- a) t (* z y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-b, z, (j * a)) * c;
double tmp;
if (c <= -3.6e+75) {
tmp = t_1;
} else if (c <= 2.05e-35) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-b), z, Float64(j * a)) * c) tmp = 0.0 if (c <= -3.6e+75) tmp = t_1; elseif (c <= 2.05e-35) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-b) * z + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -3.6e+75], t$95$1, If[LessEqual[c, 2.05e-35], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-b, z, j \cdot a\right) \cdot c\\
\mathbf{if}\;c \leq -3.6 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.6e75 or 2.05000000000000013e-35 < c Initial program 70.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6461.6
Applied rewrites61.6%
if -3.6e75 < c < 2.05000000000000013e-35Initial program 80.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6450.0
Applied rewrites50.0%
Final simplification55.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* j c) a)))
(if (<= j -1.2e+147)
t_1
(if (<= j 1.55e+127) (* (fma (- a) t (* z y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * a;
double tmp;
if (j <= -1.2e+147) {
tmp = t_1;
} else if (j <= 1.55e+127) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * a) tmp = 0.0 if (j <= -1.2e+147) tmp = t_1; elseif (j <= 1.55e+127) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[j, -1.2e+147], t$95$1, If[LessEqual[j, 1.55e+127], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;j \leq -1.2 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.20000000000000001e147 or 1.5500000000000001e127 < j Initial program 79.5%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.0%
Taylor expanded in j around inf
Applied rewrites53.3%
if -1.20000000000000001e147 < j < 1.5500000000000001e127Initial program 74.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6451.0
Applied rewrites51.0%
Final simplification51.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= a -4.3e-16) (* (* j a) c) (if (<= a 1.5e+151) (* (* z y) x) (* (* c a) j))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -4.3e-16) {
tmp = (j * a) * c;
} else if (a <= 1.5e+151) {
tmp = (z * y) * x;
} else {
tmp = (c * a) * j;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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 (a <= (-4.3d-16)) then
tmp = (j * a) * c
else if (a <= 1.5d+151) then
tmp = (z * y) * x
else
tmp = (c * a) * j
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 (a <= -4.3e-16) {
tmp = (j * a) * c;
} else if (a <= 1.5e+151) {
tmp = (z * y) * x;
} else {
tmp = (c * a) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -4.3e-16: tmp = (j * a) * c elif a <= 1.5e+151: tmp = (z * y) * x else: tmp = (c * a) * j return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -4.3e-16) tmp = Float64(Float64(j * a) * c); elseif (a <= 1.5e+151) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(c * a) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -4.3e-16) tmp = (j * a) * c; elseif (a <= 1.5e+151) tmp = (z * y) * x; else tmp = (c * a) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -4.3e-16], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[a, 1.5e+151], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{-16}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+151}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\end{array}
\end{array}
if a < -4.2999999999999999e-16Initial program 66.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.3%
Taylor expanded in j around inf
Applied rewrites44.3%
Applied rewrites44.3%
if -4.2999999999999999e-16 < a < 1.5e151Initial program 82.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6445.2
Applied rewrites45.2%
Taylor expanded in a around 0
Applied rewrites33.7%
if 1.5e151 < a Initial program 64.4%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
+-commutativeN/A
neg-mul-1N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6454.6
Applied rewrites54.6%
Taylor expanded in c around inf
Applied rewrites51.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j a) c))) (if (<= a -4.3e-16) t_1 (if (<= a 3.9e+151) (* (* z y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * a) * c;
double tmp;
if (a <= -4.3e-16) {
tmp = t_1;
} else if (a <= 3.9e+151) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * a) * c
if (a <= (-4.3d-16)) then
tmp = t_1
else if (a <= 3.9d+151) then
tmp = (z * y) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * a) * c;
double tmp;
if (a <= -4.3e-16) {
tmp = t_1;
} else if (a <= 3.9e+151) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * a) * c tmp = 0 if a <= -4.3e-16: tmp = t_1 elif a <= 3.9e+151: tmp = (z * y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * a) * c) tmp = 0.0 if (a <= -4.3e-16) tmp = t_1; elseif (a <= 3.9e+151) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * a) * c; tmp = 0.0; if (a <= -4.3e-16) tmp = t_1; elseif (a <= 3.9e+151) tmp = (z * y) * x; 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[(j * a), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[a, -4.3e-16], t$95$1, If[LessEqual[a, 3.9e+151], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot a\right) \cdot c\\
\mathbf{if}\;a \leq -4.3 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{+151}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.2999999999999999e-16 or 3.89999999999999976e151 < a Initial program 65.6%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.9%
Taylor expanded in j around inf
Applied rewrites45.3%
Applied rewrites45.3%
if -4.2999999999999999e-16 < a < 3.89999999999999976e151Initial program 82.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6445.2
Applied rewrites45.2%
Taylor expanded in a around 0
Applied rewrites33.7%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j c) a))) (if (<= c -1.52e-105) t_1 (if (<= c 1.2e-59) (* (* i t) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * a;
double tmp;
if (c <= -1.52e-105) {
tmp = t_1;
} else if (c <= 1.2e-59) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (j * c) * a
if (c <= (-1.52d-105)) then
tmp = t_1
else if (c <= 1.2d-59) then
tmp = (i * t) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (j * c) * a;
double tmp;
if (c <= -1.52e-105) {
tmp = t_1;
} else if (c <= 1.2e-59) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * a tmp = 0 if c <= -1.52e-105: tmp = t_1 elif c <= 1.2e-59: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * a) tmp = 0.0 if (c <= -1.52e-105) tmp = t_1; elseif (c <= 1.2e-59) tmp = Float64(Float64(i * t) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (j * c) * a; tmp = 0.0; if (c <= -1.52e-105) tmp = t_1; elseif (c <= 1.2e-59) tmp = (i * t) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[c, -1.52e-105], t$95$1, If[LessEqual[c, 1.2e-59], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;c \leq -1.52 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{-59}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.52e-105 or 1.20000000000000008e-59 < c Initial program 72.6%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in j around inf
Applied rewrites34.3%
if -1.52e-105 < c < 1.20000000000000008e-59Initial program 81.1%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites48.1%
Taylor expanded in i around inf
Applied rewrites26.7%
Final simplification31.4%
(FPCore (x y z t a b c i j) :precision binary64 (* (* j c) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * c) * a;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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 = (j * c) * a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * c) * a;
}
def code(x, y, z, t, a, b, c, i, j): return (j * c) * a
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(j * c) * a) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (j * c) * a; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(j \cdot c\right) \cdot a
\end{array}
Initial program 75.8%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites61.1%
Taylor expanded in j around inf
Applied rewrites23.2%
Final simplification23.2%
(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;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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 2024270
(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)))))