
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma b (* -0.25 a) (fma z (/ t 16.0) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(b, (-0.25 * a), fma(z, (t / 16.0), c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(b, Float64(-0.25 * a), fma(z, Float64(t / 16.0), c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(b * N[(-0.25 * a), $MachinePrecision] + N[(z * N[(t / 16.0), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(b, -0.25 \cdot a, \mathsf{fma}\left(z, \frac{t}{16}, c\right)\right)\right)
\end{array}
Initial program 98.4%
associate-+l-98.4%
+-commutative98.4%
associate--l+98.4%
+-commutative98.4%
associate-+l-98.4%
fma-neg98.8%
neg-sub098.8%
associate--l-98.8%
associate-+l-98.8%
neg-sub098.8%
*-commutative98.8%
associate-*r/98.8%
distribute-rgt-neg-in98.8%
fma-def99.2%
distribute-frac-neg99.2%
neg-mul-199.2%
associate-/l*99.2%
associate-/r/99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (fma t (/ z 16.0) (fma x y (- c (* b (/ a 4.0))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(t, (z / 16.0), fma(x, y, (c - (b * (a / 4.0)))));
}
function code(x, y, z, t, a, b, c) return fma(t, Float64(z / 16.0), fma(x, y, Float64(c - Float64(b * Float64(a / 4.0))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(t * N[(z / 16.0), $MachinePrecision] + N[(x * y + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Initial program 98.4%
associate-+l-98.4%
+-commutative98.4%
associate--l+98.4%
associate-*l/98.4%
*-commutative98.4%
fma-def99.2%
fma-neg99.2%
neg-sub099.2%
associate-+l-99.2%
neg-sub099.2%
+-commutative99.2%
unsub-neg99.2%
*-commutative99.2%
associate-*r/99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (/ z (/ 16.0 t))) (- c (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (z / (16.0 / t))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(z / Float64(16.0 / t))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
neg-mul-198.4%
metadata-eval98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
fma-def98.8%
associate-/l*98.7%
metadata-eval98.7%
*-lft-identity98.7%
associate-/l*98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -0.25 (* b a))))
(if (<= (* b a) -9e+133)
t_1
(if (<= (* b a) -2.15e-41)
(* x y)
(if (<= (* b a) -1.8e-70)
c
(if (<= (* b a) 8.6e-290)
(* (* z t) 0.0625)
(if (<= (* b a) 5e-156)
c
(if (<= (* b a) 1.32e+109) (* x y) t_1))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -0.25 * (b * a);
double tmp;
if ((b * a) <= -9e+133) {
tmp = t_1;
} else if ((b * a) <= -2.15e-41) {
tmp = x * y;
} else if ((b * a) <= -1.8e-70) {
tmp = c;
} else if ((b * a) <= 8.6e-290) {
tmp = (z * t) * 0.0625;
} else if ((b * a) <= 5e-156) {
tmp = c;
} else if ((b * a) <= 1.32e+109) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: tmp
t_1 = (-0.25d0) * (b * a)
if ((b * a) <= (-9d+133)) then
tmp = t_1
else if ((b * a) <= (-2.15d-41)) then
tmp = x * y
else if ((b * a) <= (-1.8d-70)) then
tmp = c
else if ((b * a) <= 8.6d-290) then
tmp = (z * t) * 0.0625d0
else if ((b * a) <= 5d-156) then
tmp = c
else if ((b * a) <= 1.32d+109) then
tmp = x * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -0.25 * (b * a);
double tmp;
if ((b * a) <= -9e+133) {
tmp = t_1;
} else if ((b * a) <= -2.15e-41) {
tmp = x * y;
} else if ((b * a) <= -1.8e-70) {
tmp = c;
} else if ((b * a) <= 8.6e-290) {
tmp = (z * t) * 0.0625;
} else if ((b * a) <= 5e-156) {
tmp = c;
} else if ((b * a) <= 1.32e+109) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = -0.25 * (b * a) tmp = 0 if (b * a) <= -9e+133: tmp = t_1 elif (b * a) <= -2.15e-41: tmp = x * y elif (b * a) <= -1.8e-70: tmp = c elif (b * a) <= 8.6e-290: tmp = (z * t) * 0.0625 elif (b * a) <= 5e-156: tmp = c elif (b * a) <= 1.32e+109: tmp = x * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(-0.25 * Float64(b * a)) tmp = 0.0 if (Float64(b * a) <= -9e+133) tmp = t_1; elseif (Float64(b * a) <= -2.15e-41) tmp = Float64(x * y); elseif (Float64(b * a) <= -1.8e-70) tmp = c; elseif (Float64(b * a) <= 8.6e-290) tmp = Float64(Float64(z * t) * 0.0625); elseif (Float64(b * a) <= 5e-156) tmp = c; elseif (Float64(b * a) <= 1.32e+109) tmp = Float64(x * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = -0.25 * (b * a); tmp = 0.0; if ((b * a) <= -9e+133) tmp = t_1; elseif ((b * a) <= -2.15e-41) tmp = x * y; elseif ((b * a) <= -1.8e-70) tmp = c; elseif ((b * a) <= 8.6e-290) tmp = (z * t) * 0.0625; elseif ((b * a) <= 5e-156) tmp = c; elseif ((b * a) <= 1.32e+109) tmp = x * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -9e+133], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -2.15e-41], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -1.8e-70], c, If[LessEqual[N[(b * a), $MachinePrecision], 8.6e-290], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 5e-156], c, If[LessEqual[N[(b * a), $MachinePrecision], 1.32e+109], N[(x * y), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;b \cdot a \leq -9 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -2.15 \cdot 10^{-41}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \cdot a \leq -1.8 \cdot 10^{-70}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \cdot a \leq 8.6 \cdot 10^{-290}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-156}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \cdot a \leq 1.32 \cdot 10^{+109}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -8.9999999999999997e133 or 1.32000000000000008e109 < (*.f64 a b) Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
neg-mul-196.1%
metadata-eval96.1%
metadata-eval96.1%
cancel-sign-sub-inv96.1%
fma-def96.1%
associate-/l*96.1%
metadata-eval96.1%
*-lft-identity96.1%
associate-/l*95.9%
Simplified95.9%
fma-udef95.9%
associate-/l*96.0%
+-commutative96.0%
associate-/l*95.9%
div-inv96.0%
clear-num96.0%
div-inv96.0%
metadata-eval96.0%
Applied egg-rr96.0%
Taylor expanded in a around inf 67.0%
*-commutative67.0%
Simplified67.0%
if -8.9999999999999997e133 < (*.f64 a b) < -2.1499999999999999e-41 or 5.00000000000000007e-156 < (*.f64 a b) < 1.32000000000000008e109Initial program 100.0%
Taylor expanded in a around 0 89.6%
Taylor expanded in c around 0 67.5%
Taylor expanded in y around inf 46.6%
if -2.1499999999999999e-41 < (*.f64 a b) < -1.8000000000000001e-70 or 8.6000000000000004e-290 < (*.f64 a b) < 5.00000000000000007e-156Initial program 100.0%
Taylor expanded in c around inf 67.5%
if -1.8000000000000001e-70 < (*.f64 a b) < 8.6000000000000004e-290Initial program 98.3%
Taylor expanded in x around 0 72.0%
Taylor expanded in t around inf 45.7%
Final simplification55.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (+ c (* -0.25 (* b a)))))
(if (<= (* b a) -1.45e+133)
t_2
(if (<= (* b a) -1.1e-43)
t_1
(if (<= (* b a) 7.8e-144)
(+ c (* t (* z 0.0625)))
(if (<= (* b a) 1.22e+103) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = c + (-0.25 * (b * a));
double tmp;
if ((b * a) <= -1.45e+133) {
tmp = t_2;
} else if ((b * a) <= -1.1e-43) {
tmp = t_1;
} else if ((b * a) <= 7.8e-144) {
tmp = c + (t * (z * 0.0625));
} else if ((b * a) <= 1.22e+103) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = c + ((-0.25d0) * (b * a))
if ((b * a) <= (-1.45d+133)) then
tmp = t_2
else if ((b * a) <= (-1.1d-43)) then
tmp = t_1
else if ((b * a) <= 7.8d-144) then
tmp = c + (t * (z * 0.0625d0))
else if ((b * a) <= 1.22d+103) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = c + (-0.25 * (b * a));
double tmp;
if ((b * a) <= -1.45e+133) {
tmp = t_2;
} else if ((b * a) <= -1.1e-43) {
tmp = t_1;
} else if ((b * a) <= 7.8e-144) {
tmp = c + (t * (z * 0.0625));
} else if ((b * a) <= 1.22e+103) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = c + (-0.25 * (b * a)) tmp = 0 if (b * a) <= -1.45e+133: tmp = t_2 elif (b * a) <= -1.1e-43: tmp = t_1 elif (b * a) <= 7.8e-144: tmp = c + (t * (z * 0.0625)) elif (b * a) <= 1.22e+103: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(c + Float64(-0.25 * Float64(b * a))) tmp = 0.0 if (Float64(b * a) <= -1.45e+133) tmp = t_2; elseif (Float64(b * a) <= -1.1e-43) tmp = t_1; elseif (Float64(b * a) <= 7.8e-144) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(b * a) <= 1.22e+103) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = c + (-0.25 * (b * a)); tmp = 0.0; if ((b * a) <= -1.45e+133) tmp = t_2; elseif ((b * a) <= -1.1e-43) tmp = t_1; elseif ((b * a) <= 7.8e-144) tmp = c + (t * (z * 0.0625)); elseif ((b * a) <= 1.22e+103) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1.45e+133], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -1.1e-43], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 7.8e-144], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 1.22e+103], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;b \cdot a \leq -1.45 \cdot 10^{+133}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -1.1 \cdot 10^{-43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 7.8 \cdot 10^{-144}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;b \cdot a \leq 1.22 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.4500000000000001e133 or 1.22e103 < (*.f64 a b) Initial program 96.1%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
Simplified76.9%
if -1.4500000000000001e133 < (*.f64 a b) < -1.09999999999999999e-43 or 7.8000000000000003e-144 < (*.f64 a b) < 1.22e103Initial program 100.0%
Taylor expanded in x around inf 69.6%
if -1.09999999999999999e-43 < (*.f64 a b) < 7.8000000000000003e-144Initial program 98.9%
Taylor expanded in z around inf 76.9%
*-commutative76.9%
associate-*r*76.9%
*-commutative76.9%
Simplified76.9%
Final simplification74.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* -0.25 (* b a))))
(if (<= (* b a) -1.45e+171)
t_2
(if (<= (* b a) -1.65e-39)
t_1
(if (<= (* b a) 5.1e-144)
(+ c (* t (* z 0.0625)))
(if (<= (* b a) 3.6e+183) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = -0.25 * (b * a);
double tmp;
if ((b * a) <= -1.45e+171) {
tmp = t_2;
} else if ((b * a) <= -1.65e-39) {
tmp = t_1;
} else if ((b * a) <= 5.1e-144) {
tmp = c + (t * (z * 0.0625));
} else if ((b * a) <= 3.6e+183) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = (-0.25d0) * (b * a)
if ((b * a) <= (-1.45d+171)) then
tmp = t_2
else if ((b * a) <= (-1.65d-39)) then
tmp = t_1
else if ((b * a) <= 5.1d-144) then
tmp = c + (t * (z * 0.0625d0))
else if ((b * a) <= 3.6d+183) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = -0.25 * (b * a);
double tmp;
if ((b * a) <= -1.45e+171) {
tmp = t_2;
} else if ((b * a) <= -1.65e-39) {
tmp = t_1;
} else if ((b * a) <= 5.1e-144) {
tmp = c + (t * (z * 0.0625));
} else if ((b * a) <= 3.6e+183) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = -0.25 * (b * a) tmp = 0 if (b * a) <= -1.45e+171: tmp = t_2 elif (b * a) <= -1.65e-39: tmp = t_1 elif (b * a) <= 5.1e-144: tmp = c + (t * (z * 0.0625)) elif (b * a) <= 3.6e+183: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(-0.25 * Float64(b * a)) tmp = 0.0 if (Float64(b * a) <= -1.45e+171) tmp = t_2; elseif (Float64(b * a) <= -1.65e-39) tmp = t_1; elseif (Float64(b * a) <= 5.1e-144) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(b * a) <= 3.6e+183) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = -0.25 * (b * a); tmp = 0.0; if ((b * a) <= -1.45e+171) tmp = t_2; elseif ((b * a) <= -1.65e-39) tmp = t_1; elseif ((b * a) <= 5.1e-144) tmp = c + (t * (z * 0.0625)); elseif ((b * a) <= 3.6e+183) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1.45e+171], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -1.65e-39], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 5.1e-144], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 3.6e+183], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;b \cdot a \leq -1.45 \cdot 10^{+171}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -1.65 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 5.1 \cdot 10^{-144}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;b \cdot a \leq 3.6 \cdot 10^{+183}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.44999999999999992e171 or 3.60000000000000023e183 < (*.f64 a b) Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
neg-mul-195.0%
metadata-eval95.0%
metadata-eval95.0%
cancel-sign-sub-inv95.0%
fma-def95.0%
associate-/l*94.9%
metadata-eval94.9%
*-lft-identity94.9%
associate-/l*94.8%
Simplified94.8%
fma-udef94.8%
associate-/l*94.8%
+-commutative94.8%
associate-/l*94.8%
div-inv94.8%
clear-num94.8%
div-inv94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
Simplified76.9%
if -1.44999999999999992e171 < (*.f64 a b) < -1.64999999999999992e-39 or 5.1e-144 < (*.f64 a b) < 3.60000000000000023e183Initial program 100.0%
Taylor expanded in x around inf 64.7%
if -1.64999999999999992e-39 < (*.f64 a b) < 5.1e-144Initial program 98.9%
Taylor expanded in z around inf 76.9%
*-commutative76.9%
associate-*r*76.9%
*-commutative76.9%
Simplified76.9%
Final simplification71.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)) (t_2 (* (* z t) 0.0625)))
(if (<= (* b a) -2e+71)
(- (+ c (* x y)) t_1)
(if (<= (* b a) 5e+96) (+ c (+ (* x y) t_2)) (- (+ c t_2) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((b * a) <= -2e+71) {
tmp = (c + (x * y)) - t_1;
} else if ((b * a) <= 5e+96) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * a) * 0.25d0
t_2 = (z * t) * 0.0625d0
if ((b * a) <= (-2d+71)) then
tmp = (c + (x * y)) - t_1
else if ((b * a) <= 5d+96) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + t_2) - 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 t_1 = (b * a) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((b * a) <= -2e+71) {
tmp = (c + (x * y)) - t_1;
} else if ((b * a) <= 5e+96) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 t_2 = (z * t) * 0.0625 tmp = 0 if (b * a) <= -2e+71: tmp = (c + (x * y)) - t_1 elif (b * a) <= 5e+96: tmp = c + ((x * y) + t_2) else: tmp = (c + t_2) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) t_2 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (Float64(b * a) <= -2e+71) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(b * a) <= 5e+96) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + t_2) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * 0.25; t_2 = (z * t) * 0.0625; tmp = 0.0; if ((b * a) <= -2e+71) tmp = (c + (x * y)) - t_1; elseif ((b * a) <= 5e+96) tmp = c + ((x * y) + t_2); else tmp = (c + t_2) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -2e+71], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 5e+96], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+71}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{+96}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e71Initial program 96.2%
Taylor expanded in z around 0 85.7%
if -2.0000000000000001e71 < (*.f64 a b) < 5.0000000000000004e96Initial program 99.4%
Taylor expanded in a around 0 95.4%
if 5.0000000000000004e96 < (*.f64 a b) Initial program 97.4%
Taylor expanded in x around 0 89.9%
Final simplification92.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (or (<= (* b a) -1.75e+176) (not (<= (* b a) 1.8e+179)))
(- t_1 (* (* b a) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if (((b * a) <= -1.75e+176) || !((b * a) <= 1.8e+179)) {
tmp = t_1 - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: tmp
t_1 = (z * t) * 0.0625d0
if (((b * a) <= (-1.75d+176)) .or. (.not. ((b * a) <= 1.8d+179))) then
tmp = t_1 - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + 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 t_1 = (z * t) * 0.0625;
double tmp;
if (((b * a) <= -1.75e+176) || !((b * a) <= 1.8e+179)) {
tmp = t_1 - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if ((b * a) <= -1.75e+176) or not ((b * a) <= 1.8e+179): tmp = t_1 - ((b * a) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if ((Float64(b * a) <= -1.75e+176) || !(Float64(b * a) <= 1.8e+179)) tmp = Float64(t_1 - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; tmp = 0.0; if (((b * a) <= -1.75e+176) || ~(((b * a) <= 1.8e+179))) tmp = t_1 - ((b * a) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(b * a), $MachinePrecision], -1.75e+176], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1.8e+179]], $MachinePrecision]], N[(t$95$1 - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;b \cdot a \leq -1.75 \cdot 10^{+176} \lor \neg \left(b \cdot a \leq 1.8 \cdot 10^{+179}\right):\\
\;\;\;\;t_1 - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.75000000000000001e176 or 1.7999999999999999e179 < (*.f64 a b) Initial program 95.0%
Taylor expanded in x around 0 89.4%
Taylor expanded in c around 0 85.0%
if -1.75000000000000001e176 < (*.f64 a b) < 1.7999999999999999e179Initial program 99.5%
Taylor expanded in a around 0 91.3%
Final simplification89.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -2e+71) (not (<= (* b a) 2e+111))) (+ (* x y) (- c (/ a (/ 4.0 b)))) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -2e+71) || !((b * a) <= 2e+111)) {
tmp = (x * y) + (c - (a / (4.0 / b)));
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((b * a) <= (-2d+71)) .or. (.not. ((b * a) <= 2d+111))) then
tmp = (x * y) + (c - (a / (4.0d0 / b)))
else
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
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 tmp;
if (((b * a) <= -2e+71) || !((b * a) <= 2e+111)) {
tmp = (x * y) + (c - (a / (4.0 / b)));
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -2e+71) or not ((b * a) <= 2e+111): tmp = (x * y) + (c - (a / (4.0 / b))) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -2e+71) || !(Float64(b * a) <= 2e+111)) tmp = Float64(Float64(x * y) + Float64(c - Float64(a / Float64(4.0 / b)))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -2e+71) || ~(((b * a) <= 2e+111))) tmp = (x * y) + (c - (a / (4.0 / b))); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -2e+71], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+111]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+71} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+111}\right):\\
\;\;\;\;x \cdot y + \left(c - \frac{a}{\frac{4}{b}}\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e71 or 1.99999999999999991e111 < (*.f64 a b) Initial program 96.6%
associate-+l-96.6%
sub-neg96.6%
neg-mul-196.6%
metadata-eval96.6%
metadata-eval96.6%
cancel-sign-sub-inv96.6%
fma-def96.6%
associate-/l*96.6%
metadata-eval96.6%
*-lft-identity96.6%
associate-/l*96.5%
Simplified96.5%
fma-udef96.5%
associate-/l*96.5%
+-commutative96.5%
associate-/l*96.5%
div-inv96.5%
clear-num96.5%
div-inv96.5%
metadata-eval96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 85.8%
if -2.0000000000000001e71 < (*.f64 a b) < 1.99999999999999991e111Initial program 99.4%
Taylor expanded in a around 0 94.9%
Final simplification91.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -2e+71) (not (<= (* b a) 2e+111))) (- (+ c (* x y)) (* (* b a) 0.25)) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -2e+71) || !((b * a) <= 2e+111)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((b * a) <= (-2d+71)) .or. (.not. ((b * a) <= 2d+111))) then
tmp = (c + (x * y)) - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
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 tmp;
if (((b * a) <= -2e+71) || !((b * a) <= 2e+111)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -2e+71) or not ((b * a) <= 2e+111): tmp = (c + (x * y)) - ((b * a) * 0.25) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -2e+71) || !(Float64(b * a) <= 2e+111)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -2e+71) || ~(((b * a) <= 2e+111))) tmp = (c + (x * y)) - ((b * a) * 0.25); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -2e+71], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+111]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+71} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+111}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e71 or 1.99999999999999991e111 < (*.f64 a b) Initial program 96.6%
Taylor expanded in z around 0 85.9%
if -2.0000000000000001e71 < (*.f64 a b) < 1.99999999999999991e111Initial program 99.4%
Taylor expanded in a around 0 94.9%
Final simplification91.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -1.35e+148)
(+ c (* -0.25 (* b a)))
(if (<= (* b a) 4.3e+172)
(+ c (+ (* x y) (* (* z t) 0.0625)))
(- (* x y) (* (* b a) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -1.35e+148) {
tmp = c + (-0.25 * (b * a));
} else if ((b * a) <= 4.3e+172) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else {
tmp = (x * y) - ((b * a) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if ((b * a) <= (-1.35d+148)) then
tmp = c + ((-0.25d0) * (b * a))
else if ((b * a) <= 4.3d+172) then
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
else
tmp = (x * y) - ((b * a) * 0.25d0)
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 tmp;
if ((b * a) <= -1.35e+148) {
tmp = c + (-0.25 * (b * a));
} else if ((b * a) <= 4.3e+172) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else {
tmp = (x * y) - ((b * a) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b * a) <= -1.35e+148: tmp = c + (-0.25 * (b * a)) elif (b * a) <= 4.3e+172: tmp = c + ((x * y) + ((z * t) * 0.0625)) else: tmp = (x * y) - ((b * a) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -1.35e+148) tmp = Float64(c + Float64(-0.25 * Float64(b * a))); elseif (Float64(b * a) <= 4.3e+172) tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); else tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b * a) <= -1.35e+148) tmp = c + (-0.25 * (b * a)); elseif ((b * a) <= 4.3e+172) tmp = c + ((x * y) + ((z * t) * 0.0625)); else tmp = (x * y) - ((b * a) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -1.35e+148], N[(c + N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4.3e+172], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.35 \cdot 10^{+148}:\\
\;\;\;\;c + -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{elif}\;b \cdot a \leq 4.3 \cdot 10^{+172}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -1.35000000000000009e148Initial program 93.8%
Taylor expanded in a around inf 84.2%
*-commutative84.2%
Simplified84.2%
if -1.35000000000000009e148 < (*.f64 a b) < 4.3000000000000003e172Initial program 99.5%
Taylor expanded in a around 0 91.7%
if 4.3000000000000003e172 < (*.f64 a b) Initial program 96.7%
Taylor expanded in z around 0 86.7%
Taylor expanded in c around 0 80.9%
Final simplification89.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (<= t -6.6e-6)
t_1
(if (<= t -4.4e-226)
(* x y)
(if (<= t -1.85e-275)
c
(if (<= t 9.2e-236)
(* x y)
(if (<= t 2.4e-112) c (if (<= t 5e+78) (* x y) t_1))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if (t <= -6.6e-6) {
tmp = t_1;
} else if (t <= -4.4e-226) {
tmp = x * y;
} else if (t <= -1.85e-275) {
tmp = c;
} else if (t <= 9.2e-236) {
tmp = x * y;
} else if (t <= 2.4e-112) {
tmp = c;
} else if (t <= 5e+78) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: tmp
t_1 = (z * t) * 0.0625d0
if (t <= (-6.6d-6)) then
tmp = t_1
else if (t <= (-4.4d-226)) then
tmp = x * y
else if (t <= (-1.85d-275)) then
tmp = c
else if (t <= 9.2d-236) then
tmp = x * y
else if (t <= 2.4d-112) then
tmp = c
else if (t <= 5d+78) then
tmp = x * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if (t <= -6.6e-6) {
tmp = t_1;
} else if (t <= -4.4e-226) {
tmp = x * y;
} else if (t <= -1.85e-275) {
tmp = c;
} else if (t <= 9.2e-236) {
tmp = x * y;
} else if (t <= 2.4e-112) {
tmp = c;
} else if (t <= 5e+78) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if t <= -6.6e-6: tmp = t_1 elif t <= -4.4e-226: tmp = x * y elif t <= -1.85e-275: tmp = c elif t <= 9.2e-236: tmp = x * y elif t <= 2.4e-112: tmp = c elif t <= 5e+78: tmp = x * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (t <= -6.6e-6) tmp = t_1; elseif (t <= -4.4e-226) tmp = Float64(x * y); elseif (t <= -1.85e-275) tmp = c; elseif (t <= 9.2e-236) tmp = Float64(x * y); elseif (t <= 2.4e-112) tmp = c; elseif (t <= 5e+78) tmp = Float64(x * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; tmp = 0.0; if (t <= -6.6e-6) tmp = t_1; elseif (t <= -4.4e-226) tmp = x * y; elseif (t <= -1.85e-275) tmp = c; elseif (t <= 9.2e-236) tmp = x * y; elseif (t <= 2.4e-112) tmp = c; elseif (t <= 5e+78) tmp = x * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[t, -6.6e-6], t$95$1, If[LessEqual[t, -4.4e-226], N[(x * y), $MachinePrecision], If[LessEqual[t, -1.85e-275], c, If[LessEqual[t, 9.2e-236], N[(x * y), $MachinePrecision], If[LessEqual[t, 2.4e-112], c, If[LessEqual[t, 5e+78], N[(x * y), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-226}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-275}:\\
\;\;\;\;c\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-236}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-112}:\\
\;\;\;\;c\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+78}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.60000000000000034e-6 or 4.99999999999999984e78 < t Initial program 97.0%
Taylor expanded in x around 0 78.8%
Taylor expanded in t around inf 50.3%
if -6.60000000000000034e-6 < t < -4.4e-226 or -1.84999999999999985e-275 < t < 9.20000000000000024e-236 or 2.4000000000000001e-112 < t < 4.99999999999999984e78Initial program 99.1%
Taylor expanded in a around 0 71.3%
Taylor expanded in c around 0 46.9%
Taylor expanded in y around inf 36.7%
if -4.4e-226 < t < -1.84999999999999985e-275 or 9.20000000000000024e-236 < t < 2.4000000000000001e-112Initial program 100.0%
Taylor expanded in c around inf 56.0%
Final simplification44.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* -0.25 (* b a)))) (t_2 (+ (* x y) (* (* z t) 0.0625))))
(if (<= z -4e+89)
t_2
(if (<= z -57000.0)
t_1
(if (<= z -2.3e-274) (+ c (* x y)) (if (<= z 8e-108) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (-0.25 * (b * a));
double t_2 = (x * y) + ((z * t) * 0.0625);
double tmp;
if (z <= -4e+89) {
tmp = t_2;
} else if (z <= -57000.0) {
tmp = t_1;
} else if (z <= -2.3e-274) {
tmp = c + (x * y);
} else if (z <= 8e-108) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + ((-0.25d0) * (b * a))
t_2 = (x * y) + ((z * t) * 0.0625d0)
if (z <= (-4d+89)) then
tmp = t_2
else if (z <= (-57000.0d0)) then
tmp = t_1
else if (z <= (-2.3d-274)) then
tmp = c + (x * y)
else if (z <= 8d-108) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (-0.25 * (b * a));
double t_2 = (x * y) + ((z * t) * 0.0625);
double tmp;
if (z <= -4e+89) {
tmp = t_2;
} else if (z <= -57000.0) {
tmp = t_1;
} else if (z <= -2.3e-274) {
tmp = c + (x * y);
} else if (z <= 8e-108) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (-0.25 * (b * a)) t_2 = (x * y) + ((z * t) * 0.0625) tmp = 0 if z <= -4e+89: tmp = t_2 elif z <= -57000.0: tmp = t_1 elif z <= -2.3e-274: tmp = c + (x * y) elif z <= 8e-108: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(-0.25 * Float64(b * a))) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)) tmp = 0.0 if (z <= -4e+89) tmp = t_2; elseif (z <= -57000.0) tmp = t_1; elseif (z <= -2.3e-274) tmp = Float64(c + Float64(x * y)); elseif (z <= 8e-108) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (-0.25 * (b * a)); t_2 = (x * y) + ((z * t) * 0.0625); tmp = 0.0; if (z <= -4e+89) tmp = t_2; elseif (z <= -57000.0) tmp = t_1; elseif (z <= -2.3e-274) tmp = c + (x * y); elseif (z <= 8e-108) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+89], t$95$2, If[LessEqual[z, -57000.0], t$95$1, If[LessEqual[z, -2.3e-274], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-108], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + -0.25 \cdot \left(b \cdot a\right)\\
t_2 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;z \leq -4 \cdot 10^{+89}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -57000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-274}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.99999999999999998e89 or 8.00000000000000032e-108 < z Initial program 97.2%
Taylor expanded in a around 0 82.7%
Taylor expanded in c around 0 69.1%
if -3.99999999999999998e89 < z < -57000 or -2.29999999999999996e-274 < z < 8.00000000000000032e-108Initial program 100.0%
Taylor expanded in a around inf 74.9%
*-commutative74.9%
Simplified74.9%
if -57000 < z < -2.29999999999999996e-274Initial program 100.0%
Taylor expanded in x around inf 67.8%
Final simplification70.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (/ (* z t) 16.0) (* x y)) (/ (* b a) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
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
code = c + ((((z * t) / 16.0d0) + (x * y)) - ((b * a) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + ((((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + ((((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5.1e+174) (not (<= (* b a) 1.35e+182))) (* -0.25 (* b a)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5.1e+174) || !((b * a) <= 1.35e+182)) {
tmp = -0.25 * (b * a);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((b * a) <= (-5.1d+174)) .or. (.not. ((b * a) <= 1.35d+182))) then
tmp = (-0.25d0) * (b * a)
else
tmp = c + (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 tmp;
if (((b * a) <= -5.1e+174) || !((b * a) <= 1.35e+182)) {
tmp = -0.25 * (b * a);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -5.1e+174) or not ((b * a) <= 1.35e+182): tmp = -0.25 * (b * a) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -5.1e+174) || !(Float64(b * a) <= 1.35e+182)) tmp = Float64(-0.25 * Float64(b * a)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -5.1e+174) || ~(((b * a) <= 1.35e+182))) tmp = -0.25 * (b * a); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -5.1e+174], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1.35e+182]], $MachinePrecision]], N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5.1 \cdot 10^{+174} \lor \neg \left(b \cdot a \leq 1.35 \cdot 10^{+182}\right):\\
\;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0999999999999997e174 or 1.3500000000000001e182 < (*.f64 a b) Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
neg-mul-195.0%
metadata-eval95.0%
metadata-eval95.0%
cancel-sign-sub-inv95.0%
fma-def95.0%
associate-/l*94.9%
metadata-eval94.9%
*-lft-identity94.9%
associate-/l*94.8%
Simplified94.8%
fma-udef94.8%
associate-/l*94.8%
+-commutative94.8%
associate-/l*94.8%
div-inv94.8%
clear-num94.8%
div-inv94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
Simplified76.9%
if -5.0999999999999997e174 < (*.f64 a b) < 1.3500000000000001e182Initial program 99.5%
Taylor expanded in x around inf 63.5%
Final simplification66.6%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -9500000.0) (* x y) (if (<= y 5.5e+83) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -9500000.0) {
tmp = x * y;
} else if (y <= 5.5e+83) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (y <= (-9500000.0d0)) then
tmp = x * y
else if (y <= 5.5d+83) then
tmp = c
else
tmp = 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 tmp;
if (y <= -9500000.0) {
tmp = x * y;
} else if (y <= 5.5e+83) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -9500000.0: tmp = x * y elif y <= 5.5e+83: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -9500000.0) tmp = Float64(x * y); elseif (y <= 5.5e+83) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -9500000.0) tmp = x * y; elseif (y <= 5.5e+83) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -9500000.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 5.5e+83], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9500000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+83}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -9.5e6 or 5.4999999999999996e83 < y Initial program 96.6%
Taylor expanded in a around 0 86.7%
Taylor expanded in c around 0 66.3%
Taylor expanded in y around inf 52.1%
if -9.5e6 < y < 5.4999999999999996e83Initial program 99.4%
Taylor expanded in c around inf 28.2%
Final simplification36.5%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 98.4%
Taylor expanded in c around inf 25.7%
Final simplification25.7%
herbie shell --seed 2023181
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))