
(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 14 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 (* b (* i (- (pow c 2.0))))))))
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 * (b * (i * -pow(c, 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 = 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 * (b * (i * -Math.pow(c, 2.0)));
}
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 * (b * (i * -math.pow(c, 2.0))) 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(b * Float64(i * Float64(-(c ^ 2.0))))); 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 * (b * (i * -(c ^ 2.0))); 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[(b * N[(i * (-N[Power[c, 2.0], $MachinePrecision])), $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(b \cdot \left(i \cdot \left(-{c}^{2}\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.3%
fma-define95.3%
associate-*l*99.2%
Simplified99.2%
fma-define99.2%
+-commutative99.2%
Applied egg-rr99.2%
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 b around inf 63.6%
associate-*r*63.6%
mul-1-neg63.6%
Simplified63.6%
Final simplification97.7%
(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 (- INFINITY))
(* 2.0 (- (* x y) t_2))
(if (<= t_3 1e+288)
(* (- (+ (* x y) (* z t)) (* t_3 i)) 2.0)
(* 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_3 <= 1e+288) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - t_2);
}
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 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_3 <= 1e+288) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - 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 <= -math.inf: tmp = 2.0 * ((x * y) - t_2) elif t_3 <= 1e+288: tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0 else: tmp = 2.0 * ((z * t) - 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 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); elseif (t_3 <= 1e+288) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_3 * i)) * 2.0); 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 = a + (b * c); t_2 = c * (t_1 * i); t_3 = c * t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = 2.0 * ((x * y) - t_2); elseif (t_3 <= 1e+288) tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0; 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[(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, (-Infinity)], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+288], 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 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+288}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_3 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 78.7%
Taylor expanded in z around 0 92.6%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1e288Initial program 98.7%
if 1e288 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 74.6%
Taylor expanded in x around 0 93.4%
Final simplification96.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= (* x y) -2e+242)
t_1
(if (<= (* x y) -2e+175)
(* (* i (* a c)) -2.0)
(if (or (<= (* x y) -5e-39) (not (<= (* x y) 5e+36)))
t_1
(* 2.0 (* z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+242) {
tmp = t_1;
} else if ((x * y) <= -2e+175) {
tmp = (i * (a * c)) * -2.0;
} else if (((x * y) <= -5e-39) || !((x * y) <= 5e+36)) {
tmp = t_1;
} else {
tmp = 2.0 * (z * t);
}
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 = (x * y) * 2.0d0
if ((x * y) <= (-2d+242)) then
tmp = t_1
else if ((x * y) <= (-2d+175)) then
tmp = (i * (a * c)) * (-2.0d0)
else if (((x * y) <= (-5d-39)) .or. (.not. ((x * y) <= 5d+36))) then
tmp = t_1
else
tmp = 2.0d0 * (z * t)
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) * 2.0;
double tmp;
if ((x * y) <= -2e+242) {
tmp = t_1;
} else if ((x * y) <= -2e+175) {
tmp = (i * (a * c)) * -2.0;
} else if (((x * y) <= -5e-39) || !((x * y) <= 5e+36)) {
tmp = t_1;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2e+242: tmp = t_1 elif (x * y) <= -2e+175: tmp = (i * (a * c)) * -2.0 elif ((x * y) <= -5e-39) or not ((x * y) <= 5e+36): tmp = t_1 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2e+242) tmp = t_1; elseif (Float64(x * y) <= -2e+175) tmp = Float64(Float64(i * Float64(a * c)) * -2.0); elseif ((Float64(x * y) <= -5e-39) || !(Float64(x * y) <= 5e+36)) tmp = t_1; else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2e+242) tmp = t_1; elseif ((x * y) <= -2e+175) tmp = (i * (a * c)) * -2.0; elseif (((x * y) <= -5e-39) || ~(((x * y) <= 5e+36))) tmp = t_1; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+242], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e+175], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e-39], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+36]], $MachinePrecision]], t$95$1, N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+242}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+175}:\\
\;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-39} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+36}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e242 or -1.9999999999999999e175 < (*.f64 x y) < -4.9999999999999998e-39 or 4.99999999999999977e36 < (*.f64 x y) Initial program 90.0%
Taylor expanded in x around inf 56.9%
if -2.0000000000000001e242 < (*.f64 x y) < -1.9999999999999999e175Initial program 99.8%
Taylor expanded in a around inf 67.0%
mul-1-neg67.0%
associate-*r*67.0%
distribute-rgt-neg-in67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in c around 0 67.0%
*-commutative67.0%
*-commutative67.0%
associate-*l*67.0%
Simplified67.0%
Taylor expanded in c around 0 67.0%
associate-*r*67.0%
*-commutative67.0%
Simplified67.0%
if -4.9999999999999998e-39 < (*.f64 x y) < 4.99999999999999977e36Initial program 92.1%
Taylor expanded in z around inf 47.0%
Final simplification52.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -4e-36) (not (<= (* x y) 5e+36)))
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -4e-36) || !((x * y) <= 5e+36)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (((x * y) <= (-4d-36)) .or. (.not. ((x * y) <= 5d+36))) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -4e-36) || !((x * y) <= 5e+36)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if ((x * y) <= -4e-36) or not ((x * y) <= 5e+36): tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if ((Float64(x * y) <= -4e-36) || !(Float64(x * y) <= 5e+36)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (((x * y) <= -4e-36) || ~(((x * y) <= 5e+36))) tmp = 2.0 * ((x * y) - t_1); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -4e-36], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+36]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-36} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+36}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.9999999999999998e-36 or 4.99999999999999977e36 < (*.f64 x y) Initial program 90.5%
Taylor expanded in z around 0 88.4%
if -3.9999999999999998e-36 < (*.f64 x y) < 4.99999999999999977e36Initial program 92.2%
Taylor expanded in x around 0 89.8%
Final simplification89.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+291)
(* (* x y) 2.0)
(if (<= (* x y) 5e+36)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* 2.0 (- (* x y) (* a (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+291) {
tmp = (x * y) * 2.0;
} else if ((x * y) <= 5e+36) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-1d+291)) then
tmp = (x * y) * 2.0d0
else if ((x * y) <= 5d+36) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+291) {
tmp = (x * y) * 2.0;
} else if ((x * y) <= 5e+36) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+291: tmp = (x * y) * 2.0 elif (x * y) <= 5e+36: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+291) tmp = Float64(Float64(x * y) * 2.0); elseif (Float64(x * y) <= 5e+36) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e+291) tmp = (x * y) * 2.0; elseif ((x * y) <= 5e+36) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((x * y) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+291], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+36], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+291}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+36}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999996e290Initial program 88.0%
Taylor expanded in x around inf 92.6%
if -9.9999999999999996e290 < (*.f64 x y) < 4.99999999999999977e36Initial program 92.8%
Taylor expanded in x around 0 83.5%
if 4.99999999999999977e36 < (*.f64 x y) Initial program 88.7%
Taylor expanded in a around inf 73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in z around 0 75.8%
Final simplification82.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= a -4.5e+45)
(* 2.0 (- t_1 (* i (* a c))))
(if (<= a 8.2e+176)
(* 2.0 (- t_1 (* (* b c) (* c i))))
(* 2.0 (- (* x y) (* a (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (a <= -4.5e+45) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (a <= 8.2e+176) {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
} else {
tmp = 2.0 * ((x * y) - (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 = (x * y) + (z * t)
if (a <= (-4.5d+45)) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else if (a <= 8.2d+176) then
tmp = 2.0d0 * (t_1 - ((b * c) * (c * i)))
else
tmp = 2.0d0 * ((x * y) - (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 = (x * y) + (z * t);
double tmp;
if (a <= -4.5e+45) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (a <= 8.2e+176) {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
} else {
tmp = 2.0 * ((x * y) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if a <= -4.5e+45: tmp = 2.0 * (t_1 - (i * (a * c))) elif a <= 8.2e+176: tmp = 2.0 * (t_1 - ((b * c) * (c * i))) else: tmp = 2.0 * ((x * y) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (a <= -4.5e+45) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); elseif (a <= 8.2e+176) tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if (a <= -4.5e+45) tmp = 2.0 * (t_1 - (i * (a * c))); elseif (a <= 8.2e+176) tmp = 2.0 * (t_1 - ((b * c) * (c * i))); else tmp = 2.0 * ((x * y) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.5e+45], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+176], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+45}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -4.4999999999999998e45Initial program 91.4%
Taylor expanded in a around inf 85.3%
*-commutative85.3%
Simplified85.3%
if -4.4999999999999998e45 < a < 8.1999999999999998e176Initial program 92.8%
fma-define92.8%
associate-*l*95.8%
Simplified95.8%
fma-define95.8%
+-commutative95.8%
Applied egg-rr95.8%
Taylor expanded in a around 0 92.8%
if 8.1999999999999998e176 < a Initial program 81.1%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in z around 0 88.7%
Final simplification90.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* (* b (* c i)) (- c)))))
(if (<= c -6.2e+114)
t_1
(if (<= c 4.3e+57)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 2.75e+131) (* 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 * ((b * (c * i)) * -c);
double tmp;
if (c <= -6.2e+114) {
tmp = t_1;
} else if (c <= 4.3e+57) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 2.75e+131) {
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 * ((b * (c * i)) * -c)
if (c <= (-6.2d+114)) then
tmp = t_1
else if (c <= 4.3d+57) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 2.75d+131) 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 * ((b * (c * i)) * -c);
double tmp;
if (c <= -6.2e+114) {
tmp = t_1;
} else if (c <= 4.3e+57) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 2.75e+131) {
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 * ((b * (c * i)) * -c) tmp = 0 if c <= -6.2e+114: tmp = t_1 elif c <= 4.3e+57: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 2.75e+131: 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(b * Float64(c * i)) * Float64(-c))) tmp = 0.0 if (c <= -6.2e+114) tmp = t_1; elseif (c <= 4.3e+57) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 2.75e+131) 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 * ((b * (c * i)) * -c); tmp = 0.0; if (c <= -6.2e+114) tmp = t_1; elseif (c <= 4.3e+57) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 2.75e+131) 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[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.2e+114], t$95$1, If[LessEqual[c, 4.3e+57], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 2.75e+131], 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(b \cdot \left(c \cdot i\right)\right) \cdot \left(-c\right)\right)\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 4.3 \cdot 10^{+57}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 2.75 \cdot 10^{+131}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -6.2000000000000001e114 or 2.74999999999999986e131 < c Initial program 81.5%
Taylor expanded in i around inf 82.0%
Taylor expanded in a around 0 72.2%
if -6.2000000000000001e114 < c < 4.30000000000000033e57Initial program 97.9%
Taylor expanded in c around 0 73.8%
if 4.30000000000000033e57 < c < 2.74999999999999986e131Initial program 86.0%
Taylor expanded in a around inf 63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in x around 0 67.4%
*-commutative67.4%
associate-*r*67.3%
Simplified67.3%
Final simplification72.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.8e-85) (not (<= c 2e-29))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.8e-85) || !(c <= 2e-29)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.8d-85)) .or. (.not. (c <= 2d-29))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.8e-85) || !(c <= 2e-29)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.8e-85) or not (c <= 2e-29): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.8e-85) || !(c <= 2e-29)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.8e-85) || ~((c <= 2e-29))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.8e-85], N[Not[LessEqual[c, 2e-29]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.8 \cdot 10^{-85} \lor \neg \left(c \leq 2 \cdot 10^{-29}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -1.7999999999999999e-85 or 1.99999999999999989e-29 < c Initial program 85.9%
Taylor expanded in z around 0 85.5%
if -1.7999999999999999e-85 < c < 1.99999999999999989e-29Initial program 100.0%
Taylor expanded in a around inf 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification90.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.35e+23) (not (<= c 9e+60))) (* 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+23) || !(c <= 9e+60)) {
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+23)) .or. (.not. (c <= 9d+60))) 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+23) || !(c <= 9e+60)) {
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+23) or not (c <= 9e+60): 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+23) || !(c <= 9e+60)) tmp = Float64(2.0 * Float64(c * Float64(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 ((c <= -1.35e+23) || ~((c <= 9e+60))) 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+23], N[Not[LessEqual[c, 9e+60]], $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^{+23} \lor \neg \left(c \leq 9 \cdot 10^{+60}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.3499999999999999e23 or 9.00000000000000026e60 < c Initial program 83.5%
Taylor expanded in i around inf 78.4%
if -1.3499999999999999e23 < c < 9.00000000000000026e60Initial program 98.4%
Taylor expanded in c around 0 76.2%
Final simplification77.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.15e+115) (not (<= c 1.2e+71))) (* 2.0 (* (* b (* c i)) (- c))) (* (+ (* 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.15e+115) || !(c <= 1.2e+71)) {
tmp = 2.0 * ((b * (c * i)) * -c);
} 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.15d+115)) .or. (.not. (c <= 1.2d+71))) then
tmp = 2.0d0 * ((b * (c * i)) * -c)
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.15e+115) || !(c <= 1.2e+71)) {
tmp = 2.0 * ((b * (c * i)) * -c);
} 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.15e+115) or not (c <= 1.2e+71): tmp = 2.0 * ((b * (c * i)) * -c) 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.15e+115) || !(c <= 1.2e+71)) tmp = Float64(2.0 * Float64(Float64(b * Float64(c * i)) * Float64(-c))); 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.15e+115) || ~((c <= 1.2e+71))) tmp = 2.0 * ((b * (c * i)) * -c); 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.15e+115], N[Not[LessEqual[c, 1.2e+71]], $MachinePrecision]], N[(2.0 * N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-c)), $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.15 \cdot 10^{+115} \lor \neg \left(c \leq 1.2 \cdot 10^{+71}\right):\\
\;\;\;\;2 \cdot \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.15000000000000002e115 or 1.1999999999999999e71 < c Initial program 82.7%
Taylor expanded in i around inf 81.3%
Taylor expanded in a around 0 66.9%
if -1.15000000000000002e115 < c < 1.1999999999999999e71Initial program 97.3%
Taylor expanded in c around 0 73.6%
Final simplification70.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e-39) (not (<= (* x y) 5e+36))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e-39) || !((x * y) <= 5e+36)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
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 (((x * y) <= (-5d-39)) .or. (.not. ((x * y) <= 5d+36))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
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 (((x * y) <= -5e-39) || !((x * y) <= 5e+36)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5e-39) or not ((x * y) <= 5e+36): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5e-39) || !(Float64(x * y) <= 5e+36)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -5e-39) || ~(((x * y) <= 5e+36))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e-39], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+36]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-39} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+36}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999998e-39 or 4.99999999999999977e36 < (*.f64 x y) Initial program 90.6%
Taylor expanded in x around inf 54.1%
if -4.9999999999999998e-39 < (*.f64 x y) < 4.99999999999999977e36Initial program 92.1%
Taylor expanded in z around inf 47.0%
Final simplification51.0%
(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}
Initial program 91.3%
fma-define91.6%
associate-*l*96.1%
Simplified96.1%
fma-define95.7%
+-commutative95.7%
Applied egg-rr95.7%
Final simplification95.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 8.5e+176) (* (+ (* x y) (* z t)) 2.0) (* (* c i) (* a -2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 8.5e+176) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * i) * (a * -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 <= 8.5d+176) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (c * i) * (a * (-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 <= 8.5e+176) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 8.5e+176: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (c * i) * (a * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 8.5e+176) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(c * i) * Float64(a * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= 8.5e+176) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (c * i) * (a * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 8.5e+176], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.5 \cdot 10^{+176}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\end{array}
\end{array}
if a < 8.4999999999999995e176Initial program 92.4%
Taylor expanded in c around 0 57.7%
if 8.4999999999999995e176 < a Initial program 81.1%
Taylor expanded in a around inf 70.1%
mul-1-neg70.1%
associate-*r*70.1%
distribute-rgt-neg-in70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in c around 0 70.1%
*-commutative70.1%
*-commutative70.1%
associate-*l*70.1%
Simplified70.1%
Final simplification58.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 91.3%
Taylor expanded in z around inf 26.1%
Final simplification26.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 2024098
(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))))