
(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 15 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 (* c t_1)))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (fma x y (* z t)) (* c (* b (* c i)))))
(if (<= t_2 2e+266)
(* 2.0 (- (+ (* x y) (* z t)) (* i t_2)))
(* 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 = c * t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (c * (b * (c * i))));
} else if (t_2 <= 2e+266) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} 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(c * t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(c * Float64(b * Float64(c * i))))); elseif (t_2 <= 2e+266) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * t_2))); else tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+266], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$2), $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 := c \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+266}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 64.1%
associate--l+64.1%
*-commutative64.1%
associate--l+64.1%
associate--l+64.1%
*-commutative64.1%
associate--l+64.1%
fma-define64.1%
*-commutative64.1%
associate-*l*89.9%
+-commutative89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in b around inf 86.3%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e266Initial program 98.3%
if 2.0000000000000001e266 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 73.0%
Taylor expanded in i around inf 92.4%
Final simplification96.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 90.6%
fma-define91.8%
associate-*l*95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c t_1)))
(if (or (<= t_2 -2e+298) (not (<= t_2 2e+266)))
(* 2.0 (* c (* t_1 (- i))))
(* 2.0 (- (+ (* x y) (* z t)) (* i 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;
double tmp;
if ((t_2 <= -2e+298) || !(t_2 <= 2e+266)) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * 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 = a + (b * c)
t_2 = c * t_1
if ((t_2 <= (-2d+298)) .or. (.not. (t_2 <= 2d+266))) then
tmp = 2.0d0 * (c * (t_1 * -i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * 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;
double tmp;
if ((t_2 <= -2e+298) || !(t_2 <= 2e+266)) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * t_1 tmp = 0 if (t_2 <= -2e+298) or not (t_2 <= 2e+266): tmp = 2.0 * (c * (t_1 * -i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * 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 * t_1) tmp = 0.0 if ((t_2 <= -2e+298) || !(t_2 <= 2e+266)) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * 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; tmp = 0.0; if ((t_2 <= -2e+298) || ~((t_2 <= 2e+266))) tmp = 2.0 * (c * (t_1 * -i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * 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 * t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+298], N[Not[LessEqual[t$95$2, 2e+266]], $MachinePrecision]], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+298} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+266}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.9999999999999999e298 or 2.0000000000000001e266 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 69.6%
Taylor expanded in i around inf 88.6%
if -1.9999999999999999e298 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e266Initial program 98.3%
Final simplification95.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= c -112000000000.0)
(* 2.0 (* c (* (+ a (* b c)) (- i))))
(if (<= c 4.7e-79)
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- t_1 (* (* b c) (* 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 (c <= -112000000000.0) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else if (c <= 4.7e-79) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (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 (c <= (-112000000000.0d0)) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else if (c <= 4.7d-79) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * (t_1 - ((b * c) * (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 (c <= -112000000000.0) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else if (c <= 4.7e-79) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if c <= -112000000000.0: tmp = 2.0 * (c * ((a + (b * c)) * -i)) elif c <= 4.7e-79: tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * (t_1 - ((b * c) * (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 (c <= -112000000000.0) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); elseif (c <= 4.7e-79) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * 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 (c <= -112000000000.0) tmp = 2.0 * (c * ((a + (b * c)) * -i)); elseif (c <= 4.7e-79) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * (t_1 - ((b * c) * (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[c, -112000000000.0], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.7e-79], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -112000000000:\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;c \leq 4.7 \cdot 10^{-79}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.12e11Initial program 77.8%
Taylor expanded in i around inf 80.5%
if -1.12e11 < c < 4.7000000000000002e-79Initial program 96.9%
Taylor expanded in a around inf 95.5%
*-commutative95.5%
Simplified95.5%
if 4.7000000000000002e-79 < c Initial program 88.5%
associate-*r*98.5%
*-commutative98.5%
+-commutative98.5%
distribute-lft-in87.7%
Applied egg-rr87.7%
add-sqr-sqrt49.9%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.4%
add-sqr-sqrt75.3%
distribute-rgt-neg-in75.3%
distribute-lft-neg-in75.3%
*-commutative75.3%
distribute-lft-neg-in75.3%
cancel-sign-sub-inv75.3%
*-commutative75.3%
distribute-rgt-out--83.4%
*-commutative83.4%
Applied egg-rr83.4%
Taylor expanded in c around inf 87.5%
Final simplification90.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))) (t_2 (* 2.0 (* z t))))
(if (<= z -1.1e+111)
t_2
(if (<= z -2.8e-257)
t_1
(if (<= z 4.7e-247)
(* c (* i (* a -2.0)))
(if (<= z 2.5e-65) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (z <= -1.1e+111) {
tmp = t_2;
} else if (z <= -2.8e-257) {
tmp = t_1;
} else if (z <= 4.7e-247) {
tmp = c * (i * (a * -2.0));
} else if (z <= 2.5e-65) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = 2.0d0 * (z * t)
if (z <= (-1.1d+111)) then
tmp = t_2
else if (z <= (-2.8d-257)) then
tmp = t_1
else if (z <= 4.7d-247) then
tmp = c * (i * (a * (-2.0d0)))
else if (z <= 2.5d-65) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (z <= -1.1e+111) {
tmp = t_2;
} else if (z <= -2.8e-257) {
tmp = t_1;
} else if (z <= 4.7e-247) {
tmp = c * (i * (a * -2.0));
} else if (z <= 2.5e-65) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) t_2 = 2.0 * (z * t) tmp = 0 if z <= -1.1e+111: tmp = t_2 elif z <= -2.8e-257: tmp = t_1 elif z <= 4.7e-247: tmp = c * (i * (a * -2.0)) elif z <= 2.5e-65: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -1.1e+111) tmp = t_2; elseif (z <= -2.8e-257) tmp = t_1; elseif (z <= 4.7e-247) tmp = Float64(c * Float64(i * Float64(a * -2.0))); elseif (z <= 2.5e-65) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); t_2 = 2.0 * (z * t); tmp = 0.0; if (z <= -1.1e+111) tmp = t_2; elseif (z <= -2.8e-257) tmp = t_1; elseif (z <= 4.7e-247) tmp = c * (i * (a * -2.0)); elseif (z <= 2.5e-65) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+111], t$95$2, If[LessEqual[z, -2.8e-257], t$95$1, If[LessEqual[z, 4.7e-247], N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-65], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-247}:\\
\;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.09999999999999999e111 or 2.49999999999999991e-65 < z Initial program 87.8%
Taylor expanded in z around inf 50.0%
if -1.09999999999999999e111 < z < -2.80000000000000001e-257 or 4.6999999999999998e-247 < z < 2.49999999999999991e-65Initial program 93.0%
Taylor expanded in x around inf 37.0%
if -2.80000000000000001e-257 < z < 4.6999999999999998e-247Initial program 93.1%
Taylor expanded in a around inf 33.2%
mul-1-neg33.2%
*-commutative33.2%
distribute-rgt-neg-in33.2%
Simplified33.2%
Taylor expanded in c around 0 33.2%
associate-*r*33.2%
*-commutative33.2%
*-commutative33.2%
Simplified33.2%
Taylor expanded in c around 0 33.2%
associate-*r*33.2%
*-commutative33.2%
*-commutative33.2%
associate-*r*32.9%
Simplified32.9%
Final simplification42.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))) (t_2 (* 2.0 (* z t))))
(if (<= z -6.8e+112)
t_2
(if (<= z -2.6e-257)
t_1
(if (<= z 4.7e-247)
(* (* a c) (* i -2.0))
(if (<= z 4e-64) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (z <= -6.8e+112) {
tmp = t_2;
} else if (z <= -2.6e-257) {
tmp = t_1;
} else if (z <= 4.7e-247) {
tmp = (a * c) * (i * -2.0);
} else if (z <= 4e-64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = 2.0d0 * (z * t)
if (z <= (-6.8d+112)) then
tmp = t_2
else if (z <= (-2.6d-257)) then
tmp = t_1
else if (z <= 4.7d-247) then
tmp = (a * c) * (i * (-2.0d0))
else if (z <= 4d-64) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (z <= -6.8e+112) {
tmp = t_2;
} else if (z <= -2.6e-257) {
tmp = t_1;
} else if (z <= 4.7e-247) {
tmp = (a * c) * (i * -2.0);
} else if (z <= 4e-64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) t_2 = 2.0 * (z * t) tmp = 0 if z <= -6.8e+112: tmp = t_2 elif z <= -2.6e-257: tmp = t_1 elif z <= 4.7e-247: tmp = (a * c) * (i * -2.0) elif z <= 4e-64: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -6.8e+112) tmp = t_2; elseif (z <= -2.6e-257) tmp = t_1; elseif (z <= 4.7e-247) tmp = Float64(Float64(a * c) * Float64(i * -2.0)); elseif (z <= 4e-64) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); t_2 = 2.0 * (z * t); tmp = 0.0; if (z <= -6.8e+112) tmp = t_2; elseif (z <= -2.6e-257) tmp = t_1; elseif (z <= 4.7e-247) tmp = (a * c) * (i * -2.0); elseif (z <= 4e-64) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+112], t$95$2, If[LessEqual[z, -2.6e-257], t$95$1, If[LessEqual[z, 4.7e-247], N[(N[(a * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+112}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-247}:\\
\;\;\;\;\left(a \cdot c\right) \cdot \left(i \cdot -2\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.79999999999999987e112 or 3.99999999999999986e-64 < z Initial program 87.8%
Taylor expanded in z around inf 50.0%
if -6.79999999999999987e112 < z < -2.6000000000000001e-257 or 4.6999999999999998e-247 < z < 3.99999999999999986e-64Initial program 93.0%
Taylor expanded in x around inf 37.0%
if -2.6000000000000001e-257 < z < 4.6999999999999998e-247Initial program 93.1%
Taylor expanded in a around inf 33.2%
mul-1-neg33.2%
*-commutative33.2%
distribute-rgt-neg-in33.2%
Simplified33.2%
Taylor expanded in c around 0 33.2%
mul-1-neg33.2%
*-commutative33.2%
associate-*r*32.9%
distribute-rgt-neg-in32.9%
*-commutative32.9%
distribute-rgt-neg-in32.9%
Simplified32.9%
Taylor expanded in c around 0 33.2%
*-commutative33.2%
associate-*r*33.0%
associate-*l*33.0%
Simplified33.0%
Final simplification42.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))) (t_2 (* 2.0 (* z t))))
(if (<= z -1.05e+111)
t_2
(if (<= z -5.3e-128)
t_1
(if (<= z 4.9e-247)
(* (* c i) (* a -2.0))
(if (<= z 1e-64) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (z <= -1.05e+111) {
tmp = t_2;
} else if (z <= -5.3e-128) {
tmp = t_1;
} else if (z <= 4.9e-247) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 1e-64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = 2.0d0 * (z * t)
if (z <= (-1.05d+111)) then
tmp = t_2
else if (z <= (-5.3d-128)) then
tmp = t_1
else if (z <= 4.9d-247) then
tmp = (c * i) * (a * (-2.0d0))
else if (z <= 1d-64) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (z <= -1.05e+111) {
tmp = t_2;
} else if (z <= -5.3e-128) {
tmp = t_1;
} else if (z <= 4.9e-247) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 1e-64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) t_2 = 2.0 * (z * t) tmp = 0 if z <= -1.05e+111: tmp = t_2 elif z <= -5.3e-128: tmp = t_1 elif z <= 4.9e-247: tmp = (c * i) * (a * -2.0) elif z <= 1e-64: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -1.05e+111) tmp = t_2; elseif (z <= -5.3e-128) tmp = t_1; elseif (z <= 4.9e-247) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (z <= 1e-64) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); t_2 = 2.0 * (z * t); tmp = 0.0; if (z <= -1.05e+111) tmp = t_2; elseif (z <= -5.3e-128) tmp = t_1; elseif (z <= 4.9e-247) tmp = (c * i) * (a * -2.0); elseif (z <= 1e-64) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+111], t$95$2, If[LessEqual[z, -5.3e-128], t$95$1, If[LessEqual[z, 4.9e-247], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-247}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;z \leq 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.04999999999999997e111 or 9.99999999999999965e-65 < z Initial program 87.8%
Taylor expanded in z around inf 50.0%
if -1.04999999999999997e111 < z < -5.2999999999999999e-128 or 4.9e-247 < z < 9.99999999999999965e-65Initial program 91.5%
Taylor expanded in x around inf 33.7%
if -5.2999999999999999e-128 < z < 4.9e-247Initial program 95.1%
Taylor expanded in a around inf 32.1%
mul-1-neg32.1%
*-commutative32.1%
distribute-rgt-neg-in32.1%
Simplified32.1%
Taylor expanded in c around 0 32.1%
associate-*r*32.1%
*-commutative32.1%
*-commutative32.1%
Simplified32.1%
Final simplification40.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1850.0) (not (<= (* x y) 1.15e-11))) (* 2.0 (+ (* x y) (* z t))) (* 2.0 (- (* z t) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1850.0) || !((x * y) <= 1.15e-11)) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1850.0d0)) .or. (.not. ((x * y) <= 1.15d-11))) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1850.0) || !((x * y) <= 1.15e-11)) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1850.0) or not ((x * y) <= 1.15e-11): tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1850.0) || !(Float64(x * y) <= 1.15e-11)) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1850.0) || ~(((x * y) <= 1.15e-11))) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1850.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.15e-11]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1850 \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{-11}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1850 or 1.15000000000000007e-11 < (*.f64 x y) Initial program 91.0%
Taylor expanded in c around 0 75.1%
if -1850 < (*.f64 x y) < 1.15000000000000007e-11Initial program 90.2%
Taylor expanded in a around inf 67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in x around 0 64.7%
Final simplification69.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -112000000000.0) (not (<= c 2.7e+110))) (* 2.0 (* 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 <= -112000000000.0) || !(c <= 2.7e+110)) {
tmp = 2.0 * (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 <= (-112000000000.0d0)) .or. (.not. (c <= 2.7d+110))) then
tmp = 2.0d0 * (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 <= -112000000000.0) || !(c <= 2.7e+110)) {
tmp = 2.0 * (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 <= -112000000000.0) or not (c <= 2.7e+110): tmp = 2.0 * (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 <= -112000000000.0) || !(c <= 2.7e+110)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-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 <= -112000000000.0) || ~((c <= 2.7e+110))) tmp = 2.0 * (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, -112000000000.0], N[Not[LessEqual[c, 2.7e+110]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $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 -112000000000 \lor \neg \left(c \leq 2.7 \cdot 10^{+110}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\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.12e11 or 2.7000000000000001e110 < c Initial program 79.0%
Taylor expanded in i around inf 81.1%
if -1.12e11 < c < 2.7000000000000001e110Initial program 97.4%
Taylor expanded in a around inf 91.6%
*-commutative91.6%
Simplified91.6%
Final simplification87.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.45e-23) (not (<= c 8.5e+110))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.45e-23) || !(c <= 8.5e+110)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-1.45d-23)) .or. (.not. (c <= 8.5d+110))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -1.45e-23) || !(c <= 8.5e+110)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.45e-23) or not (c <= 8.5e+110): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.45e-23) || !(c <= 8.5e+110)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.45e-23) || ~((c <= 8.5e+110))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.45e-23], N[Not[LessEqual[c, 8.5e+110]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{-23} \lor \neg \left(c \leq 8.5 \cdot 10^{+110}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.4500000000000001e-23 or 8.5000000000000004e110 < c Initial program 79.6%
Taylor expanded in i around inf 79.7%
if -1.4500000000000001e-23 < c < 8.5000000000000004e110Initial program 98.0%
Taylor expanded in c around 0 77.7%
Final simplification78.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -112000000000.0) (not (<= c 8.2e+154))) (* 2.0 (* c (* i (- a (* b c))))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -112000000000.0) || !(c <= 8.2e+154)) {
tmp = 2.0 * (c * (i * (a - (b * c))));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-112000000000.0d0)) .or. (.not. (c <= 8.2d+154))) then
tmp = 2.0d0 * (c * (i * (a - (b * c))))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -112000000000.0) || !(c <= 8.2e+154)) {
tmp = 2.0 * (c * (i * (a - (b * c))));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -112000000000.0) or not (c <= 8.2e+154): tmp = 2.0 * (c * (i * (a - (b * c)))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -112000000000.0) || !(c <= 8.2e+154)) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(a - Float64(b * c))))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -112000000000.0) || ~((c <= 8.2e+154))) tmp = 2.0 * (c * (i * (a - (b * c)))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -112000000000.0], N[Not[LessEqual[c, 8.2e+154]], $MachinePrecision]], N[(2.0 * N[(c * N[(i * N[(a - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -112000000000 \lor \neg \left(c \leq 8.2 \cdot 10^{+154}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(a - b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.12e11 or 8.2e154 < c Initial program 78.8%
associate-*r*90.7%
*-commutative90.7%
+-commutative90.7%
distribute-lft-in73.1%
Applied egg-rr73.1%
add-sqr-sqrt41.3%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod20.0%
add-sqr-sqrt54.3%
distribute-rgt-neg-in54.3%
distribute-lft-neg-in54.3%
*-commutative54.3%
distribute-lft-neg-in54.3%
cancel-sign-sub-inv54.3%
*-commutative54.3%
distribute-rgt-out--66.1%
*-commutative66.1%
Applied egg-rr66.1%
Taylor expanded in i around inf 58.5%
mul-1-neg58.5%
*-commutative58.5%
unsub-neg58.5%
fma-define58.5%
distribute-rgt-neg-in58.5%
distribute-rgt-neg-in58.5%
neg-sub058.5%
fma-define58.5%
+-commutative58.5%
associate--r+58.5%
neg-sub058.5%
remove-double-neg58.5%
*-commutative58.5%
Simplified58.5%
if -1.12e11 < c < 8.2e154Initial program 96.5%
Taylor expanded in c around 0 73.8%
Final simplification68.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -1040000.0) (not (<= i 1.6e+120))) (* 2.0 (- (* x y) (* a (* c i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -1040000.0) || !(i <= 1.6e+120)) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (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 ((i <= (-1040000.0d0)) .or. (.not. (i <= 1.6d+120))) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else
tmp = 2.0d0 * ((x * y) + (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 ((i <= -1040000.0) || !(i <= 1.6e+120)) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -1040000.0) or not (i <= 1.6e+120): tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -1040000.0) || !(i <= 1.6e+120)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((i <= -1040000.0) || ~((i <= 1.6e+120))) tmp = 2.0 * ((x * y) - (a * (c * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -1040000.0], N[Not[LessEqual[i, 1.6e+120]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1040000 \lor \neg \left(i \leq 1.6 \cdot 10^{+120}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if i < -1.04e6 or 1.59999999999999991e120 < i Initial program 92.4%
Taylor expanded in a around inf 69.5%
*-commutative69.5%
Simplified69.5%
Taylor expanded in z around 0 69.1%
if -1.04e6 < i < 1.59999999999999991e120Initial program 89.5%
Taylor expanded in c around 0 71.4%
Final simplification70.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7e+53) (not (<= c 1.3e+164))) (* (* c i) (* a -2.0)) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -7e+53) || !(c <= 1.3e+164)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-7d+53)) .or. (.not. (c <= 1.3d+164))) then
tmp = (c * i) * (a * (-2.0d0))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -7e+53) || !(c <= 1.3e+164)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -7e+53) or not (c <= 1.3e+164): tmp = (c * i) * (a * -2.0) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -7e+53) || !(c <= 1.3e+164)) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -7e+53) || ~((c <= 1.3e+164))) tmp = (c * i) * (a * -2.0); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -7e+53], N[Not[LessEqual[c, 1.3e+164]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7 \cdot 10^{+53} \lor \neg \left(c \leq 1.3 \cdot 10^{+164}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -7.00000000000000038e53 or 1.3e164 < c Initial program 76.3%
Taylor expanded in a around inf 45.3%
mul-1-neg45.3%
*-commutative45.3%
distribute-rgt-neg-in45.3%
Simplified45.3%
Taylor expanded in c around 0 45.3%
associate-*r*45.3%
*-commutative45.3%
*-commutative45.3%
Simplified45.3%
if -7.00000000000000038e53 < c < 1.3e164Initial program 96.2%
Taylor expanded in c around 0 71.4%
Final simplification64.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -1.1e+111) (not (<= z 9e-64))) (* 2.0 (* z t)) (* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.1e+111) || !(z <= 9e-64)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z <= (-1.1d+111)) .or. (.not. (z <= 9d-64))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.1e+111) || !(z <= 9e-64)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -1.1e+111) or not (z <= 9e-64): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -1.1e+111) || !(z <= 9e-64)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -1.1e+111) || ~((z <= 9e-64))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -1.1e+111], N[Not[LessEqual[z, 9e-64]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+111} \lor \neg \left(z \leq 9 \cdot 10^{-64}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -1.09999999999999999e111 or 9.00000000000000019e-64 < z Initial program 87.8%
Taylor expanded in z around inf 50.0%
if -1.09999999999999999e111 < z < 9.00000000000000019e-64Initial program 93.0%
Taylor expanded in x around inf 35.8%
Final simplification42.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 90.6%
Taylor expanded in z around inf 29.9%
Final simplification29.9%
(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 2024045
(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))))