
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) 1e+283)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (fma z t (fma c (* i (- (fma b c a))) (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= 1e+283) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * fma(z, t, fma(c, (i * -fma(b, c, a)), (x * y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= 1e+283) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * fma(z, t, fma(c, Float64(i * Float64(-fma(b, c, a))), Float64(x * y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], 1e+283], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t + N[(c * N[(i * (-N[(b * c + a), $MachinePrecision])), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq 10^{+283}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i \cdot \left(-\mathsf{fma}\left(b, c, a\right)\right), x \cdot y\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < 9.99999999999999955e282Initial program 95.0%
associate-*l*98.0%
fma-def98.0%
Simplified98.0%
if 9.99999999999999955e282 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 75.9%
associate--l+75.9%
+-commutative75.9%
associate-+l-75.9%
fma-neg83.4%
neg-sub083.4%
associate-+l-83.4%
neg-sub083.4%
distribute-rgt-neg-in83.4%
*-commutative83.4%
associate-*l*89.4%
fma-def90.9%
+-commutative90.9%
fma-def90.9%
Simplified90.9%
Final simplification96.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.9%
associate-*l*98.0%
fma-def98.0%
Simplified98.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 53.9%
Taylor expanded in i around 0 53.9%
Final simplification95.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ a (* b c))) (t_3 (* c t_2)))
(if (<= t_3 (- INFINITY))
(* 2.0 (- t_1 (* c (* c (* b i)))))
(if (<= t_3 1e+274)
(* 2.0 (- t_1 (* i (+ (* c (* b c)) (* a c)))))
(* 2.0 (- (* x y) (* c (* t_2 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = a + (b * c);
double t_3 = c * t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else if (t_3 <= 1e+274) {
tmp = 2.0 * (t_1 - (i * ((c * (b * c)) + (a * c))));
} else {
tmp = 2.0 * ((x * y) - (c * (t_2 * i)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = a + (b * c);
double t_3 = c * t_2;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else if (t_3 <= 1e+274) {
tmp = 2.0 * (t_1 - (i * ((c * (b * c)) + (a * c))));
} else {
tmp = 2.0 * ((x * y) - (c * (t_2 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = a + (b * c) t_3 = c * t_2 tmp = 0 if t_3 <= -math.inf: tmp = 2.0 * (t_1 - (c * (c * (b * i)))) elif t_3 <= 1e+274: tmp = 2.0 * (t_1 - (i * ((c * (b * c)) + (a * c)))) else: tmp = 2.0 * ((x * y) - (c * (t_2 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(a + Float64(b * c)) t_3 = Float64(c * t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i))))); elseif (t_3 <= 1e+274) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(Float64(c * Float64(b * c)) + Float64(a * c))))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(t_2 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = a + (b * c); t_3 = c * t_2; tmp = 0.0; if (t_3 <= -Inf) tmp = 2.0 * (t_1 - (c * (c * (b * i)))); elseif (t_3 <= 1e+274) tmp = 2.0 * (t_1 - (i * ((c * (b * c)) + (a * c)))); else tmp = 2.0 * ((x * y) - (c * (t_2 * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+274], N[(2.0 * N[(t$95$1 - N[(i * N[(N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a + b \cdot c\\
t_3 := c \cdot t_2\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;t_3 \leq 10^{+274}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \left(b \cdot c\right) + a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(t_2 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 71.7%
Taylor expanded in a around 0 76.7%
unpow276.7%
associate-*r*85.5%
Simplified85.5%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.99999999999999921e273Initial program 98.3%
*-commutative98.3%
+-commutative98.3%
distribute-rgt-in98.3%
Applied egg-rr98.3%
if 9.99999999999999921e273 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 65.8%
Taylor expanded in z around 0 86.8%
Final simplification95.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ a (* b c))) (t_3 (* c t_2)))
(if (<= t_3 (- INFINITY))
(* 2.0 (- t_1 (* c (* c (* b i)))))
(if (<= t_3 1e+274)
(* (- t_1 (* t_3 i)) 2.0)
(* 2.0 (- (* x y) (* c (* t_2 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = a + (b * c);
double t_3 = c * t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else if (t_3 <= 1e+274) {
tmp = (t_1 - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - (c * (t_2 * i)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = a + (b * c);
double t_3 = c * t_2;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else if (t_3 <= 1e+274) {
tmp = (t_1 - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - (c * (t_2 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = a + (b * c) t_3 = c * t_2 tmp = 0 if t_3 <= -math.inf: tmp = 2.0 * (t_1 - (c * (c * (b * i)))) elif t_3 <= 1e+274: tmp = (t_1 - (t_3 * i)) * 2.0 else: tmp = 2.0 * ((x * y) - (c * (t_2 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(a + Float64(b * c)) t_3 = Float64(c * t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i))))); elseif (t_3 <= 1e+274) tmp = Float64(Float64(t_1 - Float64(t_3 * i)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(t_2 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = a + (b * c); t_3 = c * t_2; tmp = 0.0; if (t_3 <= -Inf) tmp = 2.0 * (t_1 - (c * (c * (b * i)))); elseif (t_3 <= 1e+274) tmp = (t_1 - (t_3 * i)) * 2.0; else tmp = 2.0 * ((x * y) - (c * (t_2 * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+274], N[(N[(t$95$1 - N[(t$95$3 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a + b \cdot c\\
t_3 := c \cdot t_2\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;t_3 \leq 10^{+274}:\\
\;\;\;\;\left(t_1 - t_3 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(t_2 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 71.7%
Taylor expanded in a around 0 76.7%
unpow276.7%
associate-*r*85.5%
Simplified85.5%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.99999999999999921e273Initial program 98.3%
if 9.99999999999999921e273 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 65.8%
Taylor expanded in z around 0 86.8%
Final simplification94.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -4.4e+18)
(not
(or (<= c -6.4e-37) (and (not (<= c -5.8e-160)) (<= c 3.8e-70)))))
(* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
(* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4.4e+18) || !((c <= -6.4e-37) || (!(c <= -5.8e-160) && (c <= 3.8e-70)))) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if ((c <= (-4.4d+18)) .or. (.not. (c <= (-6.4d-37)) .or. (.not. (c <= (-5.8d-160))) .and. (c <= 3.8d-70))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 tmp;
if ((c <= -4.4e+18) || !((c <= -6.4e-37) || (!(c <= -5.8e-160) && (c <= 3.8e-70)))) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4.4e+18) or not ((c <= -6.4e-37) or (not (c <= -5.8e-160) and (c <= 3.8e-70))): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -4.4e+18) || !((c <= -6.4e-37) || (!(c <= -5.8e-160) && (c <= 3.8e-70)))) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -4.4e+18) || ~(((c <= -6.4e-37) || (~((c <= -5.8e-160)) && (c <= 3.8e-70))))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -4.4e+18], N[Not[Or[LessEqual[c, -6.4e-37], And[N[Not[LessEqual[c, -5.8e-160]], $MachinePrecision], LessEqual[c, 3.8e-70]]]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.4 \cdot 10^{+18} \lor \neg \left(c \leq -6.4 \cdot 10^{-37} \lor \neg \left(c \leq -5.8 \cdot 10^{-160}\right) \land c \leq 3.8 \cdot 10^{-70}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -4.4e18 or -6.3999999999999998e-37 < c < -5.7999999999999998e-160 or 3.7999999999999998e-70 < c Initial program 85.2%
Taylor expanded in z around 0 81.9%
if -4.4e18 < c < -6.3999999999999998e-37 or -5.7999999999999998e-160 < c < 3.7999999999999998e-70Initial program 97.9%
Taylor expanded in c around 0 91.3%
Final simplification85.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
(if (<= c -2.7e+63)
(* 2.0 (- (* x y) (* c (* c (* b i)))))
(if (<= c -1.85e-63)
t_1
(if (<= c -5.4e-160)
(* 2.0 (- (* x y) (* i (* a c))))
(if (<= c 3e-50) (* (+ (* x y) (* z t)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -2.7e+63) {
tmp = 2.0 * ((x * y) - (c * (c * (b * i))));
} else if (c <= -1.85e-63) {
tmp = t_1;
} else if (c <= -5.4e-160) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (c <= 3e-50) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
if (c <= (-2.7d+63)) then
tmp = 2.0d0 * ((x * y) - (c * (c * (b * i))))
else if (c <= (-1.85d-63)) then
tmp = t_1
else if (c <= (-5.4d-160)) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
else if (c <= 3d-50) then
tmp = ((x * y) + (z * t)) * 2.0d0
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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -2.7e+63) {
tmp = 2.0 * ((x * y) - (c * (c * (b * i))));
} else if (c <= -1.85e-63) {
tmp = t_1;
} else if (c <= -5.4e-160) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (c <= 3e-50) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) tmp = 0 if c <= -2.7e+63: tmp = 2.0 * ((x * y) - (c * (c * (b * i)))) elif c <= -1.85e-63: tmp = t_1 elif c <= -5.4e-160: tmp = 2.0 * ((x * y) - (i * (a * c))) elif c <= 3e-50: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) tmp = 0.0 if (c <= -2.7e+63) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(c * Float64(b * i))))); elseif (c <= -1.85e-63) tmp = t_1; elseif (c <= -5.4e-160) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); elseif (c <= 3e-50) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); tmp = 0.0; if (c <= -2.7e+63) tmp = 2.0 * ((x * y) - (c * (c * (b * i)))); elseif (c <= -1.85e-63) tmp = t_1; elseif (c <= -5.4e-160) tmp = 2.0 * ((x * y) - (i * (a * c))); elseif (c <= 3e-50) tmp = ((x * y) + (z * t)) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.7e+63], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.85e-63], t$95$1, If[LessEqual[c, -5.4e-160], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3e-50], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.7 \cdot 10^{+63}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq -1.85 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -5.4 \cdot 10^{-160}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-50}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -2.70000000000000017e63Initial program 73.7%
Taylor expanded in z around 0 81.6%
Taylor expanded in c around inf 81.3%
if -2.70000000000000017e63 < c < -1.85000000000000006e-63 or 2.9999999999999999e-50 < c Initial program 87.4%
Taylor expanded in x around 0 74.8%
if -1.85000000000000006e-63 < c < -5.40000000000000019e-160Initial program 99.8%
Taylor expanded in z around 0 85.4%
Taylor expanded in c around 0 82.1%
mul-1-neg82.1%
sub-neg82.1%
associate-*r*89.1%
*-commutative89.1%
*-commutative89.1%
Simplified89.1%
if -5.40000000000000019e-160 < c < 2.9999999999999999e-50Initial program 97.7%
Taylor expanded in c around 0 90.5%
Final simplification82.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y)))
(t_2 (* -2.0 (* c (* c (* b i)))))
(t_3 (* 2.0 (* z t))))
(if (<= c -1.7e+18)
t_2
(if (<= c -4.1e-160)
t_1
(if (<= c -6.2e-220)
t_3
(if (<= c 6.2e-115)
t_1
(if (<= c 3.3e-84) t_3 (if (<= c 1.05e+17) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = -2.0 * (c * (c * (b * i)));
double t_3 = 2.0 * (z * t);
double tmp;
if (c <= -1.7e+18) {
tmp = t_2;
} else if (c <= -4.1e-160) {
tmp = t_1;
} else if (c <= -6.2e-220) {
tmp = t_3;
} else if (c <= 6.2e-115) {
tmp = t_1;
} else if (c <= 3.3e-84) {
tmp = t_3;
} else if (c <= 1.05e+17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = (-2.0d0) * (c * (c * (b * i)))
t_3 = 2.0d0 * (z * t)
if (c <= (-1.7d+18)) then
tmp = t_2
else if (c <= (-4.1d-160)) then
tmp = t_1
else if (c <= (-6.2d-220)) then
tmp = t_3
else if (c <= 6.2d-115) then
tmp = t_1
else if (c <= 3.3d-84) then
tmp = t_3
else if (c <= 1.05d+17) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = -2.0 * (c * (c * (b * i)));
double t_3 = 2.0 * (z * t);
double tmp;
if (c <= -1.7e+18) {
tmp = t_2;
} else if (c <= -4.1e-160) {
tmp = t_1;
} else if (c <= -6.2e-220) {
tmp = t_3;
} else if (c <= 6.2e-115) {
tmp = t_1;
} else if (c <= 3.3e-84) {
tmp = t_3;
} else if (c <= 1.05e+17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) t_2 = -2.0 * (c * (c * (b * i))) t_3 = 2.0 * (z * t) tmp = 0 if c <= -1.7e+18: tmp = t_2 elif c <= -4.1e-160: tmp = t_1 elif c <= -6.2e-220: tmp = t_3 elif c <= 6.2e-115: tmp = t_1 elif c <= 3.3e-84: tmp = t_3 elif c <= 1.05e+17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) t_2 = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))) t_3 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (c <= -1.7e+18) tmp = t_2; elseif (c <= -4.1e-160) tmp = t_1; elseif (c <= -6.2e-220) tmp = t_3; elseif (c <= 6.2e-115) tmp = t_1; elseif (c <= 3.3e-84) tmp = t_3; elseif (c <= 1.05e+17) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); t_2 = -2.0 * (c * (c * (b * i))); t_3 = 2.0 * (z * t); tmp = 0.0; if (c <= -1.7e+18) tmp = t_2; elseif (c <= -4.1e-160) tmp = t_1; elseif (c <= -6.2e-220) tmp = t_3; elseif (c <= 6.2e-115) tmp = t_1; elseif (c <= 3.3e-84) tmp = t_3; elseif (c <= 1.05e+17) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.7e+18], t$95$2, If[LessEqual[c, -4.1e-160], t$95$1, If[LessEqual[c, -6.2e-220], t$95$3, If[LessEqual[c, 6.2e-115], t$95$1, If[LessEqual[c, 3.3e-84], t$95$3, If[LessEqual[c, 1.05e+17], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := -2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
t_3 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;c \leq -1.7 \cdot 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -4.1 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -6.2 \cdot 10^{-220}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 6.2 \cdot 10^{-115}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.3 \cdot 10^{-84}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.05 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.7e18 or 1.05e17 < c Initial program 79.2%
associate-*r*87.7%
*-commutative87.7%
+-commutative87.7%
distribute-lft-in77.0%
Applied egg-rr77.0%
Taylor expanded in c around inf 56.2%
mul-1-neg56.2%
unpow256.2%
associate-*r*57.4%
associate-*l*58.3%
*-commutative58.3%
associate-*r*56.7%
distribute-rgt-neg-in56.7%
associate-*r*58.3%
*-commutative58.3%
associate-*l*57.4%
Simplified57.4%
Taylor expanded in c around 0 56.2%
unpow256.2%
associate-*r*57.4%
Simplified57.4%
if -1.7e18 < c < -4.10000000000000002e-160 or -6.20000000000000023e-220 < c < 6.20000000000000013e-115 or 3.29999999999999984e-84 < c < 1.05e17Initial program 99.1%
Taylor expanded in x around inf 53.2%
if -4.10000000000000002e-160 < c < -6.20000000000000023e-220 or 6.20000000000000013e-115 < c < 3.29999999999999984e-84Initial program 94.1%
Taylor expanded in z around inf 82.9%
Final simplification57.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* c (* c (* b i)))))) (t_2 (* i (* a c))))
(if (<= c -1.85e+27)
t_1
(if (<= c -7.5e-40)
(* 2.0 (- (* z t) t_2))
(if (<= c -5.8e-160)
(* 2.0 (- (* x y) t_2))
(if (<= c 2.05e+17) (* (+ (* x y) (* z t)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((x * y) - (c * (c * (b * i))));
double t_2 = i * (a * c);
double tmp;
if (c <= -1.85e+27) {
tmp = t_1;
} else if (c <= -7.5e-40) {
tmp = 2.0 * ((z * t) - t_2);
} else if (c <= -5.8e-160) {
tmp = 2.0 * ((x * y) - t_2);
} else if (c <= 2.05e+17) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * ((x * y) - (c * (c * (b * i))))
t_2 = i * (a * c)
if (c <= (-1.85d+27)) then
tmp = t_1
else if (c <= (-7.5d-40)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (c <= (-5.8d-160)) then
tmp = 2.0d0 * ((x * y) - t_2)
else if (c <= 2.05d+17) then
tmp = ((x * y) + (z * t)) * 2.0d0
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 t_1 = 2.0 * ((x * y) - (c * (c * (b * i))));
double t_2 = i * (a * c);
double tmp;
if (c <= -1.85e+27) {
tmp = t_1;
} else if (c <= -7.5e-40) {
tmp = 2.0 * ((z * t) - t_2);
} else if (c <= -5.8e-160) {
tmp = 2.0 * ((x * y) - t_2);
} else if (c <= 2.05e+17) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (c * (c * (b * i)))) t_2 = i * (a * c) tmp = 0 if c <= -1.85e+27: tmp = t_1 elif c <= -7.5e-40: tmp = 2.0 * ((z * t) - t_2) elif c <= -5.8e-160: tmp = 2.0 * ((x * y) - t_2) elif c <= 2.05e+17: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(c * Float64(b * i))))) t_2 = Float64(i * Float64(a * c)) tmp = 0.0 if (c <= -1.85e+27) tmp = t_1; elseif (c <= -7.5e-40) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (c <= -5.8e-160) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); elseif (c <= 2.05e+17) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) - (c * (c * (b * i)))); t_2 = i * (a * c); tmp = 0.0; if (c <= -1.85e+27) tmp = t_1; elseif (c <= -7.5e-40) tmp = 2.0 * ((z * t) - t_2); elseif (c <= -5.8e-160) tmp = 2.0 * ((x * y) - t_2); elseif (c <= 2.05e+17) tmp = ((x * y) + (z * t)) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.85e+27], t$95$1, If[LessEqual[c, -7.5e-40], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -5.8e-160], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.05e+17], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
t_2 := i \cdot \left(a \cdot c\right)\\
\mathbf{if}\;c \leq -1.85 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -7.5 \cdot 10^{-40}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\
\mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\
\mathbf{elif}\;c \leq 2.05 \cdot 10^{+17}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -1.85000000000000001e27 or 2.05e17 < c Initial program 78.2%
Taylor expanded in z around 0 83.1%
Taylor expanded in c around inf 75.4%
if -1.85000000000000001e27 < c < -7.50000000000000069e-40Initial program 99.8%
Taylor expanded in a around inf 93.0%
associate-*r*98.6%
*-commutative98.6%
associate-*r*98.7%
Simplified98.7%
Taylor expanded in x around 0 74.7%
associate-*r*80.3%
*-commutative80.3%
Simplified80.3%
if -7.50000000000000069e-40 < c < -5.7999999999999998e-160Initial program 99.8%
Taylor expanded in z around 0 85.1%
Taylor expanded in c around 0 76.3%
mul-1-neg76.3%
sub-neg76.3%
associate-*r*81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
if -5.7999999999999998e-160 < c < 2.05e17Initial program 98.0%
Taylor expanded in c around 0 87.1%
Final simplification81.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -8e+18)
t_2
(if (<= c -3.2e-63)
t_1
(if (<= c -5.8e-160)
(* 2.0 (- (* x y) (* i (* a c))))
(if (<= c 3.6e+33) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -8e+18) {
tmp = t_2;
} else if (c <= -3.2e-63) {
tmp = t_1;
} else if (c <= -5.8e-160) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (c <= 3.6e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-8d+18)) then
tmp = t_2
else if (c <= (-3.2d-63)) then
tmp = t_1
else if (c <= (-5.8d-160)) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
else if (c <= 3.6d+33) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -8e+18) {
tmp = t_2;
} else if (c <= -3.2e-63) {
tmp = t_1;
} else if (c <= -5.8e-160) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (c <= 3.6e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -8e+18: tmp = t_2 elif c <= -3.2e-63: tmp = t_1 elif c <= -5.8e-160: tmp = 2.0 * ((x * y) - (i * (a * c))) elif c <= 3.6e+33: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -8e+18) tmp = t_2; elseif (c <= -3.2e-63) tmp = t_1; elseif (c <= -5.8e-160) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); elseif (c <= 3.6e+33) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -8e+18) tmp = t_2; elseif (c <= -3.2e-63) tmp = t_1; elseif (c <= -5.8e-160) tmp = 2.0 * ((x * y) - (i * (a * c))); elseif (c <= 3.6e+33) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8e+18], t$95$2, If[LessEqual[c, -3.2e-63], t$95$1, If[LessEqual[c, -5.8e-160], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.6e+33], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -8 \cdot 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -3.2 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -8e18 or 3.6000000000000003e33 < c Initial program 79.3%
Taylor expanded in i around inf 69.6%
Taylor expanded in i around 0 69.6%
if -8e18 < c < -3.19999999999999989e-63 or -5.7999999999999998e-160 < c < 3.6000000000000003e33Initial program 97.5%
Taylor expanded in c around 0 84.5%
if -3.19999999999999989e-63 < c < -5.7999999999999998e-160Initial program 99.7%
Taylor expanded in z around 0 86.0%
Taylor expanded in c around 0 82.8%
mul-1-neg82.8%
sub-neg82.8%
associate-*r*89.4%
*-commutative89.4%
*-commutative89.4%
Simplified89.4%
Final simplification78.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.45e+27) (not (<= c 1.3e+17))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.45e+27) || !(c <= 1.3e+17)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if ((c <= (-1.45d+27)) .or. (.not. (c <= 1.3d+17))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.45e+27) || !(c <= 1.3e+17)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.45e+27) or not (c <= 1.3e+17): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.45e+27) || !(c <= 1.3e+17)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.45e+27) || ~((c <= 1.3e+17))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.45e+27], N[Not[LessEqual[c, 1.3e+17]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{+27} \lor \neg \left(c \leq 1.3 \cdot 10^{+17}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.4500000000000001e27 or 1.3e17 < c Initial program 78.4%
Taylor expanded in z around 0 83.3%
if -1.4500000000000001e27 < c < 1.3e17Initial program 98.6%
Taylor expanded in a around inf 88.8%
associate-*r*94.5%
*-commutative94.5%
associate-*r*93.9%
Simplified93.9%
Final simplification89.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.2e+27) (not (<= c 5.8e+17))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.2e+27) || !(c <= 5.8e+17)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if ((c <= (-1.2d+27)) .or. (.not. (c <= 5.8d+17))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.2e+27) || !(c <= 5.8e+17)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.2e+27) or not (c <= 5.8e+17): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.2e+27) || !(c <= 5.8e+17)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.2e+27) || ~((c <= 5.8e+17))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.2e+27], N[Not[LessEqual[c, 5.8e+17]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.2 \cdot 10^{+27} \lor \neg \left(c \leq 5.8 \cdot 10^{+17}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -1.19999999999999999e27 or 5.8e17 < c Initial program 78.4%
Taylor expanded in z around 0 83.3%
if -1.19999999999999999e27 < c < 5.8e17Initial program 98.6%
Taylor expanded in a around inf 94.5%
Final simplification89.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.8e+21) (not (<= c 1.1e+33))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.8e+21) || !(c <= 1.1e+33)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if ((c <= (-3.8d+21)) .or. (.not. (c <= 1.1d+33))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 tmp;
if ((c <= -3.8e+21) || !(c <= 1.1e+33)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.8e+21) or not (c <= 1.1e+33): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.8e+21) || !(c <= 1.1e+33)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.8e+21) || ~((c <= 1.1e+33))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.8e+21], N[Not[LessEqual[c, 1.1e+33]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.8 \cdot 10^{+21} \lor \neg \left(c \leq 1.1 \cdot 10^{+33}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -3.8e21 or 1.09999999999999997e33 < c Initial program 79.3%
Taylor expanded in i around inf 69.6%
Taylor expanded in i around 0 69.6%
if -3.8e21 < c < 1.09999999999999997e33Initial program 97.9%
Taylor expanded in c around 0 80.9%
Final simplification76.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7.5e+84) (not (<= c 2.75e+181))) (* -2.0 (* c (* c (* b i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -7.5e+84) || !(c <= 2.75e+181)) {
tmp = -2.0 * (c * (c * (b * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if ((c <= (-7.5d+84)) .or. (.not. (c <= 2.75d+181))) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 tmp;
if ((c <= -7.5e+84) || !(c <= 2.75e+181)) {
tmp = -2.0 * (c * (c * (b * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -7.5e+84) or not (c <= 2.75e+181): tmp = -2.0 * (c * (c * (b * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -7.5e+84) || !(c <= 2.75e+181)) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -7.5e+84) || ~((c <= 2.75e+181))) tmp = -2.0 * (c * (c * (b * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -7.5e+84], N[Not[LessEqual[c, 2.75e+181]], $MachinePrecision]], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.5 \cdot 10^{+84} \lor \neg \left(c \leq 2.75 \cdot 10^{+181}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -7.5000000000000001e84 or 2.74999999999999996e181 < c Initial program 75.1%
associate-*r*84.9%
*-commutative84.9%
+-commutative84.9%
distribute-lft-in71.4%
Applied egg-rr71.4%
Taylor expanded in c around inf 70.2%
mul-1-neg70.2%
unpow270.2%
associate-*r*73.7%
associate-*l*75.3%
*-commutative75.3%
associate-*r*73.9%
distribute-rgt-neg-in73.9%
associate-*r*75.3%
*-commutative75.3%
associate-*l*73.7%
Simplified73.7%
Taylor expanded in c around 0 70.2%
unpow270.2%
associate-*r*73.7%
Simplified73.7%
if -7.5000000000000001e84 < c < 2.74999999999999996e181Initial program 94.5%
Taylor expanded in c around 0 71.7%
Final simplification72.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -4.2e+109)
(* -2.0 (* c (* c (* b i))))
(if (<= c 1.52e+116)
(* (+ (* x y) (* z t)) 2.0)
(* c (* -2.0 (* (* b c) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.2e+109) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 1.52e+116) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = c * (-2.0 * ((b * c) * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if (c <= (-4.2d+109)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= 1.52d+116) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = c * ((-2.0d0) * ((b * c) * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.2e+109) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 1.52e+116) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = c * (-2.0 * ((b * c) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.2e+109: tmp = -2.0 * (c * (c * (b * i))) elif c <= 1.52e+116: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = c * (-2.0 * ((b * c) * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.2e+109) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= 1.52e+116) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(c * Float64(-2.0 * Float64(Float64(b * c) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.2e+109) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= 1.52e+116) tmp = ((x * y) + (z * t)) * 2.0; else tmp = c * (-2.0 * ((b * c) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.2e+109], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.52e+116], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(c * N[(-2.0 * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.2 \cdot 10^{+109}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.52 \cdot 10^{+116}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -4.2000000000000003e109Initial program 70.9%
associate-*r*81.4%
*-commutative81.4%
+-commutative81.4%
distribute-lft-in62.5%
Applied egg-rr62.5%
Taylor expanded in c around inf 68.4%
mul-1-neg68.4%
unpow268.4%
associate-*r*71.3%
associate-*l*71.3%
*-commutative71.3%
associate-*r*69.0%
distribute-rgt-neg-in69.0%
associate-*r*71.3%
*-commutative71.3%
associate-*l*71.3%
Simplified71.3%
Taylor expanded in c around 0 68.4%
unpow268.4%
associate-*r*71.3%
Simplified71.3%
if -4.2000000000000003e109 < c < 1.52e116Initial program 95.7%
Taylor expanded in c around 0 74.3%
if 1.52e116 < c Initial program 81.5%
associate-*r*86.4%
*-commutative86.4%
+-commutative86.4%
distribute-lft-in83.7%
Applied egg-rr83.7%
Taylor expanded in c around inf 60.0%
mul-1-neg60.0%
unpow260.0%
associate-*r*60.6%
associate-*l*63.3%
*-commutative63.3%
associate-*r*65.7%
distribute-rgt-neg-in65.7%
associate-*r*63.3%
*-commutative63.3%
associate-*l*60.6%
Simplified60.6%
Taylor expanded in c around 0 60.0%
*-commutative60.0%
unpow260.0%
associate-*r*60.6%
associate-*l*60.6%
associate-*r*63.3%
*-commutative63.3%
associate-*r*65.7%
Simplified65.7%
Final simplification72.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -3.2e+102)
(* 2.0 (* c (* b (* c (- i)))))
(if (<= c 4.2e+115)
(* (+ (* x y) (* z t)) 2.0)
(* c (* -2.0 (* (* b c) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -3.2e+102) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 4.2e+115) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = c * (-2.0 * ((b * c) * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if (c <= (-3.2d+102)) then
tmp = 2.0d0 * (c * (b * (c * -i)))
else if (c <= 4.2d+115) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = c * ((-2.0d0) * ((b * c) * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -3.2e+102) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 4.2e+115) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = c * (-2.0 * ((b * c) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -3.2e+102: tmp = 2.0 * (c * (b * (c * -i))) elif c <= 4.2e+115: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = c * (-2.0 * ((b * c) * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -3.2e+102) tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i))))); elseif (c <= 4.2e+115) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(c * Float64(-2.0 * Float64(Float64(b * c) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -3.2e+102) tmp = 2.0 * (c * (b * (c * -i))); elseif (c <= 4.2e+115) tmp = ((x * y) + (z * t)) * 2.0; else tmp = c * (-2.0 * ((b * c) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -3.2e+102], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e+115], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(c * N[(-2.0 * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.2 \cdot 10^{+102}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{+115}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -3.1999999999999999e102Initial program 70.9%
associate-*r*81.4%
*-commutative81.4%
+-commutative81.4%
distribute-lft-in62.5%
Applied egg-rr62.5%
Taylor expanded in c around inf 68.4%
mul-1-neg68.4%
unpow268.4%
associate-*r*71.3%
associate-*l*71.3%
*-commutative71.3%
associate-*r*69.0%
distribute-rgt-neg-in69.0%
associate-*r*71.3%
*-commutative71.3%
associate-*l*71.3%
Simplified71.3%
Taylor expanded in c around 0 68.4%
mul-1-neg68.4%
unpow268.4%
associate-*r*71.3%
distribute-rgt-neg-in71.3%
distribute-lft-neg-out71.3%
associate-*r*71.3%
distribute-lft-neg-in71.3%
distribute-rgt-neg-in71.3%
Simplified71.3%
if -3.1999999999999999e102 < c < 4.20000000000000007e115Initial program 95.7%
Taylor expanded in c around 0 74.3%
if 4.20000000000000007e115 < c Initial program 81.5%
associate-*r*86.4%
*-commutative86.4%
+-commutative86.4%
distribute-lft-in83.7%
Applied egg-rr83.7%
Taylor expanded in c around inf 60.0%
mul-1-neg60.0%
unpow260.0%
associate-*r*60.6%
associate-*l*63.3%
*-commutative63.3%
associate-*r*65.7%
distribute-rgt-neg-in65.7%
associate-*r*63.3%
*-commutative63.3%
associate-*l*60.6%
Simplified60.6%
Taylor expanded in c around 0 60.0%
*-commutative60.0%
unpow260.0%
associate-*r*60.6%
associate-*l*60.6%
associate-*r*63.3%
*-commutative63.3%
associate-*r*65.7%
Simplified65.7%
Final simplification72.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -2.95e+54) (not (<= z 9.6e-20))) (* 2.0 (* z t)) (* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -2.95e+54) || !(z <= 9.6e-20)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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) :: tmp
if ((z <= (-2.95d+54)) .or. (.not. (z <= 9.6d-20))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -2.95e+54) || !(z <= 9.6e-20)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -2.95e+54) or not (z <= 9.6e-20): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -2.95e+54) || !(z <= 9.6e-20)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -2.95e+54) || ~((z <= 9.6e-20))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -2.95e+54], N[Not[LessEqual[z, 9.6e-20]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.95 \cdot 10^{+54} \lor \neg \left(z \leq 9.6 \cdot 10^{-20}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -2.9499999999999999e54 or 9.59999999999999971e-20 < z Initial program 89.3%
Taylor expanded in z around inf 49.1%
if -2.9499999999999999e54 < z < 9.59999999999999971e-20Initial program 90.6%
Taylor expanded in x around inf 49.6%
Final simplification49.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
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
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 90.1%
Taylor expanded in z around inf 28.1%
Final simplification28.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
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
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2023195
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))