
(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 18 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))) (t_2 (* i (* c t_1))))
(if (<= t_2 5e+301)
(* 2.0 (- (+ (* z t) (* x y)) t_2))
(* 2.0 (- (* z t) (* 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 t_2 = i * (c * t_1);
double tmp;
if (t_2 <= 5e+301) {
tmp = 2.0 * (((z * t) + (x * y)) - t_2);
} else {
tmp = 2.0 * ((z * t) - (c * (t_1 * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = i * (c * t_1)
if (t_2 <= 5d+301) then
tmp = 2.0d0 * (((z * t) + (x * y)) - t_2)
else
tmp = 2.0d0 * ((z * t) - (c * (t_1 * 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 t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if (t_2 <= 5e+301) {
tmp = 2.0 * (((z * t) + (x * y)) - t_2);
} else {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if t_2 <= 5e+301: tmp = 2.0 * (((z * t) + (x * y)) - t_2) else: tmp = 2.0 * ((z * t) - (c * (t_1 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) tmp = 0.0 if (t_2 <= 5e+301) tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - t_2)); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); tmp = 0.0; if (t_2 <= 5e+301) tmp = 2.0 * (((z * t) + (x * y)) - t_2); else tmp = 2.0 * ((z * t) - (c * (t_1 * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+301], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t_1\right)\\
\mathbf{if}\;t_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e301Initial program 97.1%
if 5.0000000000000004e301 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 74.8%
Taylor expanded in x around 0 95.5%
Final simplification96.9%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 93.5%
associate-*l*95.6%
fma-def95.6%
Simplified95.6%
Final simplification95.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -7e+34) (not (<= a 5.4e+70))) (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c)))) (* 2.0 (+ (- (* z t) (* i (* b (* c c)))) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a <= -7e+34) || !(a <= 5.4e+70)) {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
} else {
tmp = 2.0 * (((z * t) - (i * (b * (c * c)))) + (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 ((a <= (-7d+34)) .or. (.not. (a <= 5.4d+70))) then
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
else
tmp = 2.0d0 * (((z * t) - (i * (b * (c * 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 i) {
double tmp;
if ((a <= -7e+34) || !(a <= 5.4e+70)) {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
} else {
tmp = 2.0 * (((z * t) - (i * (b * (c * c)))) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -7e+34) or not (a <= 5.4e+70): tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) else: tmp = 2.0 * (((z * t) - (i * (b * (c * c)))) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -7e+34) || !(a <= 5.4e+70)) tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) - Float64(i * Float64(b * Float64(c * c)))) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a <= -7e+34) || ~((a <= 5.4e+70))) tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); else tmp = 2.0 * (((z * t) - (i * (b * (c * c)))) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -7e+34], N[Not[LessEqual[a, 5.4e+70]], $MachinePrecision]], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] - N[(i * N[(b * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+34} \lor \neg \left(a \leq 5.4 \cdot 10^{+70}\right):\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t - i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right) + x \cdot y\right)\\
\end{array}
\end{array}
if a < -6.99999999999999996e34 or 5.3999999999999999e70 < a Initial program 89.6%
Taylor expanded in a around inf 87.5%
if -6.99999999999999996e34 < a < 5.3999999999999999e70Initial program 96.2%
Taylor expanded in a around 0 88.4%
unpow288.4%
associate-*r*92.8%
Simplified92.8%
associate--l+92.8%
*-commutative92.8%
associate-*r*88.4%
Applied egg-rr88.4%
Final simplification88.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y))))
(if (or (<= a -4.4e+53) (not (<= a 2.5e+149)))
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- t_1 (* c (* c (* b i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double tmp;
if ((a <= -4.4e+53) || !(a <= 2.5e+149)) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - (c * (c * (b * 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) :: t_1
real(8) :: tmp
t_1 = (z * t) + (x * y)
if ((a <= (-4.4d+53)) .or. (.not. (a <= 2.5d+149))) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * (t_1 - (c * (c * (b * 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 t_1 = (z * t) + (x * y);
double tmp;
if ((a <= -4.4e+53) || !(a <= 2.5e+149)) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (x * y) tmp = 0 if (a <= -4.4e+53) or not (a <= 2.5e+149): tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * (t_1 - (c * (c * (b * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(x * y)) tmp = 0.0 if ((a <= -4.4e+53) || !(a <= 2.5e+149)) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (x * y); tmp = 0.0; if ((a <= -4.4e+53) || ~((a <= 2.5e+149))) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * (t_1 - (c * (c * (b * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -4.4e+53], N[Not[LessEqual[a, 2.5e+149]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
\mathbf{if}\;a \leq -4.4 \cdot 10^{+53} \lor \neg \left(a \leq 2.5 \cdot 10^{+149}\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if a < -4.39999999999999997e53 or 2.49999999999999995e149 < a Initial program 92.0%
Taylor expanded in a around inf 90.4%
if -4.39999999999999997e53 < a < 2.49999999999999995e149Initial program 94.3%
Taylor expanded in a around 0 82.7%
unpow282.7%
associate-*r*88.7%
Simplified88.7%
Final simplification89.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y))))
(if (or (<= a -2.6e+52) (not (<= a 5.5e+70)))
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- t_1 (* i (* c (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double tmp;
if ((a <= -2.6e+52) || !(a <= 5.5e+70)) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - (i * (c * (b * 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) :: t_1
real(8) :: tmp
t_1 = (z * t) + (x * y)
if ((a <= (-2.6d+52)) .or. (.not. (a <= 5.5d+70))) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * (t_1 - (i * (c * (b * 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 t_1 = (z * t) + (x * y);
double tmp;
if ((a <= -2.6e+52) || !(a <= 5.5e+70)) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - (i * (c * (b * c))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (x * y) tmp = 0 if (a <= -2.6e+52) or not (a <= 5.5e+70): tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * (t_1 - (i * (c * (b * c)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(x * y)) tmp = 0.0 if ((a <= -2.6e+52) || !(a <= 5.5e+70)) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(b * c))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (x * y); tmp = 0.0; if ((a <= -2.6e+52) || ~((a <= 5.5e+70))) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * (t_1 - (i * (c * (b * c)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -2.6e+52], N[Not[LessEqual[a, 5.5e+70]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+52} \lor \neg \left(a \leq 5.5 \cdot 10^{+70}\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if a < -2.6e52 or 5.49999999999999986e70 < a Initial program 89.5%
Taylor expanded in a around inf 87.4%
if -2.6e52 < a < 5.49999999999999986e70Initial program 96.2%
Taylor expanded in a around 0 87.9%
unpow287.9%
associate-*r*92.8%
Simplified92.8%
Final simplification90.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -6.2e+105)
t_1
(if (<= c -0.016)
(* 2.0 (- (* z t) (* (* b i) (* c c))))
(if (<= c -1e-47)
(* 2.0 (- (* x y) (* i (* a c))))
(if (<= c 2.1e+56) (* 2.0 (+ (* z t) (* x y))) 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 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -6.2e+105) {
tmp = t_1;
} else if (c <= -0.016) {
tmp = 2.0 * ((z * t) - ((b * i) * (c * c)));
} else if (c <= -1e-47) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (c <= 2.1e+56) {
tmp = 2.0 * ((z * t) + (x * y));
} 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 * (c * ((a + (b * c)) * -i))
if (c <= (-6.2d+105)) then
tmp = t_1
else if (c <= (-0.016d0)) then
tmp = 2.0d0 * ((z * t) - ((b * i) * (c * c)))
else if (c <= (-1d-47)) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
else if (c <= 2.1d+56) then
tmp = 2.0d0 * ((z * t) + (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 i) {
double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -6.2e+105) {
tmp = t_1;
} else if (c <= -0.016) {
tmp = 2.0 * ((z * t) - ((b * i) * (c * c)));
} else if (c <= -1e-47) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (c <= 2.1e+56) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -6.2e+105: tmp = t_1 elif c <= -0.016: tmp = 2.0 * ((z * t) - ((b * i) * (c * c))) elif c <= -1e-47: tmp = 2.0 * ((x * y) - (i * (a * c))) elif c <= 2.1e+56: tmp = 2.0 * ((z * t) + (x * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -6.2e+105) tmp = t_1; elseif (c <= -0.016) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(Float64(b * i) * Float64(c * c)))); elseif (c <= -1e-47) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); elseif (c <= 2.1e+56) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -6.2e+105) tmp = t_1; elseif (c <= -0.016) tmp = 2.0 * ((z * t) - ((b * i) * (c * c))); elseif (c <= -1e-47) tmp = 2.0 * ((x * y) - (i * (a * c))); elseif (c <= 2.1e+56) tmp = 2.0 * ((z * t) + (x * y)); 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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.2e+105], t$95$1, If[LessEqual[c, -0.016], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(N[(b * i), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1e-47], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.1e+56], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -0.016:\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(b \cdot i\right) \cdot \left(c \cdot c\right)\right)\\
\mathbf{elif}\;c \leq -1 \cdot 10^{-47}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 2.1 \cdot 10^{+56}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -6.20000000000000008e105 or 2.10000000000000017e56 < c Initial program 87.3%
Taylor expanded in i around inf 78.3%
if -6.20000000000000008e105 < c < -0.016Initial program 92.5%
Taylor expanded in a around 0 89.2%
unpow289.2%
associate-*r*89.2%
Simplified89.2%
Taylor expanded in x around 0 76.2%
unpow276.2%
Simplified76.2%
if -0.016 < c < -9.9999999999999997e-48Initial program 99.6%
Taylor expanded in z around 0 63.7%
Taylor expanded in c around 0 49.2%
mul-1-neg49.2%
sub-neg49.2%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
if -9.9999999999999997e-48 < c < 2.10000000000000017e56Initial program 97.6%
Taylor expanded in c around 0 80.2%
Final simplification78.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* -2.0 (* b (* c (* c i))))))
(if (<= c -2.35e+40)
t_2
(if (<= c -1.3e-130)
t_1
(if (<= c -1.52e-164)
(* 2.0 (* x y))
(if (<= c 7.8e+62)
t_1
(if (<= c 1.66e+107) (* a (* i (* c -2.0))) 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 * (z * t);
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -2.35e+40) {
tmp = t_2;
} else if (c <= -1.3e-130) {
tmp = t_1;
} else if (c <= -1.52e-164) {
tmp = 2.0 * (x * y);
} else if (c <= 7.8e+62) {
tmp = t_1;
} else if (c <= 1.66e+107) {
tmp = a * (i * (c * -2.0));
} 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 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * (b * (c * (c * i)))
if (c <= (-2.35d+40)) then
tmp = t_2
else if (c <= (-1.3d-130)) then
tmp = t_1
else if (c <= (-1.52d-164)) then
tmp = 2.0d0 * (x * y)
else if (c <= 7.8d+62) then
tmp = t_1
else if (c <= 1.66d+107) then
tmp = a * (i * (c * (-2.0d0)))
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 * (z * t);
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -2.35e+40) {
tmp = t_2;
} else if (c <= -1.3e-130) {
tmp = t_1;
} else if (c <= -1.52e-164) {
tmp = 2.0 * (x * y);
} else if (c <= 7.8e+62) {
tmp = t_1;
} else if (c <= 1.66e+107) {
tmp = a * (i * (c * -2.0));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (b * (c * (c * i))) tmp = 0 if c <= -2.35e+40: tmp = t_2 elif c <= -1.3e-130: tmp = t_1 elif c <= -1.52e-164: tmp = 2.0 * (x * y) elif c <= 7.8e+62: tmp = t_1 elif c <= 1.66e+107: tmp = a * (i * (c * -2.0)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) tmp = 0.0 if (c <= -2.35e+40) tmp = t_2; elseif (c <= -1.3e-130) tmp = t_1; elseif (c <= -1.52e-164) tmp = Float64(2.0 * Float64(x * y)); elseif (c <= 7.8e+62) tmp = t_1; elseif (c <= 1.66e+107) tmp = Float64(a * Float64(i * Float64(c * -2.0))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = -2.0 * (b * (c * (c * i))); tmp = 0.0; if (c <= -2.35e+40) tmp = t_2; elseif (c <= -1.3e-130) tmp = t_1; elseif (c <= -1.52e-164) tmp = 2.0 * (x * y); elseif (c <= 7.8e+62) tmp = t_1; elseif (c <= 1.66e+107) tmp = a * (i * (c * -2.0)); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.35e+40], t$95$2, If[LessEqual[c, -1.3e-130], t$95$1, If[LessEqual[c, -1.52e-164], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.8e+62], t$95$1, If[LessEqual[c, 1.66e+107], N[(a * N[(i * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -2.35 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -1.3 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -1.52 \cdot 10^{-164}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;c \leq 7.8 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.66 \cdot 10^{+107}:\\
\;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -2.3500000000000002e40 or 1.6599999999999999e107 < c Initial program 88.9%
associate-*r*93.7%
*-commutative93.7%
+-commutative93.7%
distribute-lft-in80.1%
Applied egg-rr80.1%
Taylor expanded in c around inf 62.0%
associate-*r*62.0%
neg-mul-162.0%
unpow262.0%
distribute-lft-neg-in62.0%
associate-*r*64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in c around 0 62.0%
unpow262.0%
associate-*r*62.0%
*-commutative62.0%
associate-*r*62.0%
*-commutative62.0%
associate-*r*62.0%
associate-*r*67.8%
Simplified67.8%
if -2.3500000000000002e40 < c < -1.3e-130 or -1.52000000000000007e-164 < c < 7.8e62Initial program 96.4%
Taylor expanded in z around inf 47.2%
if -1.3e-130 < c < -1.52000000000000007e-164Initial program 99.7%
Taylor expanded in x around inf 64.5%
if 7.8e62 < c < 1.6599999999999999e107Initial program 92.0%
Taylor expanded in a around inf 67.2%
associate-*r*67.2%
neg-mul-167.2%
Simplified67.2%
Taylor expanded in c around 0 67.2%
associate-*r*67.2%
associate-*r*67.4%
*-commutative67.4%
Simplified67.4%
Final simplification56.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.45e-14) (not (<= c 2.7e-31))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.45e-14) || !(c <= 2.7e-31)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((z * t) + (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 ((c <= (-1.45d-14)) .or. (.not. (c <= 2.7d-31))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((z * t) + (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 ((c <= -1.45e-14) || !(c <= 2.7e-31)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.45e-14) or not (c <= 2.7e-31): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.45e-14) || !(c <= 2.7e-31)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.45e-14) || ~((c <= 2.7e-31))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.45e-14], N[Not[LessEqual[c, 2.7e-31]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{-14} \lor \neg \left(c \leq 2.7 \cdot 10^{-31}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -1.4500000000000001e-14 or 2.70000000000000014e-31 < c Initial program 89.5%
Taylor expanded in x around 0 81.5%
if -1.4500000000000001e-14 < c < 2.70000000000000014e-31Initial program 98.3%
Taylor expanded in c around 0 80.8%
Final simplification81.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.35e-25)
(* 2.0 (- (* x y) t_1))
(if (<= c 3.8e-27) (* 2.0 (+ (* z t) (* x y))) (* 2.0 (- (* z t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.35e-25) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 3.8e-27) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = 2.0 * ((z * t) - 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 = c * ((a + (b * c)) * i)
if (c <= (-1.35d-25)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 3.8d-27) then
tmp = 2.0d0 * ((z * t) + (x * y))
else
tmp = 2.0d0 * ((z * t) - 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.35e-25) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 3.8e-27) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -1.35e-25: tmp = 2.0 * ((x * y) - t_1) elif c <= 3.8e-27: tmp = 2.0 * ((z * t) + (x * y)) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -1.35e-25) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 3.8e-27) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -1.35e-25) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 3.8e-27) tmp = 2.0 * ((z * t) + (x * y)); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.35e-25], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e-27], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.35 \cdot 10^{-25}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if c < -1.35000000000000008e-25Initial program 94.5%
Taylor expanded in z around 0 84.8%
if -1.35000000000000008e-25 < c < 3.8e-27Initial program 98.2%
Taylor expanded in c around 0 81.2%
if 3.8e-27 < c Initial program 84.7%
Taylor expanded in x around 0 80.8%
Final simplification82.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.7e+44)
(* 2.0 (- (* x y) t_1))
(if (<= c 3900000000.0)
(* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))
(* 2.0 (- (* z t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.7e+44) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 3900000000.0) {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - 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 = c * ((a + (b * c)) * i)
if (c <= (-1.7d+44)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 3900000000.0d0) then
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
else
tmp = 2.0d0 * ((z * t) - 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.7e+44) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 3900000000.0) {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -1.7e+44: tmp = 2.0 * ((x * y) - t_1) elif c <= 3900000000.0: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -1.7e+44) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 3900000000.0) tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -1.7e+44) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 3900000000.0) tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.7e+44], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3900000000.0], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.7 \cdot 10^{+44}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq 3900000000:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if c < -1.7e44Initial program 94.8%
Taylor expanded in z around 0 90.7%
if -1.7e44 < c < 3.9e9Initial program 97.0%
Taylor expanded in a around inf 90.1%
if 3.9e9 < c Initial program 84.6%
Taylor expanded in x around 0 83.3%
Final simplification88.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* z t) (* x y)) (* (+ 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 * (((z * t) + (x * y)) - ((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 * (((z * t) + (x * y)) - ((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 * (((z * t) + (x * y)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((z * t) + (x * y)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((z * t) + (x * y)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 93.5%
associate-*l*95.6%
fma-def95.6%
Simplified95.6%
fma-def95.6%
+-commutative95.6%
Applied egg-rr95.6%
Final simplification95.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -8.5e+139)
(not (or (<= c -1.35e+88) (and (not (<= c -1e+44)) (<= c 2.9e+143)))))
(* -2.0 (* b (* c (* c i))))
(* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8.5e+139) || !((c <= -1.35e+88) || (!(c <= -1e+44) && (c <= 2.9e+143)))) {
tmp = -2.0 * (b * (c * (c * i)));
} else {
tmp = 2.0 * ((z * t) + (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 ((c <= (-8.5d+139)) .or. (.not. (c <= (-1.35d+88)) .or. (.not. (c <= (-1d+44))) .and. (c <= 2.9d+143))) then
tmp = (-2.0d0) * (b * (c * (c * i)))
else
tmp = 2.0d0 * ((z * t) + (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 ((c <= -8.5e+139) || !((c <= -1.35e+88) || (!(c <= -1e+44) && (c <= 2.9e+143)))) {
tmp = -2.0 * (b * (c * (c * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8.5e+139) or not ((c <= -1.35e+88) or (not (c <= -1e+44) and (c <= 2.9e+143))): tmp = -2.0 * (b * (c * (c * i))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -8.5e+139) || !((c <= -1.35e+88) || (!(c <= -1e+44) && (c <= 2.9e+143)))) tmp = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8.5e+139) || ~(((c <= -1.35e+88) || (~((c <= -1e+44)) && (c <= 2.9e+143))))) tmp = -2.0 * (b * (c * (c * i))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -8.5e+139], N[Not[Or[LessEqual[c, -1.35e+88], And[N[Not[LessEqual[c, -1e+44]], $MachinePrecision], LessEqual[c, 2.9e+143]]]], $MachinePrecision]], N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.5 \cdot 10^{+139} \lor \neg \left(c \leq -1.35 \cdot 10^{+88} \lor \neg \left(c \leq -1 \cdot 10^{+44}\right) \land c \leq 2.9 \cdot 10^{+143}\right):\\
\;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -8.5e139 or -1.35000000000000008e88 < c < -1.0000000000000001e44 or 2.8999999999999998e143 < c Initial program 88.8%
associate-*r*93.5%
*-commutative93.5%
+-commutative93.5%
distribute-lft-in78.1%
Applied egg-rr78.1%
Taylor expanded in c around inf 71.2%
associate-*r*71.2%
neg-mul-171.2%
unpow271.2%
distribute-lft-neg-in71.2%
associate-*r*73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in c around 0 71.2%
unpow271.2%
associate-*r*71.2%
*-commutative71.2%
associate-*r*71.2%
*-commutative71.2%
associate-*r*70.1%
associate-*r*77.3%
Simplified77.3%
if -8.5e139 < c < -1.35000000000000008e88 or -1.0000000000000001e44 < c < 2.8999999999999998e143Initial program 95.6%
Taylor expanded in c around 0 73.6%
Final simplification74.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* z t) (* x y)))) (t_2 (* -2.0 (* b (* c (* c i))))))
(if (<= c -8.5e+139)
t_2
(if (<= c -3e+87)
t_1
(if (<= c -1.05e+44)
(* c (* (* c (* b i)) -2.0))
(if (<= c 6e+143) 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 * ((z * t) + (x * y));
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -8.5e+139) {
tmp = t_2;
} else if (c <= -3e+87) {
tmp = t_1;
} else if (c <= -1.05e+44) {
tmp = c * ((c * (b * i)) * -2.0);
} else if (c <= 6e+143) {
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 = 2.0d0 * ((z * t) + (x * y))
t_2 = (-2.0d0) * (b * (c * (c * i)))
if (c <= (-8.5d+139)) then
tmp = t_2
else if (c <= (-3d+87)) then
tmp = t_1
else if (c <= (-1.05d+44)) then
tmp = c * ((c * (b * i)) * (-2.0d0))
else if (c <= 6d+143) 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 * ((z * t) + (x * y));
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -8.5e+139) {
tmp = t_2;
} else if (c <= -3e+87) {
tmp = t_1;
} else if (c <= -1.05e+44) {
tmp = c * ((c * (b * i)) * -2.0);
} else if (c <= 6e+143) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) + (x * y)) t_2 = -2.0 * (b * (c * (c * i))) tmp = 0 if c <= -8.5e+139: tmp = t_2 elif c <= -3e+87: tmp = t_1 elif c <= -1.05e+44: tmp = c * ((c * (b * i)) * -2.0) elif c <= 6e+143: 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(Float64(z * t) + Float64(x * y))) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) tmp = 0.0 if (c <= -8.5e+139) tmp = t_2; elseif (c <= -3e+87) tmp = t_1; elseif (c <= -1.05e+44) tmp = Float64(c * Float64(Float64(c * Float64(b * i)) * -2.0)); elseif (c <= 6e+143) 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 * ((z * t) + (x * y)); t_2 = -2.0 * (b * (c * (c * i))); tmp = 0.0; if (c <= -8.5e+139) tmp = t_2; elseif (c <= -3e+87) tmp = t_1; elseif (c <= -1.05e+44) tmp = c * ((c * (b * i)) * -2.0); elseif (c <= 6e+143) 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[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+139], t$95$2, If[LessEqual[c, -3e+87], t$95$1, If[LessEqual[c, -1.05e+44], N[(c * N[(N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6e+143], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -8.5 \cdot 10^{+139}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -3 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -1.05 \cdot 10^{+44}:\\
\;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\
\mathbf{elif}\;c \leq 6 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -8.5e139 or 6.0000000000000001e143 < c Initial program 86.7%
associate-*r*93.8%
*-commutative93.8%
+-commutative93.8%
distribute-lft-in75.7%
Applied egg-rr75.7%
Taylor expanded in c around inf 68.9%
associate-*r*68.9%
neg-mul-168.9%
unpow268.9%
distribute-lft-neg-in68.9%
associate-*r*72.0%
*-commutative72.0%
Simplified72.0%
Taylor expanded in c around 0 68.9%
unpow268.9%
associate-*r*68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
associate-*r*69.0%
associate-*r*77.6%
Simplified77.6%
if -8.5e139 < c < -2.9999999999999999e87 or -1.04999999999999993e44 < c < 6.0000000000000001e143Initial program 95.6%
Taylor expanded in c around 0 73.6%
if -2.9999999999999999e87 < c < -1.04999999999999993e44Initial program 99.9%
associate-*r*91.8%
*-commutative91.8%
+-commutative91.8%
distribute-lft-in91.8%
Applied egg-rr91.8%
Taylor expanded in c around inf 83.7%
associate-*r*83.7%
neg-mul-183.7%
unpow283.7%
distribute-lft-neg-in83.7%
associate-*r*83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in c around 0 83.7%
unpow283.7%
associate-*r*83.7%
*-commutative83.7%
associate-*r*83.7%
*-commutative83.7%
associate-*l*83.7%
associate-*l*83.7%
Simplified83.7%
Final simplification75.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* z t) (* x y)))) (t_2 (* -2.0 (* b (* c (* c i))))))
(if (<= c -8.5e+143)
t_2
(if (<= c -1.15e+89)
t_1
(if (<= c -1.38e+48)
(* 2.0 (* (* b i) (- (* c c))))
(if (<= c 3.3e+145) 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 * ((z * t) + (x * y));
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -8.5e+143) {
tmp = t_2;
} else if (c <= -1.15e+89) {
tmp = t_1;
} else if (c <= -1.38e+48) {
tmp = 2.0 * ((b * i) * -(c * c));
} else if (c <= 3.3e+145) {
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 = 2.0d0 * ((z * t) + (x * y))
t_2 = (-2.0d0) * (b * (c * (c * i)))
if (c <= (-8.5d+143)) then
tmp = t_2
else if (c <= (-1.15d+89)) then
tmp = t_1
else if (c <= (-1.38d+48)) then
tmp = 2.0d0 * ((b * i) * -(c * c))
else if (c <= 3.3d+145) 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 * ((z * t) + (x * y));
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -8.5e+143) {
tmp = t_2;
} else if (c <= -1.15e+89) {
tmp = t_1;
} else if (c <= -1.38e+48) {
tmp = 2.0 * ((b * i) * -(c * c));
} else if (c <= 3.3e+145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) + (x * y)) t_2 = -2.0 * (b * (c * (c * i))) tmp = 0 if c <= -8.5e+143: tmp = t_2 elif c <= -1.15e+89: tmp = t_1 elif c <= -1.38e+48: tmp = 2.0 * ((b * i) * -(c * c)) elif c <= 3.3e+145: 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(Float64(z * t) + Float64(x * y))) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) tmp = 0.0 if (c <= -8.5e+143) tmp = t_2; elseif (c <= -1.15e+89) tmp = t_1; elseif (c <= -1.38e+48) tmp = Float64(2.0 * Float64(Float64(b * i) * Float64(-Float64(c * c)))); elseif (c <= 3.3e+145) 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 * ((z * t) + (x * y)); t_2 = -2.0 * (b * (c * (c * i))); tmp = 0.0; if (c <= -8.5e+143) tmp = t_2; elseif (c <= -1.15e+89) tmp = t_1; elseif (c <= -1.38e+48) tmp = 2.0 * ((b * i) * -(c * c)); elseif (c <= 3.3e+145) 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[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+143], t$95$2, If[LessEqual[c, -1.15e+89], t$95$1, If[LessEqual[c, -1.38e+48], N[(2.0 * N[(N[(b * i), $MachinePrecision] * (-N[(c * c), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.3e+145], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -8.5 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -1.15 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -1.38 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(\left(b \cdot i\right) \cdot \left(-c \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -8.4999999999999998e143 or 3.30000000000000027e145 < c Initial program 86.7%
associate-*r*93.8%
*-commutative93.8%
+-commutative93.8%
distribute-lft-in75.7%
Applied egg-rr75.7%
Taylor expanded in c around inf 68.9%
associate-*r*68.9%
neg-mul-168.9%
unpow268.9%
distribute-lft-neg-in68.9%
associate-*r*72.0%
*-commutative72.0%
Simplified72.0%
Taylor expanded in c around 0 68.9%
unpow268.9%
associate-*r*68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
associate-*r*69.0%
associate-*r*77.6%
Simplified77.6%
if -8.4999999999999998e143 < c < -1.1499999999999999e89 or -1.3800000000000001e48 < c < 3.30000000000000027e145Initial program 95.5%
Taylor expanded in c around 0 73.9%
if -1.1499999999999999e89 < c < -1.3800000000000001e48Initial program 99.9%
Taylor expanded in b around inf 79.0%
mul-1-neg79.0%
distribute-rgt-neg-in79.0%
unpow279.0%
Simplified79.0%
Final simplification75.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.38e+41) (not (<= c 4e+54))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.38e+41) || !(c <= 4e+54)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((z * t) + (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 ((c <= (-1.38d+41)) .or. (.not. (c <= 4d+54))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = 2.0d0 * ((z * t) + (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 ((c <= -1.38e+41) || !(c <= 4e+54)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.38e+41) or not (c <= 4e+54): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.38e+41) || !(c <= 4e+54)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.38e+41) || ~((c <= 4e+54))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.38e+41], N[Not[LessEqual[c, 4e+54]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.38 \cdot 10^{+41} \lor \neg \left(c \leq 4 \cdot 10^{+54}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -1.3800000000000001e41 or 4.0000000000000003e54 < c Initial program 88.4%
Taylor expanded in i around inf 77.0%
if -1.3800000000000001e41 < c < 4.0000000000000003e54Initial program 97.2%
Taylor expanded in c around 0 76.7%
Final simplification76.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= z -3.1e+104)
t_1
(if (<= z -2950000000.0)
(* a (* i (* c -2.0)))
(if (<= z 5000000.0) (* 2.0 (* x y)) 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);
double tmp;
if (z <= -3.1e+104) {
tmp = t_1;
} else if (z <= -2950000000.0) {
tmp = a * (i * (c * -2.0));
} else if (z <= 5000000.0) {
tmp = 2.0 * (x * y);
} 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)
if (z <= (-3.1d+104)) then
tmp = t_1
else if (z <= (-2950000000.0d0)) then
tmp = a * (i * (c * (-2.0d0)))
else if (z <= 5000000.0d0) then
tmp = 2.0d0 * (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 i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -3.1e+104) {
tmp = t_1;
} else if (z <= -2950000000.0) {
tmp = a * (i * (c * -2.0));
} else if (z <= 5000000.0) {
tmp = 2.0 * (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if z <= -3.1e+104: tmp = t_1 elif z <= -2950000000.0: tmp = a * (i * (c * -2.0)) elif z <= 5000000.0: tmp = 2.0 * (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -3.1e+104) tmp = t_1; elseif (z <= -2950000000.0) tmp = Float64(a * Float64(i * Float64(c * -2.0))); elseif (z <= 5000000.0) tmp = Float64(2.0 * Float64(x * y)); 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); tmp = 0.0; if (z <= -3.1e+104) tmp = t_1; elseif (z <= -2950000000.0) tmp = a * (i * (c * -2.0)); elseif (z <= 5000000.0) tmp = 2.0 * (x * y); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+104], t$95$1, If[LessEqual[z, -2950000000.0], N[(a * N[(i * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5000000.0], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2950000000:\\
\;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\right)\\
\mathbf{elif}\;z \leq 5000000:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.10000000000000017e104 or 5e6 < z Initial program 92.6%
Taylor expanded in z around inf 60.5%
if -3.10000000000000017e104 < z < -2.95e9Initial program 99.9%
Taylor expanded in a around inf 40.5%
associate-*r*40.5%
neg-mul-140.5%
Simplified40.5%
Taylor expanded in c around 0 40.5%
associate-*r*40.5%
associate-*r*49.3%
*-commutative49.3%
Simplified49.3%
if -2.95e9 < z < 5e6Initial program 93.2%
Taylor expanded in x around inf 40.2%
Final simplification49.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -3.6e+14) (not (<= z 105000000.0))) (* 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 <= -3.6e+14) || !(z <= 105000000.0)) {
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 <= (-3.6d+14)) .or. (.not. (z <= 105000000.0d0))) 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 <= -3.6e+14) || !(z <= 105000000.0)) {
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 <= -3.6e+14) or not (z <= 105000000.0): 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 <= -3.6e+14) || !(z <= 105000000.0)) 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 <= -3.6e+14) || ~((z <= 105000000.0))) 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, -3.6e+14], N[Not[LessEqual[z, 105000000.0]], $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 -3.6 \cdot 10^{+14} \lor \neg \left(z \leq 105000000\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -3.6e14 or 1.05e8 < z Initial program 93.7%
Taylor expanded in z around inf 55.8%
if -3.6e14 < z < 1.05e8Initial program 93.3%
Taylor expanded in x around inf 39.9%
Final simplification47.7%
(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 93.5%
Taylor expanded in z around inf 33.4%
Final simplification33.4%
(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 2023274
(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))))