
(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 16 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 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* 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 t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * 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 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (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)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * 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 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = -2.0 * (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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - 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\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - 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 95.6%
fma-define95.6%
associate-*l*99.9%
Simplified99.9%
fma-define99.9%
+-commutative99.9%
Applied egg-rr99.9%
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 66.8%
Taylor expanded in i around 0 66.8%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* c t_1)))
(if (<= t_3 -2e+276)
(* 2.0 (- (* z t) t_2))
(if (<= t_3 2e+302)
(* (- (+ (* x y) (* z t)) (* t_3 i)) 2.0)
(* -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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -2e+276) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 2e+302) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = -2.0 * 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 = a + (b * c)
t_2 = c * (t_1 * i)
t_3 = c * t_1
if (t_3 <= (-2d+276)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (t_3 <= 2d+302) then
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0d0
else
tmp = (-2.0d0) * 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -2e+276) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 2e+302) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = -2.0 * t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = c * t_1 tmp = 0 if t_3 <= -2e+276: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 2e+302: tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0 else: tmp = -2.0 * t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(c * t_1) tmp = 0.0 if (t_3 <= -2e+276) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 2e+302) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_3 * i)) * 2.0); else tmp = Float64(-2.0 * t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = c * t_1; tmp = 0.0; if (t_3 <= -2e+276) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 2e+302) tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0; else tmp = -2.0 * t_2; 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[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+276], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+302], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := c \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+276}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_3 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -2.0000000000000001e276Initial program 65.3%
Taylor expanded in x around 0 84.6%
if -2.0000000000000001e276 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000002e302Initial program 98.8%
if 2.0000000000000002e302 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 68.1%
Taylor expanded in i around inf 92.6%
Taylor expanded in i around 0 92.6%
Final simplification95.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* (* c (+ a (* b c))) (- i)))))
(if (<= i -1.75e+98)
t_1
(if (<= i -4.9e-183)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
(if (<= i 1.35e-95)
(* (+ (* x y) (* z t)) 2.0)
(if (<= i 1.7e-28)
(* 2.0 (- (* z t) (* b (* c (* c i)))))
(if (<= i 2.5e+27) (* 2.0 (- (* z t) (* c (* a i)))) 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 (i <= -1.75e+98) {
tmp = t_1;
} else if (i <= -4.9e-183) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (i <= 1.35e-95) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (i <= 1.7e-28) {
tmp = 2.0 * ((z * t) - (b * (c * (c * i))));
} else if (i <= 2.5e+27) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} 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 (i <= (-1.75d+98)) then
tmp = t_1
else if (i <= (-4.9d-183)) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
else if (i <= 1.35d-95) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (i <= 1.7d-28) then
tmp = 2.0d0 * ((z * t) - (b * (c * (c * i))))
else if (i <= 2.5d+27) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
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 (i <= -1.75e+98) {
tmp = t_1;
} else if (i <= -4.9e-183) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (i <= 1.35e-95) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (i <= 1.7e-28) {
tmp = 2.0 * ((z * t) - (b * (c * (c * i))));
} else if (i <= 2.5e+27) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} 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 i <= -1.75e+98: tmp = t_1 elif i <= -4.9e-183: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) elif i <= 1.35e-95: tmp = ((x * y) + (z * t)) * 2.0 elif i <= 1.7e-28: tmp = 2.0 * ((z * t) - (b * (c * (c * i)))) elif i <= 2.5e+27: tmp = 2.0 * ((z * t) - (c * (a * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(c * Float64(a + Float64(b * c))) * Float64(-i))) tmp = 0.0 if (i <= -1.75e+98) tmp = t_1; elseif (i <= -4.9e-183) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); elseif (i <= 1.35e-95) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (i <= 1.7e-28) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(b * Float64(c * Float64(c * i))))); elseif (i <= 2.5e+27) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); 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 (i <= -1.75e+98) tmp = t_1; elseif (i <= -4.9e-183) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); elseif (i <= 1.35e-95) tmp = ((x * y) + (z * t)) * 2.0; elseif (i <= 1.7e-28) tmp = 2.0 * ((z * t) - (b * (c * (c * i)))); elseif (i <= 2.5e+27) tmp = 2.0 * ((z * t) - (c * (a * i))); 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[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.75e+98], t$95$1, If[LessEqual[i, -4.9e-183], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.35e-95], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[i, 1.7e-28], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.5e+27], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot \left(-i\right)\right)\\
\mathbf{if}\;i \leq -1.75 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -4.9 \cdot 10^{-183}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;i \leq 1.35 \cdot 10^{-95}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;i \leq 1.7 \cdot 10^{-28}:\\
\;\;\;\;2 \cdot \left(z \cdot t - b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;i \leq 2.5 \cdot 10^{+27}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.75e98 or 2.4999999999999999e27 < i Initial program 89.2%
Taylor expanded in x around 0 74.6%
Taylor expanded in i around inf 84.1%
Taylor expanded in t around 0 76.8%
if -1.75e98 < i < -4.9e-183Initial program 90.9%
Taylor expanded in x around 0 76.3%
Taylor expanded in a around 0 70.1%
if -4.9e-183 < i < 1.35e-95Initial program 87.2%
Taylor expanded in c around 0 84.0%
if 1.35e-95 < i < 1.7e-28Initial program 83.3%
Taylor expanded in x around 0 88.2%
Taylor expanded in a around 0 71.0%
*-un-lft-identity71.0%
*-commutative71.0%
associate-*r*71.1%
*-commutative71.1%
associate-*l*71.2%
Applied egg-rr71.2%
if 1.7e-28 < i < 2.4999999999999999e27Initial program 100.0%
Taylor expanded in x around 0 86.5%
Taylor expanded in c around 0 86.5%
mul-1-neg86.5%
+-commutative86.5%
sub-neg86.5%
*-commutative86.5%
associate-*l*86.5%
Simplified86.5%
Final simplification77.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* b (* c i))))))
(t_2 (* 2.0 (* (* c (+ a (* b c))) (- i)))))
(if (<= i -1.85e+99)
t_2
(if (<= i -6.2e-181)
t_1
(if (<= i 1.3e-95)
(* (+ (* x y) (* z t)) 2.0)
(if (<= i 7.6e-31)
t_1
(if (<= i 3e+30) (* 2.0 (- (* z t) (* c (* a i)))) 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) - (c * (b * (c * i))));
double t_2 = 2.0 * ((c * (a + (b * c))) * -i);
double tmp;
if (i <= -1.85e+99) {
tmp = t_2;
} else if (i <= -6.2e-181) {
tmp = t_1;
} else if (i <= 1.3e-95) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (i <= 7.6e-31) {
tmp = t_1;
} else if (i <= 3e+30) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} 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) - (c * (b * (c * i))))
t_2 = 2.0d0 * ((c * (a + (b * c))) * -i)
if (i <= (-1.85d+99)) then
tmp = t_2
else if (i <= (-6.2d-181)) then
tmp = t_1
else if (i <= 1.3d-95) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (i <= 7.6d-31) then
tmp = t_1
else if (i <= 3d+30) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
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) - (c * (b * (c * i))));
double t_2 = 2.0 * ((c * (a + (b * c))) * -i);
double tmp;
if (i <= -1.85e+99) {
tmp = t_2;
} else if (i <= -6.2e-181) {
tmp = t_1;
} else if (i <= 1.3e-95) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (i <= 7.6e-31) {
tmp = t_1;
} else if (i <= 3e+30) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * (b * (c * i)))) t_2 = 2.0 * ((c * (a + (b * c))) * -i) tmp = 0 if i <= -1.85e+99: tmp = t_2 elif i <= -6.2e-181: tmp = t_1 elif i <= 1.3e-95: tmp = ((x * y) + (z * t)) * 2.0 elif i <= 7.6e-31: tmp = t_1 elif i <= 3e+30: tmp = 2.0 * ((z * t) - (c * (a * i))) 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(c * Float64(b * Float64(c * i))))) t_2 = Float64(2.0 * Float64(Float64(c * Float64(a + Float64(b * c))) * Float64(-i))) tmp = 0.0 if (i <= -1.85e+99) tmp = t_2; elseif (i <= -6.2e-181) tmp = t_1; elseif (i <= 1.3e-95) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (i <= 7.6e-31) tmp = t_1; elseif (i <= 3e+30) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); 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) - (c * (b * (c * i)))); t_2 = 2.0 * ((c * (a + (b * c))) * -i); tmp = 0.0; if (i <= -1.85e+99) tmp = t_2; elseif (i <= -6.2e-181) tmp = t_1; elseif (i <= 1.3e-95) tmp = ((x * y) + (z * t)) * 2.0; elseif (i <= 7.6e-31) tmp = t_1; elseif (i <= 3e+30) tmp = 2.0 * ((z * t) - (c * (a * i))); 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[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.85e+99], t$95$2, If[LessEqual[i, -6.2e-181], t$95$1, If[LessEqual[i, 1.3e-95], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[i, 7.6e-31], t$95$1, If[LessEqual[i, 3e+30], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
t_2 := 2 \cdot \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot \left(-i\right)\right)\\
\mathbf{if}\;i \leq -1.85 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -6.2 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.3 \cdot 10^{-95}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;i \leq 7.6 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 3 \cdot 10^{+30}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -1.85000000000000005e99 or 2.99999999999999978e30 < i Initial program 89.2%
Taylor expanded in x around 0 74.6%
Taylor expanded in i around inf 84.1%
Taylor expanded in t around 0 76.8%
if -1.85000000000000005e99 < i < -6.20000000000000043e-181 or 1.3e-95 < i < 7.5999999999999999e-31Initial program 89.1%
Taylor expanded in x around 0 79.2%
Taylor expanded in a around 0 70.3%
if -6.20000000000000043e-181 < i < 1.3e-95Initial program 87.2%
Taylor expanded in c around 0 84.0%
if 7.5999999999999999e-31 < i < 2.99999999999999978e30Initial program 100.0%
Taylor expanded in x around 0 86.5%
Taylor expanded in c around 0 86.5%
mul-1-neg86.5%
+-commutative86.5%
sub-neg86.5%
*-commutative86.5%
associate-*l*86.5%
Simplified86.5%
Final simplification77.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= z -1.78e+137)
t_1
(if (<= z -7.1e+19)
(* -2.0 (* a (* c i)))
(if (<= z -6.3e-221)
t_2
(if (<= z 1.1e-292)
(* 2.0 (* i (* c (- a))))
(if (<= z 5.4e-32) t_2 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 t_2 = (x * y) * 2.0;
double tmp;
if (z <= -1.78e+137) {
tmp = t_1;
} else if (z <= -7.1e+19) {
tmp = -2.0 * (a * (c * i));
} else if (z <= -6.3e-221) {
tmp = t_2;
} else if (z <= 1.1e-292) {
tmp = 2.0 * (i * (c * -a));
} else if (z <= 5.4e-32) {
tmp = t_2;
} 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 * (z * t)
t_2 = (x * y) * 2.0d0
if (z <= (-1.78d+137)) then
tmp = t_1
else if (z <= (-7.1d+19)) then
tmp = (-2.0d0) * (a * (c * i))
else if (z <= (-6.3d-221)) then
tmp = t_2
else if (z <= 1.1d-292) then
tmp = 2.0d0 * (i * (c * -a))
else if (z <= 5.4d-32) then
tmp = t_2
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 t_2 = (x * y) * 2.0;
double tmp;
if (z <= -1.78e+137) {
tmp = t_1;
} else if (z <= -7.1e+19) {
tmp = -2.0 * (a * (c * i));
} else if (z <= -6.3e-221) {
tmp = t_2;
} else if (z <= 1.1e-292) {
tmp = 2.0 * (i * (c * -a));
} else if (z <= 5.4e-32) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 tmp = 0 if z <= -1.78e+137: tmp = t_1 elif z <= -7.1e+19: tmp = -2.0 * (a * (c * i)) elif z <= -6.3e-221: tmp = t_2 elif z <= 1.1e-292: tmp = 2.0 * (i * (c * -a)) elif z <= 5.4e-32: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (z <= -1.78e+137) tmp = t_1; elseif (z <= -7.1e+19) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (z <= -6.3e-221) tmp = t_2; elseif (z <= 1.1e-292) tmp = Float64(2.0 * Float64(i * Float64(c * Float64(-a)))); elseif (z <= 5.4e-32) tmp = t_2; 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); t_2 = (x * y) * 2.0; tmp = 0.0; if (z <= -1.78e+137) tmp = t_1; elseif (z <= -7.1e+19) tmp = -2.0 * (a * (c * i)); elseif (z <= -6.3e-221) tmp = t_2; elseif (z <= 1.1e-292) tmp = 2.0 * (i * (c * -a)); elseif (z <= 5.4e-32) tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -1.78e+137], t$95$1, If[LessEqual[z, -7.1e+19], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.3e-221], t$95$2, If[LessEqual[z, 1.1e-292], N[(2.0 * N[(i * N[(c * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-32], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;z \leq -1.78 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{+19}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-221}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-292}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(-a\right)\right)\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.77999999999999997e137 or 5.39999999999999962e-32 < z Initial program 87.3%
Taylor expanded in z around inf 47.9%
if -1.77999999999999997e137 < z < -7.1e19Initial program 82.2%
Taylor expanded in a around inf 37.7%
mul-1-neg37.7%
*-commutative37.7%
associate-*l*29.1%
*-commutative29.1%
distribute-rgt-neg-in29.1%
*-commutative29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Taylor expanded in c around 0 37.7%
if -7.1e19 < z < -6.29999999999999958e-221 or 1.10000000000000006e-292 < z < 5.39999999999999962e-32Initial program 92.9%
Taylor expanded in x around inf 42.2%
if -6.29999999999999958e-221 < z < 1.10000000000000006e-292Initial program 84.1%
Taylor expanded in x around 0 73.4%
Taylor expanded in i around inf 73.1%
Taylor expanded in a around inf 31.2%
associate-*r*31.2%
mul-1-neg31.2%
Simplified31.2%
Final simplification43.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i))))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= z -7.5e+137)
t_2
(if (<= z -1.55e+20)
t_1
(if (<= z -2.45e-220)
t_3
(if (<= z 3.05e-292) t_1 (if (<= z 4e-35) t_3 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 * (a * (c * i));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if (z <= -7.5e+137) {
tmp = t_2;
} else if (z <= -1.55e+20) {
tmp = t_1;
} else if (z <= -2.45e-220) {
tmp = t_3;
} else if (z <= 3.05e-292) {
tmp = t_1;
} else if (z <= 4e-35) {
tmp = t_3;
} 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) * (a * (c * i))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if (z <= (-7.5d+137)) then
tmp = t_2
else if (z <= (-1.55d+20)) then
tmp = t_1
else if (z <= (-2.45d-220)) then
tmp = t_3
else if (z <= 3.05d-292) then
tmp = t_1
else if (z <= 4d-35) then
tmp = t_3
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 * (a * (c * i));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if (z <= -7.5e+137) {
tmp = t_2;
} else if (z <= -1.55e+20) {
tmp = t_1;
} else if (z <= -2.45e-220) {
tmp = t_3;
} else if (z <= 3.05e-292) {
tmp = t_1;
} else if (z <= 4e-35) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if z <= -7.5e+137: tmp = t_2 elif z <= -1.55e+20: tmp = t_1 elif z <= -2.45e-220: tmp = t_3 elif z <= 3.05e-292: tmp = t_1 elif z <= 4e-35: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (z <= -7.5e+137) tmp = t_2; elseif (z <= -1.55e+20) tmp = t_1; elseif (z <= -2.45e-220) tmp = t_3; elseif (z <= 3.05e-292) tmp = t_1; elseif (z <= 4e-35) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if (z <= -7.5e+137) tmp = t_2; elseif (z <= -1.55e+20) tmp = t_1; elseif (z <= -2.45e-220) tmp = t_3; elseif (z <= 3.05e-292) tmp = t_1; elseif (z <= 4e-35) tmp = t_3; 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -7.5e+137], t$95$2, If[LessEqual[z, -1.55e+20], t$95$1, If[LessEqual[z, -2.45e-220], t$95$3, If[LessEqual[z, 3.05e-292], t$95$1, If[LessEqual[z, 4e-35], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+137}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-220}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-292}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-35}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.50000000000000025e137 or 4.00000000000000003e-35 < z Initial program 87.3%
Taylor expanded in z around inf 47.9%
if -7.50000000000000025e137 < z < -1.55e20 or -2.4500000000000001e-220 < z < 3.04999999999999982e-292Initial program 83.2%
Taylor expanded in a around inf 36.2%
mul-1-neg36.2%
*-commutative36.2%
associate-*l*28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
*-commutative28.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Taylor expanded in c around 0 36.2%
if -1.55e20 < z < -2.4500000000000001e-220 or 3.04999999999999982e-292 < z < 4.00000000000000003e-35Initial program 92.9%
Taylor expanded in x around inf 42.2%
Final simplification43.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.55e+164)
(* -2.0 t_1)
(if (or (<= c -3.5e+22) (not (<= c 1.7e-47)))
(* 2.0 (- (* z t) t_1))
(* 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 t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.55e+164) {
tmp = -2.0 * t_1;
} else if ((c <= -3.5e+22) || !(c <= 1.7e-47)) {
tmp = 2.0 * ((z * t) - t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-1.55d+164)) then
tmp = (-2.0d0) * t_1
else if ((c <= (-3.5d+22)) .or. (.not. (c <= 1.7d-47))) then
tmp = 2.0d0 * ((z * t) - t_1)
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 t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.55e+164) {
tmp = -2.0 * t_1;
} else if ((c <= -3.5e+22) || !(c <= 1.7e-47)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -1.55e+164: tmp = -2.0 * t_1 elif (c <= -3.5e+22) or not (c <= 1.7e-47): tmp = 2.0 * ((z * t) - t_1) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) 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.55e+164) tmp = Float64(-2.0 * t_1); elseif ((c <= -3.5e+22) || !(c <= 1.7e-47)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); 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) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -1.55e+164) tmp = -2.0 * t_1; elseif ((c <= -3.5e+22) || ~((c <= 1.7e-47))) tmp = 2.0 * ((z * t) - t_1); 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_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.55e+164], N[(-2.0 * t$95$1), $MachinePrecision], If[Or[LessEqual[c, -3.5e+22], N[Not[LessEqual[c, 1.7e-47]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $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}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.55 \cdot 10^{+164}:\\
\;\;\;\;-2 \cdot t\_1\\
\mathbf{elif}\;c \leq -3.5 \cdot 10^{+22} \lor \neg \left(c \leq 1.7 \cdot 10^{-47}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\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.5500000000000001e164Initial program 70.8%
Taylor expanded in i around inf 90.1%
Taylor expanded in i around 0 90.1%
if -1.5500000000000001e164 < c < -3.5e22 or 1.7000000000000001e-47 < c Initial program 82.0%
Taylor expanded in x around 0 81.9%
if -3.5e22 < c < 1.7000000000000001e-47Initial program 98.4%
Taylor expanded in a around inf 92.2%
*-commutative92.2%
Simplified92.2%
Final simplification88.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -4e+164)
(* -2.0 t_1)
(if (or (<= c -2e+22) (not (<= c 6.8e-49)))
(* 2.0 (- (* z t) t_1))
(* 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 t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -4e+164) {
tmp = -2.0 * t_1;
} else if ((c <= -2e+22) || !(c <= 6.8e-49)) {
tmp = 2.0 * ((z * t) - t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-4d+164)) then
tmp = (-2.0d0) * t_1
else if ((c <= (-2d+22)) .or. (.not. (c <= 6.8d-49))) then
tmp = 2.0d0 * ((z * t) - t_1)
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 t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -4e+164) {
tmp = -2.0 * t_1;
} else if ((c <= -2e+22) || !(c <= 6.8e-49)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -4e+164: tmp = -2.0 * t_1 elif (c <= -2e+22) or not (c <= 6.8e-49): tmp = 2.0 * ((z * t) - t_1) else: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) 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 <= -4e+164) tmp = Float64(-2.0 * t_1); elseif ((c <= -2e+22) || !(c <= 6.8e-49)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); 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) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -4e+164) tmp = -2.0 * t_1; elseif ((c <= -2e+22) || ~((c <= 6.8e-49))) tmp = 2.0 * ((z * t) - t_1); 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_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4e+164], N[(-2.0 * t$95$1), $MachinePrecision], If[Or[LessEqual[c, -2e+22], N[Not[LessEqual[c, 6.8e-49]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $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}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -4 \cdot 10^{+164}:\\
\;\;\;\;-2 \cdot t\_1\\
\mathbf{elif}\;c \leq -2 \cdot 10^{+22} \lor \neg \left(c \leq 6.8 \cdot 10^{-49}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\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 < -4e164Initial program 70.8%
Taylor expanded in i around inf 90.1%
Taylor expanded in i around 0 90.1%
if -4e164 < c < -2e22 or 6.8000000000000001e-49 < c Initial program 82.0%
Taylor expanded in x around 0 81.9%
if -2e22 < c < 6.8000000000000001e-49Initial program 98.4%
Taylor expanded in a around inf 92.1%
Final simplification88.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (* c (* (+ a (* b c)) i))))
(if (<= c -5.8e+170)
(* -2.0 t_2)
(if (<= c -1.15e-38)
(* 2.0 (- t_1 (* (* b c) (* c i))))
(if (<= c 2.3e-47)
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- (* z t) 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);
double t_2 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -5.8e+170) {
tmp = -2.0 * t_2;
} else if (c <= -1.15e-38) {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
} else if (c <= 2.3e-47) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - 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)
t_2 = c * ((a + (b * c)) * i)
if (c <= (-5.8d+170)) then
tmp = (-2.0d0) * t_2
else if (c <= (-1.15d-38)) then
tmp = 2.0d0 * (t_1 - ((b * c) * (c * i)))
else if (c <= 2.3d-47) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * ((z * t) - 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);
double t_2 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -5.8e+170) {
tmp = -2.0 * t_2;
} else if (c <= -1.15e-38) {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
} else if (c <= 2.3e-47) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = c * ((a + (b * c)) * i) tmp = 0 if c <= -5.8e+170: tmp = -2.0 * t_2 elif c <= -1.15e-38: tmp = 2.0 * (t_1 - ((b * c) * (c * i))) elif c <= 2.3e-47: tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -5.8e+170) tmp = Float64(-2.0 * t_2); elseif (c <= -1.15e-38) tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * Float64(c * i)))); elseif (c <= 2.3e-47) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -5.8e+170) tmp = -2.0 * t_2; elseif (c <= -1.15e-38) tmp = 2.0 * (t_1 - ((b * c) * (c * i))); elseif (c <= 2.3e-47) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * ((z * t) - t_2); 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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.8e+170], N[(-2.0 * t$95$2), $MachinePrecision], If[LessEqual[c, -1.15e-38], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.3e-47], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -5.8 \cdot 10^{+170}:\\
\;\;\;\;-2 \cdot t\_2\\
\mathbf{elif}\;c \leq -1.15 \cdot 10^{-38}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{-47}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if c < -5.8000000000000001e170Initial program 72.2%
Taylor expanded in i around inf 96.5%
Taylor expanded in i around 0 96.5%
if -5.8000000000000001e170 < c < -1.15000000000000001e-38Initial program 90.7%
fma-define90.7%
associate-*l*97.6%
Simplified97.6%
fma-define97.6%
+-commutative97.6%
Applied egg-rr97.6%
Taylor expanded in a around 0 88.6%
if -1.15000000000000001e-38 < c < 2.29999999999999982e-47Initial program 99.1%
Taylor expanded in a around inf 93.9%
*-commutative93.9%
Simplified93.9%
if 2.29999999999999982e-47 < c Initial program 77.4%
Taylor expanded in x around 0 81.4%
Final simplification89.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (* c (* (+ a (* b c)) i))))
(if (<= c -7e+169)
(* -2.0 t_2)
(if (<= c -1.25e-38)
(* 2.0 (- t_1 (* i (* c (* b c)))))
(if (<= c 5.8e-47)
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- (* z t) 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);
double t_2 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -7e+169) {
tmp = -2.0 * t_2;
} else if (c <= -1.25e-38) {
tmp = 2.0 * (t_1 - (i * (c * (b * c))));
} else if (c <= 5.8e-47) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - 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)
t_2 = c * ((a + (b * c)) * i)
if (c <= (-7d+169)) then
tmp = (-2.0d0) * t_2
else if (c <= (-1.25d-38)) then
tmp = 2.0d0 * (t_1 - (i * (c * (b * c))))
else if (c <= 5.8d-47) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * ((z * t) - 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);
double t_2 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -7e+169) {
tmp = -2.0 * t_2;
} else if (c <= -1.25e-38) {
tmp = 2.0 * (t_1 - (i * (c * (b * c))));
} else if (c <= 5.8e-47) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = c * ((a + (b * c)) * i) tmp = 0 if c <= -7e+169: tmp = -2.0 * t_2 elif c <= -1.25e-38: tmp = 2.0 * (t_1 - (i * (c * (b * c)))) elif c <= 5.8e-47: tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -7e+169) tmp = Float64(-2.0 * t_2); elseif (c <= -1.25e-38) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(b * c))))); elseif (c <= 5.8e-47) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -7e+169) tmp = -2.0 * t_2; elseif (c <= -1.25e-38) tmp = 2.0 * (t_1 - (i * (c * (b * c)))); elseif (c <= 5.8e-47) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * ((z * t) - t_2); 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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7e+169], N[(-2.0 * t$95$2), $MachinePrecision], If[LessEqual[c, -1.25e-38], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.8e-47], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -7 \cdot 10^{+169}:\\
\;\;\;\;-2 \cdot t\_2\\
\mathbf{elif}\;c \leq -1.25 \cdot 10^{-38}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{-47}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if c < -7.00000000000000038e169Initial program 72.2%
Taylor expanded in i around inf 96.5%
Taylor expanded in i around 0 96.5%
if -7.00000000000000038e169 < c < -1.25000000000000008e-38Initial program 90.7%
Taylor expanded in a around 0 84.2%
if -1.25000000000000008e-38 < c < 5.8000000000000001e-47Initial program 99.1%
Taylor expanded in a around inf 93.9%
*-commutative93.9%
Simplified93.9%
if 5.8000000000000001e-47 < c Initial program 77.4%
Taylor expanded in x around 0 81.4%
Final simplification89.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -5.9e-182) (not (<= i 5e-142))) (* 2.0 (- (* z t) (* 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 ((i <= -5.9e-182) || !(i <= 5e-142)) {
tmp = 2.0 * ((z * t) - (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 ((i <= (-5.9d-182)) .or. (.not. (i <= 5d-142))) then
tmp = 2.0d0 * ((z * t) - (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 ((i <= -5.9e-182) || !(i <= 5e-142)) {
tmp = 2.0 * ((z * t) - (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 (i <= -5.9e-182) or not (i <= 5e-142): tmp = 2.0 * ((z * t) - (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 ((i <= -5.9e-182) || !(i <= 5e-142)) tmp = Float64(2.0 * Float64(Float64(z * t) - 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 ((i <= -5.9e-182) || ~((i <= 5e-142))) tmp = 2.0 * ((z * t) - (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[i, -5.9e-182], N[Not[LessEqual[i, 5e-142]], $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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.9 \cdot 10^{-182} \lor \neg \left(i \leq 5 \cdot 10^{-142}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - 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 i < -5.89999999999999968e-182 or 5.0000000000000002e-142 < i Initial program 87.5%
Taylor expanded in x around 0 76.0%
if -5.89999999999999968e-182 < i < 5.0000000000000002e-142Initial program 93.4%
Taylor expanded in c around 0 90.8%
Final simplification79.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -1e+97) (not (<= i 9500.0))) (* 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 ((i <= -1e+97) || !(i <= 9500.0)) {
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 ((i <= (-1d+97)) .or. (.not. (i <= 9500.0d0))) 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 ((i <= -1e+97) || !(i <= 9500.0)) {
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 (i <= -1e+97) or not (i <= 9500.0): 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 ((i <= -1e+97) || !(i <= 9500.0)) tmp = Float64(2.0 * Float64(Float64(c * Float64(a + Float64(b * c))) * Float64(-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 ((i <= -1e+97) || ~((i <= 9500.0))) 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[i, -1e+97], N[Not[LessEqual[i, 9500.0]], $MachinePrecision]], N[(2.0 * N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1 \cdot 10^{+97} \lor \neg \left(i \leq 9500\right):\\
\;\;\;\;2 \cdot \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot \left(-i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -1.0000000000000001e97 or 9500 < i Initial program 89.7%
Taylor expanded in x around 0 75.8%
Taylor expanded in i around inf 84.9%
Taylor expanded in t around 0 76.0%
if -1.0000000000000001e97 < i < 9500Initial program 88.3%
Taylor expanded in c around 0 70.9%
Final simplification73.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.35e+25) (not (<= c 3.2e-21))) (* -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 <= -1.35e+25) || !(c <= 3.2e-21)) {
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 <= (-1.35d+25)) .or. (.not. (c <= 3.2d-21))) 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 <= -1.35e+25) || !(c <= 3.2e-21)) {
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 <= -1.35e+25) or not (c <= 3.2e-21): 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 <= -1.35e+25) || !(c <= 3.2e-21)) 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 <= -1.35e+25) || ~((c <= 3.2e-21))) 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, -1.35e+25], N[Not[LessEqual[c, 3.2e-21]], $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 -1.35 \cdot 10^{+25} \lor \neg \left(c \leq 3.2 \cdot 10^{-21}\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 < -1.35e25 or 3.2000000000000002e-21 < c Initial program 79.4%
Taylor expanded in i around inf 73.3%
Taylor expanded in i around 0 73.3%
if -1.35e25 < c < 3.2000000000000002e-21Initial program 97.7%
Taylor expanded in c around 0 73.7%
Final simplification73.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -5.8e+127) (not (<= i 5.8e+74))) (* -2.0 (* a (* 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 ((i <= -5.8e+127) || !(i <= 5.8e+74)) {
tmp = -2.0 * (a * (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 ((i <= (-5.8d+127)) .or. (.not. (i <= 5.8d+74))) then
tmp = (-2.0d0) * (a * (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 ((i <= -5.8e+127) || !(i <= 5.8e+74)) {
tmp = -2.0 * (a * (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 (i <= -5.8e+127) or not (i <= 5.8e+74): tmp = -2.0 * (a * (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 ((i <= -5.8e+127) || !(i <= 5.8e+74)) tmp = Float64(-2.0 * Float64(a * Float64(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 ((i <= -5.8e+127) || ~((i <= 5.8e+74))) tmp = -2.0 * (a * (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[i, -5.8e+127], N[Not[LessEqual[i, 5.8e+74]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * 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}\;i \leq -5.8 \cdot 10^{+127} \lor \neg \left(i \leq 5.8 \cdot 10^{+74}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -5.8000000000000004e127 or 5.8000000000000005e74 < i Initial program 89.9%
Taylor expanded in a around inf 48.2%
mul-1-neg48.2%
*-commutative48.2%
associate-*l*35.1%
*-commutative35.1%
distribute-rgt-neg-in35.1%
*-commutative35.1%
distribute-rgt-neg-in35.1%
Simplified35.1%
Taylor expanded in c around 0 48.2%
if -5.8000000000000004e127 < i < 5.8000000000000005e74Initial program 88.3%
Taylor expanded in c around 0 67.5%
Final simplification60.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -11000000000000.0) (not (<= z 1.85e-39))) (* 2.0 (* z t)) (* (* x y) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -11000000000000.0) || !(z <= 1.85e-39)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 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 ((z <= (-11000000000000.0d0)) .or. (.not. (z <= 1.85d-39))) then
tmp = 2.0d0 * (z * t)
else
tmp = (x * y) * 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 ((z <= -11000000000000.0) || !(z <= 1.85e-39)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -11000000000000.0) or not (z <= 1.85e-39): tmp = 2.0 * (z * t) else: tmp = (x * y) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -11000000000000.0) || !(z <= 1.85e-39)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(Float64(x * y) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -11000000000000.0) || ~((z <= 1.85e-39))) tmp = 2.0 * (z * t); else tmp = (x * y) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -11000000000000.0], N[Not[LessEqual[z, 1.85e-39]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -11000000000000 \lor \neg \left(z \leq 1.85 \cdot 10^{-39}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if z < -1.1e13 or 1.85000000000000007e-39 < z Initial program 86.7%
Taylor expanded in z around inf 45.8%
if -1.1e13 < z < 1.85000000000000007e-39Initial program 91.0%
Taylor expanded in x around inf 40.0%
Final simplification42.9%
(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 88.9%
Taylor expanded in z around inf 29.6%
Final simplification29.6%
(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 2024101
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))