
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* z t) (* x y)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* c (* i (- (- a) (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((z * t) + (x * y)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * (c * (i * (-a - (b * c))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(z \cdot t + x \cdot y\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\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.4%
associate-*l*98.0%
fma-def98.0%
Simplified98.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 66.8%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (+ a (* b c))) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+277)))
(* 2.0 (* c (* i (- (- a) (* b c)))))
(* (- (+ (* z t) (* x y)) t_1) 2.0))))
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 ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+277)) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else {
tmp = (((z * t) + (x * y)) - t_1) * 2.0;
}
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 = (c * (a + (b * c))) * i;
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+277)) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else {
tmp = (((z * t) + (x * y)) - t_1) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * (a + (b * c))) * i tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+277): tmp = 2.0 * (c * (i * (-a - (b * c)))) else: tmp = (((z * t) + (x * y)) - t_1) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+277)) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); else tmp = Float64(Float64(Float64(Float64(z * t) + Float64(x * y)) - t_1) * 2.0); 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 ((t_1 <= -Inf) || ~((t_1 <= 1e+277))) tmp = 2.0 * (c * (i * (-a - (b * c)))); else tmp = (((z * t) + (x * y)) - t_1) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+277]], $MachinePrecision]], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+277}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - t_1\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1e277 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.5%
Taylor expanded in i around inf 90.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e277Initial program 98.6%
Final simplification95.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y))))
(if (<= c -3.5e+53)
(* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
(if (<= c 4.5e-64)
(* 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 (c <= -3.5e+53) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else if (c <= 4.5e-64) {
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 (c <= (-3.5d+53)) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else if (c <= 4.5d-64) 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 (c <= -3.5e+53) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else if (c <= 4.5e-64) {
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 c <= -3.5e+53: tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) elif c <= 4.5e-64: 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 (c <= -3.5e+53) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); elseif (c <= 4.5e-64) 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 (c <= -3.5e+53) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); elseif (c <= 4.5e-64) 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[LessEqual[c, -3.5e+53], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.5e-64], 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}\;c \leq -3.5 \cdot 10^{+53}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 4.5 \cdot 10^{-64}:\\
\;\;\;\;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 c < -3.50000000000000019e53Initial program 79.1%
Taylor expanded in z around 0 86.3%
if -3.50000000000000019e53 < c < 4.5000000000000001e-64Initial program 98.3%
Taylor expanded in a around inf 95.1%
if 4.5000000000000001e-64 < c Initial program 85.0%
Taylor expanded in a around 0 76.7%
unpow276.7%
associate-*r*85.4%
Simplified85.4%
Final simplification90.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* z t) (* x y)) 2.0))
(t_2 (* 2.0 (* c (* i (- (- a) (* b c)))))))
(if (<= c -3.2e+63)
t_2
(if (<= c -4.1e-11)
t_1
(if (<= c -5.8e-34)
(* 2.0 (- (* x y) (* c (* a i))))
(if (<= c 9.2e+127) 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 = ((z * t) + (x * y)) * 2.0;
double t_2 = 2.0 * (c * (i * (-a - (b * c))));
double tmp;
if (c <= -3.2e+63) {
tmp = t_2;
} else if (c <= -4.1e-11) {
tmp = t_1;
} else if (c <= -5.8e-34) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (c <= 9.2e+127) {
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 = ((z * t) + (x * y)) * 2.0d0
t_2 = 2.0d0 * (c * (i * (-a - (b * c))))
if (c <= (-3.2d+63)) then
tmp = t_2
else if (c <= (-4.1d-11)) then
tmp = t_1
else if (c <= (-5.8d-34)) then
tmp = 2.0d0 * ((x * y) - (c * (a * i)))
else if (c <= 9.2d+127) 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 = ((z * t) + (x * y)) * 2.0;
double t_2 = 2.0 * (c * (i * (-a - (b * c))));
double tmp;
if (c <= -3.2e+63) {
tmp = t_2;
} else if (c <= -4.1e-11) {
tmp = t_1;
} else if (c <= -5.8e-34) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (c <= 9.2e+127) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((z * t) + (x * y)) * 2.0 t_2 = 2.0 * (c * (i * (-a - (b * c)))) tmp = 0 if c <= -3.2e+63: tmp = t_2 elif c <= -4.1e-11: tmp = t_1 elif c <= -5.8e-34: tmp = 2.0 * ((x * y) - (c * (a * i))) elif c <= 9.2e+127: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0) t_2 = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))) tmp = 0.0 if (c <= -3.2e+63) tmp = t_2; elseif (c <= -4.1e-11) tmp = t_1; elseif (c <= -5.8e-34) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i)))); elseif (c <= 9.2e+127) 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 = ((z * t) + (x * y)) * 2.0; t_2 = 2.0 * (c * (i * (-a - (b * c)))); tmp = 0.0; if (c <= -3.2e+63) tmp = t_2; elseif (c <= -4.1e-11) tmp = t_1; elseif (c <= -5.8e-34) tmp = 2.0 * ((x * y) - (c * (a * i))); elseif (c <= 9.2e+127) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.2e+63], t$95$2, If[LessEqual[c, -4.1e-11], t$95$1, If[LessEqual[c, -5.8e-34], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.2e+127], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t + x \cdot y\right) \cdot 2\\
t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -3.2 \cdot 10^{+63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -4.1 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -5.8 \cdot 10^{-34}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 9.2 \cdot 10^{+127}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -3.20000000000000011e63 or 9.2000000000000007e127 < c Initial program 79.5%
Taylor expanded in i around inf 86.0%
if -3.20000000000000011e63 < c < -4.1000000000000001e-11 or -5.8000000000000004e-34 < c < 9.2000000000000007e127Initial program 96.6%
Taylor expanded in c around 0 77.1%
if -4.1000000000000001e-11 < c < -5.8000000000000004e-34Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in c around 0 100.0%
mul-1-neg100.0%
sub-neg100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.8e-34) (not (<= c 1.8e-81))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* (+ (* 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 ((c <= -2.8e-34) || !(c <= 1.8e-81)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((z * t) + (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 ((c <= (-2.8d-34)) .or. (.not. (c <= 1.8d-81))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = ((z * t) + (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 ((c <= -2.8e-34) || !(c <= 1.8e-81)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.8e-34) or not (c <= 1.8e-81): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.8e-34) || !(c <= 1.8e-81)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(z * t) + 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 ((c <= -2.8e-34) || ~((c <= 1.8e-81))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.8e-34], N[Not[LessEqual[c, 1.8e-81]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.8 \cdot 10^{-34} \lor \neg \left(c \leq 1.8 \cdot 10^{-81}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.79999999999999997e-34 or 1.7999999999999999e-81 < c Initial program 84.3%
Taylor expanded in z around 0 82.2%
if -2.79999999999999997e-34 < c < 1.7999999999999999e-81Initial program 98.0%
Taylor expanded in c around 0 84.9%
Final simplification83.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.8e+49) (not (<= c 5e+93))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.8e+49) || !(c <= 5e+93)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-3.8d+49)) .or. (.not. (c <= 5d+93))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.8e+49) || !(c <= 5e+93)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.8e+49) or not (c <= 5e+93): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.8e+49) || !(c <= 5e+93)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.8e+49) || ~((c <= 5e+93))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.8e+49], N[Not[LessEqual[c, 5e+93]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.8 \cdot 10^{+49} \lor \neg \left(c \leq 5 \cdot 10^{+93}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -3.7999999999999999e49 or 5.0000000000000001e93 < c Initial program 79.3%
Taylor expanded in z around 0 89.1%
if -3.7999999999999999e49 < c < 5.0000000000000001e93Initial program 97.3%
Taylor expanded in a around inf 89.5%
Final simplification89.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= a -2.5e+212)
(not
(or (<= a 3.6e+100) (and (not (<= a 2.75e+167)) (<= a 3.2e+227)))))
(* 2.0 (* i (* a (- c))))
(* (+ (* 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 ((a <= -2.5e+212) || !((a <= 3.6e+100) || (!(a <= 2.75e+167) && (a <= 3.2e+227)))) {
tmp = 2.0 * (i * (a * -c));
} else {
tmp = ((z * t) + (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 ((a <= (-2.5d+212)) .or. (.not. (a <= 3.6d+100) .or. (.not. (a <= 2.75d+167)) .and. (a <= 3.2d+227))) then
tmp = 2.0d0 * (i * (a * -c))
else
tmp = ((z * t) + (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 ((a <= -2.5e+212) || !((a <= 3.6e+100) || (!(a <= 2.75e+167) && (a <= 3.2e+227)))) {
tmp = 2.0 * (i * (a * -c));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -2.5e+212) or not ((a <= 3.6e+100) or (not (a <= 2.75e+167) and (a <= 3.2e+227))): tmp = 2.0 * (i * (a * -c)) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -2.5e+212) || !((a <= 3.6e+100) || (!(a <= 2.75e+167) && (a <= 3.2e+227)))) tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c)))); else tmp = Float64(Float64(Float64(z * t) + 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 ((a <= -2.5e+212) || ~(((a <= 3.6e+100) || (~((a <= 2.75e+167)) && (a <= 3.2e+227))))) tmp = 2.0 * (i * (a * -c)); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -2.5e+212], N[Not[Or[LessEqual[a, 3.6e+100], And[N[Not[LessEqual[a, 2.75e+167]], $MachinePrecision], LessEqual[a, 3.2e+227]]]], $MachinePrecision]], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+212} \lor \neg \left(a \leq 3.6 \cdot 10^{+100} \lor \neg \left(a \leq 2.75 \cdot 10^{+167}\right) \land a \leq 3.2 \cdot 10^{+227}\right):\\
\;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if a < -2.49999999999999996e212 or 3.6e100 < a < 2.7500000000000002e167 or 3.19999999999999988e227 < a Initial program 82.8%
Taylor expanded in z around 0 72.4%
Taylor expanded in a around inf 53.5%
associate-*r*53.5%
neg-mul-153.5%
associate-*r*60.0%
*-commutative60.0%
associate-*l*65.3%
Simplified65.3%
if -2.49999999999999996e212 < a < 3.6e100 or 2.7500000000000002e167 < a < 3.19999999999999988e227Initial program 91.7%
Taylor expanded in c around 0 61.2%
Final simplification62.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -9.4e+64) (not (<= c 3.1e+142))) (* 2.0 (* c (* b (* i (- c))))) (* (+ (* 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 ((c <= -9.4e+64) || !(c <= 3.1e+142)) {
tmp = 2.0 * (c * (b * (i * -c)));
} else {
tmp = ((z * t) + (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 ((c <= (-9.4d+64)) .or. (.not. (c <= 3.1d+142))) then
tmp = 2.0d0 * (c * (b * (i * -c)))
else
tmp = ((z * t) + (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 ((c <= -9.4e+64) || !(c <= 3.1e+142)) {
tmp = 2.0 * (c * (b * (i * -c)));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -9.4e+64) or not (c <= 3.1e+142): tmp = 2.0 * (c * (b * (i * -c))) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -9.4e+64) || !(c <= 3.1e+142)) tmp = Float64(2.0 * Float64(c * Float64(b * Float64(i * Float64(-c))))); else tmp = Float64(Float64(Float64(z * t) + 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 ((c <= -9.4e+64) || ~((c <= 3.1e+142))) tmp = 2.0 * (c * (b * (i * -c))); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -9.4e+64], N[Not[LessEqual[c, 3.1e+142]], $MachinePrecision]], N[(2.0 * N[(c * N[(b * N[(i * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.4 \cdot 10^{+64} \lor \neg \left(c \leq 3.1 \cdot 10^{+142}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(i \cdot \left(-c\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -9.40000000000000058e64 or 3.0999999999999999e142 < c Initial program 79.8%
Taylor expanded in a around 0 67.8%
unpow267.8%
associate-*r*80.7%
Simplified80.7%
Taylor expanded in c around inf 71.1%
unpow271.1%
associate-*r*77.1%
*-commutative77.1%
associate-*l*77.1%
neg-mul-177.1%
*-commutative77.1%
distribute-rgt-neg-in77.1%
distribute-lft-neg-in77.1%
associate-*r*79.1%
Simplified79.1%
if -9.40000000000000058e64 < c < 3.0999999999999999e142Initial program 96.2%
Taylor expanded in c around 0 74.1%
Final simplification76.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= y -1e-57)
(not
(or (<= y 2.3e+91) (and (not (<= y 8.5e+194)) (<= y 1.95e+210)))))
(* 2.0 (* 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 ((y <= -1e-57) || !((y <= 2.3e+91) || (!(y <= 8.5e+194) && (y <= 1.95e+210)))) {
tmp = 2.0 * (x * y);
} else {
tmp = (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 ((y <= (-1d-57)) .or. (.not. (y <= 2.3d+91) .or. (.not. (y <= 8.5d+194)) .and. (y <= 1.95d+210))) then
tmp = 2.0d0 * (x * y)
else
tmp = (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 ((y <= -1e-57) || !((y <= 2.3e+91) || (!(y <= 8.5e+194) && (y <= 1.95e+210)))) {
tmp = 2.0 * (x * y);
} else {
tmp = (z * t) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -1e-57) or not ((y <= 2.3e+91) or (not (y <= 8.5e+194) and (y <= 1.95e+210))): tmp = 2.0 * (x * y) else: tmp = (z * t) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -1e-57) || !((y <= 2.3e+91) || (!(y <= 8.5e+194) && (y <= 1.95e+210)))) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(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 ((y <= -1e-57) || ~(((y <= 2.3e+91) || (~((y <= 8.5e+194)) && (y <= 1.95e+210))))) tmp = 2.0 * (x * y); else tmp = (z * t) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -1e-57], N[Not[Or[LessEqual[y, 2.3e+91], And[N[Not[LessEqual[y, 8.5e+194]], $MachinePrecision], LessEqual[y, 1.95e+210]]]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-57} \lor \neg \left(y \leq 2.3 \cdot 10^{+91} \lor \neg \left(y \leq 8.5 \cdot 10^{+194}\right) \land y \leq 1.95 \cdot 10^{+210}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if y < -9.99999999999999955e-58 or 2.29999999999999991e91 < y < 8.50000000000000026e194 or 1.95e210 < y Initial program 87.6%
Taylor expanded in x around inf 45.1%
if -9.99999999999999955e-58 < y < 2.29999999999999991e91 or 8.50000000000000026e194 < y < 1.95e210Initial program 91.6%
Taylor expanded in z around inf 40.3%
Final simplification42.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.25e+62) (not (<= c 7e+135))) (* b (* i (* c (* c -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 ((c <= -3.25e+62) || !(c <= 7e+135)) {
tmp = b * (i * (c * (c * -2.0)));
} else {
tmp = ((z * t) + (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 ((c <= (-3.25d+62)) .or. (.not. (c <= 7d+135))) then
tmp = b * (i * (c * (c * (-2.0d0))))
else
tmp = ((z * t) + (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 ((c <= -3.25e+62) || !(c <= 7e+135)) {
tmp = b * (i * (c * (c * -2.0)));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.25e+62) or not (c <= 7e+135): tmp = b * (i * (c * (c * -2.0))) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.25e+62) || !(c <= 7e+135)) tmp = Float64(b * Float64(i * Float64(c * Float64(c * -2.0)))); else tmp = Float64(Float64(Float64(z * t) + 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 ((c <= -3.25e+62) || ~((c <= 7e+135))) tmp = b * (i * (c * (c * -2.0))); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.25e+62], N[Not[LessEqual[c, 7e+135]], $MachinePrecision]], N[(b * N[(i * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.25 \cdot 10^{+62} \lor \neg \left(c \leq 7 \cdot 10^{+135}\right):\\
\;\;\;\;b \cdot \left(i \cdot \left(c \cdot \left(c \cdot -2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -3.2500000000000001e62 or 7.0000000000000005e135 < c Initial program 79.8%
Taylor expanded in b around inf 71.1%
mul-1-neg71.1%
*-commutative71.1%
distribute-rgt-neg-in71.1%
unpow271.1%
distribute-rgt-neg-in71.1%
Simplified71.1%
Taylor expanded in i around 0 71.1%
unpow271.1%
associate-*r*71.1%
Simplified71.1%
Taylor expanded in c around 0 71.1%
associate-*r*71.1%
unpow271.1%
*-commutative71.1%
*-commutative71.1%
associate-*l*72.3%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
if -3.2500000000000001e62 < c < 7.0000000000000005e135Initial program 96.2%
Taylor expanded in c around 0 74.1%
Final simplification73.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.45e+52) (not (<= c 8.2e+135))) (* c (* (* c (* b i)) -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 ((c <= -3.45e+52) || !(c <= 8.2e+135)) {
tmp = c * ((c * (b * i)) * -2.0);
} else {
tmp = ((z * t) + (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 ((c <= (-3.45d+52)) .or. (.not. (c <= 8.2d+135))) then
tmp = c * ((c * (b * i)) * (-2.0d0))
else
tmp = ((z * t) + (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 ((c <= -3.45e+52) || !(c <= 8.2e+135)) {
tmp = c * ((c * (b * i)) * -2.0);
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.45e+52) or not (c <= 8.2e+135): tmp = c * ((c * (b * i)) * -2.0) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.45e+52) || !(c <= 8.2e+135)) tmp = Float64(c * Float64(Float64(c * Float64(b * i)) * -2.0)); else tmp = Float64(Float64(Float64(z * t) + 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 ((c <= -3.45e+52) || ~((c <= 8.2e+135))) tmp = c * ((c * (b * i)) * -2.0); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.45e+52], N[Not[LessEqual[c, 8.2e+135]], $MachinePrecision]], N[(c * N[(N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.45 \cdot 10^{+52} \lor \neg \left(c \leq 8.2 \cdot 10^{+135}\right):\\
\;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -3.44999999999999998e52 or 8.2e135 < c Initial program 79.8%
Taylor expanded in b around inf 71.1%
mul-1-neg71.1%
*-commutative71.1%
distribute-rgt-neg-in71.1%
unpow271.1%
distribute-rgt-neg-in71.1%
Simplified71.1%
Taylor expanded in i around 0 71.1%
*-commutative71.1%
unpow271.1%
associate-*r*77.1%
*-commutative77.1%
associate-*r*77.3%
associate-*l*77.3%
associate-*r*77.1%
*-commutative77.1%
Simplified77.1%
if -3.44999999999999998e52 < c < 8.2e135Initial program 96.2%
Taylor expanded in c around 0 74.1%
Final simplification75.3%
(FPCore (x y z t a b c i) :precision binary64 (* (* z t) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (z * t) * 2.0;
}
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 = (z * t) * 2.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (z * t) * 2.0;
}
def code(x, y, z, t, a, b, c, i): return (z * t) * 2.0
function code(x, y, z, t, a, b, c, i) return Float64(Float64(z * t) * 2.0) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (z * t) * 2.0; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot t\right) \cdot 2
\end{array}
Initial program 89.8%
Taylor expanded in z around inf 31.1%
Final simplification31.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2023221
(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))))